diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 192779a060e..ea0e9cb2c52 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-nodejs-mono-repo:latest - digest: sha256:e8e6990de55638a07539109d3148e5a88fbedfee2d28742bad8c0f8fb2fbfafe + digest: sha256:b96bfab0360acd2462523c0c21e04a60c20f740c8c6a85b29d74ab1782eabe14 diff --git a/.release-please-manifest.json b/.release-please-manifest.json index dac6f7aef2c..994c2416a9c 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,22 +1,22 @@ { - "packages/gapic-node-templating": "0.0.0", - "packages/google-ai-generativelanguage": "3.3.0", - "packages/google-analytics-admin": "8.3.0", + "packages/gapic-node-processing": "0.1.1", + "packages/google-ai-generativelanguage": "3.4.0", + "packages/google-analytics-admin": "9.0.0", "packages/google-analytics-data": "5.2.0", "packages/google-api-apikeys": "2.2.0", - "packages/google-api-servicecontrol": "4.2.0", + "packages/google-api-servicecontrol": "4.3.0", "packages/google-api-servicemanagement": "3.2.0", "packages/google-api-serviceusage": "4.2.0", "packages/google-appengine": "4.2.0", "packages/google-area120-tables": "4.2.0", "packages/google-cloud-accessapproval": "4.2.0", "packages/google-cloud-advisorynotifications": "2.2.0", - "packages/google-cloud-aiplatform": "4.4.0", + "packages/google-cloud-aiplatform": "5.6.0", "packages/google-cloud-alloydb": "2.2.0", "packages/google-cloud-apigateway": "4.2.0", "packages/google-cloud-apigeeconnect": "4.2.0", "packages/google-cloud-apigeeregistry": "2.2.0", - "packages/google-cloud-asset": "6.2.0", + "packages/google-cloud-asset": "6.3.0", "packages/google-cloud-assuredworkloads": "5.1.0", "packages/google-cloud-automl": "5.1.0", "packages/google-cloud-baremetalsolution": "2.1.0", @@ -29,10 +29,10 @@ "packages/google-cloud-bigquery-analyticshub": "2.3.0", "packages/google-cloud-bigquery-connection": "4.1.0", "packages/google-cloud-bigquery-dataexchange": "2.1.0", - "packages/google-cloud-bigquery-datapolicies": "2.2.0", + "packages/google-cloud-bigquery-datapolicies": "2.3.0", "packages/google-cloud-bigquery-datatransfer": "5.1.0", "packages/google-cloud-bigquery-migration": "2.1.0", - "packages/google-cloud-bigquery-reservation": "4.1.0", + "packages/google-cloud-bigquery-reservation": "4.2.0", "packages/google-cloud-billing": "5.1.0", "packages/google-cloud-billing-budgets": "6.1.0", "packages/google-cloud-binaryauthorization": "4.1.0", @@ -40,27 +40,27 @@ "packages/google-cloud-channel": "4.1.0", "packages/google-cloud-clouddms": "4.1.0", "packages/google-cloud-commerce-consumer-procurement": "0.7.0", - "packages/google-cloud-compute": "5.3.0", - "packages/google-cloud-confidentialcomputing": "2.1.0", - "packages/google-cloud-config": "0.10.0", + "packages/google-cloud-compute": "6.3.0", + "packages/google-cloud-confidentialcomputing": "2.2.0", + "packages/google-cloud-config": "0.11.0", "packages/google-cloud-connectors": "0.5.0", "packages/google-cloud-contactcenterinsights": "4.1.0", - "packages/google-cloud-contentwarehouse": "2.1.0", + "packages/google-cloud-contentwarehouse": "2.2.0", "packages/google-cloud-datacatalog": "5.2.0", "packages/google-cloud-datacatalog-lineage": "2.1.0", "packages/google-cloud-dataform": "2.2.0", "packages/google-cloud-datafusion": "4.1.0", "packages/google-cloud-datalabeling": "5.1.0", - "packages/google-cloud-dataplex": "4.2.0", + "packages/google-cloud-dataplex": "5.0.0", "packages/google-cloud-dataproc": "6.1.0", "packages/google-cloud-dataqna": "4.1.0", - "packages/google-cloud-datastream": "4.2.0", + "packages/google-cloud-datastream": "4.3.0", "packages/google-cloud-deploy": "5.2.0", "packages/google-cloud-dialogflow": "7.2.0", "packages/google-cloud-dialogflow-cx": "5.3.0", - "packages/google-cloud-discoveryengine": "2.3.0", + "packages/google-cloud-discoveryengine": "2.4.0", "packages/google-cloud-dns": "5.3.0", - "packages/google-cloud-documentai": "9.3.0", + "packages/google-cloud-documentai": "9.4.0", "packages/google-cloud-domains": "4.2.0", "packages/google-cloud-edgecontainer": "0.8.0", "packages/google-cloud-essentialcontacts": "4.2.0", @@ -86,18 +86,18 @@ "packages/google-cloud-metastore": "5.2.0", "packages/google-cloud-migrationcenter": "2.2.0", "packages/google-cloud-monitoring": "5.3.0", - "packages/google-cloud-netapp": "0.13.0", - "packages/google-cloud-networkconnectivity": "4.3.0", - "packages/google-cloud-networkmanagement": "4.3.0", + "packages/google-cloud-netapp": "0.14.0", + "packages/google-cloud-networkconnectivity": "4.4.0", + "packages/google-cloud-networkmanagement": "5.1.0", "packages/google-cloud-networksecurity": "3.3.0", - "packages/google-cloud-networkservices": "0.10.0", + "packages/google-cloud-networkservices": "0.11.0", "packages/google-cloud-notebooks": "4.2.0", "packages/google-cloud-orchestration-airflow-service": "4.3.0", "packages/google-cloud-orgpolicy": "4.3.0", - "packages/google-cloud-osconfig": "4.2.0", + "packages/google-cloud-osconfig": "4.3.0", "packages/google-cloud-oslogin": "6.2.0", "packages/google-cloud-phishingprotection": "5.2.0", - "packages/google-cloud-policysimulator": "0.7.0", + "packages/google-cloud-policysimulator": "0.8.0", "packages/google-cloud-policytroubleshooter": "4.2.0", "packages/google-cloud-policytroubleshooter-iam": "0.8.0", "packages/google-cloud-privatecatalog": "4.2.0", @@ -106,11 +106,11 @@ "packages/google-cloud-recommender": "7.2.0", "packages/google-cloud-redis": "5.2.0", "packages/google-cloud-resourcemanager": "6.2.0", - "packages/google-cloud-retail": "4.1.0", - "packages/google-cloud-run": "2.2.0", + "packages/google-cloud-retail": "4.2.0", + "packages/google-cloud-run": "3.0.0", "packages/google-cloud-scheduler": "5.3.0", "packages/google-cloud-secretmanager": "6.1.0", - "packages/google-cloud-security-privateca": "6.1.0", + "packages/google-cloud-security-privateca": "7.0.0", "packages/google-cloud-security-publicca": "2.2.0", "packages/google-cloud-securitycenter": "9.1.0", "packages/google-cloud-servicedirectory": "6.1.0", @@ -118,17 +118,17 @@ "packages/google-cloud-speech": "7.2.0", "packages/google-cloud-sql": "0.21.0", "packages/google-cloud-storageinsights": "2.2.0", - "packages/google-cloud-support": "2.1.0", + "packages/google-cloud-support": "2.2.0", "packages/google-cloud-talent": "7.1.0", "packages/google-cloud-tasks": "6.2.0", - "packages/google-cloud-texttospeech": "6.2.0", + "packages/google-cloud-texttospeech": "6.3.0", "packages/google-cloud-tpu": "4.1.0", "packages/google-cloud-translate": "9.2.0", "packages/google-cloud-video-livestream": "2.1.0", "packages/google-cloud-video-stitcher": "3.2.0", - "packages/google-cloud-video-transcoder": "4.2.0", + "packages/google-cloud-video-transcoder": "4.4.0", "packages/google-cloud-videointelligence": "6.2.0", - "packages/google-cloud-vision": "5.3.1", + "packages/google-cloud-vision": "5.3.3", "packages/google-cloud-vmmigration": "4.2.0", "packages/google-cloud-vmwareengine": "2.2.0", "packages/google-cloud-vpcaccess": "4.2.0", @@ -136,16 +136,16 @@ "packages/google-cloud-websecurityscanner": "4.2.0", "packages/google-cloud-workflows-executions": "4.4.0", "packages/google-cloud-workstations": "2.2.0", - "packages/google-container": "6.3.0", + "packages/google-container": "6.4.0", "packages/google-dataflow": "4.1.0", "packages/google-devtools-artifactregistry": "4.3.0", - "packages/google-devtools-cloudbuild": "5.2.0", + "packages/google-devtools-cloudbuild": "5.3.0", "packages/google-devtools-cloudprofiler": "0.9.0", "packages/google-devtools-containeranalysis": "6.3.0", "packages/google-iam": "2.3.0", "packages/google-iam-credentials": "4.2.0", "packages/google-identity-accesscontextmanager": "4.2.0", - "packages/google-maps-addressvalidation": "3.1.0", + "packages/google-maps-addressvalidation": "3.2.0", "packages/google-maps-mapsplatformdatasets": "3.1.0", "packages/google-maps-places": "2.1.0", "packages/google-maps-routing": "2.1.0", @@ -155,8 +155,8 @@ "packages/grafeas": "6.1.0", "packages/typeless-sample-bot": "3.1.0", "packages/google-cloud-edgenetwork": "0.10.0", - "packages/google-shopping-merchant-reports": "0.10.0", - "packages/google-shopping-merchant-inventories": "0.8.0", + "packages/google-shopping-merchant-reports": "0.13.0", + "packages/google-shopping-merchant-inventories": "0.11.0", "packages/google-shopping-css": "0.10.0", "packages/google-api-cloudquotas": "2.2.0", "packages/google-cloud-redis-cluster": "0.9.0", @@ -166,46 +166,49 @@ "packages/google-cloud-cloudcontrolspartner": "0.6.0", "packages/google-cloud-telcoautomation": "0.5.0", "packages/google-cloud-apphub": "0.6.0", - "packages/google-chat": "0.16.0", - "packages/google-shopping-merchant-quota": "0.5.0", + "packages/google-chat": "0.19.0", + "packages/google-shopping-merchant-quota": "0.8.0", "packages/google-storage-control": "0.5.0", - "packages/google-cloud-backupdr": "0.4.0", - "packages/google-cloud-securesourcemanager": "0.6.0", - "packages/google-shopping-merchant-notifications": "0.5.0", - "packages/google-shopping-merchant-lfp": "0.6.0", + "packages/google-cloud-backupdr": "0.5.0", + "packages/google-cloud-securesourcemanager": "0.8.0", + "packages/google-shopping-merchant-notifications": "0.8.0", + "packages/google-shopping-merchant-lfp": "0.9.0", "packages/google-cloud-securitycentermanagement": "0.7.0", - "packages/google-shopping-merchant-conversions": "0.4.0", - "packages/google-maps-solar": "0.4.0", + "packages/google-shopping-merchant-conversions": "0.7.0", + "packages/google-maps-solar": "0.5.0", "packages/google-maps-routeoptimization": "0.5.0", "packages/google-maps-fleetengine-delivery": "0.6.0", "packages/google-streetview-publish": "0.4.0", "packages/google-maps-fleetengine": "0.8.0", - "packages/google-shopping-merchant-promotions": "0.3.0", - "packages/google-shopping-merchant-datasources": "0.6.0", - "packages/google-cloud-managedkafka": "0.7.0", + "packages/google-shopping-merchant-promotions": "0.5.0", + "packages/google-shopping-merchant-datasources": "0.9.0", + "packages/google-cloud-managedkafka": "0.8.0", "packages/google-cloud-developerconnect": "0.6.0", - "packages/google-cloud-privilegedaccessmanager": "0.5.0", - "packages/google-shopping-merchant-products": "0.5.0", - "packages/google-shopping-merchant-accounts": "2.3.0", - "packages/google-cloud-gdchardwaremanagement": "0.8.0", + "packages/google-cloud-privilegedaccessmanager": "0.6.0", + "packages/google-shopping-merchant-products": "0.7.0", + "packages/google-shopping-merchant-accounts": "3.0.0", + "packages/google-cloud-gdchardwaremanagement": "0.9.0", "packages/google-cloud-apihub": "0.4.0", "packages/google-marketingplatform-admin": "0.3.0", "packages/google-cloud-oracledatabase": "0.6.0", "packages/google-ads-admanager": "0.4.0", - "packages/google-shopping-merchant-reviews": "0.4.0", + "packages/google-shopping-merchant-reviews": "0.5.0", "packages/google-cloud-memorystore": "0.3.0", "packages/google-cloud-parametermanager": "0.5.0", "packages/google-maps-areainsights": "0.5.0", - "packages/google-cloud-modelarmor": "0.2.0", + "packages/google-cloud-modelarmor": "0.4.0", "packages/google-cloud-financialservices": "0.4.0", "packages/google-cloud-chronicle": "0.2.0", "packages/google-cloud-devicestreaming": "0.2.0", - "packages/google-shopping-merchant-issueresolution": "0.1.0", - "packages/google-shopping-merchant-ordertracking": "0.1.0", + "packages/google-shopping-merchant-issueresolution": "0.3.0", + "packages/google-shopping-merchant-ordertracking": "0.3.0", "packages/google-cloud-lustre": "0.2.0", "packages/google-cloud-storagebatchoperations": "0.1.0", "packages/google-apps-events-subscriptions": "0.1.0", "packages/google-cloud-maintenance-api": "0.1.0", "packages/google-cloud-managedkafka-schemaregistry": "0.1.0", - "packages/google-cloud-licensemanager": "0.1.0" + "packages/google-cloud-licensemanager": "0.1.0", + "packages/google-cloud-configdelivery": "0.1.0", + "packages/google-cloud-saasplatform-saasservicemgmt": "0.1.0", + "packages/google-cloud-cloudsecuritycompliance": "0.1.0" } diff --git a/README.md b/README.md index 49cb76906a8..cd01b753924 100644 --- a/README.md +++ b/README.md @@ -95,6 +95,17 @@ applications that interact with individual Google Cloud services: | [Managed Service for Microsoft Active Directory](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-managedidentities) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/managed-identities)](https://npm.im/@google-cloud/managed-identities) | | [Media Translation](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-mediatranslation) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/media-translation)](https://npm.im/@google-cloud/media-translation) | | [Memorystore for Memcached](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-memcache) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/memcache)](https://npm.im/@google-cloud/memcache) | +| [Merchant API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-shopping-merchant-accounts) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-shopping/accounts)](https://npm.im/@google-shopping/accounts) | +| [Merchant API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-shopping-merchant-conversions) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-shopping/conversions)](https://npm.im/@google-shopping/conversions) | +| [Merchant API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-shopping-merchant-datasources) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-shopping/datasources)](https://npm.im/@google-shopping/datasources) | +| [Merchant API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-shopping-merchant-issueresolution) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-shopping/issueresolution)](https://npm.im/@google-shopping/issueresolution) | +| [Merchant API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-shopping-merchant-lfp) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-shopping/lfp)](https://npm.im/@google-shopping/lfp) | +| [Merchant API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-shopping-merchant-notifications) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-shopping/notifications)](https://npm.im/@google-shopping/notifications) | +| [Merchant API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-shopping-merchant-ordertracking) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-shopping/ordertracking)](https://npm.im/@google-shopping/ordertracking) | +| [Merchant API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-shopping-merchant-products) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-shopping/products)](https://npm.im/@google-shopping/products) | +| [Merchant API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-shopping-merchant-promotions) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-shopping/promotions)](https://npm.im/@google-shopping/promotions) | +| [Merchant API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-shopping-merchant-quota) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-shopping/quota)](https://npm.im/@google-shopping/quota) | +| [Merchant API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-shopping-merchant-reports) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-shopping/reports)](https://npm.im/@google-shopping/reports) | | [Migrate for Compute Engine](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-vmmigration) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/vmmigration)](https://npm.im/@google-cloud/vmmigration) | | [Migration Center API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-migrationcenter) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/migrationcenter)](https://npm.im/@google-cloud/migrationcenter) | | [Monitoring Dashboards](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-monitoring-dashboard) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/monitoring-dashboards)](https://npm.im/@google-cloud/monitoring-dashboards) | @@ -164,6 +175,7 @@ applications that interact with individual Google Cloud services: | [BeyondCorp API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-beyondcorp-appgateways) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/appgateways)](https://npm.im/@google-cloud/appgateways) | | [BeyondCorp API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-beyondcorp-clientconnectorservices) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/clientconnectorservices)](https://npm.im/@google-cloud/clientconnectorservices) | | [Chronicle API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-chronicle) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/chronicle)](https://npm.im/@google-cloud/chronicle) | +| [Config Delivery API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-configdelivery) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/configdelivery)](https://npm.im/@google-cloud/configdelivery) | | [CSS API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-shopping-css) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-shopping/css)](https://npm.im/@google-shopping/css) | | [Data Labeling](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-datalabeling) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/datalabeling)](https://npm.im/@google-cloud/datalabeling) | | [Data QnA](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-dataqna) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/data-qna)](https://npm.im/@google-cloud/data-qna) | @@ -184,24 +196,15 @@ applications that interact with individual Google Cloud services: | [Google Meet API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-apps-meet) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-apps/meet)](https://npm.im/@google-apps/meet) | | [Google Workspace Events API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-apps-events-subscriptions) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/subscriptions)](https://npm.im/@google-cloud/subscriptions) | | [Last Mile Fleet Solution Delivery API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-maps-fleetengine-delivery) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@googlemaps/fleetengine-delivery)](https://npm.im/@googlemaps/fleetengine-delivery) | +| [License Manager API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-licensemanager) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/licensemanager)](https://npm.im/@google-cloud/licensemanager) | | [Life Sciences](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-lifesciences) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/life-sciences)](https://npm.im/@google-cloud/life-sciences) | | [Local Rides and Deliveries API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-maps-fleetengine) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@googlemaps/fleetengine)](https://npm.im/@googlemaps/fleetengine) | | [Maintenance API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-maintenance-api) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/maintenance-api)](https://npm.im/@google-cloud/maintenance-api) | | [Managed Lustre API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-lustre) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/lustre)](https://npm.im/@google-cloud/lustre) | +| [Managed Service for Apache Kafka API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-managedkafka-schemaregistry) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/managedkafka-schemaregistry)](https://npm.im/@google-cloud/managedkafka-schemaregistry) | | [Managed Service for Apache Kafka API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-managedkafka) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/managedkafka)](https://npm.im/@google-cloud/managedkafka) | | [Memorystore API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-memorystore) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/memorystore)](https://npm.im/@google-cloud/memorystore) | | [Memorystore for Redis API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-redis-cluster) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/redis-cluster)](https://npm.im/@google-cloud/redis-cluster) | -| [Merchant API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-shopping-merchant-accounts) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-shopping/accounts)](https://npm.im/@google-shopping/accounts) | -| [Merchant API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-shopping-merchant-conversions) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-shopping/conversions)](https://npm.im/@google-shopping/conversions) | -| [Merchant API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-shopping-merchant-datasources) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-shopping/datasources)](https://npm.im/@google-shopping/datasources) | -| [Merchant API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-shopping-merchant-issueresolution) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-shopping/issueresolution)](https://npm.im/@google-shopping/issueresolution) | -| [Merchant API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-shopping-merchant-lfp) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-shopping/lfp)](https://npm.im/@google-shopping/lfp) | -| [Merchant API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-shopping-merchant-notifications) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-shopping/notifications)](https://npm.im/@google-shopping/notifications) | -| [Merchant API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-shopping-merchant-ordertracking) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-shopping/ordertracking)](https://npm.im/@google-shopping/ordertracking) | -| [Merchant API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-shopping-merchant-products) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-shopping/products)](https://npm.im/@google-shopping/products) | -| [Merchant API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-shopping-merchant-promotions) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-shopping/promotions)](https://npm.im/@google-shopping/promotions) | -| [Merchant API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-shopping-merchant-quota) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-shopping/quota)](https://npm.im/@google-shopping/quota) | -| [Merchant API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-shopping-merchant-reports) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-shopping/reports)](https://npm.im/@google-shopping/reports) | | [Merchant API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-shopping-merchant-reviews) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-shopping/reviews)](https://npm.im/@google-shopping/reviews) | | [Model Armor API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-modelarmor) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/modelarmor)](https://npm.im/@google-cloud/modelarmor) | | [Oracle Database@Google Cloud API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-oracledatabase) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/oracledatabase)](https://npm.im/@google-cloud/oracledatabase) | @@ -215,6 +218,8 @@ applications that interact with individual Google Cloud services: | [Privileged Access Manager API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-privilegedaccessmanager) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/privilegedaccessmanager)](https://npm.im/@google-cloud/privilegedaccessmanager) | | [Profiler API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-devtools-cloudprofiler) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/cloudprofiler)](https://npm.im/@google-cloud/cloudprofiler) | | [Route Optimization API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-maps-routeoptimization) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@googlemaps/routeoptimization)](https://npm.im/@googlemaps/routeoptimization) | +| [SaaS Runtime API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-saasplatform-saasservicemgmt) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/saasservicemgmt)](https://npm.im/@google-cloud/saasservicemgmt) | +| [Security Compliance API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-cloudsecuritycompliance) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/cloudsecuritycompliance)](https://npm.im/@google-cloud/cloudsecuritycompliance) | | [Solar API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-maps-solar) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@googlemaps/solar)](https://npm.im/@googlemaps/solar) | | [Storage Batch Operations API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-storagebatchoperations) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/storagebatchoperations)](https://npm.im/@google-cloud/storagebatchoperations) | | [Trace](https://github.com/googleapis/cloud-trace-nodejs) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/trace-agent)](https://npm.im/@google-cloud/trace-agent) | diff --git a/changelog.json b/changelog.json index c9305079bfb..3ccbddb33b3 100644 --- a/changelog.json +++ b/changelog.json @@ -1,6 +1,2818 @@ { "repository": "googleapis/google-cloud-node", "entries": [ + { + "changes": [ + { + "type": "feat", + "sha": "ba6a4977e89c5769d302e1a18d5ad305cae1bfdd", + "message": "[netapp] add new fields for flex auto tiering", + "issues": [ + "6670" + ] + } + ], + "version": "0.14.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/netapp", + "id": "0b98a658-ccb4-4214-a075-0049931f6fad", + "createTime": "2025-09-04T20:33:14.674Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "4aff726fbe811a53f24c6b5c883052716f897205", + "message": "[infra-manager] added support for service maintained provider", + "issues": [ + "6651" + ] + } + ], + "version": "0.11.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/config", + "id": "d53ef116-efa6-4a71-98d7-4535d32bfe9a", + "createTime": "2025-09-04T20:33:14.635Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "7fd10b45202d5031f6b283d9af2c15d72d76823d", + "message": "Add new `VerifyConfidentialSpace` and `VerifyConfidentialGke` rpcs and relevant fields", + "issues": [] + } + ], + "version": "2.2.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/confidentialcomputing", + "id": "bf5157f9-1d2a-4c53-b369-1d39c65fd266", + "createTime": "2025-09-04T20:33:14.600Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "72c9729e3993588996cc3a4a69a378cd92bc2646", + "message": "[compute] Update Compute Engine v1beta API to revision 20250810 (#1090)", + "issues": [ + "6610" + ] + } + ], + "version": "6.3.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/compute", + "id": "1d46451a-0825-4c84-8ba6-dd7b178c4a35", + "createTime": "2025-09-04T20:33:14.580Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "64d301886c7ed320ba1b03d850363e54bdd4657e", + "message": "Make sure we are not overwriting the README when generating it", + "issues": [ + "6632" + ] + } + ], + "version": "0.1.1", + "language": "JAVASCRIPT", + "artifactName": "gapic-node-processing", + "id": "66ad5288-cefd-4782-b05c-8e5fce962039", + "createTime": "2025-08-29T19:37:36.045Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "b92b2c7d56645f28aabd7771cba76d8fd506ec0a", + "message": "[gdchardwaremanagement] Added RequestOrderDateChange RPC - allows Customers to request date changes", + "issues": [ + "6627" + ] + } + ], + "version": "0.9.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/gdchardwaremanagement", + "id": "69eeae19-6b7b-4d74-980f-8a7d519f4cf8", + "createTime": "2025-08-28T21:41:16.387Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "5267f25145ef5605daa1bd1140c3320e5f3b5b66", + "message": "Create gapic-node-processing library", + "issues": [ + "6604" + ] + } + ], + "version": "0.1.0", + "language": "JAVASCRIPT", + "artifactName": "gapic-node-processing", + "id": "5b3b0883-7acc-40d6-84ef-7d47dad38201", + "createTime": "2025-08-28T21:41:16.360Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "71b30db34f8c83c1b2395270fd7ff8fb2621b669", + "message": "[chat] Changed field behavior for an existing field `name` in message `.google.chat.v1.QuotedMessageMetadata`", + "issues": [ + "6619" + ], + "breakingChangeNote": "[chat] Changed field behavior for an existing field `name` in message `.google.chat.v1.QuotedMessageMetadata` ([#6619](https://github.com/googleapis/google-cloud-node/issues/6619))" + } + ], + "version": "0.19.0", + "language": "JAVASCRIPT", + "artifactName": "@google-apps/chat", + "id": "32126146-b70a-43ea-b100-10df60ffd96c", + "createTime": "2025-08-27T20:58:49.633Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "66f10812282f69475c3fa923ddd7641e331bb7be", + "message": "[texttospeech] Support promptable voices by specifying a model name and a prompt", + "issues": [ + "6617" + ] + } + ], + "version": "6.3.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/text-to-speech", + "id": "5c52dfed-61af-4cac-aa00-595443422ad8", + "createTime": "2025-08-27T20:58:49.605Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "20de60f347970414459bcd168425903f11851993", + "message": "[generativelanguage] add support for thought_signature", + "issues": [ + "6616" + ] + } + ], + "version": "3.4.0", + "language": "JAVASCRIPT", + "artifactName": "@google-ai/generativelanguage", + "id": "97111a52-3a1e-4b85-a6eb-1a285e8cc587", + "createTime": "2025-08-27T20:58:49.582Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "e5913a6b39805b6e7a5f397fe5ed6ac16766f130", + "message": "Add initial files for google.cloud.cloudsecuritycompliance.v1", + "issues": [ + "6618" + ] + } + ], + "version": "0.1.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/cloudsecuritycompliance", + "id": "4488c868-7db1-48cc-bd73-9ea20a42a174", + "createTime": "2025-08-26T19:25:31.482Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "6caf062a9899f410ff8421202c696fbf9b50f4e3", + "message": "[video-transcoder] add support for automatically generating subtitle for input videos", + "issues": [ + "6614" + ] + } + ], + "version": "4.4.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/video-transcoder", + "id": "9ca5e6a9-9cb3-4c6a-b348-0c8f4f5ce71e", + "createTime": "2025-08-25T15:29:58.156Z" + }, + { + "changes": [ + { + "type": "chore", + "sha": "deb5255541602defd05896fc0093adca05f30440", + "message": "Release stable version of libraries", + "issues": [ + "6602" + ], + "breakingChangeNote": "release stable version of libraries ([#6602](https://github.com/googleapis/google-cloud-node/issues/6602))" + } + ], + "version": "0.3.0", + "language": "JAVASCRIPT", + "artifactName": "@google-shopping/ordertracking", + "id": "47ac6499-7408-4025-acb0-4d9557b7343a", + "createTime": "2025-08-21T17:57:52.785Z" + }, + { + "changes": [ + { + "type": "chore", + "sha": "deb5255541602defd05896fc0093adca05f30440", + "message": "Release stable version of libraries", + "issues": [ + "6602" + ], + "breakingChangeNote": "release stable version of libraries ([#6602](https://github.com/googleapis/google-cloud-node/issues/6602))" + } + ], + "version": "0.3.0", + "language": "JAVASCRIPT", + "artifactName": "@google-shopping/issueresolution", + "id": "e5b1f624-3628-4e3e-a49f-17172c1da887", + "createTime": "2025-08-21T17:57:52.758Z" + }, + { + "changes": [ + { + "type": "chore", + "sha": "deb5255541602defd05896fc0093adca05f30440", + "message": "Release stable version of libraries", + "issues": [ + "6602" + ], + "breakingChangeNote": "release stable version of libraries ([#6602](https://github.com/googleapis/google-cloud-node/issues/6602))" + } + ], + "version": "3.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-shopping/accounts", + "id": "3352ac98-b254-45ec-9f0f-7d4b4f38b3d0", + "createTime": "2025-08-21T17:57:52.731Z" + }, + { + "changes": [ + { + "type": "chore", + "sha": "deb5255541602defd05896fc0093adca05f30440", + "message": "Release stable version of libraries", + "issues": [ + "6602" + ], + "breakingChangeNote": "release stable version of libraries ([#6602](https://github.com/googleapis/google-cloud-node/issues/6602))" + } + ], + "version": "0.7.0", + "language": "JAVASCRIPT", + "artifactName": "@google-shopping/products", + "id": "3dbaeb06-a14a-479b-ac8a-270c9b06b076", + "createTime": "2025-08-21T17:57:52.706Z" + }, + { + "changes": [ + { + "type": "chore", + "sha": "deb5255541602defd05896fc0093adca05f30440", + "message": "Release stable version of libraries", + "issues": [ + "6602" + ], + "breakingChangeNote": "release stable version of libraries ([#6602](https://github.com/googleapis/google-cloud-node/issues/6602))" + } + ], + "version": "0.5.0", + "language": "JAVASCRIPT", + "artifactName": "@google-shopping/promotions", + "id": "7b264f05-5c97-4a7e-bb7e-662a376d7a9b", + "createTime": "2025-08-21T17:57:52.686Z" + }, + { + "changes": [ + { + "type": "chore", + "sha": "deb5255541602defd05896fc0093adca05f30440", + "message": "Release stable version of libraries", + "issues": [ + "6602" + ], + "breakingChangeNote": "release stable version of libraries ([#6602](https://github.com/googleapis/google-cloud-node/issues/6602))" + } + ], + "version": "0.9.0", + "language": "JAVASCRIPT", + "artifactName": "@google-shopping/datasources", + "id": "28dea597-f2a9-4e58-8530-76e9f022c23f", + "createTime": "2025-08-21T17:57:52.642Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "c932e46ea7dded17f830abc4a205e9c8f4f2d268", + "message": "[solar] Add `experiments` param to endpoints for access to pre-GA features", + "issues": [ + "6605" + ] + } + ], + "version": "0.5.0", + "language": "JAVASCRIPT", + "artifactName": "@googlemaps/solar", + "id": "14573cb7-f108-46cb-a637-7a376214bc05", + "createTime": "2025-08-21T17:57:52.592Z" + }, + { + "changes": [ + { + "type": "chore", + "sha": "deb5255541602defd05896fc0093adca05f30440", + "message": "Release stable version of libraries", + "issues": [ + "6602" + ], + "breakingChangeNote": "release stable version of libraries ([#6602](https://github.com/googleapis/google-cloud-node/issues/6602))" + } + ], + "version": "0.7.0", + "language": "JAVASCRIPT", + "artifactName": "@google-shopping/conversions", + "id": "6aeb0a0f-b911-46b3-a8cb-6f17d5361476", + "createTime": "2025-08-21T17:57:52.572Z" + }, + { + "changes": [ + { + "type": "chore", + "sha": "deb5255541602defd05896fc0093adca05f30440", + "message": "Release stable version of libraries", + "issues": [ + "6602" + ], + "breakingChangeNote": "release stable version of libraries ([#6602](https://github.com/googleapis/google-cloud-node/issues/6602))" + } + ], + "version": "0.9.0", + "language": "JAVASCRIPT", + "artifactName": "@google-shopping/lfp", + "id": "f96f9737-4d18-4bcc-ae79-870873f6a76d", + "createTime": "2025-08-21T17:57:52.548Z" + }, + { + "changes": [ + { + "type": "chore", + "sha": "deb5255541602defd05896fc0093adca05f30440", + "message": "Release stable version of libraries", + "issues": [ + "6602" + ], + "breakingChangeNote": "release stable version of libraries ([#6602](https://github.com/googleapis/google-cloud-node/issues/6602))" + } + ], + "version": "0.8.0", + "language": "JAVASCRIPT", + "artifactName": "@google-shopping/notifications", + "id": "614d9807-5b79-49a1-8337-b8e4d200e597", + "createTime": "2025-08-21T17:57:52.528Z" + }, + { + "changes": [ + { + "type": "chore", + "sha": "deb5255541602defd05896fc0093adca05f30440", + "message": "Release stable version of libraries", + "issues": [ + "6602" + ], + "breakingChangeNote": "release stable version of libraries ([#6602](https://github.com/googleapis/google-cloud-node/issues/6602))" + } + ], + "version": "0.8.0", + "language": "JAVASCRIPT", + "artifactName": "@google-shopping/quota", + "id": "625524c9-292a-4149-917a-37488272da34", + "createTime": "2025-08-21T17:57:52.506Z" + }, + { + "changes": [ + { + "type": "chore", + "sha": "deb5255541602defd05896fc0093adca05f30440", + "message": "Release stable version of libraries", + "issues": [ + "6602" + ], + "breakingChangeNote": "release stable version of libraries ([#6602](https://github.com/googleapis/google-cloud-node/issues/6602))" + } + ], + "version": "0.11.0", + "language": "JAVASCRIPT", + "artifactName": "@google-shopping/inventories", + "id": "dafd6746-d505-4817-8343-f531782fc3e4", + "createTime": "2025-08-21T17:57:52.486Z" + }, + { + "changes": [ + { + "type": "chore", + "sha": "deb5255541602defd05896fc0093adca05f30440", + "message": "Release stable version of libraries", + "issues": [ + "6602" + ], + "breakingChangeNote": "release stable version of libraries ([#6602](https://github.com/googleapis/google-cloud-node/issues/6602))" + } + ], + "version": "0.13.0", + "language": "JAVASCRIPT", + "artifactName": "@google-shopping/reports", + "id": "47685158-b465-4af7-bfef-d12710b913b7", + "createTime": "2025-08-21T17:57:52.464Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "d6ee97b10f310e91b403bafdb65b6e4ebabc2cfe", + "message": "[cloudbuild] Add option to enable nested virtualization if available", + "issues": [ + "6603" + ] + } + ], + "version": "5.3.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/cloudbuild", + "id": "c970e6c3-a13b-4d14-b46b-7a8daa30532a", + "createTime": "2025-08-21T17:57:52.444Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "6c132f36ebf611a13fd1c4e1b44920d4334a1a7b", + "message": "[documentai] Added config options for derived fields and signature detection. Some annotation changes changes to mark fields explicitly output only (no changes in semantics just readability)", + "issues": [ + "6607" + ] + } + ], + "version": "9.4.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/documentai", + "id": "dd0e40af-5dce-4cf8-a383-23c243b67894", + "createTime": "2025-08-21T17:57:52.420Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "dab8cb9a0b0b9629a899c95c2699c276c23a2c93", + "message": "[contentwarehouse] Added config options for derived fields and signature detection. Some annotation changes changes to mark fields explicitly output only (no changes in semantics just readability)", + "issues": [ + "6608" + ] + } + ], + "version": "2.2.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/contentwarehouse", + "id": "f1957825-166c-47c8-a58a-99e9556f0530", + "createTime": "2025-08-21T17:57:52.389Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "d3237dcc125079b0f08dc454686ebcdc73a7d236", + "message": "[bigquery-reservation] Add Reservation.max_slots field to Reservation proto, indicating the total max number of slots this reservation can use up to", + "issues": [ + "6606" + ] + }, + { + "type": "feat", + "sha": "d3237dcc125079b0f08dc454686ebcdc73a7d236", + "message": "Add Reservation.scaling_mode field and its corresponding enum message ScalingMode. This field should be used together with Reservation.max_slots", + "issues": [] + } + ], + "version": "4.2.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/bigquery-reservation", + "id": "be5691c1-a1bd-4419-88b5-d704ce94e633", + "createTime": "2025-08-21T17:57:52.367Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "11f87fa265c5b83214838c6179e007ad9e6bf590", + "message": "Add option EndpointUserId and ModelUserId fields", + "issues": [ + "6600" + ] + }, + { + "type": "feat", + "sha": "de966d3992725acf05932096ff09d0b6741a6c1f", + "message": "Add `gpu_partition_size` to `MachineSpec`", + "issues": [ + "6595" + ] + } + ], + "version": "5.6.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/aiplatform", + "id": "5c6f34d1-71c1-4647-8074-a700ea665838", + "createTime": "2025-08-21T17:57:52.335Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "cdd0d85a7213734befbb4e95a971d8351af79f23", + "message": "[analytics-admin] remove the `SetAutomatedGa4ConfigurationOptOut` method", + "issues": [ + "6613" + ], + "breakingChangeNote": "[analytics-admin] remove the `SetAutomatedGa4ConfigurationOptOut` method ([#6613](https://github.com/googleapis/google-cloud-node/issues/6613))" + } + ], + "version": "9.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-analytics/admin", + "id": "ef50205a-fe85-4020-95a6-e2c2062c81d0", + "createTime": "2025-08-21T17:57:52.309Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "a49143ea7b0b694d9b7c01a576413146dc0db241", + "message": "Add initial files for google.cloud.saasplatform.saasservicemgmt.v1beta1", + "issues": [ + "6582" + ] + } + ], + "version": "0.1.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/saasservicemgmt", + "id": "32a9fe2f-3476-49c1-99a1-f90e645463c8", + "createTime": "2025-08-12T15:48:40.697Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "0cbf8ac3e6697d92428f21010beb1c776e5e86fd", + "message": "[compute] Update Compute Engine v1 API to revision 20250729 (#1085)", + "issues": [ + "6579" + ] + } + ], + "version": "0.8.0", + "language": "JAVASCRIPT", + "artifactName": "@google-shopping/datasources", + "id": "c036b84c-a04b-4899-b3d1-53a43d327edc", + "createTime": "2025-08-12T15:48:40.673Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "0cbf8ac3e6697d92428f21010beb1c776e5e86fd", + "message": "[compute] Update Compute Engine v1 API to revision 20250729 (#1085)", + "issues": [ + "6579" + ] + } + ], + "version": "0.6.0", + "language": "JAVASCRIPT", + "artifactName": "@google-shopping/conversions", + "id": "6217e43d-c3f0-40ad-852b-b233bd7dd718", + "createTime": "2025-08-12T15:48:40.651Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "0cbf8ac3e6697d92428f21010beb1c776e5e86fd", + "message": "[compute] Update Compute Engine v1 API to revision 20250729 (#1085)", + "issues": [ + "6579" + ] + } + ], + "version": "0.8.0", + "language": "JAVASCRIPT", + "artifactName": "@google-shopping/lfp", + "id": "8b45346f-70e4-497b-9a81-159ddd4ba4ee", + "createTime": "2025-08-12T15:48:40.626Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "0cbf8ac3e6697d92428f21010beb1c776e5e86fd", + "message": "[compute] Update Compute Engine v1 API to revision 20250729 (#1085)", + "issues": [ + "6579" + ] + } + ], + "version": "0.7.0", + "language": "JAVASCRIPT", + "artifactName": "@google-shopping/notifications", + "id": "1a02ef79-e47e-4d7e-81d6-bca62ba9a1a4", + "createTime": "2025-08-12T15:48:40.604Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "0cbf8ac3e6697d92428f21010beb1c776e5e86fd", + "message": "[compute] Update Compute Engine v1 API to revision 20250729 (#1085)", + "issues": [ + "6579" + ] + } + ], + "version": "0.7.0", + "language": "JAVASCRIPT", + "artifactName": "@google-shopping/quota", + "id": "10f59236-3105-4749-ae50-9f56c2463d7a", + "createTime": "2025-08-12T15:48:40.579Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "0cbf8ac3e6697d92428f21010beb1c776e5e86fd", + "message": "[compute] Update Compute Engine v1 API to revision 20250729 (#1085)", + "issues": [ + "6579" + ] + } + ], + "version": "0.10.0", + "language": "JAVASCRIPT", + "artifactName": "@google-shopping/inventories", + "id": "c0295f41-e362-42ff-82f5-a12959669f6a", + "createTime": "2025-08-12T15:48:40.557Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "470fa86edc902a058b2c0a7abeea4754dca4ae07", + "message": "[cloudsupport] A new message `GetAttachmentRequest` and `GetComment` is added", + "issues": [ + "6587" + ] + } + ], + "version": "2.2.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/support", + "id": "919c6a80-90de-4540-b233-66f56caab4fd", + "createTime": "2025-08-12T15:48:40.530Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "ebdb88097ad08834b188e624078db97534f82e11", + "message": "[osconfig] Add highest_upgradable_cve_severity field to Vulnerability report", + "issues": [ + "6588" + ] + } + ], + "version": "4.3.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/os-config", + "id": "077dffa9-fd70-438e-aa4c-1802d38bf28a", + "createTime": "2025-08-12T15:48:40.498Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "ab4ac467126ebc0891e01b035213438a2d2d22ce", + "message": "[networkmanagement] add `service_uri` field to CloudRunRevisionEndpoint", + "issues": [ + "6590" + ] + } + ], + "version": "5.1.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/network-management", + "id": "2f40d474-73a8-49de-97a9-e3ba147dd1ff", + "createTime": "2025-08-12T15:48:40.463Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "57f85000900bd7b7bf4f4d8470ef599202f8c541", + "message": "[datastream] Add new field `salesforce_org` to message `DiscoverConnectionProfileRequest`", + "issues": [ + "6580" + ] + } + ], + "version": "4.3.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/datastream", + "id": "2cc06f7e-4d53-4c71-a9f3-aeec24df210c", + "createTime": "2025-08-12T15:48:40.440Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "0cbf8ac3e6697d92428f21010beb1c776e5e86fd", + "message": "[compute] Update Compute Engine v1 API to revision 20250729 (#1085)", + "issues": [ + "6579" + ] + } + ], + "version": "6.2.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/compute", + "id": "d4c6c8b5-d993-4f01-bdfe-3b5e3a59a657", + "createTime": "2025-08-12T15:48:40.382Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "830c73ae048261074491bcab29a1d2ebeaf1c5f2", + "message": "[asset] Add highest_upgradable_cve_severity field to Vulnerability report", + "issues": [ + "6589" + ] + } + ], + "version": "6.3.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/asset", + "id": "75438714-485c-4fd8-8adc-2163dcdc706a", + "createTime": "2025-08-12T15:48:40.349Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "ace3695ff8200040fd4dfe93c7950a08d13a5ee2", + "message": "Expose RecommendSpecs api to vertex python SDK for Custom Weights Model deployment", + "issues": [ + "6593" + ] + }, + { + "type": "feat", + "sha": "dd3f406707562e375d0978a57a5cc1537032421b", + "message": "Added document_name for vertex ai search as part of retrieved context from grounding chunk", + "issues": [ + "6586" + ] + } + ], + "version": "5.5.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/aiplatform", + "id": "25a08917-5f4d-4809-a884-09dbb5d0903c", + "createTime": "2025-08-12T15:48:40.310Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "ac22f87a6ac7fe4af0873bfd15e76e7781037296", + "message": "[merchantapi] add ordertracking API client libraries for v1", + "issues": [ + "6570" + ] + } + ], + "version": "0.2.0", + "language": "JAVASCRIPT", + "artifactName": "@google-shopping/ordertracking", + "id": "7b986fc1-ff3b-4081-8bd7-e479b42b5284", + "createTime": "2025-08-07T22:48:01.617Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "2e570f25797f2a30fc0d3092688ce02f5d0a701d", + "message": "[merchantapi] add issueresolution API client libraries for v1", + "issues": [ + "6568" + ] + } + ], + "version": "0.2.0", + "language": "JAVASCRIPT", + "artifactName": "@google-shopping/issueresolution", + "id": "fa4d3936-6339-44ba-8526-3bc693441dc9", + "createTime": "2025-08-07T22:48:01.586Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "3cdfa4762673343395c4d27879d5244d522b7fc5", + "message": "[merchantapi] add accounts API client libraries for v1", + "issues": [ + "6573" + ] + } + ], + "version": "2.4.0", + "language": "JAVASCRIPT", + "artifactName": "@google-shopping/accounts", + "id": "dc992ff8-cee1-45e3-9e80-e4a626e21af9", + "createTime": "2025-08-07T22:48:01.556Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "57f22a05e39ad20866b3d5270e55f5660fd727ff", + "message": "[merchantapi] add products API client libraries for v1", + "issues": [ + "6569" + ] + } + ], + "version": "0.6.0", + "language": "JAVASCRIPT", + "artifactName": "@google-shopping/products", + "id": "386673e8-915a-4843-ac07-f8e7e19fa1a1", + "createTime": "2025-08-07T22:48:01.531Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "21ff44708671ae294e646a9e2604ac4da9d8a858", + "message": "[merchantapi] add promotions API client libraries for v1", + "issues": [ + "6571" + ] + } + ], + "version": "0.4.0", + "language": "JAVASCRIPT", + "artifactName": "@google-shopping/promotions", + "id": "984aa02a-51cf-4d28-859f-62e2e63938b3", + "createTime": "2025-08-07T22:48:01.501Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "46bee29bfe10579f2fb20fdd079370de60d9a578", + "message": "[merchantapi] add reports API client libraries for v1beta", + "issues": [ + "6572" + ] + } + ], + "version": "0.12.0", + "language": "JAVASCRIPT", + "artifactName": "@google-shopping/reports", + "id": "f73f14a7-06cc-4481-a1ab-119482bab862", + "createTime": "2025-08-07T22:48:01.476Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "82026b2792602640080619b123cf1108d128c08b", + "message": "A type of an existing resource_reference option of the field `worker_pool` in message `.google.cloud.run.v2.SubmitBuildRequest` is changed from `cloudbuild.googleapis.com/WorkerPool` to `cloudbuild.googleapis.com/BuildWorkerPool`", + "issues": [], + "breakingChangeNote": "A type of an existing resource_reference option of the field `worker_pool` in message `.google.cloud.run.v2.SubmitBuildRequest` is changed from `cloudbuild.googleapis.com/WorkerPool` to `cloudbuild.googleapis.com/BuildWorkerPool`" + }, + { + "type": "fix", + "sha": "82026b2792602640080619b123cf1108d128c08b", + "message": "A type of an existing resource_reference option of the field `worker_pool` in message `.google.cloud.run.v2.BuildConfig` is changed from `cloudbuild.googleapis.com/WorkerPool` to `cloudbuild.googleapis.com/BuildWorkerPool`", + "issues": [], + "breakingChangeNote": "A type of an existing resource_reference option of the field `worker_pool` in message `.google.cloud.run.v2.BuildConfig` is changed from `cloudbuild.googleapis.com/WorkerPool` to `cloudbuild.googleapis.com/BuildWorkerPool`" + }, + { + "type": "fix", + "sha": "82026b2792602640080619b123cf1108d128c08b", + "message": "[run] An existing resource_definition `cloudbuild.googleapis.com/WorkerPool` is removed", + "issues": [ + "6581" + ] + }, + { + "type": "feat", + "sha": "82026b2792602640080619b123cf1108d128c08b", + "message": "Adding new resource tpye run.googleapis.com/WorkerPool.", + "issues": [] + } + ], + "version": "3.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/run", + "id": "3e07cbdf-7f26-49f5-95de-b898f59ddb6d", + "createTime": "2025-08-07T22:48:01.451Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "c0e8526a55692c48430190aa3f02db319e1f8d05", + "message": "Add Grounding with Google Maps tool", + "issues": [ + "6578" + ] + }, + { + "type": "feat", + "sha": "e80e35de2f33266dbec28487ab496e6b8e1d1699", + "message": "Add FeatureViewDirectWrite API in v1", + "issues": [ + "6566" + ] + } + ], + "version": "5.4.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/aiplatform", + "id": "0329901f-9537-4f9e-ab0c-3369205452ef", + "createTime": "2025-08-07T22:48:01.429Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "5d8c58311ccb59a339ea278ea0da9cedcc5f706f", + "message": "[merchantapi] add datasources API client libraries for v1", + "issues": [ + "6555" + ] + } + ], + "version": "0.7.0", + "language": "JAVASCRIPT", + "artifactName": "@google-shopping/datasources", + "id": "ca6818b8-8d95-4f0f-b6a6-35c9eeeae257", + "createTime": "2025-08-04T23:51:24.454Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "0be6da4a57c05c196d3d63a93d1c833c5e3e786b", + "message": "[merchantapi] add conversions API client libraries for v1", + "issues": [ + "6556" + ] + } + ], + "version": "0.5.0", + "language": "JAVASCRIPT", + "artifactName": "@google-shopping/conversions", + "id": "56ad1757-515e-4f3e-8836-fc391176a899", + "createTime": "2025-08-04T23:51:24.438Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "dfa37220357f8294ec5e65073ccce4f6a25f62aa", + "message": "[merchantapi] add lfp API for v1", + "issues": [ + "6558" + ] + } + ], + "version": "0.7.0", + "language": "JAVASCRIPT", + "artifactName": "@google-shopping/lfp", + "id": "46927076-d468-4a5c-b086-a0df115199ca", + "createTime": "2025-08-04T23:51:24.424Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "92e9a783579873f4c92ec2f643143515dfa16fe7", + "message": "[merchantapi] add notifications API client libraries for v1", + "issues": [ + "6554" + ] + } + ], + "version": "0.6.0", + "language": "JAVASCRIPT", + "artifactName": "@google-shopping/notifications", + "id": "cca3edc0-cbd1-4376-b345-5ea7532423ac", + "createTime": "2025-08-04T23:51:24.407Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "741b41bdeb78e63021a239aa53df21a845eff5e1", + "message": "[merchantapi] add quota API for v1", + "issues": [ + "6559" + ] + } + ], + "version": "0.6.0", + "language": "JAVASCRIPT", + "artifactName": "@google-shopping/quota", + "id": "93ef1f02-13ce-49f3-8297-3e726c51984c", + "createTime": "2025-08-04T23:51:24.393Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "47de42b1be9f4f6d75d0351629d7bdac4a0d9a31", + "message": "[merchantapi] add inventories API client libraries for v1", + "issues": [ + "6553" + ] + } + ], + "version": "0.9.0", + "language": "JAVASCRIPT", + "artifactName": "@google-shopping/inventories", + "id": "1d5e156e-7d08-4fb3-92a8-c9362625d3b6", + "createTime": "2025-08-04T23:51:24.376Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "a04a1fc159d93f263b0c496193f178bb8fd1283c", + "message": "[compute] Update Compute Engine v1beta API to revision 20250717", + "issues": [ + "6552" + ] + } + ], + "version": "6.1.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/compute", + "id": "dcb1a75a-ebaf-4072-b590-e214f7e63c2f", + "createTime": "2025-08-04T23:51:24.361Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "f814e743ac3da1734af1ae44b091139e12747475", + "message": "A new value `NVIDIA_GB200` is added to enum `AcceleratorType`", + "issues": [ + "6557" + ] + } + ], + "version": "5.3.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/aiplatform", + "id": "d8b45e5d-b5b4-4a2f-ba31-78af4bf27c2c", + "createTime": "2025-08-04T23:51:24.346Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "10ef432ef35d71e59f6f2c9e6406cf9103ca1a24", + "message": "[modelarmor] MultiLanguage Detection in Model Armor Floor Setting", + "issues": [ + "6543" + ] + } + ], + "version": "0.4.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/modelarmor", + "id": "4131be7e-6f9a-4ef1-ba2b-265d29a3f359", + "createTime": "2025-08-04T16:58:23.073Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "445f9a3370e3849d4b4b6e50c48706cdff10ee67", + "message": "[privilegedaccessmanager] Introducing new Grant states for Withdrawal operation", + "issues": [ + "6550" + ] + } + ], + "version": "0.6.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/privilegedaccessmanager", + "id": "f25e8f64-3242-421a-b3a2-a5b98d5d0214", + "createTime": "2025-08-04T16:58:23.057Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "c7a644781448f2cc6c56549b30f1fe5c1fd69a70", + "message": "Remove private preview label from Model Armor protos", + "issues": [] + }, + { + "type": "feat", + "sha": "c7a644781448f2cc6c56549b30f1fe5c1fd69a70", + "message": "Add a FooBar API", + "issues": [] + }, + { + "type": "feat", + "sha": "c7a644781448f2cc6c56549b30f1fe5c1fd69a70", + "message": "Add the VeoTuningSpec", + "issues": [] + } + ], + "version": "0.8.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/securesourcemanager", + "id": "e679b89c-5cf7-4c23-8be3-bf461f31d5bb", + "createTime": "2025-08-04T16:58:23.042Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "f185fb1681c37ade2d8159af240b27a308ac05e3", + "message": "[chat] Addition of app auth support for chat api", + "issues": [ + "6545" + ] + } + ], + "version": "0.18.0", + "language": "JAVASCRIPT", + "artifactName": "@google-apps/chat", + "id": "d95be9e8-21ab-4679-a7fb-6a872ac930f3", + "createTime": "2025-08-04T16:58:23.025Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "7c4f983971be37e7bdd1b2344166c8ff662b01b9", + "message": "[merchantapi] Add additional YouTube report fields to Merchant reports endpoint", + "issues": [ + "6549" + ] + } + ], + "version": "0.11.0", + "language": "JAVASCRIPT", + "artifactName": "@google-shopping/reports", + "id": "f61b8f84-43ee-4df9-bc4f-cf8515e333a8", + "createTime": "2025-08-04T16:58:23.006Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "517a9caaf1ef6bf7484208745f2fb27a57fc49da", + "message": "Update dependency redis to ~5.7.0", + "issues": [ + "6551" + ], + "scope": "deps" + } + ], + "version": "5.3.3", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/vision", + "id": "e475125c-53ab-4cd3-b18f-a3eb2a289b06", + "createTime": "2025-08-04T16:58:22.987Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "36c69e324c01ed96f87e4305636823f5e459ad41", + "message": "Update dependency @google-cloud/compute to v6", + "issues": [ + "6544" + ], + "scope": "deps" + } + ], + "version": "6.2.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/asset", + "id": "2aa8a737-2411-4983-b1f7-18c43c87eb55", + "createTime": "2025-08-04T16:58:22.969Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "9643347354333438637958811c1029d501720563", + "message": "Add field ReasoningEngineSpec.service_account", + "issues": [ + "6547" + ] + }, + { + "type": "feat", + "sha": "1783b417e71850cf29137544d613ef204f882d25", + "message": "Add enable_datapoint_upsert_logging to google.cloud.aiplatform.v1.DeployedIndex", + "issues": [ + "6542" + ] + }, + { + "type": "feat", + "sha": "1783b417e71850cf29137544d613ef204f882d25", + "message": "Remove private preview label from Model Armor protos", + "issues": [] + }, + { + "type": "feat", + "sha": "1783b417e71850cf29137544d613ef204f882d25", + "message": "Add a FooBar API", + "issues": [] + }, + { + "type": "feat", + "sha": "1783b417e71850cf29137544d613ef204f882d25", + "message": "Add the VeoTuningSpec", + "issues": [] + } + ], + "version": "5.2.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/aiplatform", + "id": "8ece3ee1-6e09-42e1-8b5c-eeddb6df2f4f", + "createTime": "2025-08-04T16:58:22.953Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "0c21b6970375c5ee7a25f910cc081fbe2f492eaa", + "message": "Add initial files for google.cloud.configdelivery.v1", + "issues": [ + "6518" + ] + } + ], + "version": "0.1.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/configdelivery", + "id": "e161a16f-c51a-4005-9936-109fec51d8a3", + "createTime": "2025-07-28T18:29:20.426Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "2a038b6294d5e45efbe082278feb08ac10f24ced", + "message": "[modelarmor] MultiLanguage Detection in Model Armor Floor Setting", + "issues": [ + "6527" + ] + } + ], + "version": "0.3.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/modelarmor", + "id": "2cba89d6-6c0e-4814-af38-00b3bcb555f5", + "createTime": "2025-07-28T18:29:20.394Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "0413b68d2220637f007679641d3c6a55df0bfc68", + "message": "[merchantapi] An existing field `attributes` is renamed to `merchant_review_attributes` in message `.google.shopping.merchant.reviews.v1beta.MerchantReview`", + "issues": [ + "6533" + ], + "breakingChangeNote": "[merchantapi] An existing field `attributes` is renamed to `merchant_review_attributes` in message `.google.shopping.merchant.reviews.v1beta.MerchantReview` ([#6533](https://github.com/googleapis/google-cloud-node/issues/6533))" + } + ], + "version": "0.5.0", + "language": "JAVASCRIPT", + "artifactName": "@google-shopping/reviews", + "id": "de8196bd-8a3b-40cd-b7cc-751ae47bb7f3", + "createTime": "2025-07-28T18:29:20.357Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Enable organization-level support for VPC Flow Logs", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add field `service_uri` to message `Endpoint.CloudRunRevisionEndpoint`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add message `Endpoint.SingleEdgeResponse`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add http additional_bindings", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add enum `Status` to message `InstanceInfo`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add field `running` to message `InstanceInfo`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add field `policy_priority` to message `NetworkInfo`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add enum value `RouteInfo.NextHopType.SECURE_WEB_PROXY_GATEWAY`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add enum `DeliverInfo.GoogleServiceType`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add field `google_service_type` to message `DeliverInfo`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add enum value `AbortInfo.Cause.GOOGLE_MANAGED_SERVICE_AMBIGUOUS_ENDPOINT`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add enum values `NO_ROUTE_FROM_EXTERNAL_IPV6_SOURCE_TO_PRIVATE_IPV6_ADDRESS`, `TRAFFIC_FROM_HYBRID_ENDPOINT_TO_INTERNET_DISALLOWED`, `NO_MATCHING_NAT64_GATEWAY`, `LOAD_BALANCER_BACKEND_IP_VERSION_MISMATCH`, and `NO_KNOWN_ROUTE_FROM_NCC_NETWORK_TO_DESTINATION` to `DropInfo.Cause`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add rpc `VpcFlowLogsService.QueryOrgVpcFlowLogsConfigs`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add service `OrganizationVpcFlowLogsService`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add enum `VpcFlowLogsConfig.CrossProjectMetadata`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add enum `VpcFlowLogsConfig.TargetResourceState`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add fields `cross_project_metadata`, `target_resource_state`, `network`, and `subnet` to message `VpcFlowLogsConfig`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "A new field `semantic_search` is added to `message.google.cloud.dataplex.v1.SearchEntriesRequest`", + "issues": [] + }, + { + "type": "fix", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Correct resource reference type for `parent` field in `data_chat_service.proto`", + "issues": [], + "breakingChangeNote": "Correct resource reference type for `parent` field in `data_chat_service.proto`" + }, + { + "type": "fix", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Pagination response for Compute Subnetworks.ListUsable (39952d9)", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Update libraries and clients for Managed Kafka", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Update Compute Engine v1 API to revision 20250626", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Update Compute Engine v1beta API to revision 20250626", + "issues": [] + }, + { + "type": "fix", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Remove field `restricted` within encryption enforcement config.", + "issues": [], + "breakingChangeNote": "Remove field `restricted` within encryption enforcement config." + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add new field `restriction_mode` for encryption enforcement config in message Bucket", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add isolation support to prevent cross-region overflow by adding a new field \"isolation_config\" to message \"ServiceLbPolicy\"", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add safebrowsing proto defs", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add User Defined Access URLs", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add backdate duration", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Adds tbs_certificate_digest to CertificateDescription", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add RDN sequence", + "issues": [] + } + ], + "version": "0.8.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/managedkafka", + "id": "339efa88-6901-442e-82aa-3658ab6e3a8d", + "createTime": "2025-07-28T18:29:20.321Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "ce2c32f00e6cbc6dd6b5a8aa585568e85f919af9", + "message": "[securesourcemanager] add support for new API resources: Issues, IssueComments, PullRequests, PullRequestComments, Blobs", + "issues": [ + "6529" + ] + } + ], + "version": "0.7.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/securesourcemanager", + "id": "8161141a-9ac7-4329-acab-588c196af62f", + "createTime": "2025-07-28T18:29:20.286Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "b592fd0ee3bc242732830a68d0041dc4680f0848", + "message": "[backupdr] Add support for Cloud SQL backup and restore", + "issues": [ + "6521" + ] + } + ], + "version": "0.5.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/backupdr", + "id": "c089238d-1329-4f72-ab23-af68a8925aba", + "createTime": "2025-07-28T18:29:20.258Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "e29b9a30ca4580fb6370c83cd99279f03f251479", + "message": "[chat] Exposing 1p integration message content (drive, calendar, huddle, meet chips)", + "issues": [ + "6517" + ] + } + ], + "version": "0.17.0", + "language": "JAVASCRIPT", + "artifactName": "@google-apps/chat", + "id": "ce702f73-4dd9-4d41-bc7e-01223b67eb74", + "createTime": "2025-07-28T18:29:20.228Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "c73b860e2473725fe7443a89b8b6410047825888", + "message": "[container] A new enum `TransparentHugepageEnabled` is added", + "issues": [ + "6522" + ] + } + ], + "version": "6.4.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/container", + "id": "6a8ef66c-3b43-4cf7-b0d8-fd30e3230610", + "createTime": "2025-07-28T18:29:20.199Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Enable organization-level support for VPC Flow Logs", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add field `service_uri` to message `Endpoint.CloudRunRevisionEndpoint`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add message `Endpoint.SingleEdgeResponse`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add http additional_bindings", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add enum `Status` to message `InstanceInfo`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add field `running` to message `InstanceInfo`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add field `policy_priority` to message `NetworkInfo`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add enum value `RouteInfo.NextHopType.SECURE_WEB_PROXY_GATEWAY`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add enum `DeliverInfo.GoogleServiceType`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add field `google_service_type` to message `DeliverInfo`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add enum value `AbortInfo.Cause.GOOGLE_MANAGED_SERVICE_AMBIGUOUS_ENDPOINT`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add enum values `NO_ROUTE_FROM_EXTERNAL_IPV6_SOURCE_TO_PRIVATE_IPV6_ADDRESS`, `TRAFFIC_FROM_HYBRID_ENDPOINT_TO_INTERNET_DISALLOWED`, `NO_MATCHING_NAT64_GATEWAY`, `LOAD_BALANCER_BACKEND_IP_VERSION_MISMATCH`, and `NO_KNOWN_ROUTE_FROM_NCC_NETWORK_TO_DESTINATION` to `DropInfo.Cause`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add rpc `VpcFlowLogsService.QueryOrgVpcFlowLogsConfigs`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add service `OrganizationVpcFlowLogsService`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add enum `VpcFlowLogsConfig.CrossProjectMetadata`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add enum `VpcFlowLogsConfig.TargetResourceState`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add fields `cross_project_metadata`, `target_resource_state`, `network`, and `subnet` to message `VpcFlowLogsConfig`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "A new field `semantic_search` is added to `message.google.cloud.dataplex.v1.SearchEntriesRequest`", + "issues": [] + }, + { + "type": "fix", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Correct resource reference type for `parent` field in `data_chat_service.proto`", + "issues": [], + "breakingChangeNote": "Correct resource reference type for `parent` field in `data_chat_service.proto`" + }, + { + "type": "fix", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Pagination response for Compute Subnetworks.ListUsable (39952d9)", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Update libraries and clients for Managed Kafka", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Update Compute Engine v1 API to revision 20250626", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Update Compute Engine v1beta API to revision 20250626", + "issues": [] + }, + { + "type": "fix", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Remove field `restricted` within encryption enforcement config.", + "issues": [], + "breakingChangeNote": "Remove field `restricted` within encryption enforcement config." + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add new field `restriction_mode` for encryption enforcement config in message Bucket", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add isolation support to prevent cross-region overflow by adding a new field \"isolation_config\" to message \"ServiceLbPolicy\"", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add safebrowsing proto defs", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add User Defined Access URLs", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add backdate duration", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Adds tbs_certificate_digest to CertificateDescription", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add RDN sequence", + "issues": [] + } + ], + "version": "7.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/security-private-ca", + "id": "4d34b130-1095-4e0d-947c-627770470503", + "createTime": "2025-07-28T18:29:20.168Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "ec9102c5b3417b8d461e8ee9bca271c62a95ccf7", + "message": "[retail] add new fields in conversational search public SDK", + "issues": [ + "6537" + ] + }, + { + "type": "feat", + "sha": "6ab93f6acc75210bffe3455ecbf1b4dbcb57cc7e", + "message": "[retail] add experiment_id in the SearchRequest proto", + "issues": [ + "6519" + ] + } + ], + "version": "4.2.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/retail", + "id": "00ca2199-4bad-4552-a333-a01a1a46a945", + "createTime": "2025-07-28T18:29:20.138Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Enable organization-level support for VPC Flow Logs", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add field `service_uri` to message `Endpoint.CloudRunRevisionEndpoint`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add message `Endpoint.SingleEdgeResponse`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add http additional_bindings", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add enum `Status` to message `InstanceInfo`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add field `running` to message `InstanceInfo`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add field `policy_priority` to message `NetworkInfo`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add enum value `RouteInfo.NextHopType.SECURE_WEB_PROXY_GATEWAY`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add enum `DeliverInfo.GoogleServiceType`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add field `google_service_type` to message `DeliverInfo`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add enum value `AbortInfo.Cause.GOOGLE_MANAGED_SERVICE_AMBIGUOUS_ENDPOINT`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add enum values `NO_ROUTE_FROM_EXTERNAL_IPV6_SOURCE_TO_PRIVATE_IPV6_ADDRESS`, `TRAFFIC_FROM_HYBRID_ENDPOINT_TO_INTERNET_DISALLOWED`, `NO_MATCHING_NAT64_GATEWAY`, `LOAD_BALANCER_BACKEND_IP_VERSION_MISMATCH`, and `NO_KNOWN_ROUTE_FROM_NCC_NETWORK_TO_DESTINATION` to `DropInfo.Cause`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add rpc `VpcFlowLogsService.QueryOrgVpcFlowLogsConfigs`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add service `OrganizationVpcFlowLogsService`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add enum `VpcFlowLogsConfig.CrossProjectMetadata`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add enum `VpcFlowLogsConfig.TargetResourceState`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add fields `cross_project_metadata`, `target_resource_state`, `network`, and `subnet` to message `VpcFlowLogsConfig`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "A new field `semantic_search` is added to `message.google.cloud.dataplex.v1.SearchEntriesRequest`", + "issues": [] + }, + { + "type": "fix", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Correct resource reference type for `parent` field in `data_chat_service.proto`", + "issues": [], + "breakingChangeNote": "Correct resource reference type for `parent` field in `data_chat_service.proto`" + }, + { + "type": "fix", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Pagination response for Compute Subnetworks.ListUsable (39952d9)", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Update libraries and clients for Managed Kafka", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Update Compute Engine v1 API to revision 20250626", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Update Compute Engine v1beta API to revision 20250626", + "issues": [] + }, + { + "type": "fix", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Remove field `restricted` within encryption enforcement config.", + "issues": [], + "breakingChangeNote": "Remove field `restricted` within encryption enforcement config." + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add new field `restriction_mode` for encryption enforcement config in message Bucket", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add isolation support to prevent cross-region overflow by adding a new field \"isolation_config\" to message \"ServiceLbPolicy\"", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add safebrowsing proto defs", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add User Defined Access URLs", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add backdate duration", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Adds tbs_certificate_digest to CertificateDescription", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add RDN sequence", + "issues": [] + } + ], + "version": "0.11.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/networkservices", + "id": "36902c53-a563-43be-978f-92ed0d078642", + "createTime": "2025-07-28T18:29:20.099Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Enable organization-level support for VPC Flow Logs", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add field `service_uri` to message `Endpoint.CloudRunRevisionEndpoint`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add message `Endpoint.SingleEdgeResponse`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add http additional_bindings", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add enum `Status` to message `InstanceInfo`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add field `running` to message `InstanceInfo`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add field `policy_priority` to message `NetworkInfo`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add enum value `RouteInfo.NextHopType.SECURE_WEB_PROXY_GATEWAY`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add enum `DeliverInfo.GoogleServiceType`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add field `google_service_type` to message `DeliverInfo`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add enum value `AbortInfo.Cause.GOOGLE_MANAGED_SERVICE_AMBIGUOUS_ENDPOINT`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add enum values `NO_ROUTE_FROM_EXTERNAL_IPV6_SOURCE_TO_PRIVATE_IPV6_ADDRESS`, `TRAFFIC_FROM_HYBRID_ENDPOINT_TO_INTERNET_DISALLOWED`, `NO_MATCHING_NAT64_GATEWAY`, `LOAD_BALANCER_BACKEND_IP_VERSION_MISMATCH`, and `NO_KNOWN_ROUTE_FROM_NCC_NETWORK_TO_DESTINATION` to `DropInfo.Cause`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add rpc `VpcFlowLogsService.QueryOrgVpcFlowLogsConfigs`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add service `OrganizationVpcFlowLogsService`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add enum `VpcFlowLogsConfig.CrossProjectMetadata`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add enum `VpcFlowLogsConfig.TargetResourceState`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add fields `cross_project_metadata`, `target_resource_state`, `network`, and `subnet` to message `VpcFlowLogsConfig`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "A new field `semantic_search` is added to `message.google.cloud.dataplex.v1.SearchEntriesRequest`", + "issues": [] + }, + { + "type": "fix", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Correct resource reference type for `parent` field in `data_chat_service.proto`", + "issues": [], + "breakingChangeNote": "Correct resource reference type for `parent` field in `data_chat_service.proto`" + }, + { + "type": "fix", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Pagination response for Compute Subnetworks.ListUsable (39952d9)", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Update libraries and clients for Managed Kafka", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Update Compute Engine v1 API to revision 20250626", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Update Compute Engine v1beta API to revision 20250626", + "issues": [] + }, + { + "type": "fix", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Remove field `restricted` within encryption enforcement config.", + "issues": [], + "breakingChangeNote": "Remove field `restricted` within encryption enforcement config." + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add new field `restriction_mode` for encryption enforcement config in message Bucket", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add isolation support to prevent cross-region overflow by adding a new field \"isolation_config\" to message \"ServiceLbPolicy\"", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add safebrowsing proto defs", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add User Defined Access URLs", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add backdate duration", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Adds tbs_certificate_digest to CertificateDescription", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add RDN sequence", + "issues": [] + } + ], + "version": "5.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/network-management", + "id": "f8bda808-e748-4602-9d13-6446e2f16387", + "createTime": "2025-07-28T18:29:20.050Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "032112fc61ff177814bfde60f95bc5dbaf170605", + "message": "[discoveryengine] add SessionService", + "issues": [ + "6528" + ] + }, + { + "type": "feat", + "sha": "fe839667fab84d85b7dedc82947309579cf443c6", + "message": "[discoveryengine] add AssistantService", + "issues": [ + "6524" + ] + } + ], + "version": "2.4.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/discoveryengine", + "id": "44055438-a75a-41f9-b049-40d940dc6217", + "createTime": "2025-07-28T18:29:20.013Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Enable organization-level support for VPC Flow Logs", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add field `service_uri` to message `Endpoint.CloudRunRevisionEndpoint`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add message `Endpoint.SingleEdgeResponse`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add http additional_bindings", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add enum `Status` to message `InstanceInfo`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add field `running` to message `InstanceInfo`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add field `policy_priority` to message `NetworkInfo`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add enum value `RouteInfo.NextHopType.SECURE_WEB_PROXY_GATEWAY`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add enum `DeliverInfo.GoogleServiceType`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add field `google_service_type` to message `DeliverInfo`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add enum value `AbortInfo.Cause.GOOGLE_MANAGED_SERVICE_AMBIGUOUS_ENDPOINT`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add enum values `NO_ROUTE_FROM_EXTERNAL_IPV6_SOURCE_TO_PRIVATE_IPV6_ADDRESS`, `TRAFFIC_FROM_HYBRID_ENDPOINT_TO_INTERNET_DISALLOWED`, `NO_MATCHING_NAT64_GATEWAY`, `LOAD_BALANCER_BACKEND_IP_VERSION_MISMATCH`, and `NO_KNOWN_ROUTE_FROM_NCC_NETWORK_TO_DESTINATION` to `DropInfo.Cause`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add rpc `VpcFlowLogsService.QueryOrgVpcFlowLogsConfigs`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add service `OrganizationVpcFlowLogsService`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add enum `VpcFlowLogsConfig.CrossProjectMetadata`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add enum `VpcFlowLogsConfig.TargetResourceState`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add fields `cross_project_metadata`, `target_resource_state`, `network`, and `subnet` to message `VpcFlowLogsConfig`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "A new field `semantic_search` is added to `message.google.cloud.dataplex.v1.SearchEntriesRequest`", + "issues": [] + }, + { + "type": "fix", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Correct resource reference type for `parent` field in `data_chat_service.proto`", + "issues": [], + "breakingChangeNote": "Correct resource reference type for `parent` field in `data_chat_service.proto`" + }, + { + "type": "fix", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Pagination response for Compute Subnetworks.ListUsable (39952d9)", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Update libraries and clients for Managed Kafka", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Update Compute Engine v1 API to revision 20250626", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Update Compute Engine v1beta API to revision 20250626", + "issues": [] + }, + { + "type": "fix", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Remove field `restricted` within encryption enforcement config.", + "issues": [], + "breakingChangeNote": "Remove field `restricted` within encryption enforcement config." + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add new field `restriction_mode` for encryption enforcement config in message Bucket", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add isolation support to prevent cross-region overflow by adding a new field \"isolation_config\" to message \"ServiceLbPolicy\"", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add safebrowsing proto defs", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add User Defined Access URLs", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add backdate duration", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Adds tbs_certificate_digest to CertificateDescription", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add RDN sequence", + "issues": [] + } + ], + "version": "5.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/dataplex", + "id": "f54c946e-a769-446c-b9de-f1e8be6e3f86", + "createTime": "2025-07-28T18:29:19.980Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "11e810577f3d6550fc60397785bcea5018a53286", + "message": "[compute] Update Compute Engine v1beta API to revision 20250708 (#1072)", + "issues": [ + "6501" + ] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Enable organization-level support for VPC Flow Logs", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add field `service_uri` to message `Endpoint.CloudRunRevisionEndpoint`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add message `Endpoint.SingleEdgeResponse`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add http additional_bindings", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add enum `Status` to message `InstanceInfo`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add field `running` to message `InstanceInfo`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add field `policy_priority` to message `NetworkInfo`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add enum value `RouteInfo.NextHopType.SECURE_WEB_PROXY_GATEWAY`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add enum `DeliverInfo.GoogleServiceType`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add field `google_service_type` to message `DeliverInfo`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add enum value `AbortInfo.Cause.GOOGLE_MANAGED_SERVICE_AMBIGUOUS_ENDPOINT`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add enum values `NO_ROUTE_FROM_EXTERNAL_IPV6_SOURCE_TO_PRIVATE_IPV6_ADDRESS`, `TRAFFIC_FROM_HYBRID_ENDPOINT_TO_INTERNET_DISALLOWED`, `NO_MATCHING_NAT64_GATEWAY`, `LOAD_BALANCER_BACKEND_IP_VERSION_MISMATCH`, and `NO_KNOWN_ROUTE_FROM_NCC_NETWORK_TO_DESTINATION` to `DropInfo.Cause`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add rpc `VpcFlowLogsService.QueryOrgVpcFlowLogsConfigs`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add service `OrganizationVpcFlowLogsService`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add enum `VpcFlowLogsConfig.CrossProjectMetadata`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add enum `VpcFlowLogsConfig.TargetResourceState`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add fields `cross_project_metadata`, `target_resource_state`, `network`, and `subnet` to message `VpcFlowLogsConfig`", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "A new field `semantic_search` is added to `message.google.cloud.dataplex.v1.SearchEntriesRequest`", + "issues": [] + }, + { + "type": "fix", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Correct resource reference type for `parent` field in `data_chat_service.proto`", + "issues": [], + "breakingChangeNote": "Correct resource reference type for `parent` field in `data_chat_service.proto`" + }, + { + "type": "fix", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Pagination response for Compute Subnetworks.ListUsable (39952d9)", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Update libraries and clients for Managed Kafka", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Update Compute Engine v1 API to revision 20250626", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Update Compute Engine v1beta API to revision 20250626", + "issues": [] + }, + { + "type": "fix", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Remove field `restricted` within encryption enforcement config.", + "issues": [], + "breakingChangeNote": "Remove field `restricted` within encryption enforcement config." + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add new field `restriction_mode` for encryption enforcement config in message Bucket", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add isolation support to prevent cross-region overflow by adding a new field \"isolation_config\" to message \"ServiceLbPolicy\"", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add safebrowsing proto defs", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add User Defined Access URLs", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add backdate duration", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Adds tbs_certificate_digest to CertificateDescription", + "issues": [] + }, + { + "type": "feat", + "sha": "7e3d10b075bb9b7c8f9e88a47e77b6d55a80bf31", + "message": "Add RDN sequence", + "issues": [] + } + ], + "version": "6.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/compute", + "id": "21600dd8-fc3b-454f-8f96-fea40e60fcc4", + "createTime": "2025-07-28T18:29:19.933Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "4ef705b409954f45fae7638064aafa61ade1bcc8", + "message": "Adds DWS and spot VM feature support to custom batch predictions 2.0", + "issues": [ + "6536" + ] + }, + { + "type": "feat", + "sha": "4afa04ea37f9a1d3df1082b481891ce4b844d7bf", + "message": "Add service_account to Reasoning Engine public protos", + "issues": [ + "6523" + ] + } + ], + "version": "5.1.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/aiplatform", + "id": "aa97e87e-5145-4751-b936-e6f5d79b6c31", + "createTime": "2025-07-28T18:29:19.903Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "a39702e4f0e8a9536cef0adbc64d5fd3045592d8", + "message": "[addressvalidation] add has_spell_corrected_components field to the Address Validation verdict in the API response", + "issues": [ + "6498" + ] + } + ], + "version": "3.2.0", + "language": "JAVASCRIPT", + "artifactName": "@googlemaps/addressvalidation", + "id": "072accf7-cbed-4a8a-ae86-b31a1e73bc33", + "createTime": "2025-07-22T18:14:26.548Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "0cb9bb2180f333f075aabd0fd637918352e88cf7", + "message": "Remove is dependency", + "issues": [ + "6516" + ] + } + ], + "version": "5.3.2", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/vision", + "id": "ed875108-35c7-4e89-9363-ddc481c66909", + "createTime": "2025-07-22T18:14:26.530Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "f2cd7fd1f89c904fbf56967f93d7b7fc7fcfa1d4", + "message": "[video-transcoder] added support for specifying HEVC codec tag", + "issues": [ + "6504" + ] + } + ], + "version": "4.3.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/video-transcoder", + "id": "50d92ceb-75fb-4f51-a346-a31f44a9b9ec", + "createTime": "2025-07-22T18:14:26.497Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "2d56d45f0a0e8bc9be618875af71abf89ca79e9d", + "message": "[run] support GPU zonal redundancy setting for Cloud Run jobs", + "issues": [ + "6499" + ] + } + ], + "version": "2.3.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/run", + "id": "9175e9d6-8c65-42ab-8219-bf87fb2eacd7", + "createTime": "2025-07-22T18:14:26.479Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "778fbd3c8ae51d3ef185454bfb0c44efda250edd", + "message": "[policysimulator] added OrgPolicyViolationsPreviewService v1 API to simulate Org Policy", + "issues": [ + "6509" + ] + } + ], + "version": "0.8.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/policysimulator", + "id": "2b3b93a8-8435-468c-a90c-4d461a201a12", + "createTime": "2025-07-22T18:14:26.456Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "872ff6ea741976c5173fbae5c5f5fee8f7f99a51", + "message": "[networkconnectivity] add Network Connectivity Center APIs for Internal Range service", + "issues": [ + "6512" + ] + } + ], + "version": "4.4.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/network-connectivity", + "id": "e4dde342-8bbf-4525-895c-ea39854a8cb6", + "createTime": "2025-07-22T18:14:26.435Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "67792d85893a9f5ae5de70998c012bf92c789313", + "message": "[bigquery-datapolicies] Add client libraries for V2 Data Policy api", + "issues": [ + "6503" + ] + } + ], + "version": "2.3.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/bigquery-datapolicies", + "id": "a5a118b4-a20e-40dc-921a-1df67f34d68b", + "createTime": "2025-07-22T18:14:26.403Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "7e751ac51e5e5f66e1fda8419cae4a36cd7e22c5", + "message": "Remove gemini_template_config and request_column_name fields from DatasetService.AssessData and DatasetService.AssembleData", + "issues": [ + "6508" + ], + "breakingChangeNote": "remove gemini_template_config and request_column_name fields from DatasetService.AssessData and DatasetService.AssembleData ([#6508](https://github.com/googleapis/google-cloud-node/issues/6508))" + } + ], + "version": "5.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/aiplatform", + "id": "9f4d1243-fdc9-409c-9a17-33b8e3bfd217", + "createTime": "2025-07-22T18:14:26.383Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "ff417302f401a0ef9af47f7e8c43cbc9a2f0d0ba", + "message": "[servicecontrol] ServiceController V2 APIs are out of private preview", + "issues": [ + "6513" + ] + } + ], + "version": "4.3.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/service-control", + "id": "5a40fe8f-cd9f-4f54-a49f-3cb6701ec4d9", + "createTime": "2025-07-22T18:14:26.363Z" + }, { "changes": [ { @@ -59351,5 +62163,5 @@ "createTime": "2023-01-28T04:18:24.718Z" } ], - "updateTime": "2025-07-17T01:18:58.823Z" + "updateTime": "2025-09-04T20:33:14.674Z" } \ No newline at end of file diff --git a/containers/node-bootstrap-container/entrypoint.sh b/containers/node-bootstrap-container/entrypoint.sh index 133054b3e6b..62dfd3077b1 100755 --- a/containers/node-bootstrap-container/entrypoint.sh +++ b/containers/node-bootstrap-container/entrypoint.sh @@ -15,7 +15,7 @@ set -e MONO_REPO_NAME="google-cloud-node" -cd "${MONO_REPO_PATH}/packages/gapic-node-templating" +cd "${MONO_REPO_PATH}/packages/gapic-node-processing" npm i npm run compile npm link . @@ -28,4 +28,4 @@ mkdir -p "${MONO_REPO_PATH}/packages/${FOLDER_NAME}" || node /create-gh-issue.js node /add-to-well-known-path.js "${INTER_CONTAINER_VARS_PATH}" "${FOLDER_NAME}" cd "${MONO_REPO_PATH}" -/usr/local/bin/gapic-node-templating bootstrap-library --api-id "${API_ID}" --destination-folder "${MONO_REPO_PATH}/packages/${FOLDER_NAME}" --mono-repo-name "${MONO_REPO_NAME}" --folder-name "${FOLDER_NAME}" --service-config-path "${SERVICE_CONFIG_PATH}" || node /create-gh-issue.js +/usr/local/bin/gapic-node-processing bootstrap-library --api-id "${API_ID}" --destination-folder "${MONO_REPO_PATH}/packages/${FOLDER_NAME}" --mono-repo-name "${MONO_REPO_NAME}" --folder-name "${FOLDER_NAME}" --service-config-path "${SERVICE_CONFIG_PATH}" || node /create-gh-issue.js diff --git a/libraries.json b/libraries.json index 829d31d23b1..adb5862b752 100644 --- a/libraries.json +++ b/libraries.json @@ -1557,6 +1557,204 @@ "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-memcache", "support_documentation": "https://cloud.google.com/memorystore/docs/getting-support" }, + { + "name": "merchantapi", + "name_pretty": "Merchant API", + "product_documentation": "https://developers.google.com/merchant/api", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/merchantapi/latest", + "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", + "release_level": "stable", + "language": "nodejs", + "repo": "googleapis/google-cloud-node", + "distribution_name": "@google-shopping/accounts", + "api_id": "merchantapi.googleapis.com", + "default_version": "v1", + "requires_billing": true, + "library_type": "GAPIC_AUTO", + "api_shortname": "merchantapi", + "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-shopping-merchant-accounts", + "support_documentation": "https://developers.google.com/merchant/api/docs/getting-support" + }, + { + "name": "merchantapi", + "name_pretty": "Merchant API", + "product_documentation": "https://developers.google.com/merchant/api", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/merchantapi/latest", + "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", + "release_level": "stable", + "language": "nodejs", + "repo": "googleapis/google-cloud-node", + "distribution_name": "@google-shopping/conversions", + "api_id": "merchantapi.googleapis.com", + "default_version": "v1", + "requires_billing": true, + "library_type": "GAPIC_AUTO", + "api_shortname": "merchantapi", + "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-shopping-merchant-conversions", + "support_documentation": "https://developers.google.com/merchant/api/docs/getting-support" + }, + { + "name": "merchantapi", + "name_pretty": "Merchant API", + "product_documentation": "https://developers.google.com/merchant/api", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/merchantapi/latest", + "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", + "release_level": "stable", + "language": "nodejs", + "repo": "googleapis/google-cloud-node", + "distribution_name": "@google-shopping/datasources", + "api_id": "merchantapi.googleapis.com", + "default_version": "v1", + "requires_billing": true, + "library_type": "GAPIC_AUTO", + "api_shortname": "merchantapi", + "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-shopping-merchant-datasources", + "support_documentation": "https://developers.google.com/merchant/api/docs/getting-support" + }, + { + "name": "merchantapi", + "name_pretty": "Merchant API", + "product_documentation": "https://developers.google.com/merchant/api", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/merchantapi/latest", + "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", + "release_level": "stable", + "language": "nodejs", + "repo": "googleapis/google-cloud-node", + "distribution_name": "@google-shopping/issueresolution", + "api_id": "merchantapi.googleapis.com", + "default_version": "v1", + "requires_billing": true, + "library_type": "GAPIC_AUTO", + "api_shortname": "merchantapi", + "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-shopping-merchant-issueresolution", + "support_documentation": "https://developers.google.com/merchant/api/docs/getting-support" + }, + { + "name": "merchantapi", + "name_pretty": "Merchant API", + "product_documentation": "https://developers.google.com/merchant/api", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/merchantapi/latest", + "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", + "release_level": "stable", + "language": "nodejs", + "repo": "googleapis/google-cloud-node", + "distribution_name": "@google-shopping/lfp", + "api_id": "merchantapi.googleapis.com", + "default_version": "v1", + "requires_billing": true, + "library_type": "GAPIC_AUTO", + "api_shortname": "merchantapi", + "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-shopping-merchant-lfp", + "support_documentation": "https://developers.google.com/merchant/api/docs/getting-support" + }, + { + "name": "merchantapi", + "name_pretty": "Merchant API", + "product_documentation": "https://developers.google.com/merchant/api", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/merchantapi/latest", + "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", + "release_level": "stable", + "language": "nodejs", + "repo": "googleapis/google-cloud-node", + "distribution_name": "@google-shopping/notifications", + "api_id": "merchantapi.googleapis.com", + "default_version": "v1", + "requires_billing": true, + "library_type": "GAPIC_AUTO", + "api_shortname": "merchantapi", + "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-shopping-merchant-notifications", + "support_documentation": "https://developers.google.com/merchant/api/docs/getting-support" + }, + { + "name": "merchantapi", + "name_pretty": "Merchant API", + "product_documentation": "https://developers.google.com/merchant/api", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/merchantapi/latest", + "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", + "release_level": "stable", + "language": "nodejs", + "repo": "googleapis/google-cloud-node", + "distribution_name": "@google-shopping/ordertracking", + "api_id": "merchantapi.googleapis.com", + "default_version": "v1", + "requires_billing": true, + "library_type": "GAPIC_AUTO", + "api_shortname": "merchantapi", + "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-shopping-merchant-ordertracking", + "support_documentation": "https://developers.google.com/merchant/api/docs/getting-support" + }, + { + "name": "merchantapi", + "name_pretty": "Merchant API", + "product_documentation": "https://developers.google.com/merchant/api", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/merchantapi/latest", + "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", + "release_level": "stable", + "language": "nodejs", + "repo": "googleapis/google-cloud-node", + "distribution_name": "@google-shopping/products", + "api_id": "merchantapi.googleapis.com", + "default_version": "v1", + "requires_billing": true, + "library_type": "GAPIC_AUTO", + "api_shortname": "merchantapi", + "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-shopping-merchant-products", + "support_documentation": "https://developers.google.com/merchant/api/docs/getting-support" + }, + { + "name": "merchantapi", + "name_pretty": "Merchant API", + "product_documentation": "https://developers.google.com/merchant/api", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/merchantapi/latest", + "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", + "release_level": "stable", + "language": "nodejs", + "repo": "googleapis/google-cloud-node", + "distribution_name": "@google-shopping/promotions", + "api_id": "merchantapi.googleapis.com", + "default_version": "v1", + "requires_billing": true, + "library_type": "GAPIC_AUTO", + "api_shortname": "merchantapi", + "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-shopping-merchant-promotions", + "support_documentation": "https://developers.google.com/merchant/api/docs/getting-support" + }, + { + "name": "merchantapi", + "name_pretty": "Merchant API", + "product_documentation": "https://developers.google.com/merchant/api", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/merchantapi/latest", + "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", + "release_level": "stable", + "language": "nodejs", + "repo": "googleapis/google-cloud-node", + "distribution_name": "@google-shopping/quota", + "api_id": "merchantapi.googleapis.com", + "default_version": "v1", + "requires_billing": true, + "library_type": "GAPIC_AUTO", + "api_shortname": "merchantapi", + "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-shopping-merchant-quota", + "support_documentation": "https://developers.google.com/merchant/api/docs/getting-support" + }, + { + "name": "merchantapi", + "name_pretty": "Merchant API", + "product_documentation": "https://developers.google.com/merchant/api", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/merchantapi/latest", + "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", + "release_level": "stable", + "language": "nodejs", + "repo": "googleapis/google-cloud-node", + "distribution_name": "@google-shopping/reports", + "api_id": "merchantapi.googleapis.com", + "default_version": "v1", + "requires_billing": true, + "library_type": "GAPIC_AUTO", + "api_shortname": "merchantapi", + "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-shopping-merchant-reports", + "support_documentation": "https://developers.google.com/merchant/api/docs/getting-support" + }, { "name": "vmmigration", "name_pretty": "Migrate for Compute Engine", @@ -2810,6 +3008,24 @@ "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-chronicle", "support_documentation": "https://cloud.google.com/chronicle/docs/getting-support" }, + { + "name": "configdelivery", + "name_pretty": "Config Delivery API", + "product_documentation": "https://cloud.google.com/kubernetes-engine/enterprise/config-sync/docs/concepts/fleet-packages", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/configdelivery/latest", + "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", + "release_level": "preview", + "language": "nodejs", + "repo": "googleapis/google-cloud-node", + "distribution_name": "@google-cloud/configdelivery", + "api_id": "configdelivery.googleapis.com", + "default_version": "v1", + "requires_billing": true, + "library_type": "GAPIC_AUTO", + "api_shortname": "configdelivery", + "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-configdelivery", + "support_documentation": "https://cloud.google.com/kubernetes-engine/enterprise/config-sync/docs/getting-support" + }, { "name": "css", "name_pretty": "CSS API", @@ -3171,6 +3387,24 @@ "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-maps-fleetengine-delivery", "support_documentation": "https://developers.google.com/maps/documentation/transportation-logistics/mobility/docs/getting-support" }, + { + "name": "licensemanager", + "name_pretty": "License Manager API", + "product_documentation": "https://cloud.google.com/compute/docs/instances/windows/ms-licensing", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/licensemanager/latest", + "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", + "release_level": "preview", + "language": "nodejs", + "repo": "googleapis/google-cloud-node", + "distribution_name": "@google-cloud/licensemanager", + "api_id": "licensemanager.googleapis.com", + "default_version": "v1", + "requires_billing": true, + "library_type": "GAPIC_AUTO", + "api_shortname": "licensemanager", + "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-licensemanager", + "support_documentation": "https://cloud.google.com/compute/docs/getting-support" + }, { "name": "lifesciences", "name_pretty": "Life Sciences", @@ -3243,6 +3477,24 @@ "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-lustre", "support_documentation": "https://cloud.google.com/managed-lustre/docs/getting-support" }, + { + "name": "managedkafka", + "name_pretty": "Managed Service for Apache Kafka API", + "product_documentation": "https://cloud.google.com/managed-service-for-apache-kafka/docs", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/managedkafka/latest", + "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", + "release_level": "preview", + "language": "nodejs", + "repo": "googleapis/google-cloud-node", + "distribution_name": "@google-cloud/managedkafka-schemaregistry", + "api_id": "managedkafka.googleapis.com", + "default_version": "v1", + "requires_billing": true, + "library_type": "GAPIC_AUTO", + "api_shortname": "managedkafka", + "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-managedkafka-schemaregistry", + "support_documentation": "https://cloud.google.com/managed-service-for-apache-kafka/docs/getting-support" + }, { "name": "managedkafka", "name_pretty": "Managed Service for Apache Kafka API", @@ -3297,204 +3549,6 @@ "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-redis-cluster", "support_documentation": "https://cloud.google.com/redis/docs/getting-support" }, - { - "name": "merchantapi", - "name_pretty": "Merchant API", - "product_documentation": "https://developers.google.com/merchant/api", - "client_documentation": "https://cloud.google.com/nodejs/docs/reference/merchantapi/latest", - "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", - "release_level": "preview", - "language": "nodejs", - "repo": "googleapis/google-cloud-node", - "distribution_name": "@google-shopping/accounts", - "api_id": "merchantapi.googleapis.com", - "default_version": "v1beta", - "requires_billing": true, - "library_type": "GAPIC_AUTO", - "api_shortname": "merchantapi", - "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-shopping-merchant-accounts", - "support_documentation": "https://developers.google.com/merchant/api/docs/getting-support" - }, - { - "name": "merchantapi", - "name_pretty": "Merchant API", - "product_documentation": "https://developers.google.com/merchant/api", - "client_documentation": "https://cloud.google.com/nodejs/docs/reference/merchantapi/latest", - "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", - "release_level": "preview", - "language": "nodejs", - "repo": "googleapis/google-cloud-node", - "distribution_name": "@google-shopping/conversions", - "api_id": "merchantapi.googleapis.com", - "default_version": "v1beta", - "requires_billing": true, - "library_type": "GAPIC_AUTO", - "api_shortname": "merchantapi", - "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-shopping-merchant-conversions", - "support_documentation": "https://developers.google.com/merchant/api/docs/getting-support" - }, - { - "name": "merchantapi", - "name_pretty": "Merchant API", - "product_documentation": "https://developers.google.com/merchant/api", - "client_documentation": "https://cloud.google.com/nodejs/docs/reference/merchantapi/latest", - "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", - "release_level": "preview", - "language": "nodejs", - "repo": "googleapis/google-cloud-node", - "distribution_name": "@google-shopping/datasources", - "api_id": "merchantapi.googleapis.com", - "default_version": "v1beta", - "requires_billing": true, - "library_type": "GAPIC_AUTO", - "api_shortname": "merchantapi", - "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-shopping-merchant-datasources", - "support_documentation": "https://developers.google.com/merchant/api/docs/getting-support" - }, - { - "name": "merchantapi", - "name_pretty": "Merchant API", - "product_documentation": "https://developers.google.com/merchant/api", - "client_documentation": "https://cloud.google.com/nodejs/docs/reference/merchantapi/latest", - "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", - "release_level": "preview", - "language": "nodejs", - "repo": "googleapis/google-cloud-node", - "distribution_name": "@google-shopping/issueresolution", - "api_id": "merchantapi.googleapis.com", - "default_version": "v1beta", - "requires_billing": true, - "library_type": "GAPIC_AUTO", - "api_shortname": "merchantapi", - "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-shopping-merchant-issueresolution", - "support_documentation": "https://developers.google.com/merchant/api/docs/getting-support" - }, - { - "name": "merchantapi", - "name_pretty": "Merchant API", - "product_documentation": "https://developers.google.com/merchant/api", - "client_documentation": "https://cloud.google.com/nodejs/docs/reference/merchantapi/latest", - "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", - "release_level": "preview", - "language": "nodejs", - "repo": "googleapis/google-cloud-node", - "distribution_name": "@google-shopping/lfp", - "api_id": "merchantapi.googleapis.com", - "default_version": "v1beta", - "requires_billing": true, - "library_type": "GAPIC_AUTO", - "api_shortname": "merchantapi", - "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-shopping-merchant-lfp", - "support_documentation": "https://developers.google.com/merchant/api/docs/getting-support" - }, - { - "name": "merchantapi", - "name_pretty": "Merchant API", - "product_documentation": "https://developers.google.com/merchant/api", - "client_documentation": "https://cloud.google.com/nodejs/docs/reference/merchantapi/latest", - "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", - "release_level": "preview", - "language": "nodejs", - "repo": "googleapis/google-cloud-node", - "distribution_name": "@google-shopping/notifications", - "api_id": "merchantapi.googleapis.com", - "default_version": "v1beta", - "requires_billing": true, - "library_type": "GAPIC_AUTO", - "api_shortname": "merchantapi", - "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-shopping-merchant-notifications", - "support_documentation": "https://developers.google.com/merchant/api/docs/getting-support" - }, - { - "name": "merchantapi", - "name_pretty": "Merchant API", - "product_documentation": "https://developers.google.com/merchant/api", - "client_documentation": "https://cloud.google.com/nodejs/docs/reference/merchantapi/latest", - "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", - "release_level": "preview", - "language": "nodejs", - "repo": "googleapis/google-cloud-node", - "distribution_name": "@google-shopping/ordertracking", - "api_id": "merchantapi.googleapis.com", - "default_version": "v1beta", - "requires_billing": true, - "library_type": "GAPIC_AUTO", - "api_shortname": "merchantapi", - "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-shopping-merchant-ordertracking", - "support_documentation": "https://developers.google.com/merchant/api/docs/getting-support" - }, - { - "name": "merchantapi", - "name_pretty": "Merchant API", - "product_documentation": "https://developers.google.com/merchant/api", - "client_documentation": "https://cloud.google.com/nodejs/docs/reference/merchantapi/latest", - "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", - "release_level": "preview", - "language": "nodejs", - "repo": "googleapis/google-cloud-node", - "distribution_name": "@google-shopping/products", - "api_id": "merchantapi.googleapis.com", - "default_version": "v1beta", - "requires_billing": true, - "library_type": "GAPIC_AUTO", - "api_shortname": "merchantapi", - "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-shopping-merchant-products", - "support_documentation": "https://developers.google.com/merchant/api/docs/getting-support" - }, - { - "name": "merchantapi", - "name_pretty": "Merchant API", - "product_documentation": "https://developers.google.com/merchant/api", - "client_documentation": "https://cloud.google.com/nodejs/docs/reference/merchantapi/latest", - "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", - "release_level": "preview", - "language": "nodejs", - "repo": "googleapis/google-cloud-node", - "distribution_name": "@google-shopping/promotions", - "api_id": "merchantapi.googleapis.com", - "default_version": "v1beta", - "requires_billing": true, - "library_type": "GAPIC_AUTO", - "api_shortname": "merchantapi", - "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-shopping-merchant-promotions", - "support_documentation": "https://developers.google.com/merchant/api/docs/getting-support" - }, - { - "name": "merchantapi", - "name_pretty": "Merchant API", - "product_documentation": "https://developers.google.com/merchant/api", - "client_documentation": "https://cloud.google.com/nodejs/docs/reference/merchantapi/latest", - "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", - "release_level": "preview", - "language": "nodejs", - "repo": "googleapis/google-cloud-node", - "distribution_name": "@google-shopping/quota", - "api_id": "merchantapi.googleapis.com", - "default_version": "v1beta", - "requires_billing": true, - "library_type": "GAPIC_AUTO", - "api_shortname": "merchantapi", - "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-shopping-merchant-quota", - "support_documentation": "https://developers.google.com/merchant/api/docs/getting-support" - }, - { - "name": "merchantapi", - "name_pretty": "Merchant API", - "product_documentation": "https://developers.google.com/merchant/api", - "client_documentation": "https://cloud.google.com/nodejs/docs/reference/merchantapi/latest", - "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", - "release_level": "preview", - "language": "nodejs", - "repo": "googleapis/google-cloud-node", - "distribution_name": "@google-shopping/reports", - "api_id": "merchantapi.googleapis.com", - "default_version": "v1beta", - "requires_billing": true, - "library_type": "GAPIC_AUTO", - "api_shortname": "merchantapi", - "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-shopping-merchant-reports", - "support_documentation": "https://developers.google.com/merchant/api/docs/getting-support" - }, { "name": "merchantapi", "name_pretty": "Merchant API", @@ -3729,6 +3783,42 @@ "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-maps-routeoptimization", "support_documentation": "https://developers.google.com/maps/documentation/route-optimization/docs/getting-support" }, + { + "name": "saasservicemgmt", + "name_pretty": "SaaS Runtime API", + "product_documentation": "https://cloud.google.com/saas-runtime/docs/overview", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/saasservicemgmt/latest", + "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", + "release_level": "preview", + "language": "nodejs", + "repo": "googleapis/google-cloud-node", + "distribution_name": "@google-cloud/saasservicemgmt", + "api_id": "saasservicemgmt.googleapis.com", + "default_version": "v1beta1", + "requires_billing": true, + "library_type": "GAPIC_AUTO", + "api_shortname": "saasservicemgmt", + "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-saasplatform-saasservicemgmt", + "support_documentation": "https://cloud.google.com/saas-runtime/docs/getting-support" + }, + { + "name": "cloudsecuritycompliance", + "name_pretty": "Security Compliance API", + "product_documentation": "https://cloud.google.com/security-command-center/docs/compliance-manager-overview", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/cloudsecuritycompliance/latest", + "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", + "release_level": "preview", + "language": "nodejs", + "repo": "googleapis/google-cloud-node", + "distribution_name": "@google-cloud/cloudsecuritycompliance", + "api_id": "cloudsecuritycompliance.googleapis.com", + "default_version": "v1", + "requires_billing": true, + "library_type": "GAPIC_AUTO", + "api_shortname": "cloudsecuritycompliance", + "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-cloudsecuritycompliance", + "support_documentation": "https://cloud.google.com/security-command-center/docs/getting-support" + }, { "name": "solar", "name_pretty": "Solar API", diff --git a/packages/gapic-node-templating/.c8rc.json b/packages/gapic-node-processing/.c8rc.json similarity index 100% rename from packages/gapic-node-templating/.c8rc.json rename to packages/gapic-node-processing/.c8rc.json diff --git a/packages/gapic-node-templating/.eslintignore b/packages/gapic-node-processing/.eslintignore similarity index 100% rename from packages/gapic-node-templating/.eslintignore rename to packages/gapic-node-processing/.eslintignore diff --git a/packages/gapic-node-templating/.eslintrc.json b/packages/gapic-node-processing/.eslintrc.json similarity index 100% rename from packages/gapic-node-templating/.eslintrc.json rename to packages/gapic-node-processing/.eslintrc.json diff --git a/packages/gapic-node-templating/.gitignore b/packages/gapic-node-processing/.gitignore similarity index 100% rename from packages/gapic-node-templating/.gitignore rename to packages/gapic-node-processing/.gitignore diff --git a/packages/gapic-node-templating/.mocharc.js b/packages/gapic-node-processing/.mocharc.js similarity index 100% rename from packages/gapic-node-templating/.mocharc.js rename to packages/gapic-node-processing/.mocharc.js diff --git a/packages/gapic-node-templating/.nycrc b/packages/gapic-node-processing/.nycrc similarity index 100% rename from packages/gapic-node-templating/.nycrc rename to packages/gapic-node-processing/.nycrc diff --git a/packages/gapic-node-templating/.prettierignore b/packages/gapic-node-processing/.prettierignore similarity index 100% rename from packages/gapic-node-templating/.prettierignore rename to packages/gapic-node-processing/.prettierignore diff --git a/packages/gapic-node-templating/.prettierrc.js b/packages/gapic-node-processing/.prettierrc.js similarity index 100% rename from packages/gapic-node-templating/.prettierrc.js rename to packages/gapic-node-processing/.prettierrc.js diff --git a/packages/gapic-node-processing/CHANGELOG.md b/packages/gapic-node-processing/CHANGELOG.md new file mode 100644 index 00000000000..6a2bf932731 --- /dev/null +++ b/packages/gapic-node-processing/CHANGELOG.md @@ -0,0 +1,15 @@ +# Changelog + +## [0.1.1](https://github.com/googleapis/google-cloud-node/compare/gapic-node-processing-v0.1.0...gapic-node-processing-v0.1.1) (2025-08-29) + + +### Bug Fixes + +* Make sure we are not overwriting the README when generating it ([#6632](https://github.com/googleapis/google-cloud-node/issues/6632)) ([64d3018](https://github.com/googleapis/google-cloud-node/commit/64d301886c7ed320ba1b03d850363e54bdd4657e)) + +## 0.1.0 (2025-08-28) + + +### Features + +* Create gapic-node-processing library ([#6604](https://github.com/googleapis/google-cloud-node/issues/6604)) ([5267f25](https://github.com/googleapis/google-cloud-node/commit/5267f25145ef5605daa1bd1140c3320e5f3b5b66)) diff --git a/packages/gapic-node-templating/README.md b/packages/gapic-node-processing/README.md similarity index 89% rename from packages/gapic-node-templating/README.md rename to packages/gapic-node-processing/README.md index 62b29b3bc02..d4434c8c9fd 100644 --- a/packages/gapic-node-templating/README.md +++ b/packages/gapic-node-processing/README.md @@ -1,5 +1,5 @@ -# gapic-node-templating -gapic-node-templating is a CLI tool that generates Node client library templates. +# gapic-node-processing +gapic-node-processing is a CLI tool that generates Node client library templates. It is responsible for grabbing information from DRIFT and github, and using that info as inputs into the templates. This templating tool is intended to run in the Docker container under containers/node-bootstrap-container. In production, that Docker container runs in the context of the git clone of google-cloud-node in a new branch. @@ -7,7 +7,7 @@ Docker container runs in the context of the git clone of google-cloud-node in a To use the CLI, first link the command, like so: ``` -cd $MONO_REPO_NAME/packages/gapic-node-templating +cd $MONO_REPO_NAME/packages/gapic-node-processing npm ci npm run compile npm link . diff --git a/packages/gapic-node-templating/__snapshots__/templating.test.js b/packages/gapic-node-processing/__snapshots__/templating.test.js similarity index 100% rename from packages/gapic-node-templating/__snapshots__/templating.test.js rename to packages/gapic-node-processing/__snapshots__/templating.test.js diff --git a/packages/gapic-node-templating/package.json b/packages/gapic-node-processing/package.json similarity index 79% rename from packages/gapic-node-templating/package.json rename to packages/gapic-node-processing/package.json index 45dca85b102..4e7f681c7d0 100644 --- a/packages/gapic-node-templating/package.json +++ b/packages/gapic-node-processing/package.json @@ -1,7 +1,7 @@ { - "name": "gapic-node-templating", - "version": "1.0.0", - "description": "Generates Node templates for gapic libraries", + "name": "gapic-node-processing", + "version": "0.1.1", + "description": "Does various processing functions for Nodejs gapic libraries", "bin": "./build/src/cli.js", "scripts": { "clean": "gts clean", @@ -38,6 +38,11 @@ "engines": { "node": ">=18" }, + "repository": { + "type": "git", + "url": "https://github.com/googleapis/google-cloud-node.git", + "directory": "packages/gapic-node-processing" + }, "dependencies": { "@google-cloud/storage": "^7.15.2", "@octokit/rest": "^20.0.0", diff --git a/packages/gapic-node-processing/src/cli.ts b/packages/gapic-node-processing/src/cli.ts new file mode 100755 index 00000000000..90aea867e7c --- /dev/null +++ b/packages/gapic-node-processing/src/cli.ts @@ -0,0 +1,33 @@ +#!/usr/bin/env node +// 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. + +import yargs = require('yargs'); +import {bootstrapLibrary} from './commands/bootstrap-library'; +import {generateCombinedLibraries} from './commands/generate-combined-library'; +import {generateReadme} from './commands/generate-readme'; + +/** + * Cli main caller; routes commands to either bootstrap a library, generate combined + * libraries, or generate readme. If any other commands are added to this tool, add them + * here. + */ +void yargs(process.argv.slice(2)) + .command(bootstrapLibrary) + .command(generateCombinedLibraries) // Add the new command here + .command(generateReadme) // Add the new command here + .demandCommand(1, 'You need at least one command before moving on') // Ensure at least one command is provided + .help() // Enable the --help option + .alias('h', 'help') // Alias -h to --help + .parse(); diff --git a/packages/gapic-node-processing/src/combine-libraries.ts b/packages/gapic-node-processing/src/combine-libraries.ts new file mode 100644 index 00000000000..440e26e183a --- /dev/null +++ b/packages/gapic-node-processing/src/combine-libraries.ts @@ -0,0 +1,264 @@ +// 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. + +import {Dirent} from 'fs'; + +const fs = require('fs/promises'); // For async file system operations +const path = require('path'); + +export interface FilePaths { + filePath: string +} + +export interface FilePathsAndContents { + filePath: string, + content: string +} +/** + * Recursively removes a regex pattern from a specified property in an array of objects. + * + * @param array The array of objects to modify. + * @param property The nested property to modify (e.g., 'a.b.c'). + * @param stringToRemove The string to remove. + */ +export function removeRegexFromNestedProperty( + array: any[], + property: string, + stringToRemove: string, +): void { + const propertyPath = property.split('.'); + + array.forEach(item => { + let currentObject = item; + // Traverse the object to find the target property's parent + for (let i = 0; i < propertyPath.length - 1; i++) { + const key = propertyPath[i]; + if (currentObject && typeof currentObject === 'object') { + currentObject = currentObject[key]; + } else { + // Stop if the path is invalid or a primitive is encountered + return; + } + } + + const lastKey = propertyPath[propertyPath.length - 1]; + if (currentObject && typeof currentObject[lastKey] === 'string') { + // Modify the string property by replacing the regex with an empty string + currentObject[lastKey] = currentObject[lastKey].replace( + stringToRemove, + '', + ); + } + }); +} + +/** + * Reads the content of files from an array of objects and adds the content to each object. + * The input array is modified in place. + * + * @param filePaths An array of objects, where each object has a 'filePath' property. + * @returns A promise that resolves when all file contents have been read and added to the array. + */ +async function readFilesContent( + filePaths: FilePaths[], +): Promise { + const promises = filePaths.map(async item => { + try { + const content = await fs.readFile(item.filePath, 'utf-8'); + Object.assign(item, {content}); + } catch (error) { + console.error(`Failed to read file at ${item.filePath}:`, error); + Object.assign(item, {content: null}); + } + }); + + await Promise.all(promises); +} + +/** + * Recursive helper function to traverse the directory. + * + * @param {string} currentPath The current path being processed. + * @param {Array} accumulator An array to accumulate objects with unique paths and their content. + */ +export async function traverseDirectory( + currentPath: string, + accumulator: {filePath: string}[], +) { + let items: Dirent[]; + try { + items = await fs.readdir(currentPath, {withFileTypes: true}); // Get dirent objects + } catch (err) { + // If this fails, it means that the library is not + // in the format we expect. This could happen if we + // are rerunning the command on a well-formed library + // or its otherwise unexpected. In this case, fail early + throw new Error( + 'Unexpected library format. Expected *only* top-level directories containing fully formed libraries for each verison.', + ); + } + + for (const item of items) { + const filePath = path.join(currentPath, item.name); + + if (item.isDirectory()) { + // If it's a directory, recurse into it + await traverseDirectory(filePath, accumulator); + } else { + accumulator.push({filePath}); + } + // If it's a file, we've already added its path above, so no further action needed + } + + return accumulator; +} + +/** + * Asynchronously traverses a directory to find all unique file paths and their content from multiple subdirectories. + * + * This function reads all top-level directories within a given path. It then + * recursively traverses each subdirectory to get a list of all files. Finally, + * it deduplicates the list to ensure each unique file path is represented only once. + * + * @param {string} currentPath - The path to the root directory containing all library versions. + * @returns {Promise>} A promise that resolves to an array of objects, each containing a unique file path and its content. + */ +export async function generateFinalDirectoryPath( + currentPath: string, +): Promise> { + // Get a full list of all the file paths in all the libraries + let fullPaths: {filePath: string}[] = []; + let fullPathsAndContents: {filePath: string; content: string}[] = []; + const directories = await fs.readdir(currentPath); + for (const directory of directories) { + fullPaths = await traverseDirectory(path.join(currentPath, directory), []); + await readFilesContent(fullPaths); + removeRegexFromNestedProperty( + fullPaths, + 'filePath', + path.join(currentPath, directory), + ); + fullPathsAndContents = fullPathsAndContents.concat( + fullPaths as FilePathsAndContents[], + ); + } + + // Now we need to clean out duplicates + const uniquePaths = new Set(); + const uniquefullPathAndContent = []; + + for (const fullPathAndContent of fullPathsAndContents) { + if (!uniquePaths.has(fullPathAndContent.filePath)) { + uniquePaths.add(fullPathAndContent.filePath); + uniquefullPathAndContent.push(fullPathAndContent); + } + } + uniquefullPathAndContent.forEach(x => console.log(x)); + return uniquefullPathAndContent as unknown as { + filePath: string; + content: string; + }[]; +} + +/** + * Recursively creates all directories in a given file path if they don't already exist. + * + * @param {string} filePath The full path including the file name. + * @returns {Promise} A promise that resolves when all directories are created. + */ +export async function ensureDirectoryExists(filePath: string): Promise { + const dirPath = path.dirname(filePath); + try { + await fs.mkdir(dirPath, {recursive: true}); + } catch (error) { + // EEXIST means it already exists, which is fine + if ((error as any).code !== 'EEXIST') { + console.error(`Error ensuring directory ${dirPath} exists:`, error); + throw error; + } + } +} + +/** + * Combines multiple library versions into a single, unified directory. + * + * This function reads files from all subdirectories of a `readDirectory`, + * removes duplicates, and then writes the unique set of files to a new + * `writeDirectory`. This process is used to merge multiple versioned + * libraries into one. + * + * @param {string} sourcePath - The source directory containing the individual library versions. + * @param {string} destinationPath - The destination directory where the combined library will be created. + * @returns {Promise} A promise that resolves when all files have been combined and written. + */ +export async function combineLibraries( + sourcePath: string, + destinationPath: string, +): Promise { + console.log( + `Generating all unique paths in all library versions from ${sourcePath} to ${destinationPath}`, + ); + const uniquefullPathAndContent = await generateFinalDirectoryPath(sourcePath); + + console.log( + `Creating new library in ${destinationPath} with ${uniquefullPathAndContent.length} items`, + ); + await writeFilesToGivenLocation(destinationPath, uniquefullPathAndContent); +} + +/** + * Writes all files with their contents and paths. Creates any directories needed along the way. + * + * @param {string} dirToWrite The root directory where files should be written. + * @param {Array<{filePath: string; content: string}>} files An array of objects, where each object has a file path and its content. + * @returns {Promise} A promise that resolves when all files are written. + */ +export async function writeFilesToGivenLocation( + dirToWrite: string, + files: {filePath: string; content: string}[], +): Promise { + if (!dirToWrite) { + throw new Error('baseOutputDir cannot be empty.'); + } + if (!Array.isArray(files)) { + throw new Error('Files must be an array of objects.'); + } + + // first, remove any existing files; this ensures + // we're overwriting the existing file + try { + await fs.rm(dirToWrite, {recursive: true, force: true}); + } catch (err) { + `${dirToWrite} not found; could not be deleted`; + } + await ensureDirectoryExists(dirToWrite); + + const writeFilePromises = files.map(async fileData => { + const fullFilePath = path.join(dirToWrite, fileData.filePath); + console.log(`Processing: ${fullFilePath}`); + + // 1. Ensure all parent directories for the current file exist + await ensureDirectoryExists(path.join(dirToWrite, fileData.filePath)); + // await fs.mkdir(path.dirname(fileData.filePath), {recursive: true}); + + // 2. Write the file with its content + await fs.writeFile(fullFilePath, fileData.content, 'utf8'); + }); + + // Wait for all file writing operations to complete + await Promise.all(writeFilePromises); + console.log( + `\nSuccessfully created directory and wrote all specified files to: ${dirToWrite}`, + ); +} diff --git a/packages/gapic-node-templating/src/commands/bootstrap-library.ts b/packages/gapic-node-processing/src/commands/bootstrap-library.ts similarity index 94% rename from packages/gapic-node-templating/src/commands/bootstrap-library.ts rename to packages/gapic-node-processing/src/commands/bootstrap-library.ts index ba54142d57d..f5ca08bb1a3 100644 --- a/packages/gapic-node-templating/src/commands/bootstrap-library.ts +++ b/packages/gapic-node-processing/src/commands/bootstrap-library.ts @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// 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. @@ -77,6 +77,11 @@ export const bootstrapLibrary: yargs.CommandModule<{}, CliArgs> = { demand: true, }); }, + /** + * Yargs command handler for bootstrapping a library. + * + * @param {CliArgs} argv - The command line arguments. + */ async handler(argv: CliArgs) { const octokit = new Octokit(); const distributionName = await getDistributionName( @@ -98,7 +103,7 @@ export const bootstrapLibrary: yargs.CommandModule<{}, CliArgs> = { await compileTemplates( BOOTSTRAP_TEMPLATES_PATH, argv['destination-folder'], - bootstrapVars + bootstrapVars, ); }, }; diff --git a/packages/gapic-node-processing/src/commands/generate-combined-library.ts b/packages/gapic-node-processing/src/commands/generate-combined-library.ts new file mode 100644 index 00000000000..dc6487fbb5e --- /dev/null +++ b/packages/gapic-node-processing/src/commands/generate-combined-library.ts @@ -0,0 +1,88 @@ +// 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. + +import yargs = require('yargs'); +import {combineLibraries} from '../combine-libraries'; +import {generateIndexTs} from '../generate-index'; + +export interface CliArgs { + 'source-path': string; + 'default-version'?: string; + 'destination-path'?: string; + 'is-esm'?: boolean; +} + +/** + * Command module for bootstrapping a library. + * + * This module defines a yargs command to combine a library when all individual + * libraries are generated + */ +export const generateCombinedLibraries: yargs.CommandModule<{}, CliArgs> = { + command: 'combine-library', + describe: 'Combines the versions for a given API into a single library', + builder(yargs) { + return yargs + .option('source-path', { + describe: 'path in which a pre-combined library lives', + type: 'string', + demand: true, + }) + .option('destination-path', { + describe: 'path where to copy over the library', + type: 'string', + }) + .option('default-version', { + describe: + 'what is the default version of the library (default is highest)', + type: 'string', + }) + .option('is-esm', { + describe: 'is the library an ESM library', + type: 'boolean', + }); + }, + + /** + * Yargs command handler for generating a combined library. + * + * @param {CliArgs} argv - The command line arguments + * source-path: path in which a pre-combined library lives + * destination-path: path where to copy over the library + * default-version: what is the default version of the library (default is highest) + */ + async handler(argv: CliArgs) { + // Since we're 'transforming' a library, we're going to assume that the user wants to overwrite the library + // unless otherwise specified + const destinationPath = argv['destination-path'] || argv['source-path']; + console.log( + `Combining libraries in ${argv['source-path']} ${argv['destination-path'] ? `to ${argv['destination-path']}` : ''}`, + ); + try { + await combineLibraries(argv['source-path'], destinationPath); + } catch (err) { + if (!(err as any).message.includes('Unexpected library format')) { + throw err; + } else { + console.warn(err); + } + } + console.log(`Generating index.ts in ${destinationPath}`); + await generateIndexTs( + destinationPath, + argv['default-version'], + argv['is-esm'], + ); + }, +}; diff --git a/packages/gapic-node-processing/src/commands/generate-readme.ts b/packages/gapic-node-processing/src/commands/generate-readme.ts new file mode 100644 index 00000000000..9ff3f3bff08 --- /dev/null +++ b/packages/gapic-node-processing/src/commands/generate-readme.ts @@ -0,0 +1,159 @@ +// 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. + +import yargs = require('yargs'); +import {initialGenerateReadMe, readAndWriteToReadme} from '../generate-readme'; + +export interface CliArgsReadme { + 'source-path': string; + 'initial-generation'?: boolean; + 'destination-path'?: string; + 'release-level'?: string; + 'string-to-replace'?: string; + 'replacement-string'?: string; + 'replacement-string-samples'?: string; + 'replacement-string-release-level'?: string; +} + +const DEFAULT_REPLACEMENT_STRING_SAMPLES = '[//]: # "samples"'; +const DEFAULT_REPLACEMENT_STRING_RELEASE_LEVEL = '[//]: # "releaseLevel"'; + +function validateCliArgs(argv: CliArgsReadme) { + if ( + !argv['initial-generation'] && + (!argv['string-to-replace'] || !argv['replacement-string']) + ) { + throw new Error( + 'Post-initial generate readme was selected, but no string to replace/replacement was given', + ); + } + if (argv['initial-generation'] && !argv['release-level']) { + console.log( + 'No release level was selected for initial generation; will generate with preview', + ); + } +} + +function getReplacementStringSamples(argv: CliArgsReadme) { + const stringToReplaceForSampleTable = argv['replacement-string-samples']; + if (argv['initial-generation'] && !stringToReplaceForSampleTable) { + console.log( + 'Initial readme generation was selected, but no string to replace the samples table was given. ' + + 'Will use \'[//]: # "samples"\'', + ); + return DEFAULT_REPLACEMENT_STRING_SAMPLES; + } + return stringToReplaceForSampleTable; +} + +function getReplacementStringReleaseLevel(argv: CliArgsReadme) { + const stringToReplaceForReleaseLevel = + argv['replacement-string-release-level']; + if (argv['initial-generation'] && !stringToReplaceForReleaseLevel) { + console.log( + 'Initial readme generation was selected, but no string to replace the release level was given. ' + + 'Will use \'[//]: # "releaseLevel"\'', + ); + return DEFAULT_REPLACEMENT_STRING_RELEASE_LEVEL; + } + return stringToReplaceForReleaseLevel; +} + +function generateArgsForInitialReadme(argv: CliArgsReadme, writeDestination: string) { + const stringToReplaceForSampleTable = getReplacementStringSamples(argv); + const stringToReplaceForReleaseLevel = getReplacementStringReleaseLevel(argv); + return { + currentLibrary: argv['source-path'], + stringToReplaceForSampleTable: stringToReplaceForSampleTable!, + stringToReplaceForReleaseLevel: stringToReplaceForReleaseLevel!, + releaseLevel: argv['release-level'], + writeLibrary: writeDestination, + }; +} + +/** + * Command module for bootstrapping a library. + * + * This module defines a yargs command to generate a README.md + */ +export const generateReadme: yargs.CommandModule<{}, CliArgsReadme> = { + command: 'generate-readme', + describe: 'Combines the versions for a given API into a single library', + builder(yargs) { + return yargs + .option('source-path', { + describe: 'path in which a pre-combined library lives', + type: 'string', + demand: true, + }) + .option('initial-generation', { + describe: + 'path in which a pre-combined library lives; defaults to false', + type: 'boolean', + }) + .option('destination-path', { + describe: 'path where to copy over the library', + type: 'string', + }) + .option('release-level', { + describe: + 'what is the release level of the library (default is preview)', + type: 'string', + }) + .option('string-to-replace', { + describe: 'string to replace in the readme', + type: 'string', + }) + .option('replacement-string-samples', { + describe: + 'string to replace with the string-to-replace for the samples table in the readme (only used with initial generation)', + type: 'string', + }) + .option('replacement-string-release-level', { + describe: + 'string to replace with the string-to-replace for the releaseLevel in the readme (only used with initial generation)', + type: 'string', + }); + }, + + /** + * Yargs command handler for generating a combined library. + * + * @param {CliArgs} argv - The command line arguments + * source-path: path in which a pre-combined library lives + * destination-path: path where to copy over the library + * initial-generation: path in which a pre-combined library lives; defaults to false + * release-level: what is the release level of the library (default is preview) + * string-to-replace: string to replace in the readme + * replacement-string-samples: string to replace with the string-to-replace for the samples table in the readme (only used with initial generation) + * replacement-string-release-level: string to replace with the string-to-replace for the releaseLevel in the readme (only used with initial generation) + */ + async handler(argv: CliArgsReadme) { + const destinationPath = argv['destination-path'] || argv['source-path']; + validateCliArgs(argv); + if (argv['initial-generation']) { + const args = generateArgsForInitialReadme(argv, destinationPath); + console.log(`Generating initial readme with ${JSON.stringify(args)}`); + await initialGenerateReadMe(args); + } else { + // validateCliArgs will confirm these strings exist + await readAndWriteToReadme( + argv['source-path'], + argv['string-to-replace']!, + argv['replacement-string']!, + destinationPath, + ); + } + }, +}; diff --git a/packages/gapic-node-processing/src/generate-index.ts b/packages/gapic-node-processing/src/generate-index.ts new file mode 100644 index 00000000000..2af16cd17d4 --- /dev/null +++ b/packages/gapic-node-processing/src/generate-index.ts @@ -0,0 +1,254 @@ +// 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. + +import {Dirent} from 'fs'; +import * as nj from 'nunjucks'; + +const fs = require('fs/promises'); // For async file system operations +const path = require('path'); + +const SRC_PATH = 'src'; +const INDEX_PATH = 'index.ts'; +const TEMPLATE_FILE_NAME = 'index.ts.njk'; + +export interface VersionsAndClients { + version: string + clients: string[] +} +export const POST_PROCESSING_TEMPLATES_PATH = path.resolve( + __dirname, + '../../templates/post-processing-templates', +); + +// This regex is safe because we are basically just searching for the code in +// the generator +/* +{% for service in api.services -%} +export {{ '{' + service.name.toPascalCase() + 'Client}' }} from './{{ service.name.toSnakeCase() }}_client'; +{% endfor -%} +*/ +const CLIENT_EXTRACTION_REGEX = /export\s*{\s*(\w+Client)\s*}/g; + +/** + * Asynchronously extracts all version directories from a library's `src` folder. + * + * This function reads the contents of a specified library's `src` directory and + * filters the entries to return an array of names for all subdirectories. It + * throws an error if the directory structure is not as expected. + * + * @param {string} currentPath - The path to the library's root directory. + * @returns {Promise} A promise that resolves to an array of version directory names (e.g., ['v1', 'v2beta1']). + * @throws {Error} Throws an error if the `src` directory does not exist or has an unexpected format. + */ +export async function extractVersions(currentPath: string) { + let allItemsInSrc: Dirent[] = []; + try { + allItemsInSrc = await fs.readdir(path.join(currentPath, SRC_PATH), { + withFileTypes: true, + }); + } catch (err) { + // If this fails, it means that the library is not + // in the format we expect. This could happen if we + // are rerunning the command on a well-formed library + // or its otherwise unexpected. In this case, fail early + throw new Error( + 'Unexpected library format. Expected *only* top-level directories containing fully formed libraries for each verison.', + ); + } + const justVersionDirectories = allItemsInSrc + .filter((fileOrFolder: Dirent) => fileOrFolder.isDirectory()) + .map((x: Dirent) => x.name); + return justVersionDirectories; +} + +/** + * Asynchronously extracts all client names and their corresponding versions from a library. + * + * This function first gets a list of version directories. For each version, it reads the + * `index.ts` file, uses a regular expression to find all exported client classes, + * and compiles them into a structured array. + * + * @param {string} currentPath - The path to the library's root directory. + * @returns {Promise<{version: string; clients: string[]}[]>} A promise that resolves to an array of objects, each containing a version string and an array of client names. + */ +export async function extractClients(currentPath: string) { + const directories = await extractVersions(currentPath); + const clientsAndVersions: VersionsAndClients[] = []; + for (const directory of directories) { + const indexFile = path.join(currentPath, SRC_PATH, directory, INDEX_PATH); + if (await fs.stat(indexFile)) { + const clientsRegexMatch = [ + ...(await fs.readFile(indexFile, 'utf8')).matchAll( + CLIENT_EXTRACTION_REGEX, + ), + ]; + clientsAndVersions.push({ + version: directory, + clients: clientsRegexMatch.map((x: any) => x[1]), + }); + } + } + return clientsAndVersions; +} + +/** + * Generates an `index.ts` file for a combined library. + * + * This function orchestrates the generation of a new `index.ts` file that re-exports + * all clients from their versioned subdirectories. It automatically determines + * the highest-precedence version to set as the default, unless a specific default + * version is provided. + * + * @param {string} currentLibrary - The path to the library's root directory. + * @param {string} [defaultVersion] - An optional version string to explicitly set as the default. + * @param {string} [isEsm] - An optional flag whether the library should be generated with ESM syntax + */ +export async function generateIndexTs( + currentLibrary: string, + defaultVersion?: string, + isEsm?: boolean, +) { + // Get all the versions + const versions = await extractVersions(currentLibrary); + console.log(`All versions in ${currentLibrary}: ${versions}`); + + // Get all the clients in each specific version + const clientsAndVersions = await extractClients(currentLibrary); + console.log( + `All clients and their versions in ${currentLibrary}: ${JSON.stringify(clientsAndVersions, null, 2)}`, + ); + defaultVersion = defaultVersion || getHighestVersionWithPrecedence(versions); + // Get the default versions' clients + const defaultClientAndVersions = clientsAndVersions.find( + x => x.version === defaultVersion, + ); + console.log( + `The default version is ${JSON.stringify(defaultClientAndVersions, null, 2)}`, + ); + + // Render index.ts + const variables = {versions, defaultClientAndVersions, isEsm: isEsm ?? false}; + + // Create a new Nunjucks environment configured to load from the templateDirectory + // This is necessary due to occurring in a Bazel environment or locally + const env = new nj.Environment( + new nj.FileSystemLoader(POST_PROCESSING_TEMPLATES_PATH), + {autoescape: false}, // Disable autoescaping for code generation + ); + + const compiledTemplate = env.render(TEMPLATE_FILE_NAME, variables); + + const outputPath = path.join(currentLibrary, SRC_PATH, INDEX_PATH); + console.log( + `Generating index.ts in ${outputPath} with the following values: ${JSON.stringify(variables)}`, + ); + await fs.writeFile(outputPath, compiledTemplate); + console.log(`Successfully wrote: ${outputPath}`); +} + +interface VersionSpec { + version: string; // Stores the "best" version found so far + major: number; + precedence: number; + preReleaseQualifier: number; // For e.g., beta1 vs beta2 +} + +// Comparison Logic: +// 1. Higher Precedence (Stable > Beta > Alpha) +// 2. Higher Major Version +// 3. Within same pre-release type, higher qualifier (e.g., beta2 > beta1) +// 4. If everything else is equal, the current one is just as good + +function isNewAHighestVersion( + currentVersionSpec: VersionSpec, + newVersionSpec: VersionSpec, +): boolean { + // Current version has higher precedence (e.g., stable over beta) + if (newVersionSpec.precedence > currentVersionSpec.precedence) { + return true; + } + if ( + newVersionSpec.precedence === currentVersionSpec.precedence && + newVersionSpec.major > currentVersionSpec.major + ) { + return true; + } + if ( + newVersionSpec.precedence === currentVersionSpec.precedence && + newVersionSpec.major === currentVersionSpec.major && + newVersionSpec.preReleaseQualifier > currentVersionSpec.preReleaseQualifier + ) { + return true; + } + return false; +} + +// In case a default version isn't provided, this function should +// offer a default version +/** + * Gets the highest version with precedence from a list of versions. + * Precedence is defined as: stable > beta > alpha. + * If two versions have the same precedence, the one with the higher major version is chosen. + * If two versions have the same precedence and major version, the one with the higher pre-release qualifier is chosen (e.g., beta2 > beta1). + * + * @param {string[]} versions - An array of version strings. + * @returns {string} The highest version with precedence. + */ +export function getHighestVersionWithPrecedence(versions: string[]) { + if (!versions || versions.length === 0) { + throw new Error('No versions found in library; cannot generate index.ts'); + } + + // Define the precedence of pre-release types + const precedence = { + '': 3, // Stable (no suffix) is highest precedence + beta: 2, + alpha: 1, + }; + + let currentVersionSpec: VersionSpec = { + version: versions[0], // Stores the "best" version found so far + major: -1, + precedence: -1, + preReleaseQualifier: -1, // For e.g., beta1 vs beta2 + }; + + for (const version of versions) { + const match = version.match(/^v(\d+)(alpha|beta(\d*))?$/); + + if (match) { + const majorVersion = parseInt(match[1], 10); + const preReleaseType = match[2] + ? match[2].startsWith('beta') + ? 'beta' + : 'alpha' + : ''; + const preReleaseQualifier = match[3] ? parseInt(match[3], 10) : 0; // For beta1, beta2 etc. + + const currentPrecedence = precedence[preReleaseType]; + const newVersionSpec: VersionSpec = { + version: version, + major: majorVersion, + precedence: currentPrecedence, + preReleaseQualifier: preReleaseQualifier, + }; + + if (isNewAHighestVersion(currentVersionSpec, newVersionSpec)) { + currentVersionSpec = newVersionSpec; + } + } + } + + return currentVersionSpec.version; +} diff --git a/packages/gapic-node-processing/src/generate-readme.ts b/packages/gapic-node-processing/src/generate-readme.ts new file mode 100644 index 00000000000..3379447a705 --- /dev/null +++ b/packages/gapic-node-processing/src/generate-readme.ts @@ -0,0 +1,210 @@ +// 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. + +import {ensureDirectoryExists, traverseDirectory, FilePaths} from './combine-libraries'; +import * as nj from 'nunjucks'; +import {POST_PROCESSING_TEMPLATES_PATH} from './generate-index'; +import { CliArgsReadme } from './commands/generate-readme'; + +const fs = require('fs/promises'); // For async file system operations +const path = require('path'); +const README_PATH = 'README.md'; +export const SAMPLES_TEMPLATE_PATH = 'sample.njk'; +export const SAMPLES_PATH = 'samples/generated'; + +export const RELEASE_LEVEL_STABLE = `This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways +unless absolutely necessary (e.g. because of critical security issues) or with +an extensive deprecation period. Issues and requests against **stable** libraries +are addressed with the highest priority`; + +export const RELEASE_LEVEL_PREVIEW = `This library is considered to be in **preview**. This means it is still a +work-in-progress and under active development. Any release is subject to +backwards-incompatible changes at any time.`; + +interface SampleMetadata { + filePath: string, + content: string, + title: string +} + +const DEFAULT_RELEASE_LEVEL = 'preview'; + +/** + * Retrieves metadata for all generated samples within a given library path. + * + * This function traverses the `samples/generated` directory within a specified library, + * processes each sample to get its title, and returns a list of objects containing + * the file path, content, and title for each sample. + * + * @param {string} currentLibrary - The path to the library's root directory. + * @returns {Promise} A promise that resolves to an array of sample metadata objects. + */ +export async function getSamplesMetadata( + currentLibrary: string, +): Promise { + // Let's separate out the absolute path so that we + // can later remove it from the filePath (so that it + // is relative to the working directory). + // For example for CURRENT LIBRARY: google-cloud-node/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech + // we would produce stringToRemove: /Users/sofialeon/gcp/google-cloud-node/packages/gapic-node-processing/test/fixtures/combined-library + // which we then use to remove from the absolute filePath (so + // /google-cloud-node/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1/adaptation.create_custom_class.js + // becomes just google-cloud-speech/samples/generated/v1/adaptation.create_custom_class.js (the relative path to the new directory) + const stringToRemove = currentLibrary + .split('/') + .slice(0, currentLibrary.split('/').length - 1) + .join('/'); + + const samples = await traverseDirectory( + path.join(currentLibrary, SAMPLES_PATH), + [], + ); + samples.map(sample => { + sample.filePath = sample.filePath.replace(stringToRemove, '').replace('-nodejs', ''); + Object.assign(sample, {title: getSampleName(sample)}); + }); + console.log(samples) + // Since we later assign the title property, we can coerce it into + // this type + return samples as unknown as SampleMetadata[]; +} + +/** + * Extracts and formats a human-readable name from a sample's file path. + * + * The function takes a sample object and attempts to derive a clean name by + * stripping the file extension, API version, and replacing underscores with spaces. + * If the path is not in the expected format, it logs an error and returns the original path. + * + * @param {FilePaths} sample - The sample object containing the file path. + * @returns {string} The formatted name of the sample. + */ +export function getSampleName(sample: { + filePath: string; +}): string { + // Get just the sample name from the path + let sampleName = sample.filePath; + try { + sampleName = sampleName.split('/')[sample.filePath.split('/').length - 1]; + // Remove the API name + sampleName = sampleName.split('.')[1]; + // Remove the .js + sampleName = sampleName.replace('.js', ''); + // Remove the underscores + sampleName = sampleName.replace(/_/g, ' '); + } catch (err) { + console.log( + `${sample.filePath} was not in correct format; transformations could not be completed`, + ); + // Reset if there was an error + sampleName = sample.filePath; + } + return sampleName; +} + +/** + * Generates the initial README file for a library by compiling templates and replacing placeholders. + * + * This function uses Nunjucks to render a sample table based on the found samples + * and injects it along with the appropriate release level message into the README.md + * template. + * + * @param {CliArgsReadme} args - An object containing the arguments for the function. + * @param {string} args.currentLibrary - The path to the library's root directory. + * @param {string} args.stringToReplaceForSampleTable - The placeholder string to be replaced with the samples table. + * @param {string} args.stringToReplaceForReleaseLevel - The placeholder string to be replaced with the release level message. + * @param {string} args.writeLibrary - The path where the final README.md will be written. + * @param {string} [args.releaseLevel] - The release level of the library (e.g., 'stable', 'preview'). Defaults to 'preview'. + */ +export async function initialGenerateReadMe(args: { + currentLibrary: string; + stringToReplaceForSampleTable: string; + stringToReplaceForReleaseLevel: string; + writeLibrary: string; + releaseLevel?: string; +}) { + const samplesMetadata = await getSamplesMetadata(args.currentLibrary); + const releaseLevel = args.releaseLevel || DEFAULT_RELEASE_LEVEL; + const releaseLevelMessage = /stable/i.test(releaseLevel) + ? RELEASE_LEVEL_STABLE + : RELEASE_LEVEL_PREVIEW; + + console.log( + `Configuring Nunjucks with FileSystemLoader for directory: ${POST_PROCESSING_TEMPLATES_PATH}`, + ); + // Create a new Nunjucks environment configured to load from the templateDirectory + const env = new nj.Environment( + new nj.FileSystemLoader(POST_PROCESSING_TEMPLATES_PATH), + {autoescape: false}, // Disable autoescaping for code generation + ); + + // Now, render using the template's filename, and Nunjucks will find it + // within the configured templateDirectory. + const compiledTemplate = env.render(SAMPLES_TEMPLATE_PATH, { + samplesMetadata: samplesMetadata, + }); + + // Most of the README is generated at the inital library level + // Except for the samples and the release level, which only the top-level + // BUILD rule has access to. So we set comments that the + // README will replace eventually. + // stringToReplaceForSampleTable should be '[//]: # "samples"' + // stringToReplaceForReleaseLevel should be '[//]: # "releaseLevel"' + // Since this regex could change, we + await readAndWriteToReadme( + args.currentLibrary, + args.stringToReplaceForSampleTable, + compiledTemplate, + args.writeLibrary, + ); + // The first argument is the writeLibrary because we've already changed + // it once, and we want the changes to be cummulative + await readAndWriteToReadme( + args.writeLibrary, + args.stringToReplaceForReleaseLevel, + releaseLevelMessage, + args.writeLibrary, + ); + console.log('Nunjucks template rendered successfully.'); +} + +/** + * Reads the content of a README.md file, replaces a specified string, and writes the modified content to a new README.md file. + * + * @param {string} currentLibrary - The path to the current library. + * @param {string} stringToReplace - The string to replace in the README.md file. + * @param {string} replacementString - The string to replace with. + * @param {string} writeLibrary - The path to the directory where the new README.md file will be written. + */ +export async function readAndWriteToReadme( + currentLibrary: string, + stringToReplace: string, + replacementString: string, + writeLibrary: string, +) { + const readmePath = path.join(currentLibrary, README_PATH); + const writeFilePath = path.join(writeLibrary, README_PATH); + let contents; + try { + contents = await fs.readFile(readmePath, 'utf8'); + } catch (err) { + throw new Error( + `${readmePath} does not exist; cannot write to ${writeFilePath}`, + ); + } + contents = contents.replace(stringToReplace, replacementString); + console.log(`Writing ${contents} to ${writeFilePath}`); + await ensureDirectoryExists(writeFilePath); + await fs.writeFile(writeFilePath, contents); +} diff --git a/packages/gapic-node-templating/src/get-bootstrap-template-vars.ts b/packages/gapic-node-processing/src/get-bootstrap-template-vars.ts similarity index 97% rename from packages/gapic-node-templating/src/get-bootstrap-template-vars.ts rename to packages/gapic-node-processing/src/get-bootstrap-template-vars.ts index 4def45d48c5..813bcd9e9c2 100644 --- a/packages/gapic-node-templating/src/get-bootstrap-template-vars.ts +++ b/packages/gapic-node-processing/src/get-bootstrap-template-vars.ts @@ -138,6 +138,12 @@ export function getApiPathWithDashes(apiId: string) { return apiId.replace(/\.v[0-9].*/, '').replace(/\./g, '-'); } +/** + * Gets the version from the API ID. + * + * @param {string} apiId - The API ID. + * @returns {string} The version. + */ export function getVersion(apiId: string) { return apiId.split('.')[apiId.split('.').length - 1]; } diff --git a/packages/gapic-node-templating/src/templating.ts b/packages/gapic-node-processing/src/templating.ts similarity index 77% rename from packages/gapic-node-templating/src/templating.ts rename to packages/gapic-node-processing/src/templating.ts index 5be8188dce4..eb003090336 100644 --- a/packages/gapic-node-templating/src/templating.ts +++ b/packages/gapic-node-processing/src/templating.ts @@ -17,6 +17,13 @@ import * as fs from 'fs'; import * as nj from 'nunjucks'; import * as path from 'path'; +/** + * Compiles templates in a directory and writes them to another directory. + * + * @param {string} dirNameReadAbsolute - The absolute path to the directory to read templates from. + * @param {string} dirNameWriteAbsolute - The absolute path to the directory to write compiled templates to. + * @param {TemplateVars} vars - The variables to use when compiling the templates. + */ export async function compileTemplates( dirNameReadAbsolute: string, dirNameWriteAbsolute: string, @@ -26,7 +33,7 @@ export async function compileTemplates( `copying from ${dirNameReadAbsolute} to ${dirNameWriteAbsolute}...`, ); const files = fs.readdirSync(dirNameReadAbsolute); - files.forEach(file => { + files.forEach(async file => { const fileName = file.toString(); const readName = path.join(dirNameReadAbsolute, fileName); @@ -36,7 +43,7 @@ export async function compileTemplates( if (fs.statSync(readName).isDirectory()) { fs.mkdirSync(writeName, {recursive: true}); console.log(writeName + ' generated'); - compileTemplates(readName, writeName, vars); + await compileTemplates(readName, writeName, vars); } else { const compiledTemplate = nj.render(readName, vars); fs.writeFileSync(writeName.replace('.njk', ''), compiledTemplate); diff --git a/packages/gapic-node-templating/templates/bootstrap-templates/.OwlBot.yaml b/packages/gapic-node-processing/templates/bootstrap-templates/.OwlBot.yaml similarity index 100% rename from packages/gapic-node-templating/templates/bootstrap-templates/.OwlBot.yaml rename to packages/gapic-node-processing/templates/bootstrap-templates/.OwlBot.yaml diff --git a/packages/gapic-node-templating/templates/bootstrap-templates/.repo-metadata.json.njk b/packages/gapic-node-processing/templates/bootstrap-templates/.repo-metadata.json.njk similarity index 100% rename from packages/gapic-node-templating/templates/bootstrap-templates/.repo-metadata.json.njk rename to packages/gapic-node-processing/templates/bootstrap-templates/.repo-metadata.json.njk diff --git a/packages/gapic-node-templating/templates/bootstrap-templates/LICENSE b/packages/gapic-node-processing/templates/bootstrap-templates/LICENSE similarity index 100% rename from packages/gapic-node-templating/templates/bootstrap-templates/LICENSE rename to packages/gapic-node-processing/templates/bootstrap-templates/LICENSE diff --git a/packages/gapic-node-templating/templates/bootstrap-templates/package.json b/packages/gapic-node-processing/templates/bootstrap-templates/package.json similarity index 100% rename from packages/gapic-node-templating/templates/bootstrap-templates/package.json rename to packages/gapic-node-processing/templates/bootstrap-templates/package.json diff --git a/packages/gapic-node-processing/templates/post-processing-templates/index.ts.njk b/packages/gapic-node-processing/templates/post-processing-templates/index.ts.njk new file mode 100644 index 00000000000..7305f471cd0 --- /dev/null +++ b/packages/gapic-node-processing/templates/post-processing-templates/index.ts.njk @@ -0,0 +1,26 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by synthtool. ** +// ** https://github.com/googleapis/synthtool ** +// ** All changes to this file may be overwritten. ** + +{% for version in versions %}import * as {{ version }} from './{{ version }}{% if isEsm %}/index.js{% endif %}';{{ " +" }}{% endfor %} +{% for client in defaultClientAndVersions.clients %}const {{ client }} = {{ defaultClientAndVersions.version }}.{{ client }}; +type {{ client }} = {{ defaultClientAndVersions.version }}.{{ client }};{{ "\n" }}{% endfor %} +export {{ "{" }}{{ versions|join(', ')}}, {{ defaultClientAndVersions.clients|join(', ')}}{{ "}" }}; +export default {{ "{" }}{{ versions|join(', ')}}, {{ defaultClientAndVersions.clients|join(', ')}}{{ "}" }}; +import * as protos from '{% if isEsm %}../../protos/protos.js{% else %}../protos/protos{% endif %}'; +export {protos}; diff --git a/packages/gapic-node-processing/templates/post-processing-templates/sample.njk b/packages/gapic-node-processing/templates/post-processing-templates/sample.njk new file mode 100644 index 00000000000..96700465e41 --- /dev/null +++ b/packages/gapic-node-processing/templates/post-processing-templates/sample.njk @@ -0,0 +1,4 @@ +| Sample | Source Code | +| --------------------------- | --------------------------------- | +{% for sample in samplesMetadata %}| {{ sample.title }} | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages{{ sample.filePath }}) | +{% endfor %} \ No newline at end of file diff --git a/packages/gapic-node-templating/test/bootstrap-library.test.ts b/packages/gapic-node-processing/test/bootstrap-library-command.test.ts similarity index 95% rename from packages/gapic-node-templating/test/bootstrap-library.test.ts rename to packages/gapic-node-processing/test/bootstrap-library-command.test.ts index d10e91fbafe..b435528554f 100644 --- a/packages/gapic-node-templating/test/bootstrap-library.test.ts +++ b/packages/gapic-node-processing/test/bootstrap-library-command.test.ts @@ -14,9 +14,9 @@ import * as assert from 'assert'; import {bootstrapLibrary} from '../src/commands/bootstrap-library'; -// eslint-disable-next-line node/no-unpublished-import +// eslint-disable-next-line n/no-unpublished-import import {describe, it} from 'mocha'; -// eslint-disable-next-line node/no-unpublished-import +// eslint-disable-next-line n/no-unpublished-import import * as sinon from 'sinon'; import * as vars from '../src/get-bootstrap-template-vars'; import * as templates from '../src/templating'; diff --git a/packages/gapic-node-processing/test/combine-libraries.test.ts b/packages/gapic-node-processing/test/combine-libraries.test.ts new file mode 100644 index 00000000000..849d6212ede --- /dev/null +++ b/packages/gapic-node-processing/test/combine-libraries.test.ts @@ -0,0 +1,156 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import { + generateFinalDirectoryPath, + combineLibraries, + writeFilesToGivenLocation, +} from '../src/combine-libraries'; +import {describe, it} from 'mocha'; +import * as path from 'path'; +import * as fs from 'fs/promises'; +import * as assert from 'assert'; +// import { generateReadMe } from '../src/generate-readme'; +export const TEST_FIXTURES_PATH = path.resolve( + 'test/fixtures/combined-library', +); +export const LIB_PRE_COMBINATION = 'google-cloud-speech-nodejs'; +export const LIB_POST_COMBINATION = 'google-cloud-speech'; + +describe('combine libraries', () => { + it('should throw an error if the library is not in a "pre" combo state', async () => { + await combineLibraries( + path.resolve(TEST_FIXTURES_PATH, LIB_PRE_COMBINATION), + path.resolve(TEST_FIXTURES_PATH, LIB_POST_COMBINATION), + ); + await assert.rejects( + () => + generateFinalDirectoryPath( + path.join(TEST_FIXTURES_PATH, LIB_POST_COMBINATION), + ), + /Unexpected library format/, + ); + try { + await fs.rm(path.join(TEST_FIXTURES_PATH, LIB_POST_COMBINATION), { + recursive: true, + }); + } catch (err) { + console.log(`Could not delete ${LIB_POST_COMBINATION} directory`); + } + }); + + it('should generate unique final directory paths', async () => { + const libraryPaths = await generateFinalDirectoryPath( + path.join(TEST_FIXTURES_PATH, LIB_PRE_COMBINATION), + ); + // This should be the amount of unique file paths in the tree directory + assert.deepStrictEqual(libraryPaths.length, 103); + + // Confirm there are only unique items in the array + assert.deepStrictEqual( + new Set(libraryPaths.map(x => x.filePath)).size, + libraryPaths.length, + ); + }); + + it('should create a combined library', async () => { + // Even though the library combination should delete the current library, + // this allows us to ensure that our output is expected. + try { + await fs.rm(path.join(TEST_FIXTURES_PATH, LIB_POST_COMBINATION), { + recursive: true, + }); + } catch (err) { + console.log(`Could not delete ${LIB_POST_COMBINATION} directory`); + } + await combineLibraries( + path.resolve(TEST_FIXTURES_PATH, LIB_PRE_COMBINATION), + path.resolve(TEST_FIXTURES_PATH, LIB_POST_COMBINATION), + ); + + assert.ok(fs.stat(path.resolve(TEST_FIXTURES_PATH, LIB_POST_COMBINATION))); + // We won't assert very specific library structure, but we will assert + // the top-level folders + assert.ok( + fs.stat(path.resolve(TEST_FIXTURES_PATH, LIB_POST_COMBINATION, 'protos')), + ); + assert.ok( + fs.stat( + path.resolve(TEST_FIXTURES_PATH, LIB_POST_COMBINATION, 'samples'), + ), + ); + assert.ok( + fs.stat(path.resolve(TEST_FIXTURES_PATH, LIB_POST_COMBINATION, 'src')), + ); + assert.ok( + fs.stat( + path.resolve(TEST_FIXTURES_PATH, LIB_POST_COMBINATION, 'system-test'), + ), + ); + assert.ok( + fs.stat(path.resolve(TEST_FIXTURES_PATH, LIB_POST_COMBINATION, 'test')), + ); + try { + await fs.rm(path.join(TEST_FIXTURES_PATH, LIB_POST_COMBINATION), { + recursive: true, + }); + } catch (err) { + console.log(`Could not delete ${LIB_POST_COMBINATION} directory`); + } + }); + + it('should create a directory and write files', async () => { + const filePathAndContent = [ + {filePath: 'testing.txt', content: 'hello!'}, + {filePath: 'src/v1/index.txt', content: 'goodbye!'}, + {filePath: 'src/index.txt', content: 'another content!'}, + ]; + await writeFilesToGivenLocation( + path.resolve(TEST_FIXTURES_PATH, 'testDir'), + filePathAndContent, + ); + assert.ok(fs.stat(path.resolve(TEST_FIXTURES_PATH, 'testDir'))); + + assert.deepEqual( + await fs.readFile( + path.resolve(TEST_FIXTURES_PATH, 'testDir', 'testing.txt'), + 'utf8', + ), + 'hello!', + ); + assert.deepEqual( + await fs.readFile( + path.resolve(TEST_FIXTURES_PATH, 'testDir', 'src/v1/index.txt'), + 'utf8', + ), + 'goodbye!', + ); + assert.deepEqual( + await fs.readFile( + path.resolve(TEST_FIXTURES_PATH, 'testDir', 'src/index.txt'), + 'utf8', + ), + 'another content!', + ); + + // Delete the testing library + try { + await fs.rm(path.join(TEST_FIXTURES_PATH, 'testDir'), {recursive: true}); + } catch (err) { + console.log( + `Could not delete ${path.join(TEST_FIXTURES_PATH, 'testDir')} directory`, + ); + } + }); +}); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/.eslintignore b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/.eslintignore new file mode 100644 index 00000000000..cfc348ec4d1 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/.eslintrc.json b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/.gitignore b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/.gitignore new file mode 100644 index 00000000000..d4f03a0df2e --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/.gitignore @@ -0,0 +1,14 @@ +**/*.log +**/node_modules +/.coverage +/coverage +/.nyc_output +/docs/ +/out/ +/build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +package-lock.json +__pycache__ diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/.jsdoc.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/.jsdoc.js new file mode 100644 index 00000000000..51d12943d53 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/.jsdoc.js @@ -0,0 +1,55 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2025 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/speech', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/.mocharc.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/.mocharc.js new file mode 100644 index 00000000000..24e9d15257f --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/.mocharc.js @@ -0,0 +1,33 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/.prettierrc.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/.prettierrc.js new file mode 100644 index 00000000000..d89a632f90b --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/.prettierrc.js @@ -0,0 +1,22 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/README.md b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/README.md new file mode 100644 index 00000000000..061c4f74c8d --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/README.md @@ -0,0 +1,107 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "The comments you see below are used to generate those parts of the template in later states." +Google Cloud Platform logo + +[homepage]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-speech + +# [Speech: Nodejs Client][homepage] + +[//]: # "releaseLevel" + +[![npm version](https://img.shields.io/npm/v/@google-cloud/speech.svg)](https://www.npmjs.org/package/@google-cloud/speech) + +Speech client for Node.js + +[//]: # "partials.introduction" + +A comprehensive list of changes in each version may be found in +[the CHANGELOG]([homepage]/CHANGELOG.md). + +* [Speech Nodejs Client API Reference](https://cloud.google.com/nodejs/docs/reference/speech/latest) + + +Read more about the client libraries for Cloud APIs, including the older +Google APIs Client Libraries, in [Client Libraries Explained][explained]. + +[explained]: https://cloud.google.com/apis/docs/client-libraries-explained + +**Table of contents:** + +* [Quickstart](#quickstart) + * [Before you begin](#before-you-begin) + * [Installing the client library](#installing-the-client-library) + +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) + +## Quickstart +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Speech API][enable_api]. +1. [Set up authentication][auth] so you can access the + API from your local workstation. +### Installing the client library + +```bash +npm install @google-cloud/speech +``` + +[//]: # "partials.body" + +## Samples + +Samples are in the [`samples/`]([homepage]/samples) directory. Each sample's `README.md` has instructions for running its sample. + +[//]: # "samples" + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://github.com/nodejs/release#release-schedule). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. +If you are using an end-of-life version of Node.js, we recommend that you update +as soon as possible to an actively supported LTS version. + +Google's client libraries support legacy versions of Node.js runtimes on a +best-efforts basis with the following warnings: + +* Legacy versions are not tested in continuous integration. +* Some security patches and features cannot be backported. +* Dependencies cannot be kept up-to-date. + +Client libraries targeting some end-of-life versions of Node.js are available, and +can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. +For example, `npm install @google-cloud/speech@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide]([homepage]/CONTRIBUTING.md). + +Please note that this `README.md` +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. + +## License + +Apache Version 2.0 + +See [LICENSE]([homepage]/LICENSE) + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=speech.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local \ No newline at end of file diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/package.json b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/package.json new file mode 100644 index 00000000000..2eb237195cb --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/package.json @@ -0,0 +1,59 @@ +{ + "name": "@google-cloud/speech", + "version": "0.1.0", + "description": "Speech client for Node.js", + "repository": "googleapis/nodejs-speech", + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google speech", + "speech", + "adaptation", + "speech" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test" + }, + "dependencies": { + "google-gax": "^5.1.1-rc.1" + }, + "devDependencies": { + "@types/mocha": "^10.0.10", + "@types/node": "^22.16.2", + "@types/sinon": "^17.0.4", + "c8": "^10.1.3", + "gapic-tools": "^1.0.2", + "gts": "^6.0.2", + "jsdoc": "^4.0.4", + "jsdoc-fresh": "^4.0.0", + "jsdoc-region-tag": "^3.0.0", + "mocha": "^11.7.1", + "pack-n-play": "^3.0.0", + "typescript": "5.8.3", + "sinon": "^21.0.0" + }, + "engines": { + "node": ">=v18" + } +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/protos/google/cloud/speech/v1/cloud_speech.proto b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/protos/google/cloud/speech/v1/cloud_speech.proto new file mode 100644 index 00000000000..6b62e4f94a9 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/protos/google/cloud/speech/v1/cloud_speech.proto @@ -0,0 +1,996 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.speech.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/cloud/speech/v1/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; +import "google/rpc/status.proto"; + +option cc_enable_arenas = true; +option go_package = "cloud.google.com/go/speech/apiv1/speechpb;speechpb"; +option java_multiple_files = true; +option java_outer_classname = "SpeechProto"; +option java_package = "com.google.cloud.speech.v1"; +option objc_class_prefix = "GCS"; + +// Service that implements Google Cloud Speech API. +service Speech { + option (google.api.default_host) = "speech.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Performs synchronous speech recognition: receive results after all audio + // has been sent and processed. + rpc Recognize(RecognizeRequest) returns (RecognizeResponse) { + option (google.api.http) = { + post: "/v1/speech:recognize" + body: "*" + }; + option (google.api.method_signature) = "config,audio"; + } + + // Performs asynchronous speech recognition: receive results via the + // google.longrunning.Operations interface. Returns either an + // `Operation.error` or an `Operation.response` which contains + // a `LongRunningRecognizeResponse` message. + // For more information on asynchronous speech recognition, see the + // [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). + rpc LongRunningRecognize(LongRunningRecognizeRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/speech:longrunningrecognize" + body: "*" + }; + option (google.api.method_signature) = "config,audio"; + option (google.longrunning.operation_info) = { + response_type: "LongRunningRecognizeResponse" + metadata_type: "LongRunningRecognizeMetadata" + }; + } + + // Performs bidirectional streaming speech recognition: receive results while + // sending audio. This method is only available via the gRPC API (not REST). + rpc StreamingRecognize(stream StreamingRecognizeRequest) + returns (stream StreamingRecognizeResponse) {} +} + +// The top-level message sent by the client for the `Recognize` method. +message RecognizeRequest { + // Required. Provides information to the recognizer that specifies how to + // process the request. + RecognitionConfig config = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The audio data to be recognized. + RecognitionAudio audio = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The top-level message sent by the client for the `LongRunningRecognize` +// method. +message LongRunningRecognizeRequest { + // Required. Provides information to the recognizer that specifies how to + // process the request. + RecognitionConfig config = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The audio data to be recognized. + RecognitionAudio audio = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Specifies an optional destination for the recognition results. + TranscriptOutputConfig output_config = 4 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Specifies an optional destination for the recognition results. +message TranscriptOutputConfig { + oneof output_type { + // Specifies a Cloud Storage URI for the recognition results. Must be + // specified in the format: `gs://bucket_name/object_name`, and the bucket + // must already exist. + string gcs_uri = 1; + } +} + +// The top-level message sent by the client for the `StreamingRecognize` method. +// Multiple `StreamingRecognizeRequest` messages are sent. The first message +// must contain a `streaming_config` message and must not contain +// `audio_content`. All subsequent messages must contain `audio_content` and +// must not contain a `streaming_config` message. +message StreamingRecognizeRequest { + // The streaming request, which is either a streaming config or audio content. + oneof streaming_request { + // Provides information to the recognizer that specifies how to process the + // request. The first `StreamingRecognizeRequest` message must contain a + // `streaming_config` message. + StreamingRecognitionConfig streaming_config = 1; + + // The audio data to be recognized. Sequential chunks of audio data are sent + // in sequential `StreamingRecognizeRequest` messages. The first + // `StreamingRecognizeRequest` message must not contain `audio_content` data + // and all subsequent `StreamingRecognizeRequest` messages must contain + // `audio_content` data. The audio bytes must be encoded as specified in + // `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a + // pure binary representation (not base64). See + // [content limits](https://cloud.google.com/speech-to-text/quotas#content). + bytes audio_content = 2; + } +} + +// Provides information to the recognizer that specifies how to process the +// request. +message StreamingRecognitionConfig { + // Events that a timeout can be set on for voice activity. + message VoiceActivityTimeout { + // Duration to timeout the stream if no speech begins. + google.protobuf.Duration speech_start_timeout = 1; + + // Duration to timeout the stream after speech ends. + google.protobuf.Duration speech_end_timeout = 2; + } + + // Required. Provides information to the recognizer that specifies how to + // process the request. + RecognitionConfig config = 1 [(google.api.field_behavior) = REQUIRED]; + + // If `false` or omitted, the recognizer will perform continuous + // recognition (continuing to wait for and process audio even if the user + // pauses speaking) until the client closes the input stream (gRPC API) or + // until the maximum time limit has been reached. May return multiple + // `StreamingRecognitionResult`s with the `is_final` flag set to `true`. + // + // If `true`, the recognizer will detect a single spoken utterance. When it + // detects that the user has paused or stopped speaking, it will return an + // `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no + // more than one `StreamingRecognitionResult` with the `is_final` flag set to + // `true`. + // + // The `single_utterance` field can only be used with specified models, + // otherwise an error is thrown. The `model` field in [`RecognitionConfig`][] + // must be set to: + // + // * `command_and_search` + // * `phone_call` AND additional field `useEnhanced`=`true` + // * The `model` field is left undefined. In this case the API auto-selects + // a model based on any other parameters that you set in + // `RecognitionConfig`. + bool single_utterance = 2; + + // If `true`, interim results (tentative hypotheses) may be + // returned as they become available (these interim results are indicated with + // the `is_final=false` flag). + // If `false` or omitted, only `is_final=true` result(s) are returned. + bool interim_results = 3; + + // If `true`, responses with voice activity speech events will be returned as + // they are detected. + bool enable_voice_activity_events = 5; + + // If set, the server will automatically close the stream after the specified + // duration has elapsed after the last VOICE_ACTIVITY speech event has been + // sent. The field `voice_activity_events` must also be set to true. + VoiceActivityTimeout voice_activity_timeout = 6; +} + +// Provides information to the recognizer that specifies how to process the +// request. +message RecognitionConfig { + // The encoding of the audio data sent in the request. + // + // All encodings support only 1 channel (mono) audio, unless the + // `audio_channel_count` and `enable_separate_recognition_per_channel` fields + // are set. + // + // For best results, the audio source should be captured and transmitted using + // a lossless encoding (`FLAC` or `LINEAR16`). The accuracy of the speech + // recognition can be reduced if lossy codecs are used to capture or transmit + // audio, particularly if background noise is present. Lossy codecs include + // `MULAW`, `AMR`, `AMR_WB`, `OGG_OPUS`, `SPEEX_WITH_HEADER_BYTE`, `MP3`, + // and `WEBM_OPUS`. + // + // The `FLAC` and `WAV` audio file formats include a header that describes the + // included audio content. You can request recognition for `WAV` files that + // contain either `LINEAR16` or `MULAW` encoded audio. + // If you send `FLAC` or `WAV` audio file format in + // your request, you do not need to specify an `AudioEncoding`; the audio + // encoding format is determined from the file header. If you specify + // an `AudioEncoding` when you send send `FLAC` or `WAV` audio, the + // encoding configuration must match the encoding described in the audio + // header; otherwise the request returns an + // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT] error + // code. + enum AudioEncoding { + // Not specified. + ENCODING_UNSPECIFIED = 0; + + // Uncompressed 16-bit signed little-endian samples (Linear PCM). + LINEAR16 = 1; + + // `FLAC` (Free Lossless Audio + // Codec) is the recommended encoding because it is + // lossless--therefore recognition is not compromised--and + // requires only about half the bandwidth of `LINEAR16`. `FLAC` stream + // encoding supports 16-bit and 24-bit samples, however, not all fields in + // `STREAMINFO` are supported. + FLAC = 2; + + // 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. + MULAW = 3; + + // Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000. + AMR = 4; + + // Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000. + AMR_WB = 5; + + // Opus encoded audio frames in Ogg container + // ([OggOpus](https://wiki.xiph.org/OggOpus)). + // `sample_rate_hertz` must be one of 8000, 12000, 16000, 24000, or 48000. + OGG_OPUS = 6; + + // Although the use of lossy encodings is not recommended, if a very low + // bitrate encoding is required, `OGG_OPUS` is highly preferred over + // Speex encoding. The [Speex](https://speex.org/) encoding supported by + // Cloud Speech API has a header byte in each block, as in MIME type + // `audio/x-speex-with-header-byte`. + // It is a variant of the RTP Speex encoding defined in + // [RFC 5574](https://tools.ietf.org/html/rfc5574). + // The stream is a sequence of blocks, one block per RTP packet. Each block + // starts with a byte containing the length of the block, in bytes, followed + // by one or more frames of Speex data, padded to an integral number of + // bytes (octets) as specified in RFC 5574. In other words, each RTP header + // is replaced with a single byte containing the block length. Only Speex + // wideband is supported. `sample_rate_hertz` must be 16000. + SPEEX_WITH_HEADER_BYTE = 7; + + // MP3 audio. MP3 encoding is a Beta feature and only available in + // v1p1beta1. Support all standard MP3 bitrates (which range from 32-320 + // kbps). When using this encoding, `sample_rate_hertz` has to match the + // sample rate of the file being used. + MP3 = 8; + + // Opus encoded audio frames in WebM container + // ([OggOpus](https://wiki.xiph.org/OggOpus)). `sample_rate_hertz` must be + // one of 8000, 12000, 16000, 24000, or 48000. + WEBM_OPUS = 9; + } + + // Encoding of audio data sent in all `RecognitionAudio` messages. + // This field is optional for `FLAC` and `WAV` audio files and required + // for all other audio formats. For details, see + // [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding]. + AudioEncoding encoding = 1; + + // Sample rate in Hertz of the audio data sent in all + // `RecognitionAudio` messages. Valid values are: 8000-48000. + // 16000 is optimal. For best results, set the sampling rate of the audio + // source to 16000 Hz. If that's not possible, use the native sample rate of + // the audio source (instead of re-sampling). + // This field is optional for FLAC and WAV audio files, but is + // required for all other audio formats. For details, see + // [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding]. + int32 sample_rate_hertz = 2; + + // The number of channels in the input audio data. + // ONLY set this for MULTI-CHANNEL recognition. + // Valid values for LINEAR16, OGG_OPUS and FLAC are `1`-`8`. + // Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`. + // If `0` or omitted, defaults to one channel (mono). + // Note: We only recognize the first channel by default. + // To perform independent recognition on each channel set + // `enable_separate_recognition_per_channel` to 'true'. + int32 audio_channel_count = 7; + + // This needs to be set to `true` explicitly and `audio_channel_count` > 1 + // to get each channel recognized separately. The recognition result will + // contain a `channel_tag` field to state which channel that result belongs + // to. If this is not true, we will only recognize the first channel. The + // request is billed cumulatively for all channels recognized: + // `audio_channel_count` multiplied by the length of the audio. + bool enable_separate_recognition_per_channel = 12; + + // Required. The language of the supplied audio as a + // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. + // Example: "en-US". + // See [Language + // Support](https://cloud.google.com/speech-to-text/docs/languages) for a list + // of the currently supported language codes. + string language_code = 3 [(google.api.field_behavior) = REQUIRED]; + + // A list of up to 3 additional + // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags, + // listing possible alternative languages of the supplied audio. + // See [Language + // Support](https://cloud.google.com/speech-to-text/docs/languages) for a list + // of the currently supported language codes. If alternative languages are + // listed, recognition result will contain recognition in the most likely + // language detected including the main language_code. The recognition result + // will include the language tag of the language detected in the audio. Note: + // This feature is only supported for Voice Command and Voice Search use cases + // and performance may vary for other use cases (e.g., phone call + // transcription). + repeated string alternative_language_codes = 18; + + // Maximum number of recognition hypotheses to be returned. + // Specifically, the maximum number of `SpeechRecognitionAlternative` messages + // within each `SpeechRecognitionResult`. + // The server may return fewer than `max_alternatives`. + // Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of + // one. If omitted, will return a maximum of one. + int32 max_alternatives = 4; + + // If set to `true`, the server will attempt to filter out + // profanities, replacing all but the initial character in each filtered word + // with asterisks, e.g. "f***". If set to `false` or omitted, profanities + // won't be filtered out. + bool profanity_filter = 5; + + // Speech adaptation configuration improves the accuracy of speech + // recognition. For more information, see the [speech + // adaptation](https://cloud.google.com/speech-to-text/docs/adaptation) + // documentation. + // When speech adaptation is set it supersedes the `speech_contexts` field. + SpeechAdaptation adaptation = 20; + + // Optional. Use transcription normalization to automatically replace parts of + // the transcript with phrases of your choosing. For StreamingRecognize, this + // normalization only applies to stable partial transcripts (stability > 0.8) + // and final transcripts. + TranscriptNormalization transcript_normalization = 24 + [(google.api.field_behavior) = OPTIONAL]; + + // Array of [SpeechContext][google.cloud.speech.v1.SpeechContext]. + // A means to provide context to assist the speech recognition. For more + // information, see + // [speech + // adaptation](https://cloud.google.com/speech-to-text/docs/adaptation). + repeated SpeechContext speech_contexts = 6; + + // If `true`, the top result includes a list of words and + // the start and end time offsets (timestamps) for those words. If + // `false`, no word-level time offset information is returned. The default is + // `false`. + bool enable_word_time_offsets = 8; + + // If `true`, the top result includes a list of words and the + // confidence for those words. If `false`, no word-level confidence + // information is returned. The default is `false`. + bool enable_word_confidence = 15; + + // If 'true', adds punctuation to recognition result hypotheses. + // This feature is only available in select languages. Setting this for + // requests in other languages has no effect at all. + // The default 'false' value does not add punctuation to result hypotheses. + bool enable_automatic_punctuation = 11; + + // The spoken punctuation behavior for the call + // If not set, uses default behavior based on model of choice + // e.g. command_and_search will enable spoken punctuation by default + // If 'true', replaces spoken punctuation with the corresponding symbols in + // the request. For example, "how are you question mark" becomes "how are + // you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation + // for support. If 'false', spoken punctuation is not replaced. + google.protobuf.BoolValue enable_spoken_punctuation = 22; + + // The spoken emoji behavior for the call + // If not set, uses default behavior based on model of choice + // If 'true', adds spoken emoji formatting for the request. This will replace + // spoken emojis with the corresponding Unicode symbols in the final + // transcript. If 'false', spoken emojis are not replaced. + google.protobuf.BoolValue enable_spoken_emojis = 23; + + // Config to enable speaker diarization and set additional + // parameters to make diarization better suited for your application. + // Note: When this is enabled, we send all the words from the beginning of the + // audio for the top alternative in every consecutive STREAMING responses. + // This is done in order to improve our speaker tags as our models learn to + // identify the speakers in the conversation over time. + // For non-streaming requests, the diarization results will be provided only + // in the top alternative of the FINAL SpeechRecognitionResult. + SpeakerDiarizationConfig diarization_config = 19; + + // Metadata regarding this request. + RecognitionMetadata metadata = 9; + + // Which model to select for the given request. Select the model + // best suited to your domain to get best results. If a model is not + // explicitly specified, then we auto-select a model based on the parameters + // in the RecognitionConfig. + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + //
ModelDescription
latest_longBest for long form content like media or conversation.
latest_shortBest for short form content like commands or single shot directed + // speech.
command_and_searchBest for short queries such as voice commands or voice search.
phone_callBest for audio that originated from a phone call (typically + // recorded at an 8khz sampling rate).
videoBest for audio that originated from video or includes multiple + // speakers. Ideally the audio is recorded at a 16khz or greater + // sampling rate. This is a premium model that costs more than the + // standard rate.
defaultBest for audio that is not one of the specific audio models. + // For example, long-form audio. Ideally the audio is high-fidelity, + // recorded at a 16khz or greater sampling rate.
medical_conversationBest for audio that originated from a conversation between a + // medical provider and patient.
medical_dictationBest for audio that originated from dictation notes by a medical + // provider.
+ string model = 13; + + // Set to true to use an enhanced model for speech recognition. + // If `use_enhanced` is set to true and the `model` field is not set, then + // an appropriate enhanced model is chosen if an enhanced model exists for + // the audio. + // + // If `use_enhanced` is true and an enhanced version of the specified model + // does not exist, then the speech is recognized using the standard version + // of the specified model. + bool use_enhanced = 14; +} + +// Config to enable speaker diarization. +message SpeakerDiarizationConfig { + // If 'true', enables speaker detection for each recognized word in + // the top alternative of the recognition result using a speaker_label + // provided in the WordInfo. + bool enable_speaker_diarization = 1; + + // Minimum number of speakers in the conversation. This range gives you more + // flexibility by allowing the system to automatically determine the correct + // number of speakers. If not set, the default value is 2. + int32 min_speaker_count = 2; + + // Maximum number of speakers in the conversation. This range gives you more + // flexibility by allowing the system to automatically determine the correct + // number of speakers. If not set, the default value is 6. + int32 max_speaker_count = 3; + + // Output only. Unused. + int32 speaker_tag = 5 + [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Description of audio data to be recognized. +message RecognitionMetadata { + option deprecated = true; + + // Use case categories that the audio recognition request can be described + // by. + enum InteractionType { + // Use case is either unknown or is something other than one of the other + // values below. + INTERACTION_TYPE_UNSPECIFIED = 0; + + // Multiple people in a conversation or discussion. For example in a + // meeting with two or more people actively participating. Typically + // all the primary people speaking would be in the same room (if not, + // see PHONE_CALL) + DISCUSSION = 1; + + // One or more persons lecturing or presenting to others, mostly + // uninterrupted. + PRESENTATION = 2; + + // A phone-call or video-conference in which two or more people, who are + // not in the same room, are actively participating. + PHONE_CALL = 3; + + // A recorded message intended for another person to listen to. + VOICEMAIL = 4; + + // Professionally produced audio (eg. TV Show, Podcast). + PROFESSIONALLY_PRODUCED = 5; + + // Transcribe spoken questions and queries into text. + VOICE_SEARCH = 6; + + // Transcribe voice commands, such as for controlling a device. + VOICE_COMMAND = 7; + + // Transcribe speech to text to create a written document, such as a + // text-message, email or report. + DICTATION = 8; + } + + // Enumerates the types of capture settings describing an audio file. + enum MicrophoneDistance { + // Audio type is not known. + MICROPHONE_DISTANCE_UNSPECIFIED = 0; + + // The audio was captured from a closely placed microphone. Eg. phone, + // dictaphone, or handheld microphone. Generally if there speaker is within + // 1 meter of the microphone. + NEARFIELD = 1; + + // The speaker if within 3 meters of the microphone. + MIDFIELD = 2; + + // The speaker is more than 3 meters away from the microphone. + FARFIELD = 3; + } + + // The original media the speech was recorded on. + enum OriginalMediaType { + // Unknown original media type. + ORIGINAL_MEDIA_TYPE_UNSPECIFIED = 0; + + // The speech data is an audio recording. + AUDIO = 1; + + // The speech data originally recorded on a video. + VIDEO = 2; + } + + // The type of device the speech was recorded with. + enum RecordingDeviceType { + // The recording device is unknown. + RECORDING_DEVICE_TYPE_UNSPECIFIED = 0; + + // Speech was recorded on a smartphone. + SMARTPHONE = 1; + + // Speech was recorded using a personal computer or tablet. + PC = 2; + + // Speech was recorded over a phone line. + PHONE_LINE = 3; + + // Speech was recorded in a vehicle. + VEHICLE = 4; + + // Speech was recorded outdoors. + OTHER_OUTDOOR_DEVICE = 5; + + // Speech was recorded indoors. + OTHER_INDOOR_DEVICE = 6; + } + + // The use case most closely describing the audio content to be recognized. + InteractionType interaction_type = 1; + + // The industry vertical to which this speech recognition request most + // closely applies. This is most indicative of the topics contained + // in the audio. Use the 6-digit NAICS code to identify the industry + // vertical - see https://www.naics.com/search/. + uint32 industry_naics_code_of_audio = 3; + + // The audio type that most closely describes the audio being recognized. + MicrophoneDistance microphone_distance = 4; + + // The original media the speech was recorded on. + OriginalMediaType original_media_type = 5; + + // The type of device the speech was recorded with. + RecordingDeviceType recording_device_type = 6; + + // The device used to make the recording. Examples 'Nexus 5X' or + // 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or + // 'Cardioid Microphone'. + string recording_device_name = 7; + + // Mime type of the original audio file. For example `audio/m4a`, + // `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`. + // A list of possible audio mime types is maintained at + // http://www.iana.org/assignments/media-types/media-types.xhtml#audio + string original_mime_type = 8; + + // Description of the content. Eg. "Recordings of federal supreme court + // hearings from 2012". + string audio_topic = 10; +} + +// Provides "hints" to the speech recognizer to favor specific words and phrases +// in the results. +message SpeechContext { + // A list of strings containing words and phrases "hints" so that + // the speech recognition is more likely to recognize them. This can be used + // to improve the accuracy for specific words and phrases, for example, if + // specific commands are typically spoken by the user. This can also be used + // to add additional words to the vocabulary of the recognizer. See + // [usage limits](https://cloud.google.com/speech-to-text/quotas#content). + // + // List items can also be set to classes for groups of words that represent + // common concepts that occur in natural language. For example, rather than + // providing phrase hints for every month of the year, using the $MONTH class + // improves the likelihood of correctly transcribing audio that includes + // months. + repeated string phrases = 1; + + // Hint Boost. Positive value will increase the probability that a specific + // phrase will be recognized over other similar sounding phrases. The higher + // the boost, the higher the chance of false positive recognition as well. + // Negative boost values would correspond to anti-biasing. Anti-biasing is not + // enabled, so negative boost will simply be ignored. Though `boost` can + // accept a wide range of positive values, most use cases are best served with + // values between 0 and 20. We recommend using a binary search approach to + // finding the optimal value for your use case. + float boost = 4; +} + +// Contains audio data in the encoding specified in the `RecognitionConfig`. +// Either `content` or `uri` must be supplied. Supplying both or neither +// returns [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. +// See [content limits](https://cloud.google.com/speech-to-text/quotas#content). +message RecognitionAudio { + // The audio source, which is either inline content or a Google Cloud + // Storage uri. + oneof audio_source { + // The audio data bytes encoded as specified in + // `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a + // pure binary representation, whereas JSON representations use base64. + bytes content = 1; + + // URI that points to a file that contains audio data bytes as specified in + // `RecognitionConfig`. The file must not be compressed (for example, gzip). + // Currently, only Google Cloud Storage URIs are + // supported, which must be specified in the following format: + // `gs://bucket_name/object_name` (other URI formats return + // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). + // For more information, see [Request + // URIs](https://cloud.google.com/storage/docs/reference-uris). + string uri = 2; + } +} + +// The only message returned to the client by the `Recognize` method. It +// contains the result as zero or more sequential `SpeechRecognitionResult` +// messages. +message RecognizeResponse { + // Sequential list of transcription results corresponding to + // sequential portions of audio. + repeated SpeechRecognitionResult results = 2; + + // When available, billed audio seconds for the corresponding request. + google.protobuf.Duration total_billed_time = 3; + + // Provides information on adaptation behavior in response + SpeechAdaptationInfo speech_adaptation_info = 7; + + // The ID associated with the request. This is a unique ID specific only to + // the given request. + int64 request_id = 8; +} + +// The only message returned to the client by the `LongRunningRecognize` method. +// It contains the result as zero or more sequential `SpeechRecognitionResult` +// messages. It is included in the `result.response` field of the `Operation` +// returned by the `GetOperation` call of the `google::longrunning::Operations` +// service. +message LongRunningRecognizeResponse { + // Sequential list of transcription results corresponding to + // sequential portions of audio. + repeated SpeechRecognitionResult results = 2; + + // When available, billed audio seconds for the corresponding request. + google.protobuf.Duration total_billed_time = 3; + + // Original output config if present in the request. + TranscriptOutputConfig output_config = 6; + + // If the transcript output fails this field contains the relevant error. + google.rpc.Status output_error = 7; + + // Provides information on speech adaptation behavior in response + SpeechAdaptationInfo speech_adaptation_info = 8; + + // The ID associated with the request. This is a unique ID specific only to + // the given request. + int64 request_id = 9; +} + +// Describes the progress of a long-running `LongRunningRecognize` call. It is +// included in the `metadata` field of the `Operation` returned by the +// `GetOperation` call of the `google::longrunning::Operations` service. +message LongRunningRecognizeMetadata { + // Approximate percentage of audio processed thus far. Guaranteed to be 100 + // when the audio is fully processed and the results are available. + int32 progress_percent = 1; + + // Time when the request was received. + google.protobuf.Timestamp start_time = 2; + + // Time of the most recent processing update. + google.protobuf.Timestamp last_update_time = 3; + + // Output only. The URI of the audio file being transcribed. Empty if the + // audio was sent as byte content. + string uri = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// `StreamingRecognizeResponse` is the only message returned to the client by +// `StreamingRecognize`. A series of zero or more `StreamingRecognizeResponse` +// messages are streamed back to the client. If there is no recognizable +// audio, and `single_utterance` is set to false, then no messages are streamed +// back to the client. +// +// Here's an example of a series of `StreamingRecognizeResponse`s that might be +// returned while processing audio: +// +// 1. results { alternatives { transcript: "tube" } stability: 0.01 } +// +// 2. results { alternatives { transcript: "to be a" } stability: 0.01 } +// +// 3. results { alternatives { transcript: "to be" } stability: 0.9 } +// results { alternatives { transcript: " or not to be" } stability: 0.01 } +// +// 4. results { alternatives { transcript: "to be or not to be" +// confidence: 0.92 } +// alternatives { transcript: "to bee or not to bee" } +// is_final: true } +// +// 5. results { alternatives { transcript: " that's" } stability: 0.01 } +// +// 6. results { alternatives { transcript: " that is" } stability: 0.9 } +// results { alternatives { transcript: " the question" } stability: 0.01 } +// +// 7. results { alternatives { transcript: " that is the question" +// confidence: 0.98 } +// alternatives { transcript: " that was the question" } +// is_final: true } +// +// Notes: +// +// - Only two of the above responses #4 and #7 contain final results; they are +// indicated by `is_final: true`. Concatenating these together generates the +// full transcript: "to be or not to be that is the question". +// +// - The others contain interim `results`. #3 and #6 contain two interim +// `results`: the first portion has a high stability and is less likely to +// change; the second portion has a low stability and is very likely to +// change. A UI designer might choose to show only high stability `results`. +// +// - The specific `stability` and `confidence` values shown above are only for +// illustrative purposes. Actual values may vary. +// +// - In each response, only one of these fields will be set: +// `error`, +// `speech_event_type`, or +// one or more (repeated) `results`. +message StreamingRecognizeResponse { + // Indicates the type of speech event. + enum SpeechEventType { + // No speech event specified. + SPEECH_EVENT_UNSPECIFIED = 0; + + // This event indicates that the server has detected the end of the user's + // speech utterance and expects no additional speech. Therefore, the server + // will not process additional audio (although it may subsequently return + // additional results). The client should stop sending additional audio + // data, half-close the gRPC connection, and wait for any additional results + // until the server closes the gRPC connection. This event is only sent if + // `single_utterance` was set to `true`, and is not used otherwise. + END_OF_SINGLE_UTTERANCE = 1; + + // This event indicates that the server has detected the beginning of human + // voice activity in the stream. This event can be returned multiple times + // if speech starts and stops repeatedly throughout the stream. This event + // is only sent if `voice_activity_events` is set to true. + SPEECH_ACTIVITY_BEGIN = 2; + + // This event indicates that the server has detected the end of human voice + // activity in the stream. This event can be returned multiple times if + // speech starts and stops repeatedly throughout the stream. This event is + // only sent if `voice_activity_events` is set to true. + SPEECH_ACTIVITY_END = 3; + + // This event indicates that the user-set timeout for speech activity begin + // or end has exceeded. Upon receiving this event, the client is expected to + // send a half close. Further audio will not be processed. + SPEECH_ACTIVITY_TIMEOUT = 4; + } + + // If set, returns a [google.rpc.Status][google.rpc.Status] message that + // specifies the error for the operation. + google.rpc.Status error = 1; + + // This repeated list contains zero or more results that + // correspond to consecutive portions of the audio currently being processed. + // It contains zero or one `is_final=true` result (the newly settled portion), + // followed by zero or more `is_final=false` results (the interim results). + repeated StreamingRecognitionResult results = 2; + + // Indicates the type of speech event. + SpeechEventType speech_event_type = 4; + + // Time offset between the beginning of the audio and event emission. + google.protobuf.Duration speech_event_time = 8; + + // When available, billed audio seconds for the stream. + // Set only if this is the last response in the stream. + google.protobuf.Duration total_billed_time = 5; + + // Provides information on adaptation behavior in response + SpeechAdaptationInfo speech_adaptation_info = 9; + + // The ID associated with the request. This is a unique ID specific only to + // the given request. + int64 request_id = 10; +} + +// A streaming speech recognition result corresponding to a portion of the audio +// that is currently being processed. +message StreamingRecognitionResult { + // May contain one or more recognition hypotheses (up to the + // maximum specified in `max_alternatives`). + // These alternatives are ordered in terms of accuracy, with the top (first) + // alternative being the most probable, as ranked by the recognizer. + repeated SpeechRecognitionAlternative alternatives = 1; + + // If `false`, this `StreamingRecognitionResult` represents an + // interim result that may change. If `true`, this is the final time the + // speech service will return this particular `StreamingRecognitionResult`, + // the recognizer will not return any further hypotheses for this portion of + // the transcript and corresponding audio. + bool is_final = 2; + + // An estimate of the likelihood that the recognizer will not + // change its guess about this interim result. Values range from 0.0 + // (completely unstable) to 1.0 (completely stable). + // This field is only provided for interim results (`is_final=false`). + // The default of 0.0 is a sentinel value indicating `stability` was not set. + float stability = 3; + + // Time offset of the end of this result relative to the + // beginning of the audio. + google.protobuf.Duration result_end_time = 4; + + // For multi-channel audio, this is the channel number corresponding to the + // recognized result for the audio from that channel. + // For audio_channel_count = N, its output values can range from '1' to 'N'. + int32 channel_tag = 5; + + // Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + // language tag of the language in this result. This language code was + // detected to have the most likelihood of being spoken in the audio. + string language_code = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A speech recognition result corresponding to a portion of the audio. +message SpeechRecognitionResult { + // May contain one or more recognition hypotheses (up to the + // maximum specified in `max_alternatives`). + // These alternatives are ordered in terms of accuracy, with the top (first) + // alternative being the most probable, as ranked by the recognizer. + repeated SpeechRecognitionAlternative alternatives = 1; + + // For multi-channel audio, this is the channel number corresponding to the + // recognized result for the audio from that channel. + // For audio_channel_count = N, its output values can range from '1' to 'N'. + int32 channel_tag = 2; + + // Time offset of the end of this result relative to the + // beginning of the audio. + google.protobuf.Duration result_end_time = 4; + + // Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + // language tag of the language in this result. This language code was + // detected to have the most likelihood of being spoken in the audio. + string language_code = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Alternative hypotheses (a.k.a. n-best list). +message SpeechRecognitionAlternative { + // Transcript text representing the words that the user spoke. + // In languages that use spaces to separate words, the transcript might have a + // leading space if it isn't the first result. You can concatenate each result + // to obtain the full transcript without using a separator. + string transcript = 1; + + // The confidence estimate between 0.0 and 1.0. A higher number + // indicates an estimated greater likelihood that the recognized words are + // correct. This field is set only for the top alternative of a non-streaming + // result or, of a streaming result where `is_final=true`. + // This field is not guaranteed to be accurate and users should not rely on it + // to be always provided. + // The default of 0.0 is a sentinel value indicating `confidence` was not set. + float confidence = 2; + + // A list of word-specific information for each recognized word. + // Note: When `enable_speaker_diarization` is true, you will see all the words + // from the beginning of the audio. + repeated WordInfo words = 3; +} + +// Word-specific information for recognized words. +message WordInfo { + // Time offset relative to the beginning of the audio, + // and corresponding to the start of the spoken word. + // This field is only set if `enable_word_time_offsets=true` and only + // in the top hypothesis. + // This is an experimental feature and the accuracy of the time offset can + // vary. + google.protobuf.Duration start_time = 1; + + // Time offset relative to the beginning of the audio, + // and corresponding to the end of the spoken word. + // This field is only set if `enable_word_time_offsets=true` and only + // in the top hypothesis. + // This is an experimental feature and the accuracy of the time offset can + // vary. + google.protobuf.Duration end_time = 2; + + // The word corresponding to this set of information. + string word = 3; + + // The confidence estimate between 0.0 and 1.0. A higher number + // indicates an estimated greater likelihood that the recognized words are + // correct. This field is set only for the top alternative of a non-streaming + // result or, of a streaming result where `is_final=true`. + // This field is not guaranteed to be accurate and users should not rely on it + // to be always provided. + // The default of 0.0 is a sentinel value indicating `confidence` was not set. + float confidence = 4; + + // Output only. A distinct integer value is assigned for every speaker within + // the audio. This field specifies which one of those speakers was detected to + // have spoken this word. Value ranges from '1' to diarization_speaker_count. + // speaker_tag is set if enable_speaker_diarization = 'true' and only for the + // top alternative. + // Note: Use speaker_label instead. + int32 speaker_tag = 5 + [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A label value assigned for every unique speaker within the + // audio. This field specifies which speaker was detected to have spoken this + // word. For some models, like medical_conversation this can be actual speaker + // role, for example "patient" or "provider", but generally this would be a + // number identifying a speaker. This field is only set if + // enable_speaker_diarization = 'true' and only for the top alternative. + string speaker_label = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Information on speech adaptation use in results +message SpeechAdaptationInfo { + // Whether there was a timeout when applying speech adaptation. If true, + // adaptation had no effect in the response transcript. + bool adaptation_timeout = 1; + + // If set, returns a message specifying which part of the speech adaptation + // request timed out. + string timeout_message = 4; +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/protos/google/cloud/speech/v1/cloud_speech_adaptation.proto b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/protos/google/cloud/speech/v1/cloud_speech_adaptation.proto new file mode 100644 index 00000000000..b9895c2d1bc --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/protos/google/cloud/speech/v1/cloud_speech_adaptation.proto @@ -0,0 +1,376 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.speech.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/speech/v1/resource.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option cc_enable_arenas = true; +option go_package = "cloud.google.com/go/speech/apiv1/speechpb;speechpb"; +option java_multiple_files = true; +option java_outer_classname = "SpeechAdaptationProto"; +option java_package = "com.google.cloud.speech.v1"; +option objc_class_prefix = "GCS"; + +// Service that implements Google Cloud Speech Adaptation API. +service Adaptation { + option (google.api.default_host) = "speech.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Create a set of phrase hints. Each item in the set can be a single word or + // a multi-word phrase. The items in the PhraseSet are favored by the + // recognition model when you send a call that includes the PhraseSet. + rpc CreatePhraseSet(CreatePhraseSetRequest) returns (PhraseSet) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/phraseSets" + body: "*" + }; + option (google.api.method_signature) = "parent,phrase_set,phrase_set_id"; + } + + // Get a phrase set. + rpc GetPhraseSet(GetPhraseSetRequest) returns (PhraseSet) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/phraseSets/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List phrase sets. + rpc ListPhraseSet(ListPhraseSetRequest) returns (ListPhraseSetResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/phraseSets" + }; + option (google.api.method_signature) = "parent"; + } + + // Update a phrase set. + rpc UpdatePhraseSet(UpdatePhraseSetRequest) returns (PhraseSet) { + option (google.api.http) = { + patch: "/v1/{phrase_set.name=projects/*/locations/*/phraseSets/*}" + body: "phrase_set" + }; + option (google.api.method_signature) = "phrase_set,update_mask"; + } + + // Delete a phrase set. + rpc DeletePhraseSet(DeletePhraseSetRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/phraseSets/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Create a custom class. + rpc CreateCustomClass(CreateCustomClassRequest) returns (CustomClass) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/customClasses" + body: "*" + }; + option (google.api.method_signature) = + "parent,custom_class,custom_class_id"; + } + + // Get a custom class. + rpc GetCustomClass(GetCustomClassRequest) returns (CustomClass) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/customClasses/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List custom classes. + rpc ListCustomClasses(ListCustomClassesRequest) + returns (ListCustomClassesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/customClasses" + }; + option (google.api.method_signature) = "parent"; + } + + // Update a custom class. + rpc UpdateCustomClass(UpdateCustomClassRequest) returns (CustomClass) { + option (google.api.http) = { + patch: "/v1/{custom_class.name=projects/*/locations/*/customClasses/*}" + body: "custom_class" + }; + option (google.api.method_signature) = "custom_class,update_mask"; + } + + // Delete a custom class. + rpc DeleteCustomClass(DeleteCustomClassRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/customClasses/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// Message sent by the client for the `CreatePhraseSet` method. +message CreatePhraseSetRequest { + // Required. The parent resource where this phrase set will be created. + // Format: + // + // `projects/{project}/locations/{location}` + // + // Speech-to-Text supports three locations: `global`, `us` (US North America), + // and `eu` (Europe). If you are calling the `speech.googleapis.com` + // endpoint, use the `global` location. To specify a region, use a + // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + // with matching `us` or `eu` location value. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "speech.googleapis.com/PhraseSet" + } + ]; + + // Required. The ID to use for the phrase set, which will become the final + // component of the phrase set's resource name. + // + // This value should restrict to letters, numbers, and hyphens, with the first + // character a letter, the last a letter or a number, and be 4-63 characters. + string phrase_set_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The phrase set to create. + PhraseSet phrase_set = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Message sent by the client for the `UpdatePhraseSet` method. +message UpdatePhraseSetRequest { + // Required. The phrase set to update. + // + // The phrase set's `name` field is used to identify the set to be + // updated. Format: + // + // `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + // + // Speech-to-Text supports three locations: `global`, `us` (US North America), + // and `eu` (Europe). If you are calling the `speech.googleapis.com` + // endpoint, use the `global` location. To specify a region, use a + // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + // with matching `us` or `eu` location value. + PhraseSet phrase_set = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Message sent by the client for the `GetPhraseSet` method. +message GetPhraseSetRequest { + // Required. The name of the phrase set to retrieve. Format: + // + // `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + // + // Speech-to-Text supports three locations: `global`, `us` (US North America), + // and `eu` (Europe). If you are calling the `speech.googleapis.com` + // endpoint, use the `global` location. To specify a region, use a + // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + // with matching `us` or `eu` location value. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "speech.googleapis.com/PhraseSet" + } + ]; +} + +// Message sent by the client for the `ListPhraseSet` method. +message ListPhraseSetRequest { + // Required. The parent, which owns this collection of phrase set. Format: + // + // `projects/{project}/locations/{location}` + // + // Speech-to-Text supports three locations: `global`, `us` (US North America), + // and `eu` (Europe). If you are calling the `speech.googleapis.com` + // endpoint, use the `global` location. To specify a region, use a + // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + // with matching `us` or `eu` location value. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "speech.googleapis.com/PhraseSet" + } + ]; + + // The maximum number of phrase sets to return. The service may return + // fewer than this value. If unspecified, at most 50 phrase sets will be + // returned. The maximum value is 1000; values above 1000 will be coerced to + // 1000. + int32 page_size = 2; + + // A page token, received from a previous `ListPhraseSet` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListPhraseSet` must + // match the call that provided the page token. + string page_token = 3; +} + +// Message returned to the client by the `ListPhraseSet` method. +message ListPhraseSetResponse { + // The phrase set. + repeated PhraseSet phrase_sets = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Message sent by the client for the `DeletePhraseSet` method. +message DeletePhraseSetRequest { + // Required. The name of the phrase set to delete. Format: + // + // `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "speech.googleapis.com/PhraseSet" + } + ]; +} + +// Message sent by the client for the `CreateCustomClass` method. +message CreateCustomClassRequest { + // Required. The parent resource where this custom class will be created. + // Format: + // + // `projects/{project}/locations/{location}/customClasses` + // + // Speech-to-Text supports three locations: `global`, `us` (US North America), + // and `eu` (Europe). If you are calling the `speech.googleapis.com` + // endpoint, use the `global` location. To specify a region, use a + // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + // with matching `us` or `eu` location value. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "speech.googleapis.com/CustomClass" + } + ]; + + // Required. The ID to use for the custom class, which will become the final + // component of the custom class' resource name. + // + // This value should restrict to letters, numbers, and hyphens, with the first + // character a letter, the last a letter or a number, and be 4-63 characters. + string custom_class_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The custom class to create. + CustomClass custom_class = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Message sent by the client for the `UpdateCustomClass` method. +message UpdateCustomClassRequest { + // Required. The custom class to update. + // + // The custom class's `name` field is used to identify the custom class to be + // updated. Format: + // + // `projects/{project}/locations/{location}/customClasses/{custom_class}` + // + // Speech-to-Text supports three locations: `global`, `us` (US North America), + // and `eu` (Europe). If you are calling the `speech.googleapis.com` + // endpoint, use the `global` location. To specify a region, use a + // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + // with matching `us` or `eu` location value. + CustomClass custom_class = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Message sent by the client for the `GetCustomClass` method. +message GetCustomClassRequest { + // Required. The name of the custom class to retrieve. Format: + // + // `projects/{project}/locations/{location}/customClasses/{custom_class}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "speech.googleapis.com/CustomClass" + } + ]; +} + +// Message sent by the client for the `ListCustomClasses` method. +message ListCustomClassesRequest { + // Required. The parent, which owns this collection of custom classes. Format: + // + // `projects/{project}/locations/{location}/customClasses` + // + // Speech-to-Text supports three locations: `global`, `us` (US North America), + // and `eu` (Europe). If you are calling the `speech.googleapis.com` + // endpoint, use the `global` location. To specify a region, use a + // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + // with matching `us` or `eu` location value. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "speech.googleapis.com/CustomClass" + } + ]; + + // The maximum number of custom classes to return. The service may return + // fewer than this value. If unspecified, at most 50 custom classes will be + // returned. The maximum value is 1000; values above 1000 will be coerced to + // 1000. + int32 page_size = 2; + + // A page token, received from a previous `ListCustomClass` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListCustomClass` must + // match the call that provided the page token. + string page_token = 3; +} + +// Message returned to the client by the `ListCustomClasses` method. +message ListCustomClassesResponse { + // The custom classes. + repeated CustomClass custom_classes = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Message sent by the client for the `DeleteCustomClass` method. +message DeleteCustomClassRequest { + // Required. The name of the custom class to delete. Format: + // + // `projects/{project}/locations/{location}/customClasses/{custom_class}` + // + // Speech-to-Text supports three locations: `global`, `us` (US North America), + // and `eu` (Europe). If you are calling the `speech.googleapis.com` + // endpoint, use the `global` location. To specify a region, use a + // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + // with matching `us` or `eu` location value. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "speech.googleapis.com/CustomClass" + } + ]; +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/protos/google/cloud/speech/v1/resource.proto b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/protos/google/cloud/speech/v1/resource.proto new file mode 100644 index 00000000000..b88b5d491c2 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/protos/google/cloud/speech/v1/resource.proto @@ -0,0 +1,173 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.speech.v1; + +import "google/api/resource.proto"; + +option cc_enable_arenas = true; +option go_package = "cloud.google.com/go/speech/apiv1/speechpb;speechpb"; +option java_multiple_files = true; +option java_outer_classname = "SpeechResourceProto"; +option java_package = "com.google.cloud.speech.v1"; +option objc_class_prefix = "GCS"; + +// A set of words or phrases that represents a common concept likely to appear +// in your audio, for example a list of passenger ship names. CustomClass items +// can be substituted into placeholders that you set in PhraseSet phrases. +message CustomClass { + option (google.api.resource) = { + type: "speech.googleapis.com/CustomClass" + pattern: "projects/{project}/locations/{location}/customClasses/{custom_class}" + }; + + // An item of the class. + message ClassItem { + // The class item's value. + string value = 1; + } + + // The resource name of the custom class. + string name = 1; + + // If this custom class is a resource, the custom_class_id is the resource id + // of the CustomClass. Case sensitive. + string custom_class_id = 2; + + // A collection of class items. + repeated ClassItem items = 3; +} + +// Provides "hints" to the speech recognizer to favor specific words and phrases +// in the results. +message PhraseSet { + option (google.api.resource) = { + type: "speech.googleapis.com/PhraseSet" + pattern: "projects/{project}/locations/{location}/phraseSets/{phrase_set}" + }; + + // A phrases containing words and phrase "hints" so that + // the speech recognition is more likely to recognize them. This can be used + // to improve the accuracy for specific words and phrases, for example, if + // specific commands are typically spoken by the user. This can also be used + // to add additional words to the vocabulary of the recognizer. See + // [usage limits](https://cloud.google.com/speech-to-text/quotas#content). + // + // List items can also include pre-built or custom classes containing groups + // of words that represent common concepts that occur in natural language. For + // example, rather than providing a phrase hint for every month of the + // year (e.g. "i was born in january", "i was born in febuary", ...), use the + // pre-built `$MONTH` class improves the likelihood of correctly transcribing + // audio that includes months (e.g. "i was born in $month"). + // To refer to pre-built classes, use the class' symbol prepended with `$` + // e.g. `$MONTH`. To refer to custom classes that were defined inline in the + // request, set the class's `custom_class_id` to a string unique to all class + // resources and inline classes. Then use the class' id wrapped in $`{...}` + // e.g. "${my-months}". To refer to custom classes resources, use the class' + // id wrapped in `${}` (e.g. `${my-months}`). + // + // Speech-to-Text supports three locations: `global`, `us` (US North America), + // and `eu` (Europe). If you are calling the `speech.googleapis.com` + // endpoint, use the `global` location. To specify a region, use a + // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + // with matching `us` or `eu` location value. + message Phrase { + // The phrase itself. + string value = 1; + + // Hint Boost. Overrides the boost set at the phrase set level. + // Positive value will increase the probability that a specific phrase will + // be recognized over other similar sounding phrases. The higher the boost, + // the higher the chance of false positive recognition as well. Negative + // boost will simply be ignored. Though `boost` can accept a wide range of + // positive values, most use cases are best served + // with values between 0 and 20. We recommend using a binary search approach + // to finding the optimal value for your use case as well as adding + // phrases both with and without boost to your requests. + float boost = 2; + } + + // The resource name of the phrase set. + string name = 1; + + // A list of word and phrases. + repeated Phrase phrases = 2; + + // Hint Boost. Positive value will increase the probability that a specific + // phrase will be recognized over other similar sounding phrases. The higher + // the boost, the higher the chance of false positive recognition as well. + // Negative boost values would correspond to anti-biasing. Anti-biasing is not + // enabled, so negative boost will simply be ignored. Though `boost` can + // accept a wide range of positive values, most use cases are best served with + // values between 0 (exclusive) and 20. We recommend using a binary search + // approach to finding the optimal value for your use case as well as adding + // phrases both with and without boost to your requests. + float boost = 4; +} + +// Speech adaptation configuration. +message SpeechAdaptation { + message ABNFGrammar { + // All declarations and rules of an ABNF grammar broken up into multiple + // strings that will end up concatenated. + repeated string abnf_strings = 1; + } + + // A collection of phrase sets. To specify the hints inline, leave the + // phrase set's `name` blank and fill in the rest of its fields. Any + // phrase set can use any custom class. + repeated PhraseSet phrase_sets = 1; + + // A collection of phrase set resource names to use. + repeated string phrase_set_references = 2 [(google.api.resource_reference) = { + type: "speech.googleapis.com/PhraseSet" + }]; + + // A collection of custom classes. To specify the classes inline, leave the + // class' `name` blank and fill in the rest of its fields, giving it a unique + // `custom_class_id`. Refer to the inline defined class in phrase hints by its + // `custom_class_id`. + repeated CustomClass custom_classes = 3; + + // Augmented Backus-Naur form (ABNF) is a standardized grammar notation + // comprised by a set of derivation rules. + // See specifications: https://www.w3.org/TR/speech-grammar + ABNFGrammar abnf_grammar = 4; +} + +// Transcription normalization configuration. Use transcription normalization +// to automatically replace parts of the transcript with phrases of your +// choosing. For StreamingRecognize, this normalization only applies to stable +// partial transcripts (stability > 0.8) and final transcripts. +message TranscriptNormalization { + // A single replacement configuration. + message Entry { + // What to replace. Max length is 100 characters. + string search = 1; + + // What to replace with. Max length is 100 characters. + string replace = 2; + + // Whether the search is case sensitive. + bool case_sensitive = 3; + } + + // A list of replacement entries. We will perform replacement with one entry + // at a time. For example, the second entry in ["cat" => "dog", "mountain cat" + // => "mountain dog"] will never be applied because we will always process the + // first entry before it. At most 100 entries. + repeated Entry entries = 1; +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/protos/protos.d.ts b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/protos/protos.d.ts new file mode 100644 index 00000000000..7130a2cc16f --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/protos/protos.d.ts @@ -0,0 +1,13586 @@ +// 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. + +import type {protobuf as $protobuf} from "google-gax"; +import Long = require("long"); +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace speech. */ + namespace speech { + + /** Namespace v1. */ + namespace v1 { + + /** Represents a Speech */ + class Speech extends $protobuf.rpc.Service { + + /** + * Constructs a new Speech service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Speech service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Speech; + + /** + * Calls Recognize. + * @param request RecognizeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RecognizeResponse + */ + public recognize(request: google.cloud.speech.v1.IRecognizeRequest, callback: google.cloud.speech.v1.Speech.RecognizeCallback): void; + + /** + * Calls Recognize. + * @param request RecognizeRequest message or plain object + * @returns Promise + */ + public recognize(request: google.cloud.speech.v1.IRecognizeRequest): Promise; + + /** + * Calls LongRunningRecognize. + * @param request LongRunningRecognizeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public longRunningRecognize(request: google.cloud.speech.v1.ILongRunningRecognizeRequest, callback: google.cloud.speech.v1.Speech.LongRunningRecognizeCallback): void; + + /** + * Calls LongRunningRecognize. + * @param request LongRunningRecognizeRequest message or plain object + * @returns Promise + */ + public longRunningRecognize(request: google.cloud.speech.v1.ILongRunningRecognizeRequest): Promise; + + /** + * Calls StreamingRecognize. + * @param request StreamingRecognizeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and StreamingRecognizeResponse + */ + public streamingRecognize(request: google.cloud.speech.v1.IStreamingRecognizeRequest, callback: google.cloud.speech.v1.Speech.StreamingRecognizeCallback): void; + + /** + * Calls StreamingRecognize. + * @param request StreamingRecognizeRequest message or plain object + * @returns Promise + */ + public streamingRecognize(request: google.cloud.speech.v1.IStreamingRecognizeRequest): Promise; + } + + namespace Speech { + + /** + * Callback as used by {@link google.cloud.speech.v1.Speech|recognize}. + * @param error Error, if any + * @param [response] RecognizeResponse + */ + type RecognizeCallback = (error: (Error|null), response?: google.cloud.speech.v1.RecognizeResponse) => void; + + /** + * Callback as used by {@link google.cloud.speech.v1.Speech|longRunningRecognize}. + * @param error Error, if any + * @param [response] Operation + */ + type LongRunningRecognizeCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.speech.v1.Speech|streamingRecognize}. + * @param error Error, if any + * @param [response] StreamingRecognizeResponse + */ + type StreamingRecognizeCallback = (error: (Error|null), response?: google.cloud.speech.v1.StreamingRecognizeResponse) => void; + } + + /** Properties of a RecognizeRequest. */ + interface IRecognizeRequest { + + /** RecognizeRequest config */ + config?: (google.cloud.speech.v1.IRecognitionConfig|null); + + /** RecognizeRequest audio */ + audio?: (google.cloud.speech.v1.IRecognitionAudio|null); + } + + /** Represents a RecognizeRequest. */ + class RecognizeRequest implements IRecognizeRequest { + + /** + * Constructs a new RecognizeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.IRecognizeRequest); + + /** RecognizeRequest config. */ + public config?: (google.cloud.speech.v1.IRecognitionConfig|null); + + /** RecognizeRequest audio. */ + public audio?: (google.cloud.speech.v1.IRecognitionAudio|null); + + /** + * Creates a new RecognizeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RecognizeRequest instance + */ + public static create(properties?: google.cloud.speech.v1.IRecognizeRequest): google.cloud.speech.v1.RecognizeRequest; + + /** + * Encodes the specified RecognizeRequest message. Does not implicitly {@link google.cloud.speech.v1.RecognizeRequest.verify|verify} messages. + * @param message RecognizeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.IRecognizeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RecognizeRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.RecognizeRequest.verify|verify} messages. + * @param message RecognizeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.IRecognizeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RecognizeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RecognizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.RecognizeRequest; + + /** + * Decodes a RecognizeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RecognizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.RecognizeRequest; + + /** + * Verifies a RecognizeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RecognizeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RecognizeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.RecognizeRequest; + + /** + * Creates a plain object from a RecognizeRequest message. Also converts values to other types if specified. + * @param message RecognizeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.RecognizeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RecognizeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RecognizeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LongRunningRecognizeRequest. */ + interface ILongRunningRecognizeRequest { + + /** LongRunningRecognizeRequest config */ + config?: (google.cloud.speech.v1.IRecognitionConfig|null); + + /** LongRunningRecognizeRequest audio */ + audio?: (google.cloud.speech.v1.IRecognitionAudio|null); + + /** LongRunningRecognizeRequest outputConfig */ + outputConfig?: (google.cloud.speech.v1.ITranscriptOutputConfig|null); + } + + /** Represents a LongRunningRecognizeRequest. */ + class LongRunningRecognizeRequest implements ILongRunningRecognizeRequest { + + /** + * Constructs a new LongRunningRecognizeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.ILongRunningRecognizeRequest); + + /** LongRunningRecognizeRequest config. */ + public config?: (google.cloud.speech.v1.IRecognitionConfig|null); + + /** LongRunningRecognizeRequest audio. */ + public audio?: (google.cloud.speech.v1.IRecognitionAudio|null); + + /** LongRunningRecognizeRequest outputConfig. */ + public outputConfig?: (google.cloud.speech.v1.ITranscriptOutputConfig|null); + + /** + * Creates a new LongRunningRecognizeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns LongRunningRecognizeRequest instance + */ + public static create(properties?: google.cloud.speech.v1.ILongRunningRecognizeRequest): google.cloud.speech.v1.LongRunningRecognizeRequest; + + /** + * Encodes the specified LongRunningRecognizeRequest message. Does not implicitly {@link google.cloud.speech.v1.LongRunningRecognizeRequest.verify|verify} messages. + * @param message LongRunningRecognizeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.ILongRunningRecognizeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LongRunningRecognizeRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.LongRunningRecognizeRequest.verify|verify} messages. + * @param message LongRunningRecognizeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.ILongRunningRecognizeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LongRunningRecognizeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LongRunningRecognizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.LongRunningRecognizeRequest; + + /** + * Decodes a LongRunningRecognizeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LongRunningRecognizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.LongRunningRecognizeRequest; + + /** + * Verifies a LongRunningRecognizeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LongRunningRecognizeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LongRunningRecognizeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.LongRunningRecognizeRequest; + + /** + * Creates a plain object from a LongRunningRecognizeRequest message. Also converts values to other types if specified. + * @param message LongRunningRecognizeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.LongRunningRecognizeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LongRunningRecognizeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LongRunningRecognizeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TranscriptOutputConfig. */ + interface ITranscriptOutputConfig { + + /** TranscriptOutputConfig gcsUri */ + gcsUri?: (string|null); + } + + /** Represents a TranscriptOutputConfig. */ + class TranscriptOutputConfig implements ITranscriptOutputConfig { + + /** + * Constructs a new TranscriptOutputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.ITranscriptOutputConfig); + + /** TranscriptOutputConfig gcsUri. */ + public gcsUri?: (string|null); + + /** TranscriptOutputConfig outputType. */ + public outputType?: "gcsUri"; + + /** + * Creates a new TranscriptOutputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns TranscriptOutputConfig instance + */ + public static create(properties?: google.cloud.speech.v1.ITranscriptOutputConfig): google.cloud.speech.v1.TranscriptOutputConfig; + + /** + * Encodes the specified TranscriptOutputConfig message. Does not implicitly {@link google.cloud.speech.v1.TranscriptOutputConfig.verify|verify} messages. + * @param message TranscriptOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.ITranscriptOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TranscriptOutputConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v1.TranscriptOutputConfig.verify|verify} messages. + * @param message TranscriptOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.ITranscriptOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TranscriptOutputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TranscriptOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.TranscriptOutputConfig; + + /** + * Decodes a TranscriptOutputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TranscriptOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.TranscriptOutputConfig; + + /** + * Verifies a TranscriptOutputConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TranscriptOutputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TranscriptOutputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.TranscriptOutputConfig; + + /** + * Creates a plain object from a TranscriptOutputConfig message. Also converts values to other types if specified. + * @param message TranscriptOutputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.TranscriptOutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TranscriptOutputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TranscriptOutputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StreamingRecognizeRequest. */ + interface IStreamingRecognizeRequest { + + /** StreamingRecognizeRequest streamingConfig */ + streamingConfig?: (google.cloud.speech.v1.IStreamingRecognitionConfig|null); + + /** StreamingRecognizeRequest audioContent */ + audioContent?: (Uint8Array|Buffer|string|null); + } + + /** Represents a StreamingRecognizeRequest. */ + class StreamingRecognizeRequest implements IStreamingRecognizeRequest { + + /** + * Constructs a new StreamingRecognizeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.IStreamingRecognizeRequest); + + /** StreamingRecognizeRequest streamingConfig. */ + public streamingConfig?: (google.cloud.speech.v1.IStreamingRecognitionConfig|null); + + /** StreamingRecognizeRequest audioContent. */ + public audioContent?: (Uint8Array|Buffer|string|null); + + /** StreamingRecognizeRequest streamingRequest. */ + public streamingRequest?: ("streamingConfig"|"audioContent"); + + /** + * Creates a new StreamingRecognizeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingRecognizeRequest instance + */ + public static create(properties?: google.cloud.speech.v1.IStreamingRecognizeRequest): google.cloud.speech.v1.StreamingRecognizeRequest; + + /** + * Encodes the specified StreamingRecognizeRequest message. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognizeRequest.verify|verify} messages. + * @param message StreamingRecognizeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.IStreamingRecognizeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamingRecognizeRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognizeRequest.verify|verify} messages. + * @param message StreamingRecognizeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.IStreamingRecognizeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamingRecognizeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingRecognizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.StreamingRecognizeRequest; + + /** + * Decodes a StreamingRecognizeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingRecognizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.StreamingRecognizeRequest; + + /** + * Verifies a StreamingRecognizeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamingRecognizeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingRecognizeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.StreamingRecognizeRequest; + + /** + * Creates a plain object from a StreamingRecognizeRequest message. Also converts values to other types if specified. + * @param message StreamingRecognizeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.StreamingRecognizeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamingRecognizeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamingRecognizeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StreamingRecognitionConfig. */ + interface IStreamingRecognitionConfig { + + /** StreamingRecognitionConfig config */ + config?: (google.cloud.speech.v1.IRecognitionConfig|null); + + /** StreamingRecognitionConfig singleUtterance */ + singleUtterance?: (boolean|null); + + /** StreamingRecognitionConfig interimResults */ + interimResults?: (boolean|null); + + /** StreamingRecognitionConfig enableVoiceActivityEvents */ + enableVoiceActivityEvents?: (boolean|null); + + /** StreamingRecognitionConfig voiceActivityTimeout */ + voiceActivityTimeout?: (google.cloud.speech.v1.StreamingRecognitionConfig.IVoiceActivityTimeout|null); + } + + /** Represents a StreamingRecognitionConfig. */ + class StreamingRecognitionConfig implements IStreamingRecognitionConfig { + + /** + * Constructs a new StreamingRecognitionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.IStreamingRecognitionConfig); + + /** StreamingRecognitionConfig config. */ + public config?: (google.cloud.speech.v1.IRecognitionConfig|null); + + /** StreamingRecognitionConfig singleUtterance. */ + public singleUtterance: boolean; + + /** StreamingRecognitionConfig interimResults. */ + public interimResults: boolean; + + /** StreamingRecognitionConfig enableVoiceActivityEvents. */ + public enableVoiceActivityEvents: boolean; + + /** StreamingRecognitionConfig voiceActivityTimeout. */ + public voiceActivityTimeout?: (google.cloud.speech.v1.StreamingRecognitionConfig.IVoiceActivityTimeout|null); + + /** + * Creates a new StreamingRecognitionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingRecognitionConfig instance + */ + public static create(properties?: google.cloud.speech.v1.IStreamingRecognitionConfig): google.cloud.speech.v1.StreamingRecognitionConfig; + + /** + * Encodes the specified StreamingRecognitionConfig message. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognitionConfig.verify|verify} messages. + * @param message StreamingRecognitionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.IStreamingRecognitionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamingRecognitionConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognitionConfig.verify|verify} messages. + * @param message StreamingRecognitionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.IStreamingRecognitionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamingRecognitionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingRecognitionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.StreamingRecognitionConfig; + + /** + * Decodes a StreamingRecognitionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingRecognitionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.StreamingRecognitionConfig; + + /** + * Verifies a StreamingRecognitionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamingRecognitionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingRecognitionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.StreamingRecognitionConfig; + + /** + * Creates a plain object from a StreamingRecognitionConfig message. Also converts values to other types if specified. + * @param message StreamingRecognitionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.StreamingRecognitionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamingRecognitionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamingRecognitionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace StreamingRecognitionConfig { + + /** Properties of a VoiceActivityTimeout. */ + interface IVoiceActivityTimeout { + + /** VoiceActivityTimeout speechStartTimeout */ + speechStartTimeout?: (google.protobuf.IDuration|null); + + /** VoiceActivityTimeout speechEndTimeout */ + speechEndTimeout?: (google.protobuf.IDuration|null); + } + + /** Represents a VoiceActivityTimeout. */ + class VoiceActivityTimeout implements IVoiceActivityTimeout { + + /** + * Constructs a new VoiceActivityTimeout. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.StreamingRecognitionConfig.IVoiceActivityTimeout); + + /** VoiceActivityTimeout speechStartTimeout. */ + public speechStartTimeout?: (google.protobuf.IDuration|null); + + /** VoiceActivityTimeout speechEndTimeout. */ + public speechEndTimeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new VoiceActivityTimeout instance using the specified properties. + * @param [properties] Properties to set + * @returns VoiceActivityTimeout instance + */ + public static create(properties?: google.cloud.speech.v1.StreamingRecognitionConfig.IVoiceActivityTimeout): google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout; + + /** + * Encodes the specified VoiceActivityTimeout message. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout.verify|verify} messages. + * @param message VoiceActivityTimeout message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.StreamingRecognitionConfig.IVoiceActivityTimeout, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VoiceActivityTimeout message, length delimited. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout.verify|verify} messages. + * @param message VoiceActivityTimeout message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.StreamingRecognitionConfig.IVoiceActivityTimeout, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VoiceActivityTimeout message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VoiceActivityTimeout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout; + + /** + * Decodes a VoiceActivityTimeout message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VoiceActivityTimeout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout; + + /** + * Verifies a VoiceActivityTimeout message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VoiceActivityTimeout message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VoiceActivityTimeout + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout; + + /** + * Creates a plain object from a VoiceActivityTimeout message. Also converts values to other types if specified. + * @param message VoiceActivityTimeout + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VoiceActivityTimeout to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VoiceActivityTimeout + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a RecognitionConfig. */ + interface IRecognitionConfig { + + /** RecognitionConfig encoding */ + encoding?: (google.cloud.speech.v1.RecognitionConfig.AudioEncoding|keyof typeof google.cloud.speech.v1.RecognitionConfig.AudioEncoding|null); + + /** RecognitionConfig sampleRateHertz */ + sampleRateHertz?: (number|null); + + /** RecognitionConfig audioChannelCount */ + audioChannelCount?: (number|null); + + /** RecognitionConfig enableSeparateRecognitionPerChannel */ + enableSeparateRecognitionPerChannel?: (boolean|null); + + /** RecognitionConfig languageCode */ + languageCode?: (string|null); + + /** RecognitionConfig alternativeLanguageCodes */ + alternativeLanguageCodes?: (string[]|null); + + /** RecognitionConfig maxAlternatives */ + maxAlternatives?: (number|null); + + /** RecognitionConfig profanityFilter */ + profanityFilter?: (boolean|null); + + /** RecognitionConfig adaptation */ + adaptation?: (google.cloud.speech.v1.ISpeechAdaptation|null); + + /** RecognitionConfig transcriptNormalization */ + transcriptNormalization?: (google.cloud.speech.v1.ITranscriptNormalization|null); + + /** RecognitionConfig speechContexts */ + speechContexts?: (google.cloud.speech.v1.ISpeechContext[]|null); + + /** RecognitionConfig enableWordTimeOffsets */ + enableWordTimeOffsets?: (boolean|null); + + /** RecognitionConfig enableWordConfidence */ + enableWordConfidence?: (boolean|null); + + /** RecognitionConfig enableAutomaticPunctuation */ + enableAutomaticPunctuation?: (boolean|null); + + /** RecognitionConfig enableSpokenPunctuation */ + enableSpokenPunctuation?: (google.protobuf.IBoolValue|null); + + /** RecognitionConfig enableSpokenEmojis */ + enableSpokenEmojis?: (google.protobuf.IBoolValue|null); + + /** RecognitionConfig diarizationConfig */ + diarizationConfig?: (google.cloud.speech.v1.ISpeakerDiarizationConfig|null); + + /** RecognitionConfig metadata */ + metadata?: (google.cloud.speech.v1.IRecognitionMetadata|null); + + /** RecognitionConfig model */ + model?: (string|null); + + /** RecognitionConfig useEnhanced */ + useEnhanced?: (boolean|null); + } + + /** Represents a RecognitionConfig. */ + class RecognitionConfig implements IRecognitionConfig { + + /** + * Constructs a new RecognitionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.IRecognitionConfig); + + /** RecognitionConfig encoding. */ + public encoding: (google.cloud.speech.v1.RecognitionConfig.AudioEncoding|keyof typeof google.cloud.speech.v1.RecognitionConfig.AudioEncoding); + + /** RecognitionConfig sampleRateHertz. */ + public sampleRateHertz: number; + + /** RecognitionConfig audioChannelCount. */ + public audioChannelCount: number; + + /** RecognitionConfig enableSeparateRecognitionPerChannel. */ + public enableSeparateRecognitionPerChannel: boolean; + + /** RecognitionConfig languageCode. */ + public languageCode: string; + + /** RecognitionConfig alternativeLanguageCodes. */ + public alternativeLanguageCodes: string[]; + + /** RecognitionConfig maxAlternatives. */ + public maxAlternatives: number; + + /** RecognitionConfig profanityFilter. */ + public profanityFilter: boolean; + + /** RecognitionConfig adaptation. */ + public adaptation?: (google.cloud.speech.v1.ISpeechAdaptation|null); + + /** RecognitionConfig transcriptNormalization. */ + public transcriptNormalization?: (google.cloud.speech.v1.ITranscriptNormalization|null); + + /** RecognitionConfig speechContexts. */ + public speechContexts: google.cloud.speech.v1.ISpeechContext[]; + + /** RecognitionConfig enableWordTimeOffsets. */ + public enableWordTimeOffsets: boolean; + + /** RecognitionConfig enableWordConfidence. */ + public enableWordConfidence: boolean; + + /** RecognitionConfig enableAutomaticPunctuation. */ + public enableAutomaticPunctuation: boolean; + + /** RecognitionConfig enableSpokenPunctuation. */ + public enableSpokenPunctuation?: (google.protobuf.IBoolValue|null); + + /** RecognitionConfig enableSpokenEmojis. */ + public enableSpokenEmojis?: (google.protobuf.IBoolValue|null); + + /** RecognitionConfig diarizationConfig. */ + public diarizationConfig?: (google.cloud.speech.v1.ISpeakerDiarizationConfig|null); + + /** RecognitionConfig metadata. */ + public metadata?: (google.cloud.speech.v1.IRecognitionMetadata|null); + + /** RecognitionConfig model. */ + public model: string; + + /** RecognitionConfig useEnhanced. */ + public useEnhanced: boolean; + + /** + * Creates a new RecognitionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns RecognitionConfig instance + */ + public static create(properties?: google.cloud.speech.v1.IRecognitionConfig): google.cloud.speech.v1.RecognitionConfig; + + /** + * Encodes the specified RecognitionConfig message. Does not implicitly {@link google.cloud.speech.v1.RecognitionConfig.verify|verify} messages. + * @param message RecognitionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.IRecognitionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RecognitionConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v1.RecognitionConfig.verify|verify} messages. + * @param message RecognitionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.IRecognitionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RecognitionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RecognitionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.RecognitionConfig; + + /** + * Decodes a RecognitionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RecognitionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.RecognitionConfig; + + /** + * Verifies a RecognitionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RecognitionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RecognitionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.RecognitionConfig; + + /** + * Creates a plain object from a RecognitionConfig message. Also converts values to other types if specified. + * @param message RecognitionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.RecognitionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RecognitionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RecognitionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RecognitionConfig { + + /** AudioEncoding enum. */ + enum AudioEncoding { + ENCODING_UNSPECIFIED = 0, + LINEAR16 = 1, + FLAC = 2, + MULAW = 3, + AMR = 4, + AMR_WB = 5, + OGG_OPUS = 6, + SPEEX_WITH_HEADER_BYTE = 7, + MP3 = 8, + WEBM_OPUS = 9 + } + } + + /** Properties of a SpeakerDiarizationConfig. */ + interface ISpeakerDiarizationConfig { + + /** SpeakerDiarizationConfig enableSpeakerDiarization */ + enableSpeakerDiarization?: (boolean|null); + + /** SpeakerDiarizationConfig minSpeakerCount */ + minSpeakerCount?: (number|null); + + /** SpeakerDiarizationConfig maxSpeakerCount */ + maxSpeakerCount?: (number|null); + + /** SpeakerDiarizationConfig speakerTag */ + speakerTag?: (number|null); + } + + /** Represents a SpeakerDiarizationConfig. */ + class SpeakerDiarizationConfig implements ISpeakerDiarizationConfig { + + /** + * Constructs a new SpeakerDiarizationConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.ISpeakerDiarizationConfig); + + /** SpeakerDiarizationConfig enableSpeakerDiarization. */ + public enableSpeakerDiarization: boolean; + + /** SpeakerDiarizationConfig minSpeakerCount. */ + public minSpeakerCount: number; + + /** SpeakerDiarizationConfig maxSpeakerCount. */ + public maxSpeakerCount: number; + + /** SpeakerDiarizationConfig speakerTag. */ + public speakerTag: number; + + /** + * Creates a new SpeakerDiarizationConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SpeakerDiarizationConfig instance + */ + public static create(properties?: google.cloud.speech.v1.ISpeakerDiarizationConfig): google.cloud.speech.v1.SpeakerDiarizationConfig; + + /** + * Encodes the specified SpeakerDiarizationConfig message. Does not implicitly {@link google.cloud.speech.v1.SpeakerDiarizationConfig.verify|verify} messages. + * @param message SpeakerDiarizationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.ISpeakerDiarizationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpeakerDiarizationConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v1.SpeakerDiarizationConfig.verify|verify} messages. + * @param message SpeakerDiarizationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.ISpeakerDiarizationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpeakerDiarizationConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpeakerDiarizationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.SpeakerDiarizationConfig; + + /** + * Decodes a SpeakerDiarizationConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpeakerDiarizationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.SpeakerDiarizationConfig; + + /** + * Verifies a SpeakerDiarizationConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpeakerDiarizationConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpeakerDiarizationConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.SpeakerDiarizationConfig; + + /** + * Creates a plain object from a SpeakerDiarizationConfig message. Also converts values to other types if specified. + * @param message SpeakerDiarizationConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.SpeakerDiarizationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpeakerDiarizationConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpeakerDiarizationConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RecognitionMetadata. */ + interface IRecognitionMetadata { + + /** RecognitionMetadata interactionType */ + interactionType?: (google.cloud.speech.v1.RecognitionMetadata.InteractionType|keyof typeof google.cloud.speech.v1.RecognitionMetadata.InteractionType|null); + + /** RecognitionMetadata industryNaicsCodeOfAudio */ + industryNaicsCodeOfAudio?: (number|null); + + /** RecognitionMetadata microphoneDistance */ + microphoneDistance?: (google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance|keyof typeof google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance|null); + + /** RecognitionMetadata originalMediaType */ + originalMediaType?: (google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType|keyof typeof google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType|null); + + /** RecognitionMetadata recordingDeviceType */ + recordingDeviceType?: (google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType|keyof typeof google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType|null); + + /** RecognitionMetadata recordingDeviceName */ + recordingDeviceName?: (string|null); + + /** RecognitionMetadata originalMimeType */ + originalMimeType?: (string|null); + + /** RecognitionMetadata audioTopic */ + audioTopic?: (string|null); + } + + /** Represents a RecognitionMetadata. */ + class RecognitionMetadata implements IRecognitionMetadata { + + /** + * Constructs a new RecognitionMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.IRecognitionMetadata); + + /** RecognitionMetadata interactionType. */ + public interactionType: (google.cloud.speech.v1.RecognitionMetadata.InteractionType|keyof typeof google.cloud.speech.v1.RecognitionMetadata.InteractionType); + + /** RecognitionMetadata industryNaicsCodeOfAudio. */ + public industryNaicsCodeOfAudio: number; + + /** RecognitionMetadata microphoneDistance. */ + public microphoneDistance: (google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance|keyof typeof google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance); + + /** RecognitionMetadata originalMediaType. */ + public originalMediaType: (google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType|keyof typeof google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType); + + /** RecognitionMetadata recordingDeviceType. */ + public recordingDeviceType: (google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType|keyof typeof google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType); + + /** RecognitionMetadata recordingDeviceName. */ + public recordingDeviceName: string; + + /** RecognitionMetadata originalMimeType. */ + public originalMimeType: string; + + /** RecognitionMetadata audioTopic. */ + public audioTopic: string; + + /** + * Creates a new RecognitionMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns RecognitionMetadata instance + */ + public static create(properties?: google.cloud.speech.v1.IRecognitionMetadata): google.cloud.speech.v1.RecognitionMetadata; + + /** + * Encodes the specified RecognitionMetadata message. Does not implicitly {@link google.cloud.speech.v1.RecognitionMetadata.verify|verify} messages. + * @param message RecognitionMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.IRecognitionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RecognitionMetadata message, length delimited. Does not implicitly {@link google.cloud.speech.v1.RecognitionMetadata.verify|verify} messages. + * @param message RecognitionMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.IRecognitionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RecognitionMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RecognitionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.RecognitionMetadata; + + /** + * Decodes a RecognitionMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RecognitionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.RecognitionMetadata; + + /** + * Verifies a RecognitionMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RecognitionMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RecognitionMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.RecognitionMetadata; + + /** + * Creates a plain object from a RecognitionMetadata message. Also converts values to other types if specified. + * @param message RecognitionMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.RecognitionMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RecognitionMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RecognitionMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RecognitionMetadata { + + /** InteractionType enum. */ + enum InteractionType { + INTERACTION_TYPE_UNSPECIFIED = 0, + DISCUSSION = 1, + PRESENTATION = 2, + PHONE_CALL = 3, + VOICEMAIL = 4, + PROFESSIONALLY_PRODUCED = 5, + VOICE_SEARCH = 6, + VOICE_COMMAND = 7, + DICTATION = 8 + } + + /** MicrophoneDistance enum. */ + enum MicrophoneDistance { + MICROPHONE_DISTANCE_UNSPECIFIED = 0, + NEARFIELD = 1, + MIDFIELD = 2, + FARFIELD = 3 + } + + /** OriginalMediaType enum. */ + enum OriginalMediaType { + ORIGINAL_MEDIA_TYPE_UNSPECIFIED = 0, + AUDIO = 1, + VIDEO = 2 + } + + /** RecordingDeviceType enum. */ + enum RecordingDeviceType { + RECORDING_DEVICE_TYPE_UNSPECIFIED = 0, + SMARTPHONE = 1, + PC = 2, + PHONE_LINE = 3, + VEHICLE = 4, + OTHER_OUTDOOR_DEVICE = 5, + OTHER_INDOOR_DEVICE = 6 + } + } + + /** Properties of a SpeechContext. */ + interface ISpeechContext { + + /** SpeechContext phrases */ + phrases?: (string[]|null); + + /** SpeechContext boost */ + boost?: (number|null); + } + + /** Represents a SpeechContext. */ + class SpeechContext implements ISpeechContext { + + /** + * Constructs a new SpeechContext. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.ISpeechContext); + + /** SpeechContext phrases. */ + public phrases: string[]; + + /** SpeechContext boost. */ + public boost: number; + + /** + * Creates a new SpeechContext instance using the specified properties. + * @param [properties] Properties to set + * @returns SpeechContext instance + */ + public static create(properties?: google.cloud.speech.v1.ISpeechContext): google.cloud.speech.v1.SpeechContext; + + /** + * Encodes the specified SpeechContext message. Does not implicitly {@link google.cloud.speech.v1.SpeechContext.verify|verify} messages. + * @param message SpeechContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.ISpeechContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpeechContext message, length delimited. Does not implicitly {@link google.cloud.speech.v1.SpeechContext.verify|verify} messages. + * @param message SpeechContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.ISpeechContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpeechContext message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpeechContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.SpeechContext; + + /** + * Decodes a SpeechContext message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpeechContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.SpeechContext; + + /** + * Verifies a SpeechContext message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpeechContext message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpeechContext + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.SpeechContext; + + /** + * Creates a plain object from a SpeechContext message. Also converts values to other types if specified. + * @param message SpeechContext + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.SpeechContext, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpeechContext to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpeechContext + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RecognitionAudio. */ + interface IRecognitionAudio { + + /** RecognitionAudio content */ + content?: (Uint8Array|Buffer|string|null); + + /** RecognitionAudio uri */ + uri?: (string|null); + } + + /** Represents a RecognitionAudio. */ + class RecognitionAudio implements IRecognitionAudio { + + /** + * Constructs a new RecognitionAudio. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.IRecognitionAudio); + + /** RecognitionAudio content. */ + public content?: (Uint8Array|Buffer|string|null); + + /** RecognitionAudio uri. */ + public uri?: (string|null); + + /** RecognitionAudio audioSource. */ + public audioSource?: ("content"|"uri"); + + /** + * Creates a new RecognitionAudio instance using the specified properties. + * @param [properties] Properties to set + * @returns RecognitionAudio instance + */ + public static create(properties?: google.cloud.speech.v1.IRecognitionAudio): google.cloud.speech.v1.RecognitionAudio; + + /** + * Encodes the specified RecognitionAudio message. Does not implicitly {@link google.cloud.speech.v1.RecognitionAudio.verify|verify} messages. + * @param message RecognitionAudio message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.IRecognitionAudio, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RecognitionAudio message, length delimited. Does not implicitly {@link google.cloud.speech.v1.RecognitionAudio.verify|verify} messages. + * @param message RecognitionAudio message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.IRecognitionAudio, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RecognitionAudio message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RecognitionAudio + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.RecognitionAudio; + + /** + * Decodes a RecognitionAudio message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RecognitionAudio + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.RecognitionAudio; + + /** + * Verifies a RecognitionAudio message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RecognitionAudio message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RecognitionAudio + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.RecognitionAudio; + + /** + * Creates a plain object from a RecognitionAudio message. Also converts values to other types if specified. + * @param message RecognitionAudio + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.RecognitionAudio, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RecognitionAudio to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RecognitionAudio + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RecognizeResponse. */ + interface IRecognizeResponse { + + /** RecognizeResponse results */ + results?: (google.cloud.speech.v1.ISpeechRecognitionResult[]|null); + + /** RecognizeResponse totalBilledTime */ + totalBilledTime?: (google.protobuf.IDuration|null); + + /** RecognizeResponse speechAdaptationInfo */ + speechAdaptationInfo?: (google.cloud.speech.v1.ISpeechAdaptationInfo|null); + + /** RecognizeResponse requestId */ + requestId?: (number|Long|string|null); + } + + /** Represents a RecognizeResponse. */ + class RecognizeResponse implements IRecognizeResponse { + + /** + * Constructs a new RecognizeResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.IRecognizeResponse); + + /** RecognizeResponse results. */ + public results: google.cloud.speech.v1.ISpeechRecognitionResult[]; + + /** RecognizeResponse totalBilledTime. */ + public totalBilledTime?: (google.protobuf.IDuration|null); + + /** RecognizeResponse speechAdaptationInfo. */ + public speechAdaptationInfo?: (google.cloud.speech.v1.ISpeechAdaptationInfo|null); + + /** RecognizeResponse requestId. */ + public requestId: (number|Long|string); + + /** + * Creates a new RecognizeResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RecognizeResponse instance + */ + public static create(properties?: google.cloud.speech.v1.IRecognizeResponse): google.cloud.speech.v1.RecognizeResponse; + + /** + * Encodes the specified RecognizeResponse message. Does not implicitly {@link google.cloud.speech.v1.RecognizeResponse.verify|verify} messages. + * @param message RecognizeResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.IRecognizeResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RecognizeResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v1.RecognizeResponse.verify|verify} messages. + * @param message RecognizeResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.IRecognizeResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RecognizeResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RecognizeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.RecognizeResponse; + + /** + * Decodes a RecognizeResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RecognizeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.RecognizeResponse; + + /** + * Verifies a RecognizeResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RecognizeResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RecognizeResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.RecognizeResponse; + + /** + * Creates a plain object from a RecognizeResponse message. Also converts values to other types if specified. + * @param message RecognizeResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.RecognizeResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RecognizeResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RecognizeResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LongRunningRecognizeResponse. */ + interface ILongRunningRecognizeResponse { + + /** LongRunningRecognizeResponse results */ + results?: (google.cloud.speech.v1.ISpeechRecognitionResult[]|null); + + /** LongRunningRecognizeResponse totalBilledTime */ + totalBilledTime?: (google.protobuf.IDuration|null); + + /** LongRunningRecognizeResponse outputConfig */ + outputConfig?: (google.cloud.speech.v1.ITranscriptOutputConfig|null); + + /** LongRunningRecognizeResponse outputError */ + outputError?: (google.rpc.IStatus|null); + + /** LongRunningRecognizeResponse speechAdaptationInfo */ + speechAdaptationInfo?: (google.cloud.speech.v1.ISpeechAdaptationInfo|null); + + /** LongRunningRecognizeResponse requestId */ + requestId?: (number|Long|string|null); + } + + /** Represents a LongRunningRecognizeResponse. */ + class LongRunningRecognizeResponse implements ILongRunningRecognizeResponse { + + /** + * Constructs a new LongRunningRecognizeResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.ILongRunningRecognizeResponse); + + /** LongRunningRecognizeResponse results. */ + public results: google.cloud.speech.v1.ISpeechRecognitionResult[]; + + /** LongRunningRecognizeResponse totalBilledTime. */ + public totalBilledTime?: (google.protobuf.IDuration|null); + + /** LongRunningRecognizeResponse outputConfig. */ + public outputConfig?: (google.cloud.speech.v1.ITranscriptOutputConfig|null); + + /** LongRunningRecognizeResponse outputError. */ + public outputError?: (google.rpc.IStatus|null); + + /** LongRunningRecognizeResponse speechAdaptationInfo. */ + public speechAdaptationInfo?: (google.cloud.speech.v1.ISpeechAdaptationInfo|null); + + /** LongRunningRecognizeResponse requestId. */ + public requestId: (number|Long|string); + + /** + * Creates a new LongRunningRecognizeResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns LongRunningRecognizeResponse instance + */ + public static create(properties?: google.cloud.speech.v1.ILongRunningRecognizeResponse): google.cloud.speech.v1.LongRunningRecognizeResponse; + + /** + * Encodes the specified LongRunningRecognizeResponse message. Does not implicitly {@link google.cloud.speech.v1.LongRunningRecognizeResponse.verify|verify} messages. + * @param message LongRunningRecognizeResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.ILongRunningRecognizeResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LongRunningRecognizeResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v1.LongRunningRecognizeResponse.verify|verify} messages. + * @param message LongRunningRecognizeResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.ILongRunningRecognizeResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LongRunningRecognizeResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LongRunningRecognizeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.LongRunningRecognizeResponse; + + /** + * Decodes a LongRunningRecognizeResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LongRunningRecognizeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.LongRunningRecognizeResponse; + + /** + * Verifies a LongRunningRecognizeResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LongRunningRecognizeResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LongRunningRecognizeResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.LongRunningRecognizeResponse; + + /** + * Creates a plain object from a LongRunningRecognizeResponse message. Also converts values to other types if specified. + * @param message LongRunningRecognizeResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.LongRunningRecognizeResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LongRunningRecognizeResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LongRunningRecognizeResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LongRunningRecognizeMetadata. */ + interface ILongRunningRecognizeMetadata { + + /** LongRunningRecognizeMetadata progressPercent */ + progressPercent?: (number|null); + + /** LongRunningRecognizeMetadata startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** LongRunningRecognizeMetadata lastUpdateTime */ + lastUpdateTime?: (google.protobuf.ITimestamp|null); + + /** LongRunningRecognizeMetadata uri */ + uri?: (string|null); + } + + /** Represents a LongRunningRecognizeMetadata. */ + class LongRunningRecognizeMetadata implements ILongRunningRecognizeMetadata { + + /** + * Constructs a new LongRunningRecognizeMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.ILongRunningRecognizeMetadata); + + /** LongRunningRecognizeMetadata progressPercent. */ + public progressPercent: number; + + /** LongRunningRecognizeMetadata startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** LongRunningRecognizeMetadata lastUpdateTime. */ + public lastUpdateTime?: (google.protobuf.ITimestamp|null); + + /** LongRunningRecognizeMetadata uri. */ + public uri: string; + + /** + * Creates a new LongRunningRecognizeMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns LongRunningRecognizeMetadata instance + */ + public static create(properties?: google.cloud.speech.v1.ILongRunningRecognizeMetadata): google.cloud.speech.v1.LongRunningRecognizeMetadata; + + /** + * Encodes the specified LongRunningRecognizeMetadata message. Does not implicitly {@link google.cloud.speech.v1.LongRunningRecognizeMetadata.verify|verify} messages. + * @param message LongRunningRecognizeMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.ILongRunningRecognizeMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LongRunningRecognizeMetadata message, length delimited. Does not implicitly {@link google.cloud.speech.v1.LongRunningRecognizeMetadata.verify|verify} messages. + * @param message LongRunningRecognizeMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.ILongRunningRecognizeMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LongRunningRecognizeMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LongRunningRecognizeMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.LongRunningRecognizeMetadata; + + /** + * Decodes a LongRunningRecognizeMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LongRunningRecognizeMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.LongRunningRecognizeMetadata; + + /** + * Verifies a LongRunningRecognizeMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LongRunningRecognizeMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LongRunningRecognizeMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.LongRunningRecognizeMetadata; + + /** + * Creates a plain object from a LongRunningRecognizeMetadata message. Also converts values to other types if specified. + * @param message LongRunningRecognizeMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.LongRunningRecognizeMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LongRunningRecognizeMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LongRunningRecognizeMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StreamingRecognizeResponse. */ + interface IStreamingRecognizeResponse { + + /** StreamingRecognizeResponse error */ + error?: (google.rpc.IStatus|null); + + /** StreamingRecognizeResponse results */ + results?: (google.cloud.speech.v1.IStreamingRecognitionResult[]|null); + + /** StreamingRecognizeResponse speechEventType */ + speechEventType?: (google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType|keyof typeof google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType|null); + + /** StreamingRecognizeResponse speechEventTime */ + speechEventTime?: (google.protobuf.IDuration|null); + + /** StreamingRecognizeResponse totalBilledTime */ + totalBilledTime?: (google.protobuf.IDuration|null); + + /** StreamingRecognizeResponse speechAdaptationInfo */ + speechAdaptationInfo?: (google.cloud.speech.v1.ISpeechAdaptationInfo|null); + + /** StreamingRecognizeResponse requestId */ + requestId?: (number|Long|string|null); + } + + /** Represents a StreamingRecognizeResponse. */ + class StreamingRecognizeResponse implements IStreamingRecognizeResponse { + + /** + * Constructs a new StreamingRecognizeResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.IStreamingRecognizeResponse); + + /** StreamingRecognizeResponse error. */ + public error?: (google.rpc.IStatus|null); + + /** StreamingRecognizeResponse results. */ + public results: google.cloud.speech.v1.IStreamingRecognitionResult[]; + + /** StreamingRecognizeResponse speechEventType. */ + public speechEventType: (google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType|keyof typeof google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType); + + /** StreamingRecognizeResponse speechEventTime. */ + public speechEventTime?: (google.protobuf.IDuration|null); + + /** StreamingRecognizeResponse totalBilledTime. */ + public totalBilledTime?: (google.protobuf.IDuration|null); + + /** StreamingRecognizeResponse speechAdaptationInfo. */ + public speechAdaptationInfo?: (google.cloud.speech.v1.ISpeechAdaptationInfo|null); + + /** StreamingRecognizeResponse requestId. */ + public requestId: (number|Long|string); + + /** + * Creates a new StreamingRecognizeResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingRecognizeResponse instance + */ + public static create(properties?: google.cloud.speech.v1.IStreamingRecognizeResponse): google.cloud.speech.v1.StreamingRecognizeResponse; + + /** + * Encodes the specified StreamingRecognizeResponse message. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognizeResponse.verify|verify} messages. + * @param message StreamingRecognizeResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.IStreamingRecognizeResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamingRecognizeResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognizeResponse.verify|verify} messages. + * @param message StreamingRecognizeResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.IStreamingRecognizeResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamingRecognizeResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingRecognizeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.StreamingRecognizeResponse; + + /** + * Decodes a StreamingRecognizeResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingRecognizeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.StreamingRecognizeResponse; + + /** + * Verifies a StreamingRecognizeResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamingRecognizeResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingRecognizeResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.StreamingRecognizeResponse; + + /** + * Creates a plain object from a StreamingRecognizeResponse message. Also converts values to other types if specified. + * @param message StreamingRecognizeResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.StreamingRecognizeResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamingRecognizeResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamingRecognizeResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace StreamingRecognizeResponse { + + /** SpeechEventType enum. */ + enum SpeechEventType { + SPEECH_EVENT_UNSPECIFIED = 0, + END_OF_SINGLE_UTTERANCE = 1, + SPEECH_ACTIVITY_BEGIN = 2, + SPEECH_ACTIVITY_END = 3, + SPEECH_ACTIVITY_TIMEOUT = 4 + } + } + + /** Properties of a StreamingRecognitionResult. */ + interface IStreamingRecognitionResult { + + /** StreamingRecognitionResult alternatives */ + alternatives?: (google.cloud.speech.v1.ISpeechRecognitionAlternative[]|null); + + /** StreamingRecognitionResult isFinal */ + isFinal?: (boolean|null); + + /** StreamingRecognitionResult stability */ + stability?: (number|null); + + /** StreamingRecognitionResult resultEndTime */ + resultEndTime?: (google.protobuf.IDuration|null); + + /** StreamingRecognitionResult channelTag */ + channelTag?: (number|null); + + /** StreamingRecognitionResult languageCode */ + languageCode?: (string|null); + } + + /** Represents a StreamingRecognitionResult. */ + class StreamingRecognitionResult implements IStreamingRecognitionResult { + + /** + * Constructs a new StreamingRecognitionResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.IStreamingRecognitionResult); + + /** StreamingRecognitionResult alternatives. */ + public alternatives: google.cloud.speech.v1.ISpeechRecognitionAlternative[]; + + /** StreamingRecognitionResult isFinal. */ + public isFinal: boolean; + + /** StreamingRecognitionResult stability. */ + public stability: number; + + /** StreamingRecognitionResult resultEndTime. */ + public resultEndTime?: (google.protobuf.IDuration|null); + + /** StreamingRecognitionResult channelTag. */ + public channelTag: number; + + /** StreamingRecognitionResult languageCode. */ + public languageCode: string; + + /** + * Creates a new StreamingRecognitionResult instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingRecognitionResult instance + */ + public static create(properties?: google.cloud.speech.v1.IStreamingRecognitionResult): google.cloud.speech.v1.StreamingRecognitionResult; + + /** + * Encodes the specified StreamingRecognitionResult message. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognitionResult.verify|verify} messages. + * @param message StreamingRecognitionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.IStreamingRecognitionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamingRecognitionResult message, length delimited. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognitionResult.verify|verify} messages. + * @param message StreamingRecognitionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.IStreamingRecognitionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamingRecognitionResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingRecognitionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.StreamingRecognitionResult; + + /** + * Decodes a StreamingRecognitionResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingRecognitionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.StreamingRecognitionResult; + + /** + * Verifies a StreamingRecognitionResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamingRecognitionResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingRecognitionResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.StreamingRecognitionResult; + + /** + * Creates a plain object from a StreamingRecognitionResult message. Also converts values to other types if specified. + * @param message StreamingRecognitionResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.StreamingRecognitionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamingRecognitionResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamingRecognitionResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpeechRecognitionResult. */ + interface ISpeechRecognitionResult { + + /** SpeechRecognitionResult alternatives */ + alternatives?: (google.cloud.speech.v1.ISpeechRecognitionAlternative[]|null); + + /** SpeechRecognitionResult channelTag */ + channelTag?: (number|null); + + /** SpeechRecognitionResult resultEndTime */ + resultEndTime?: (google.protobuf.IDuration|null); + + /** SpeechRecognitionResult languageCode */ + languageCode?: (string|null); + } + + /** Represents a SpeechRecognitionResult. */ + class SpeechRecognitionResult implements ISpeechRecognitionResult { + + /** + * Constructs a new SpeechRecognitionResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.ISpeechRecognitionResult); + + /** SpeechRecognitionResult alternatives. */ + public alternatives: google.cloud.speech.v1.ISpeechRecognitionAlternative[]; + + /** SpeechRecognitionResult channelTag. */ + public channelTag: number; + + /** SpeechRecognitionResult resultEndTime. */ + public resultEndTime?: (google.protobuf.IDuration|null); + + /** SpeechRecognitionResult languageCode. */ + public languageCode: string; + + /** + * Creates a new SpeechRecognitionResult instance using the specified properties. + * @param [properties] Properties to set + * @returns SpeechRecognitionResult instance + */ + public static create(properties?: google.cloud.speech.v1.ISpeechRecognitionResult): google.cloud.speech.v1.SpeechRecognitionResult; + + /** + * Encodes the specified SpeechRecognitionResult message. Does not implicitly {@link google.cloud.speech.v1.SpeechRecognitionResult.verify|verify} messages. + * @param message SpeechRecognitionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.ISpeechRecognitionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpeechRecognitionResult message, length delimited. Does not implicitly {@link google.cloud.speech.v1.SpeechRecognitionResult.verify|verify} messages. + * @param message SpeechRecognitionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.ISpeechRecognitionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpeechRecognitionResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpeechRecognitionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.SpeechRecognitionResult; + + /** + * Decodes a SpeechRecognitionResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpeechRecognitionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.SpeechRecognitionResult; + + /** + * Verifies a SpeechRecognitionResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpeechRecognitionResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpeechRecognitionResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.SpeechRecognitionResult; + + /** + * Creates a plain object from a SpeechRecognitionResult message. Also converts values to other types if specified. + * @param message SpeechRecognitionResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.SpeechRecognitionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpeechRecognitionResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpeechRecognitionResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpeechRecognitionAlternative. */ + interface ISpeechRecognitionAlternative { + + /** SpeechRecognitionAlternative transcript */ + transcript?: (string|null); + + /** SpeechRecognitionAlternative confidence */ + confidence?: (number|null); + + /** SpeechRecognitionAlternative words */ + words?: (google.cloud.speech.v1.IWordInfo[]|null); + } + + /** Represents a SpeechRecognitionAlternative. */ + class SpeechRecognitionAlternative implements ISpeechRecognitionAlternative { + + /** + * Constructs a new SpeechRecognitionAlternative. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.ISpeechRecognitionAlternative); + + /** SpeechRecognitionAlternative transcript. */ + public transcript: string; + + /** SpeechRecognitionAlternative confidence. */ + public confidence: number; + + /** SpeechRecognitionAlternative words. */ + public words: google.cloud.speech.v1.IWordInfo[]; + + /** + * Creates a new SpeechRecognitionAlternative instance using the specified properties. + * @param [properties] Properties to set + * @returns SpeechRecognitionAlternative instance + */ + public static create(properties?: google.cloud.speech.v1.ISpeechRecognitionAlternative): google.cloud.speech.v1.SpeechRecognitionAlternative; + + /** + * Encodes the specified SpeechRecognitionAlternative message. Does not implicitly {@link google.cloud.speech.v1.SpeechRecognitionAlternative.verify|verify} messages. + * @param message SpeechRecognitionAlternative message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.ISpeechRecognitionAlternative, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpeechRecognitionAlternative message, length delimited. Does not implicitly {@link google.cloud.speech.v1.SpeechRecognitionAlternative.verify|verify} messages. + * @param message SpeechRecognitionAlternative message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.ISpeechRecognitionAlternative, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpeechRecognitionAlternative message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpeechRecognitionAlternative + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.SpeechRecognitionAlternative; + + /** + * Decodes a SpeechRecognitionAlternative message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpeechRecognitionAlternative + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.SpeechRecognitionAlternative; + + /** + * Verifies a SpeechRecognitionAlternative message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpeechRecognitionAlternative message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpeechRecognitionAlternative + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.SpeechRecognitionAlternative; + + /** + * Creates a plain object from a SpeechRecognitionAlternative message. Also converts values to other types if specified. + * @param message SpeechRecognitionAlternative + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.SpeechRecognitionAlternative, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpeechRecognitionAlternative to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpeechRecognitionAlternative + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WordInfo. */ + interface IWordInfo { + + /** WordInfo startTime */ + startTime?: (google.protobuf.IDuration|null); + + /** WordInfo endTime */ + endTime?: (google.protobuf.IDuration|null); + + /** WordInfo word */ + word?: (string|null); + + /** WordInfo confidence */ + confidence?: (number|null); + + /** WordInfo speakerTag */ + speakerTag?: (number|null); + + /** WordInfo speakerLabel */ + speakerLabel?: (string|null); + } + + /** Represents a WordInfo. */ + class WordInfo implements IWordInfo { + + /** + * Constructs a new WordInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.IWordInfo); + + /** WordInfo startTime. */ + public startTime?: (google.protobuf.IDuration|null); + + /** WordInfo endTime. */ + public endTime?: (google.protobuf.IDuration|null); + + /** WordInfo word. */ + public word: string; + + /** WordInfo confidence. */ + public confidence: number; + + /** WordInfo speakerTag. */ + public speakerTag: number; + + /** WordInfo speakerLabel. */ + public speakerLabel: string; + + /** + * Creates a new WordInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns WordInfo instance + */ + public static create(properties?: google.cloud.speech.v1.IWordInfo): google.cloud.speech.v1.WordInfo; + + /** + * Encodes the specified WordInfo message. Does not implicitly {@link google.cloud.speech.v1.WordInfo.verify|verify} messages. + * @param message WordInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.IWordInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WordInfo message, length delimited. Does not implicitly {@link google.cloud.speech.v1.WordInfo.verify|verify} messages. + * @param message WordInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.IWordInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WordInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WordInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.WordInfo; + + /** + * Decodes a WordInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WordInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.WordInfo; + + /** + * Verifies a WordInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WordInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WordInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.WordInfo; + + /** + * Creates a plain object from a WordInfo message. Also converts values to other types if specified. + * @param message WordInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.WordInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WordInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WordInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpeechAdaptationInfo. */ + interface ISpeechAdaptationInfo { + + /** SpeechAdaptationInfo adaptationTimeout */ + adaptationTimeout?: (boolean|null); + + /** SpeechAdaptationInfo timeoutMessage */ + timeoutMessage?: (string|null); + } + + /** Represents a SpeechAdaptationInfo. */ + class SpeechAdaptationInfo implements ISpeechAdaptationInfo { + + /** + * Constructs a new SpeechAdaptationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.ISpeechAdaptationInfo); + + /** SpeechAdaptationInfo adaptationTimeout. */ + public adaptationTimeout: boolean; + + /** SpeechAdaptationInfo timeoutMessage. */ + public timeoutMessage: string; + + /** + * Creates a new SpeechAdaptationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SpeechAdaptationInfo instance + */ + public static create(properties?: google.cloud.speech.v1.ISpeechAdaptationInfo): google.cloud.speech.v1.SpeechAdaptationInfo; + + /** + * Encodes the specified SpeechAdaptationInfo message. Does not implicitly {@link google.cloud.speech.v1.SpeechAdaptationInfo.verify|verify} messages. + * @param message SpeechAdaptationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.ISpeechAdaptationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpeechAdaptationInfo message, length delimited. Does not implicitly {@link google.cloud.speech.v1.SpeechAdaptationInfo.verify|verify} messages. + * @param message SpeechAdaptationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.ISpeechAdaptationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpeechAdaptationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpeechAdaptationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.SpeechAdaptationInfo; + + /** + * Decodes a SpeechAdaptationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpeechAdaptationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.SpeechAdaptationInfo; + + /** + * Verifies a SpeechAdaptationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpeechAdaptationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpeechAdaptationInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.SpeechAdaptationInfo; + + /** + * Creates a plain object from a SpeechAdaptationInfo message. Also converts values to other types if specified. + * @param message SpeechAdaptationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.SpeechAdaptationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpeechAdaptationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpeechAdaptationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomClass. */ + interface ICustomClass { + + /** CustomClass name */ + name?: (string|null); + + /** CustomClass customClassId */ + customClassId?: (string|null); + + /** CustomClass items */ + items?: (google.cloud.speech.v1.CustomClass.IClassItem[]|null); + } + + /** Represents a CustomClass. */ + class CustomClass implements ICustomClass { + + /** + * Constructs a new CustomClass. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.ICustomClass); + + /** CustomClass name. */ + public name: string; + + /** CustomClass customClassId. */ + public customClassId: string; + + /** CustomClass items. */ + public items: google.cloud.speech.v1.CustomClass.IClassItem[]; + + /** + * Creates a new CustomClass instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomClass instance + */ + public static create(properties?: google.cloud.speech.v1.ICustomClass): google.cloud.speech.v1.CustomClass; + + /** + * Encodes the specified CustomClass message. Does not implicitly {@link google.cloud.speech.v1.CustomClass.verify|verify} messages. + * @param message CustomClass message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.ICustomClass, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomClass message, length delimited. Does not implicitly {@link google.cloud.speech.v1.CustomClass.verify|verify} messages. + * @param message CustomClass message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.ICustomClass, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomClass message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomClass + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.CustomClass; + + /** + * Decodes a CustomClass message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomClass + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.CustomClass; + + /** + * Verifies a CustomClass message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomClass message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomClass + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.CustomClass; + + /** + * Creates a plain object from a CustomClass message. Also converts values to other types if specified. + * @param message CustomClass + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.CustomClass, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomClass to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomClass + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CustomClass { + + /** Properties of a ClassItem. */ + interface IClassItem { + + /** ClassItem value */ + value?: (string|null); + } + + /** Represents a ClassItem. */ + class ClassItem implements IClassItem { + + /** + * Constructs a new ClassItem. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.CustomClass.IClassItem); + + /** ClassItem value. */ + public value: string; + + /** + * Creates a new ClassItem instance using the specified properties. + * @param [properties] Properties to set + * @returns ClassItem instance + */ + public static create(properties?: google.cloud.speech.v1.CustomClass.IClassItem): google.cloud.speech.v1.CustomClass.ClassItem; + + /** + * Encodes the specified ClassItem message. Does not implicitly {@link google.cloud.speech.v1.CustomClass.ClassItem.verify|verify} messages. + * @param message ClassItem message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.CustomClass.IClassItem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClassItem message, length delimited. Does not implicitly {@link google.cloud.speech.v1.CustomClass.ClassItem.verify|verify} messages. + * @param message ClassItem message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.CustomClass.IClassItem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClassItem message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClassItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.CustomClass.ClassItem; + + /** + * Decodes a ClassItem message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClassItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.CustomClass.ClassItem; + + /** + * Verifies a ClassItem message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClassItem message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClassItem + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.CustomClass.ClassItem; + + /** + * Creates a plain object from a ClassItem message. Also converts values to other types if specified. + * @param message ClassItem + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.CustomClass.ClassItem, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClassItem to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClassItem + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a PhraseSet. */ + interface IPhraseSet { + + /** PhraseSet name */ + name?: (string|null); + + /** PhraseSet phrases */ + phrases?: (google.cloud.speech.v1.PhraseSet.IPhrase[]|null); + + /** PhraseSet boost */ + boost?: (number|null); + } + + /** Represents a PhraseSet. */ + class PhraseSet implements IPhraseSet { + + /** + * Constructs a new PhraseSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.IPhraseSet); + + /** PhraseSet name. */ + public name: string; + + /** PhraseSet phrases. */ + public phrases: google.cloud.speech.v1.PhraseSet.IPhrase[]; + + /** PhraseSet boost. */ + public boost: number; + + /** + * Creates a new PhraseSet instance using the specified properties. + * @param [properties] Properties to set + * @returns PhraseSet instance + */ + public static create(properties?: google.cloud.speech.v1.IPhraseSet): google.cloud.speech.v1.PhraseSet; + + /** + * Encodes the specified PhraseSet message. Does not implicitly {@link google.cloud.speech.v1.PhraseSet.verify|verify} messages. + * @param message PhraseSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.IPhraseSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PhraseSet message, length delimited. Does not implicitly {@link google.cloud.speech.v1.PhraseSet.verify|verify} messages. + * @param message PhraseSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.IPhraseSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PhraseSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PhraseSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.PhraseSet; + + /** + * Decodes a PhraseSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PhraseSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.PhraseSet; + + /** + * Verifies a PhraseSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PhraseSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PhraseSet + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.PhraseSet; + + /** + * Creates a plain object from a PhraseSet message. Also converts values to other types if specified. + * @param message PhraseSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.PhraseSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PhraseSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PhraseSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PhraseSet { + + /** Properties of a Phrase. */ + interface IPhrase { + + /** Phrase value */ + value?: (string|null); + + /** Phrase boost */ + boost?: (number|null); + } + + /** Represents a Phrase. */ + class Phrase implements IPhrase { + + /** + * Constructs a new Phrase. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.PhraseSet.IPhrase); + + /** Phrase value. */ + public value: string; + + /** Phrase boost. */ + public boost: number; + + /** + * Creates a new Phrase instance using the specified properties. + * @param [properties] Properties to set + * @returns Phrase instance + */ + public static create(properties?: google.cloud.speech.v1.PhraseSet.IPhrase): google.cloud.speech.v1.PhraseSet.Phrase; + + /** + * Encodes the specified Phrase message. Does not implicitly {@link google.cloud.speech.v1.PhraseSet.Phrase.verify|verify} messages. + * @param message Phrase message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.PhraseSet.IPhrase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Phrase message, length delimited. Does not implicitly {@link google.cloud.speech.v1.PhraseSet.Phrase.verify|verify} messages. + * @param message Phrase message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.PhraseSet.IPhrase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Phrase message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Phrase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.PhraseSet.Phrase; + + /** + * Decodes a Phrase message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Phrase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.PhraseSet.Phrase; + + /** + * Verifies a Phrase message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Phrase message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Phrase + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.PhraseSet.Phrase; + + /** + * Creates a plain object from a Phrase message. Also converts values to other types if specified. + * @param message Phrase + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.PhraseSet.Phrase, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Phrase to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Phrase + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SpeechAdaptation. */ + interface ISpeechAdaptation { + + /** SpeechAdaptation phraseSets */ + phraseSets?: (google.cloud.speech.v1.IPhraseSet[]|null); + + /** SpeechAdaptation phraseSetReferences */ + phraseSetReferences?: (string[]|null); + + /** SpeechAdaptation customClasses */ + customClasses?: (google.cloud.speech.v1.ICustomClass[]|null); + + /** SpeechAdaptation abnfGrammar */ + abnfGrammar?: (google.cloud.speech.v1.SpeechAdaptation.IABNFGrammar|null); + } + + /** Represents a SpeechAdaptation. */ + class SpeechAdaptation implements ISpeechAdaptation { + + /** + * Constructs a new SpeechAdaptation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.ISpeechAdaptation); + + /** SpeechAdaptation phraseSets. */ + public phraseSets: google.cloud.speech.v1.IPhraseSet[]; + + /** SpeechAdaptation phraseSetReferences. */ + public phraseSetReferences: string[]; + + /** SpeechAdaptation customClasses. */ + public customClasses: google.cloud.speech.v1.ICustomClass[]; + + /** SpeechAdaptation abnfGrammar. */ + public abnfGrammar?: (google.cloud.speech.v1.SpeechAdaptation.IABNFGrammar|null); + + /** + * Creates a new SpeechAdaptation instance using the specified properties. + * @param [properties] Properties to set + * @returns SpeechAdaptation instance + */ + public static create(properties?: google.cloud.speech.v1.ISpeechAdaptation): google.cloud.speech.v1.SpeechAdaptation; + + /** + * Encodes the specified SpeechAdaptation message. Does not implicitly {@link google.cloud.speech.v1.SpeechAdaptation.verify|verify} messages. + * @param message SpeechAdaptation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.ISpeechAdaptation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpeechAdaptation message, length delimited. Does not implicitly {@link google.cloud.speech.v1.SpeechAdaptation.verify|verify} messages. + * @param message SpeechAdaptation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.ISpeechAdaptation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpeechAdaptation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpeechAdaptation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.SpeechAdaptation; + + /** + * Decodes a SpeechAdaptation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpeechAdaptation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.SpeechAdaptation; + + /** + * Verifies a SpeechAdaptation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpeechAdaptation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpeechAdaptation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.SpeechAdaptation; + + /** + * Creates a plain object from a SpeechAdaptation message. Also converts values to other types if specified. + * @param message SpeechAdaptation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.SpeechAdaptation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpeechAdaptation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpeechAdaptation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SpeechAdaptation { + + /** Properties of a ABNFGrammar. */ + interface IABNFGrammar { + + /** ABNFGrammar abnfStrings */ + abnfStrings?: (string[]|null); + } + + /** Represents a ABNFGrammar. */ + class ABNFGrammar implements IABNFGrammar { + + /** + * Constructs a new ABNFGrammar. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.SpeechAdaptation.IABNFGrammar); + + /** ABNFGrammar abnfStrings. */ + public abnfStrings: string[]; + + /** + * Creates a new ABNFGrammar instance using the specified properties. + * @param [properties] Properties to set + * @returns ABNFGrammar instance + */ + public static create(properties?: google.cloud.speech.v1.SpeechAdaptation.IABNFGrammar): google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar; + + /** + * Encodes the specified ABNFGrammar message. Does not implicitly {@link google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar.verify|verify} messages. + * @param message ABNFGrammar message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.SpeechAdaptation.IABNFGrammar, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ABNFGrammar message, length delimited. Does not implicitly {@link google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar.verify|verify} messages. + * @param message ABNFGrammar message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.SpeechAdaptation.IABNFGrammar, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ABNFGrammar message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ABNFGrammar + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar; + + /** + * Decodes a ABNFGrammar message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ABNFGrammar + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar; + + /** + * Verifies a ABNFGrammar message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ABNFGrammar message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ABNFGrammar + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar; + + /** + * Creates a plain object from a ABNFGrammar message. Also converts values to other types if specified. + * @param message ABNFGrammar + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ABNFGrammar to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ABNFGrammar + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a TranscriptNormalization. */ + interface ITranscriptNormalization { + + /** TranscriptNormalization entries */ + entries?: (google.cloud.speech.v1.TranscriptNormalization.IEntry[]|null); + } + + /** Represents a TranscriptNormalization. */ + class TranscriptNormalization implements ITranscriptNormalization { + + /** + * Constructs a new TranscriptNormalization. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.ITranscriptNormalization); + + /** TranscriptNormalization entries. */ + public entries: google.cloud.speech.v1.TranscriptNormalization.IEntry[]; + + /** + * Creates a new TranscriptNormalization instance using the specified properties. + * @param [properties] Properties to set + * @returns TranscriptNormalization instance + */ + public static create(properties?: google.cloud.speech.v1.ITranscriptNormalization): google.cloud.speech.v1.TranscriptNormalization; + + /** + * Encodes the specified TranscriptNormalization message. Does not implicitly {@link google.cloud.speech.v1.TranscriptNormalization.verify|verify} messages. + * @param message TranscriptNormalization message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.ITranscriptNormalization, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TranscriptNormalization message, length delimited. Does not implicitly {@link google.cloud.speech.v1.TranscriptNormalization.verify|verify} messages. + * @param message TranscriptNormalization message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.ITranscriptNormalization, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TranscriptNormalization message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TranscriptNormalization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.TranscriptNormalization; + + /** + * Decodes a TranscriptNormalization message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TranscriptNormalization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.TranscriptNormalization; + + /** + * Verifies a TranscriptNormalization message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TranscriptNormalization message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TranscriptNormalization + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.TranscriptNormalization; + + /** + * Creates a plain object from a TranscriptNormalization message. Also converts values to other types if specified. + * @param message TranscriptNormalization + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.TranscriptNormalization, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TranscriptNormalization to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TranscriptNormalization + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TranscriptNormalization { + + /** Properties of an Entry. */ + interface IEntry { + + /** Entry search */ + search?: (string|null); + + /** Entry replace */ + replace?: (string|null); + + /** Entry caseSensitive */ + caseSensitive?: (boolean|null); + } + + /** Represents an Entry. */ + class Entry implements IEntry { + + /** + * Constructs a new Entry. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.TranscriptNormalization.IEntry); + + /** Entry search. */ + public search: string; + + /** Entry replace. */ + public replace: string; + + /** Entry caseSensitive. */ + public caseSensitive: boolean; + + /** + * Creates a new Entry instance using the specified properties. + * @param [properties] Properties to set + * @returns Entry instance + */ + public static create(properties?: google.cloud.speech.v1.TranscriptNormalization.IEntry): google.cloud.speech.v1.TranscriptNormalization.Entry; + + /** + * Encodes the specified Entry message. Does not implicitly {@link google.cloud.speech.v1.TranscriptNormalization.Entry.verify|verify} messages. + * @param message Entry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.TranscriptNormalization.IEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Entry message, length delimited. Does not implicitly {@link google.cloud.speech.v1.TranscriptNormalization.Entry.verify|verify} messages. + * @param message Entry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.TranscriptNormalization.IEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Entry message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Entry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.TranscriptNormalization.Entry; + + /** + * Decodes an Entry message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Entry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.TranscriptNormalization.Entry; + + /** + * Verifies an Entry message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Entry message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Entry + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.TranscriptNormalization.Entry; + + /** + * Creates a plain object from an Entry message. Also converts values to other types if specified. + * @param message Entry + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.TranscriptNormalization.Entry, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Entry to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Entry + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Represents an Adaptation */ + class Adaptation extends $protobuf.rpc.Service { + + /** + * Constructs a new Adaptation service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Adaptation service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Adaptation; + + /** + * Calls CreatePhraseSet. + * @param request CreatePhraseSetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PhraseSet + */ + public createPhraseSet(request: google.cloud.speech.v1.ICreatePhraseSetRequest, callback: google.cloud.speech.v1.Adaptation.CreatePhraseSetCallback): void; + + /** + * Calls CreatePhraseSet. + * @param request CreatePhraseSetRequest message or plain object + * @returns Promise + */ + public createPhraseSet(request: google.cloud.speech.v1.ICreatePhraseSetRequest): Promise; + + /** + * Calls GetPhraseSet. + * @param request GetPhraseSetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PhraseSet + */ + public getPhraseSet(request: google.cloud.speech.v1.IGetPhraseSetRequest, callback: google.cloud.speech.v1.Adaptation.GetPhraseSetCallback): void; + + /** + * Calls GetPhraseSet. + * @param request GetPhraseSetRequest message or plain object + * @returns Promise + */ + public getPhraseSet(request: google.cloud.speech.v1.IGetPhraseSetRequest): Promise; + + /** + * Calls ListPhraseSet. + * @param request ListPhraseSetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListPhraseSetResponse + */ + public listPhraseSet(request: google.cloud.speech.v1.IListPhraseSetRequest, callback: google.cloud.speech.v1.Adaptation.ListPhraseSetCallback): void; + + /** + * Calls ListPhraseSet. + * @param request ListPhraseSetRequest message or plain object + * @returns Promise + */ + public listPhraseSet(request: google.cloud.speech.v1.IListPhraseSetRequest): Promise; + + /** + * Calls UpdatePhraseSet. + * @param request UpdatePhraseSetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PhraseSet + */ + public updatePhraseSet(request: google.cloud.speech.v1.IUpdatePhraseSetRequest, callback: google.cloud.speech.v1.Adaptation.UpdatePhraseSetCallback): void; + + /** + * Calls UpdatePhraseSet. + * @param request UpdatePhraseSetRequest message or plain object + * @returns Promise + */ + public updatePhraseSet(request: google.cloud.speech.v1.IUpdatePhraseSetRequest): Promise; + + /** + * Calls DeletePhraseSet. + * @param request DeletePhraseSetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deletePhraseSet(request: google.cloud.speech.v1.IDeletePhraseSetRequest, callback: google.cloud.speech.v1.Adaptation.DeletePhraseSetCallback): void; + + /** + * Calls DeletePhraseSet. + * @param request DeletePhraseSetRequest message or plain object + * @returns Promise + */ + public deletePhraseSet(request: google.cloud.speech.v1.IDeletePhraseSetRequest): Promise; + + /** + * Calls CreateCustomClass. + * @param request CreateCustomClassRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CustomClass + */ + public createCustomClass(request: google.cloud.speech.v1.ICreateCustomClassRequest, callback: google.cloud.speech.v1.Adaptation.CreateCustomClassCallback): void; + + /** + * Calls CreateCustomClass. + * @param request CreateCustomClassRequest message or plain object + * @returns Promise + */ + public createCustomClass(request: google.cloud.speech.v1.ICreateCustomClassRequest): Promise; + + /** + * Calls GetCustomClass. + * @param request GetCustomClassRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CustomClass + */ + public getCustomClass(request: google.cloud.speech.v1.IGetCustomClassRequest, callback: google.cloud.speech.v1.Adaptation.GetCustomClassCallback): void; + + /** + * Calls GetCustomClass. + * @param request GetCustomClassRequest message or plain object + * @returns Promise + */ + public getCustomClass(request: google.cloud.speech.v1.IGetCustomClassRequest): Promise; + + /** + * Calls ListCustomClasses. + * @param request ListCustomClassesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListCustomClassesResponse + */ + public listCustomClasses(request: google.cloud.speech.v1.IListCustomClassesRequest, callback: google.cloud.speech.v1.Adaptation.ListCustomClassesCallback): void; + + /** + * Calls ListCustomClasses. + * @param request ListCustomClassesRequest message or plain object + * @returns Promise + */ + public listCustomClasses(request: google.cloud.speech.v1.IListCustomClassesRequest): Promise; + + /** + * Calls UpdateCustomClass. + * @param request UpdateCustomClassRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CustomClass + */ + public updateCustomClass(request: google.cloud.speech.v1.IUpdateCustomClassRequest, callback: google.cloud.speech.v1.Adaptation.UpdateCustomClassCallback): void; + + /** + * Calls UpdateCustomClass. + * @param request UpdateCustomClassRequest message or plain object + * @returns Promise + */ + public updateCustomClass(request: google.cloud.speech.v1.IUpdateCustomClassRequest): Promise; + + /** + * Calls DeleteCustomClass. + * @param request DeleteCustomClassRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteCustomClass(request: google.cloud.speech.v1.IDeleteCustomClassRequest, callback: google.cloud.speech.v1.Adaptation.DeleteCustomClassCallback): void; + + /** + * Calls DeleteCustomClass. + * @param request DeleteCustomClassRequest message or plain object + * @returns Promise + */ + public deleteCustomClass(request: google.cloud.speech.v1.IDeleteCustomClassRequest): Promise; + } + + namespace Adaptation { + + /** + * Callback as used by {@link google.cloud.speech.v1.Adaptation|createPhraseSet}. + * @param error Error, if any + * @param [response] PhraseSet + */ + type CreatePhraseSetCallback = (error: (Error|null), response?: google.cloud.speech.v1.PhraseSet) => void; + + /** + * Callback as used by {@link google.cloud.speech.v1.Adaptation|getPhraseSet}. + * @param error Error, if any + * @param [response] PhraseSet + */ + type GetPhraseSetCallback = (error: (Error|null), response?: google.cloud.speech.v1.PhraseSet) => void; + + /** + * Callback as used by {@link google.cloud.speech.v1.Adaptation|listPhraseSet}. + * @param error Error, if any + * @param [response] ListPhraseSetResponse + */ + type ListPhraseSetCallback = (error: (Error|null), response?: google.cloud.speech.v1.ListPhraseSetResponse) => void; + + /** + * Callback as used by {@link google.cloud.speech.v1.Adaptation|updatePhraseSet}. + * @param error Error, if any + * @param [response] PhraseSet + */ + type UpdatePhraseSetCallback = (error: (Error|null), response?: google.cloud.speech.v1.PhraseSet) => void; + + /** + * Callback as used by {@link google.cloud.speech.v1.Adaptation|deletePhraseSet}. + * @param error Error, if any + * @param [response] Empty + */ + type DeletePhraseSetCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.speech.v1.Adaptation|createCustomClass}. + * @param error Error, if any + * @param [response] CustomClass + */ + type CreateCustomClassCallback = (error: (Error|null), response?: google.cloud.speech.v1.CustomClass) => void; + + /** + * Callback as used by {@link google.cloud.speech.v1.Adaptation|getCustomClass}. + * @param error Error, if any + * @param [response] CustomClass + */ + type GetCustomClassCallback = (error: (Error|null), response?: google.cloud.speech.v1.CustomClass) => void; + + /** + * Callback as used by {@link google.cloud.speech.v1.Adaptation|listCustomClasses}. + * @param error Error, if any + * @param [response] ListCustomClassesResponse + */ + type ListCustomClassesCallback = (error: (Error|null), response?: google.cloud.speech.v1.ListCustomClassesResponse) => void; + + /** + * Callback as used by {@link google.cloud.speech.v1.Adaptation|updateCustomClass}. + * @param error Error, if any + * @param [response] CustomClass + */ + type UpdateCustomClassCallback = (error: (Error|null), response?: google.cloud.speech.v1.CustomClass) => void; + + /** + * Callback as used by {@link google.cloud.speech.v1.Adaptation|deleteCustomClass}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteCustomClassCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of a CreatePhraseSetRequest. */ + interface ICreatePhraseSetRequest { + + /** CreatePhraseSetRequest parent */ + parent?: (string|null); + + /** CreatePhraseSetRequest phraseSetId */ + phraseSetId?: (string|null); + + /** CreatePhraseSetRequest phraseSet */ + phraseSet?: (google.cloud.speech.v1.IPhraseSet|null); + } + + /** Represents a CreatePhraseSetRequest. */ + class CreatePhraseSetRequest implements ICreatePhraseSetRequest { + + /** + * Constructs a new CreatePhraseSetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.ICreatePhraseSetRequest); + + /** CreatePhraseSetRequest parent. */ + public parent: string; + + /** CreatePhraseSetRequest phraseSetId. */ + public phraseSetId: string; + + /** CreatePhraseSetRequest phraseSet. */ + public phraseSet?: (google.cloud.speech.v1.IPhraseSet|null); + + /** + * Creates a new CreatePhraseSetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreatePhraseSetRequest instance + */ + public static create(properties?: google.cloud.speech.v1.ICreatePhraseSetRequest): google.cloud.speech.v1.CreatePhraseSetRequest; + + /** + * Encodes the specified CreatePhraseSetRequest message. Does not implicitly {@link google.cloud.speech.v1.CreatePhraseSetRequest.verify|verify} messages. + * @param message CreatePhraseSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.ICreatePhraseSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreatePhraseSetRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.CreatePhraseSetRequest.verify|verify} messages. + * @param message CreatePhraseSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.ICreatePhraseSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreatePhraseSetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreatePhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.CreatePhraseSetRequest; + + /** + * Decodes a CreatePhraseSetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreatePhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.CreatePhraseSetRequest; + + /** + * Verifies a CreatePhraseSetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreatePhraseSetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreatePhraseSetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.CreatePhraseSetRequest; + + /** + * Creates a plain object from a CreatePhraseSetRequest message. Also converts values to other types if specified. + * @param message CreatePhraseSetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.CreatePhraseSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreatePhraseSetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreatePhraseSetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdatePhraseSetRequest. */ + interface IUpdatePhraseSetRequest { + + /** UpdatePhraseSetRequest phraseSet */ + phraseSet?: (google.cloud.speech.v1.IPhraseSet|null); + + /** UpdatePhraseSetRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdatePhraseSetRequest. */ + class UpdatePhraseSetRequest implements IUpdatePhraseSetRequest { + + /** + * Constructs a new UpdatePhraseSetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.IUpdatePhraseSetRequest); + + /** UpdatePhraseSetRequest phraseSet. */ + public phraseSet?: (google.cloud.speech.v1.IPhraseSet|null); + + /** UpdatePhraseSetRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdatePhraseSetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdatePhraseSetRequest instance + */ + public static create(properties?: google.cloud.speech.v1.IUpdatePhraseSetRequest): google.cloud.speech.v1.UpdatePhraseSetRequest; + + /** + * Encodes the specified UpdatePhraseSetRequest message. Does not implicitly {@link google.cloud.speech.v1.UpdatePhraseSetRequest.verify|verify} messages. + * @param message UpdatePhraseSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.IUpdatePhraseSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdatePhraseSetRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.UpdatePhraseSetRequest.verify|verify} messages. + * @param message UpdatePhraseSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.IUpdatePhraseSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdatePhraseSetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdatePhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.UpdatePhraseSetRequest; + + /** + * Decodes an UpdatePhraseSetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdatePhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.UpdatePhraseSetRequest; + + /** + * Verifies an UpdatePhraseSetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdatePhraseSetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdatePhraseSetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.UpdatePhraseSetRequest; + + /** + * Creates a plain object from an UpdatePhraseSetRequest message. Also converts values to other types if specified. + * @param message UpdatePhraseSetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.UpdatePhraseSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdatePhraseSetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdatePhraseSetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetPhraseSetRequest. */ + interface IGetPhraseSetRequest { + + /** GetPhraseSetRequest name */ + name?: (string|null); + } + + /** Represents a GetPhraseSetRequest. */ + class GetPhraseSetRequest implements IGetPhraseSetRequest { + + /** + * Constructs a new GetPhraseSetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.IGetPhraseSetRequest); + + /** GetPhraseSetRequest name. */ + public name: string; + + /** + * Creates a new GetPhraseSetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetPhraseSetRequest instance + */ + public static create(properties?: google.cloud.speech.v1.IGetPhraseSetRequest): google.cloud.speech.v1.GetPhraseSetRequest; + + /** + * Encodes the specified GetPhraseSetRequest message. Does not implicitly {@link google.cloud.speech.v1.GetPhraseSetRequest.verify|verify} messages. + * @param message GetPhraseSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.IGetPhraseSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetPhraseSetRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.GetPhraseSetRequest.verify|verify} messages. + * @param message GetPhraseSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.IGetPhraseSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetPhraseSetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetPhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.GetPhraseSetRequest; + + /** + * Decodes a GetPhraseSetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetPhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.GetPhraseSetRequest; + + /** + * Verifies a GetPhraseSetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetPhraseSetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetPhraseSetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.GetPhraseSetRequest; + + /** + * Creates a plain object from a GetPhraseSetRequest message. Also converts values to other types if specified. + * @param message GetPhraseSetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.GetPhraseSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetPhraseSetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetPhraseSetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListPhraseSetRequest. */ + interface IListPhraseSetRequest { + + /** ListPhraseSetRequest parent */ + parent?: (string|null); + + /** ListPhraseSetRequest pageSize */ + pageSize?: (number|null); + + /** ListPhraseSetRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListPhraseSetRequest. */ + class ListPhraseSetRequest implements IListPhraseSetRequest { + + /** + * Constructs a new ListPhraseSetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.IListPhraseSetRequest); + + /** ListPhraseSetRequest parent. */ + public parent: string; + + /** ListPhraseSetRequest pageSize. */ + public pageSize: number; + + /** ListPhraseSetRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListPhraseSetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPhraseSetRequest instance + */ + public static create(properties?: google.cloud.speech.v1.IListPhraseSetRequest): google.cloud.speech.v1.ListPhraseSetRequest; + + /** + * Encodes the specified ListPhraseSetRequest message. Does not implicitly {@link google.cloud.speech.v1.ListPhraseSetRequest.verify|verify} messages. + * @param message ListPhraseSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.IListPhraseSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPhraseSetRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.ListPhraseSetRequest.verify|verify} messages. + * @param message ListPhraseSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.IListPhraseSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPhraseSetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.ListPhraseSetRequest; + + /** + * Decodes a ListPhraseSetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.ListPhraseSetRequest; + + /** + * Verifies a ListPhraseSetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListPhraseSetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPhraseSetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.ListPhraseSetRequest; + + /** + * Creates a plain object from a ListPhraseSetRequest message. Also converts values to other types if specified. + * @param message ListPhraseSetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.ListPhraseSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPhraseSetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListPhraseSetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListPhraseSetResponse. */ + interface IListPhraseSetResponse { + + /** ListPhraseSetResponse phraseSets */ + phraseSets?: (google.cloud.speech.v1.IPhraseSet[]|null); + + /** ListPhraseSetResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListPhraseSetResponse. */ + class ListPhraseSetResponse implements IListPhraseSetResponse { + + /** + * Constructs a new ListPhraseSetResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.IListPhraseSetResponse); + + /** ListPhraseSetResponse phraseSets. */ + public phraseSets: google.cloud.speech.v1.IPhraseSet[]; + + /** ListPhraseSetResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListPhraseSetResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPhraseSetResponse instance + */ + public static create(properties?: google.cloud.speech.v1.IListPhraseSetResponse): google.cloud.speech.v1.ListPhraseSetResponse; + + /** + * Encodes the specified ListPhraseSetResponse message. Does not implicitly {@link google.cloud.speech.v1.ListPhraseSetResponse.verify|verify} messages. + * @param message ListPhraseSetResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.IListPhraseSetResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPhraseSetResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v1.ListPhraseSetResponse.verify|verify} messages. + * @param message ListPhraseSetResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.IListPhraseSetResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPhraseSetResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPhraseSetResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.ListPhraseSetResponse; + + /** + * Decodes a ListPhraseSetResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPhraseSetResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.ListPhraseSetResponse; + + /** + * Verifies a ListPhraseSetResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListPhraseSetResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPhraseSetResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.ListPhraseSetResponse; + + /** + * Creates a plain object from a ListPhraseSetResponse message. Also converts values to other types if specified. + * @param message ListPhraseSetResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.ListPhraseSetResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPhraseSetResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListPhraseSetResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeletePhraseSetRequest. */ + interface IDeletePhraseSetRequest { + + /** DeletePhraseSetRequest name */ + name?: (string|null); + } + + /** Represents a DeletePhraseSetRequest. */ + class DeletePhraseSetRequest implements IDeletePhraseSetRequest { + + /** + * Constructs a new DeletePhraseSetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.IDeletePhraseSetRequest); + + /** DeletePhraseSetRequest name. */ + public name: string; + + /** + * Creates a new DeletePhraseSetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeletePhraseSetRequest instance + */ + public static create(properties?: google.cloud.speech.v1.IDeletePhraseSetRequest): google.cloud.speech.v1.DeletePhraseSetRequest; + + /** + * Encodes the specified DeletePhraseSetRequest message. Does not implicitly {@link google.cloud.speech.v1.DeletePhraseSetRequest.verify|verify} messages. + * @param message DeletePhraseSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.IDeletePhraseSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeletePhraseSetRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.DeletePhraseSetRequest.verify|verify} messages. + * @param message DeletePhraseSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.IDeletePhraseSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeletePhraseSetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeletePhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.DeletePhraseSetRequest; + + /** + * Decodes a DeletePhraseSetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeletePhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.DeletePhraseSetRequest; + + /** + * Verifies a DeletePhraseSetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeletePhraseSetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeletePhraseSetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.DeletePhraseSetRequest; + + /** + * Creates a plain object from a DeletePhraseSetRequest message. Also converts values to other types if specified. + * @param message DeletePhraseSetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.DeletePhraseSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeletePhraseSetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeletePhraseSetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateCustomClassRequest. */ + interface ICreateCustomClassRequest { + + /** CreateCustomClassRequest parent */ + parent?: (string|null); + + /** CreateCustomClassRequest customClassId */ + customClassId?: (string|null); + + /** CreateCustomClassRequest customClass */ + customClass?: (google.cloud.speech.v1.ICustomClass|null); + } + + /** Represents a CreateCustomClassRequest. */ + class CreateCustomClassRequest implements ICreateCustomClassRequest { + + /** + * Constructs a new CreateCustomClassRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.ICreateCustomClassRequest); + + /** CreateCustomClassRequest parent. */ + public parent: string; + + /** CreateCustomClassRequest customClassId. */ + public customClassId: string; + + /** CreateCustomClassRequest customClass. */ + public customClass?: (google.cloud.speech.v1.ICustomClass|null); + + /** + * Creates a new CreateCustomClassRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateCustomClassRequest instance + */ + public static create(properties?: google.cloud.speech.v1.ICreateCustomClassRequest): google.cloud.speech.v1.CreateCustomClassRequest; + + /** + * Encodes the specified CreateCustomClassRequest message. Does not implicitly {@link google.cloud.speech.v1.CreateCustomClassRequest.verify|verify} messages. + * @param message CreateCustomClassRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.ICreateCustomClassRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateCustomClassRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.CreateCustomClassRequest.verify|verify} messages. + * @param message CreateCustomClassRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.ICreateCustomClassRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateCustomClassRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.CreateCustomClassRequest; + + /** + * Decodes a CreateCustomClassRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.CreateCustomClassRequest; + + /** + * Verifies a CreateCustomClassRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateCustomClassRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateCustomClassRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.CreateCustomClassRequest; + + /** + * Creates a plain object from a CreateCustomClassRequest message. Also converts values to other types if specified. + * @param message CreateCustomClassRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.CreateCustomClassRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateCustomClassRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateCustomClassRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateCustomClassRequest. */ + interface IUpdateCustomClassRequest { + + /** UpdateCustomClassRequest customClass */ + customClass?: (google.cloud.speech.v1.ICustomClass|null); + + /** UpdateCustomClassRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateCustomClassRequest. */ + class UpdateCustomClassRequest implements IUpdateCustomClassRequest { + + /** + * Constructs a new UpdateCustomClassRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.IUpdateCustomClassRequest); + + /** UpdateCustomClassRequest customClass. */ + public customClass?: (google.cloud.speech.v1.ICustomClass|null); + + /** UpdateCustomClassRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateCustomClassRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateCustomClassRequest instance + */ + public static create(properties?: google.cloud.speech.v1.IUpdateCustomClassRequest): google.cloud.speech.v1.UpdateCustomClassRequest; + + /** + * Encodes the specified UpdateCustomClassRequest message. Does not implicitly {@link google.cloud.speech.v1.UpdateCustomClassRequest.verify|verify} messages. + * @param message UpdateCustomClassRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.IUpdateCustomClassRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateCustomClassRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.UpdateCustomClassRequest.verify|verify} messages. + * @param message UpdateCustomClassRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.IUpdateCustomClassRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateCustomClassRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.UpdateCustomClassRequest; + + /** + * Decodes an UpdateCustomClassRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.UpdateCustomClassRequest; + + /** + * Verifies an UpdateCustomClassRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateCustomClassRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateCustomClassRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.UpdateCustomClassRequest; + + /** + * Creates a plain object from an UpdateCustomClassRequest message. Also converts values to other types if specified. + * @param message UpdateCustomClassRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.UpdateCustomClassRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateCustomClassRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateCustomClassRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetCustomClassRequest. */ + interface IGetCustomClassRequest { + + /** GetCustomClassRequest name */ + name?: (string|null); + } + + /** Represents a GetCustomClassRequest. */ + class GetCustomClassRequest implements IGetCustomClassRequest { + + /** + * Constructs a new GetCustomClassRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.IGetCustomClassRequest); + + /** GetCustomClassRequest name. */ + public name: string; + + /** + * Creates a new GetCustomClassRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetCustomClassRequest instance + */ + public static create(properties?: google.cloud.speech.v1.IGetCustomClassRequest): google.cloud.speech.v1.GetCustomClassRequest; + + /** + * Encodes the specified GetCustomClassRequest message. Does not implicitly {@link google.cloud.speech.v1.GetCustomClassRequest.verify|verify} messages. + * @param message GetCustomClassRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.IGetCustomClassRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetCustomClassRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.GetCustomClassRequest.verify|verify} messages. + * @param message GetCustomClassRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.IGetCustomClassRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetCustomClassRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.GetCustomClassRequest; + + /** + * Decodes a GetCustomClassRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.GetCustomClassRequest; + + /** + * Verifies a GetCustomClassRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetCustomClassRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetCustomClassRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.GetCustomClassRequest; + + /** + * Creates a plain object from a GetCustomClassRequest message. Also converts values to other types if specified. + * @param message GetCustomClassRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.GetCustomClassRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetCustomClassRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetCustomClassRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCustomClassesRequest. */ + interface IListCustomClassesRequest { + + /** ListCustomClassesRequest parent */ + parent?: (string|null); + + /** ListCustomClassesRequest pageSize */ + pageSize?: (number|null); + + /** ListCustomClassesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListCustomClassesRequest. */ + class ListCustomClassesRequest implements IListCustomClassesRequest { + + /** + * Constructs a new ListCustomClassesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.IListCustomClassesRequest); + + /** ListCustomClassesRequest parent. */ + public parent: string; + + /** ListCustomClassesRequest pageSize. */ + public pageSize: number; + + /** ListCustomClassesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListCustomClassesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCustomClassesRequest instance + */ + public static create(properties?: google.cloud.speech.v1.IListCustomClassesRequest): google.cloud.speech.v1.ListCustomClassesRequest; + + /** + * Encodes the specified ListCustomClassesRequest message. Does not implicitly {@link google.cloud.speech.v1.ListCustomClassesRequest.verify|verify} messages. + * @param message ListCustomClassesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.IListCustomClassesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCustomClassesRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.ListCustomClassesRequest.verify|verify} messages. + * @param message ListCustomClassesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.IListCustomClassesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCustomClassesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCustomClassesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.ListCustomClassesRequest; + + /** + * Decodes a ListCustomClassesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCustomClassesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.ListCustomClassesRequest; + + /** + * Verifies a ListCustomClassesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCustomClassesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCustomClassesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.ListCustomClassesRequest; + + /** + * Creates a plain object from a ListCustomClassesRequest message. Also converts values to other types if specified. + * @param message ListCustomClassesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.ListCustomClassesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCustomClassesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCustomClassesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCustomClassesResponse. */ + interface IListCustomClassesResponse { + + /** ListCustomClassesResponse customClasses */ + customClasses?: (google.cloud.speech.v1.ICustomClass[]|null); + + /** ListCustomClassesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListCustomClassesResponse. */ + class ListCustomClassesResponse implements IListCustomClassesResponse { + + /** + * Constructs a new ListCustomClassesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.IListCustomClassesResponse); + + /** ListCustomClassesResponse customClasses. */ + public customClasses: google.cloud.speech.v1.ICustomClass[]; + + /** ListCustomClassesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListCustomClassesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCustomClassesResponse instance + */ + public static create(properties?: google.cloud.speech.v1.IListCustomClassesResponse): google.cloud.speech.v1.ListCustomClassesResponse; + + /** + * Encodes the specified ListCustomClassesResponse message. Does not implicitly {@link google.cloud.speech.v1.ListCustomClassesResponse.verify|verify} messages. + * @param message ListCustomClassesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.IListCustomClassesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCustomClassesResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v1.ListCustomClassesResponse.verify|verify} messages. + * @param message ListCustomClassesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.IListCustomClassesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCustomClassesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCustomClassesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.ListCustomClassesResponse; + + /** + * Decodes a ListCustomClassesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCustomClassesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.ListCustomClassesResponse; + + /** + * Verifies a ListCustomClassesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCustomClassesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCustomClassesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.ListCustomClassesResponse; + + /** + * Creates a plain object from a ListCustomClassesResponse message. Also converts values to other types if specified. + * @param message ListCustomClassesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.ListCustomClassesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCustomClassesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCustomClassesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteCustomClassRequest. */ + interface IDeleteCustomClassRequest { + + /** DeleteCustomClassRequest name */ + name?: (string|null); + } + + /** Represents a DeleteCustomClassRequest. */ + class DeleteCustomClassRequest implements IDeleteCustomClassRequest { + + /** + * Constructs a new DeleteCustomClassRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.IDeleteCustomClassRequest); + + /** DeleteCustomClassRequest name. */ + public name: string; + + /** + * Creates a new DeleteCustomClassRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteCustomClassRequest instance + */ + public static create(properties?: google.cloud.speech.v1.IDeleteCustomClassRequest): google.cloud.speech.v1.DeleteCustomClassRequest; + + /** + * Encodes the specified DeleteCustomClassRequest message. Does not implicitly {@link google.cloud.speech.v1.DeleteCustomClassRequest.verify|verify} messages. + * @param message DeleteCustomClassRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.IDeleteCustomClassRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteCustomClassRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.DeleteCustomClassRequest.verify|verify} messages. + * @param message DeleteCustomClassRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.IDeleteCustomClassRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteCustomClassRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.DeleteCustomClassRequest; + + /** + * Decodes a DeleteCustomClassRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.DeleteCustomClassRequest; + + /** + * Verifies a DeleteCustomClassRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteCustomClassRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteCustomClassRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.DeleteCustomClassRequest; + + /** + * Creates a plain object from a DeleteCustomClassRequest message. Also converts values to other types if specified. + * @param message DeleteCustomClassRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.DeleteCustomClassRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteCustomClassRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteCustomClassRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Http message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + + /** + * Verifies a Http message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Http + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HttpRule. */ + interface IHttpRule { + + /** HttpRule selector */ + selector?: (string|null); + + /** HttpRule get */ + get?: (string|null); + + /** HttpRule put */ + put?: (string|null); + + /** HttpRule post */ + post?: (string|null); + + /** HttpRule delete */ + "delete"?: (string|null); + + /** HttpRule patch */ + patch?: (string|null); + + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body */ + body?: (string|null); + + /** HttpRule responseBody */ + responseBody?: (string|null); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } + + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { + + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); + + /** HttpRule selector. */ + public selector: string; + + /** HttpRule get. */ + public get?: (string|null); + + /** HttpRule put. */ + public put?: (string|null); + + /** HttpRule post. */ + public post?: (string|null); + + /** HttpRule delete. */ + public delete?: (string|null); + + /** HttpRule patch. */ + public patch?: (string|null); + + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body. */ + public body: string; + + /** HttpRule responseBody. */ + public responseBody: string; + + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; + + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + + /** + * Creates a new HttpRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRule instance + */ + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; + + /** + * Verifies a HttpRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRule + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @param message HttpRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { + + /** CustomHttpPattern kind */ + kind?: (string|null); + + /** CustomHttpPattern path */ + path?: (string|null); + } + + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { + + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); + + /** CustomHttpPattern kind. */ + public kind: string; + + /** CustomHttpPattern path. */ + public path: string; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHttpPattern instance + */ + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; + + /** + * Verifies a CustomHttpPattern message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomHttpPattern + */ + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @param message CustomHttpPattern + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomHttpPattern + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CommonLanguageSettings. */ + interface ICommonLanguageSettings { + + /** CommonLanguageSettings referenceDocsUri */ + referenceDocsUri?: (string|null); + + /** CommonLanguageSettings destinations */ + destinations?: (google.api.ClientLibraryDestination[]|null); + } + + /** Represents a CommonLanguageSettings. */ + class CommonLanguageSettings implements ICommonLanguageSettings { + + /** + * Constructs a new CommonLanguageSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICommonLanguageSettings); + + /** CommonLanguageSettings referenceDocsUri. */ + public referenceDocsUri: string; + + /** CommonLanguageSettings destinations. */ + public destinations: google.api.ClientLibraryDestination[]; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CommonLanguageSettings instance + */ + public static create(properties?: google.api.ICommonLanguageSettings): google.api.CommonLanguageSettings; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CommonLanguageSettings; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CommonLanguageSettings; + + /** + * Verifies a CommonLanguageSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommonLanguageSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CommonLanguageSettings; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @param message CommonLanguageSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CommonLanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CommonLanguageSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClientLibrarySettings. */ + interface IClientLibrarySettings { + + /** ClientLibrarySettings version */ + version?: (string|null); + + /** ClientLibrarySettings launchStage */ + launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); + + /** ClientLibrarySettings restNumericEnums */ + restNumericEnums?: (boolean|null); + + /** ClientLibrarySettings javaSettings */ + javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings */ + cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings */ + phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings */ + pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings */ + nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings */ + dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings */ + rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings */ + goSettings?: (google.api.IGoSettings|null); + } + + /** Represents a ClientLibrarySettings. */ + class ClientLibrarySettings implements IClientLibrarySettings { + + /** + * Constructs a new ClientLibrarySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IClientLibrarySettings); + + /** ClientLibrarySettings version. */ + public version: string; + + /** ClientLibrarySettings launchStage. */ + public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); + + /** ClientLibrarySettings restNumericEnums. */ + public restNumericEnums: boolean; + + /** ClientLibrarySettings javaSettings. */ + public javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings. */ + public cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings. */ + public phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings. */ + public pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings. */ + public nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings. */ + public dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings. */ + public rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings. */ + public goSettings?: (google.api.IGoSettings|null); + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientLibrarySettings instance + */ + public static create(properties?: google.api.IClientLibrarySettings): google.api.ClientLibrarySettings; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ClientLibrarySettings; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ClientLibrarySettings; + + /** + * Verifies a ClientLibrarySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClientLibrarySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.ClientLibrarySettings; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @param message ClientLibrarySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ClientLibrarySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClientLibrarySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Publishing. */ + interface IPublishing { + + /** Publishing methodSettings */ + methodSettings?: (google.api.IMethodSettings[]|null); + + /** Publishing newIssueUri */ + newIssueUri?: (string|null); + + /** Publishing documentationUri */ + documentationUri?: (string|null); + + /** Publishing apiShortName */ + apiShortName?: (string|null); + + /** Publishing githubLabel */ + githubLabel?: (string|null); + + /** Publishing codeownerGithubTeams */ + codeownerGithubTeams?: (string[]|null); + + /** Publishing docTagPrefix */ + docTagPrefix?: (string|null); + + /** Publishing organization */ + organization?: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization|null); + + /** Publishing librarySettings */ + librarySettings?: (google.api.IClientLibrarySettings[]|null); + + /** Publishing protoReferenceDocumentationUri */ + protoReferenceDocumentationUri?: (string|null); + + /** Publishing restReferenceDocumentationUri */ + restReferenceDocumentationUri?: (string|null); + } + + /** Represents a Publishing. */ + class Publishing implements IPublishing { + + /** + * Constructs a new Publishing. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPublishing); + + /** Publishing methodSettings. */ + public methodSettings: google.api.IMethodSettings[]; + + /** Publishing newIssueUri. */ + public newIssueUri: string; + + /** Publishing documentationUri. */ + public documentationUri: string; + + /** Publishing apiShortName. */ + public apiShortName: string; + + /** Publishing githubLabel. */ + public githubLabel: string; + + /** Publishing codeownerGithubTeams. */ + public codeownerGithubTeams: string[]; + + /** Publishing docTagPrefix. */ + public docTagPrefix: string; + + /** Publishing organization. */ + public organization: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization); + + /** Publishing librarySettings. */ + public librarySettings: google.api.IClientLibrarySettings[]; + + /** Publishing protoReferenceDocumentationUri. */ + public protoReferenceDocumentationUri: string; + + /** Publishing restReferenceDocumentationUri. */ + public restReferenceDocumentationUri: string; + + /** + * Creates a new Publishing instance using the specified properties. + * @param [properties] Properties to set + * @returns Publishing instance + */ + public static create(properties?: google.api.IPublishing): google.api.Publishing; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Publishing; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Publishing; + + /** + * Verifies a Publishing message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Publishing + */ + public static fromObject(object: { [k: string]: any }): google.api.Publishing; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @param message Publishing + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Publishing, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Publishing to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Publishing + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JavaSettings. */ + interface IJavaSettings { + + /** JavaSettings libraryPackage */ + libraryPackage?: (string|null); + + /** JavaSettings serviceClassNames */ + serviceClassNames?: ({ [k: string]: string }|null); + + /** JavaSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a JavaSettings. */ + class JavaSettings implements IJavaSettings { + + /** + * Constructs a new JavaSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IJavaSettings); + + /** JavaSettings libraryPackage. */ + public libraryPackage: string; + + /** JavaSettings serviceClassNames. */ + public serviceClassNames: { [k: string]: string }; + + /** JavaSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new JavaSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns JavaSettings instance + */ + public static create(properties?: google.api.IJavaSettings): google.api.JavaSettings; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.JavaSettings; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.JavaSettings; + + /** + * Verifies a JavaSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JavaSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.JavaSettings; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @param message JavaSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.JavaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JavaSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JavaSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CppSettings. */ + interface ICppSettings { + + /** CppSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a CppSettings. */ + class CppSettings implements ICppSettings { + + /** + * Constructs a new CppSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICppSettings); + + /** CppSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new CppSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CppSettings instance + */ + public static create(properties?: google.api.ICppSettings): google.api.CppSettings; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CppSettings; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CppSettings; + + /** + * Verifies a CppSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CppSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CppSettings; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @param message CppSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CppSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CppSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CppSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PhpSettings. */ + interface IPhpSettings { + + /** PhpSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PhpSettings. */ + class PhpSettings implements IPhpSettings { + + /** + * Constructs a new PhpSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPhpSettings); + + /** PhpSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PhpSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PhpSettings instance + */ + public static create(properties?: google.api.IPhpSettings): google.api.PhpSettings; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PhpSettings; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PhpSettings; + + /** + * Verifies a PhpSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PhpSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PhpSettings; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @param message PhpSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PhpSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PhpSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PhpSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PythonSettings. */ + interface IPythonSettings { + + /** PythonSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PythonSettings. */ + class PythonSettings implements IPythonSettings { + + /** + * Constructs a new PythonSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPythonSettings); + + /** PythonSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PythonSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PythonSettings instance + */ + public static create(properties?: google.api.IPythonSettings): google.api.PythonSettings; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings; + + /** + * Verifies a PythonSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PythonSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @param message PythonSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PythonSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PythonSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeSettings. */ + interface INodeSettings { + + /** NodeSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a NodeSettings. */ + class NodeSettings implements INodeSettings { + + /** + * Constructs a new NodeSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.INodeSettings); + + /** NodeSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new NodeSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeSettings instance + */ + public static create(properties?: google.api.INodeSettings): google.api.NodeSettings; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.NodeSettings; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.NodeSettings; + + /** + * Verifies a NodeSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.NodeSettings; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @param message NodeSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.NodeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodeSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DotnetSettings. */ + interface IDotnetSettings { + + /** DotnetSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|null); + + /** DotnetSettings renamedResources */ + renamedResources?: ({ [k: string]: string }|null); + + /** DotnetSettings ignoredResources */ + ignoredResources?: (string[]|null); + + /** DotnetSettings forcedNamespaceAliases */ + forcedNamespaceAliases?: (string[]|null); + + /** DotnetSettings handwrittenSignatures */ + handwrittenSignatures?: (string[]|null); + } + + /** Represents a DotnetSettings. */ + class DotnetSettings implements IDotnetSettings { + + /** + * Constructs a new DotnetSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IDotnetSettings); + + /** DotnetSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + + /** DotnetSettings renamedResources. */ + public renamedResources: { [k: string]: string }; + + /** DotnetSettings ignoredResources. */ + public ignoredResources: string[]; + + /** DotnetSettings forcedNamespaceAliases. */ + public forcedNamespaceAliases: string[]; + + /** DotnetSettings handwrittenSignatures. */ + public handwrittenSignatures: string[]; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns DotnetSettings instance + */ + public static create(properties?: google.api.IDotnetSettings): google.api.DotnetSettings; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.DotnetSettings; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.DotnetSettings; + + /** + * Verifies a DotnetSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DotnetSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @param message DotnetSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DotnetSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DotnetSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RubySettings. */ + interface IRubySettings { + + /** RubySettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a RubySettings. */ + class RubySettings implements IRubySettings { + + /** + * Constructs a new RubySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IRubySettings); + + /** RubySettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new RubySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns RubySettings instance + */ + public static create(properties?: google.api.IRubySettings): google.api.RubySettings; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.RubySettings; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.RubySettings; + + /** + * Verifies a RubySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RubySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.RubySettings; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @param message RubySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.RubySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RubySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RubySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GoSettings. */ + interface IGoSettings { + + /** GoSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a GoSettings. */ + class GoSettings implements IGoSettings { + + /** + * Constructs a new GoSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IGoSettings); + + /** GoSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new GoSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns GoSettings instance + */ + public static create(properties?: google.api.IGoSettings): google.api.GoSettings; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.GoSettings; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.GoSettings; + + /** + * Verifies a GoSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.GoSettings; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @param message GoSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodSettings. */ + interface IMethodSettings { + + /** MethodSettings selector */ + selector?: (string|null); + + /** MethodSettings longRunning */ + longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields */ + autoPopulatedFields?: (string[]|null); + } + + /** Represents a MethodSettings. */ + class MethodSettings implements IMethodSettings { + + /** + * Constructs a new MethodSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IMethodSettings); + + /** MethodSettings selector. */ + public selector: string; + + /** MethodSettings longRunning. */ + public longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields. */ + public autoPopulatedFields: string[]; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodSettings instance + */ + public static create(properties?: google.api.IMethodSettings): google.api.MethodSettings; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings; + + /** + * Verifies a MethodSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @param message MethodSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodSettings { + + /** Properties of a LongRunning. */ + interface ILongRunning { + + /** LongRunning initialPollDelay */ + initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier */ + pollDelayMultiplier?: (number|null); + + /** LongRunning maxPollDelay */ + maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout */ + totalPollTimeout?: (google.protobuf.IDuration|null); + } + + /** Represents a LongRunning. */ + class LongRunning implements ILongRunning { + + /** + * Constructs a new LongRunning. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.MethodSettings.ILongRunning); + + /** LongRunning initialPollDelay. */ + public initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier. */ + public pollDelayMultiplier: number; + + /** LongRunning maxPollDelay. */ + public maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout. */ + public totalPollTimeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new LongRunning instance using the specified properties. + * @param [properties] Properties to set + * @returns LongRunning instance + */ + public static create(properties?: google.api.MethodSettings.ILongRunning): google.api.MethodSettings.LongRunning; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings.LongRunning; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings.LongRunning; + + /** + * Verifies a LongRunning message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LongRunning + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings.LongRunning; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @param message LongRunning + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings.LongRunning, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LongRunning to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LongRunning + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** ClientLibraryOrganization enum. */ + enum ClientLibraryOrganization { + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, + CLOUD = 1, + ADS = 2, + PHOTOS = 3, + STREET_VIEW = 4, + SHOPPING = 5, + GEO = 6, + GENERATIVE_AI = 7 + } + + /** ClientLibraryDestination enum. */ + enum ClientLibraryDestination { + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, + GITHUB = 10, + PACKAGE_MANAGER = 20 + } + + /** LaunchStage enum. */ + enum LaunchStage { + LAUNCH_STAGE_UNSPECIFIED = 0, + UNIMPLEMENTED = 6, + PRELAUNCH = 7, + EARLY_ACCESS = 1, + ALPHA = 2, + BETA = 3, + GA = 4, + DEPRECATED = 5 + } + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7, + IDENTIFIER = 8 + } + + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { + + /** ResourceDescriptor type */ + type?: (string|null); + + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); + } + + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { + + /** + * Constructs a new ResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceDescriptor); + + /** ResourceDescriptor type. */ + public type: string; + + /** ResourceDescriptor pattern. */ + public pattern: string[]; + + /** ResourceDescriptor nameField. */ + public nameField: string; + + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceDescriptor instance + */ + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; + + /** + * Verifies a ResourceDescriptor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @param message ResourceDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } + } + + /** Properties of a ResourceReference. */ + interface IResourceReference { + + /** ResourceReference type */ + type?: (string|null); + + /** ResourceReference childType */ + childType?: (string|null); + } + + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { + + /** + * Constructs a new ResourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceReference); + + /** ResourceReference type. */ + public type: string; + + /** ResourceReference childType. */ + public childType: string; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceReference instance + */ + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; + + /** + * Verifies a ResourceReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceReference + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @param message ResourceReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { + + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } + + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { + + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); + + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorSet instance + */ + public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; + + /** + * Verifies a FileDescriptorSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @param message FileDescriptorSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Edition enum. */ + enum Edition { + EDITION_UNKNOWN = 0, + EDITION_PROTO2 = 998, + EDITION_PROTO3 = 999, + EDITION_2023 = 1000, + EDITION_2024 = 1001, + EDITION_1_TEST_ONLY = 1, + EDITION_2_TEST_ONLY = 2, + EDITION_99997_TEST_ONLY = 99997, + EDITION_99998_TEST_ONLY = 99998, + EDITION_99999_TEST_ONLY = 99999, + EDITION_MAX = 2147483647 + } + + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { + + /** FileDescriptorProto name */ + name?: (string|null); + + /** FileDescriptorProto package */ + "package"?: (string|null); + + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); + + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); + + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); + + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); + + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); + + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax */ + syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { + + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); + + /** FileDescriptorProto name. */ + public name: string; + + /** FileDescriptorProto package. */ + public package: string; + + /** FileDescriptorProto dependency. */ + public dependency: string[]; + + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; + + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; + + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; + + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; + + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax. */ + public syntax: string; + + /** FileDescriptorProto edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; + + /** + * Verifies a FileDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @param message FileDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { + + /** DescriptorProto name */ + name?: (string|null); + + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); + + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { + + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); + + /** DescriptorProto name. */ + public name: string; + + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; + + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + + /** DescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DescriptorProto instance + */ + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; + + /** + * Verifies a DescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @param message DescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DescriptorProto { + + /** Properties of an ExtensionRange. */ + interface IExtensionRange { + + /** ExtensionRange start */ + start?: (number|null); + + /** ExtensionRange end */ + end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } + + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { + + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + + /** ExtensionRange start. */ + public start: number; + + /** ExtensionRange end. */ + public end: number; + + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Verifies an ExtensionRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @param message ExtensionRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReservedRange. */ + interface IReservedRange { + + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); + } + + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { + + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + + /** ReservedRange start. */ + public start: number; + + /** ReservedRange end. */ + public end: number; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservedRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Verifies a ReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @param message ReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ExtensionRangeOptions declaration */ + declaration?: (google.protobuf.ExtensionRangeOptions.IDeclaration[]|null); + + /** ExtensionRangeOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification */ + verification?: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState|null); + } + + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { + + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); + + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** ExtensionRangeOptions declaration. */ + public declaration: google.protobuf.ExtensionRangeOptions.IDeclaration[]; + + /** ExtensionRangeOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification. */ + public verification: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState); + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRangeOptions instance + */ + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; + + /** + * Verifies an ExtensionRangeOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRangeOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @param message ExtensionRangeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExtensionRangeOptions { + + /** Properties of a Declaration. */ + interface IDeclaration { + + /** Declaration number */ + number?: (number|null); + + /** Declaration fullName */ + fullName?: (string|null); + + /** Declaration type */ + type?: (string|null); + + /** Declaration reserved */ + reserved?: (boolean|null); + + /** Declaration repeated */ + repeated?: (boolean|null); + } + + /** Represents a Declaration. */ + class Declaration implements IDeclaration { + + /** + * Constructs a new Declaration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration); + + /** Declaration number. */ + public number: number; + + /** Declaration fullName. */ + public fullName: string; + + /** Declaration type. */ + public type: string; + + /** Declaration reserved. */ + public reserved: boolean; + + /** Declaration repeated. */ + public repeated: boolean; + + /** + * Creates a new Declaration instance using the specified properties. + * @param [properties] Properties to set + * @returns Declaration instance + */ + public static create(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Verifies a Declaration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Declaration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @param message Declaration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions.Declaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Declaration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Declaration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** VerificationState enum. */ + enum VerificationState { + DECLARATION = 0, + UNVERIFIED = 1 + } + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldDescriptorProto { + + /** Type enum. */ + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } + + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REPEATED = 3, + LABEL_REQUIRED = 2 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Verifies an EnumReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; + + /** + * Verifies an EnumValueDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; + + /** + * Verifies a ServiceDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; + + /** + * Verifies a MethodDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions deprecated */ + deprecated?: (boolean|null); + + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); + + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); + + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); + + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); + + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); + + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); + + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); + + /** FileOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); + } + + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { + + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); + + /** FileOptions javaPackage. */ + public javaPackage: string; + + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; + + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; + + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions deprecated. */ + public deprecated: boolean; + + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; + + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; + + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; + + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; + + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; + + /** FileOptions phpNamespace. */ + public phpNamespace: string; + + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; + + /** FileOptions rubyPackage. */ + public rubyPackage: string; + + /** FileOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FileOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOptions instance + */ + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; + + /** + * Verifies a FileOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @param message FileOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FileOptions { + + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } + + /** Properties of a MessageOptions. */ + interface IMessageOptions { + + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); + + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); + + /** MessageOptions deprecated */ + deprecated?: (boolean|null); + + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); + + /** MessageOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** MessageOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); + } + + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { + + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); + + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** MessageOptions mapEntry. */ + public mapEntry: boolean; + + /** MessageOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** MessageOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageOptions instance + */ + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; + + /** + * Verifies a MessageOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @param message MessageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MessageOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldOptions. */ + interface IFieldOptions { + + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + + /** FieldOptions lazy */ + lazy?: (boolean|null); + + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions debugRedact */ + debugRedact?: (boolean|null); + + /** FieldOptions retention */ + retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); + + /** FieldOptions targets */ + targets?: (google.protobuf.FieldOptions.OptionTargetType[]|null); + + /** FieldOptions editionDefaults */ + editionDefaults?: (google.protobuf.FieldOptions.IEditionDefault[]|null); + + /** FieldOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions debugRedact. */ + public debugRedact: boolean; + + /** FieldOptions retention. */ + public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); + + /** FieldOptions targets. */ + public targets: google.protobuf.FieldOptions.OptionTargetType[]; + + /** FieldOptions editionDefaults. */ + public editionDefaults: google.protobuf.FieldOptions.IEditionDefault[]; + + /** FieldOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldOptions instance + */ + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; + + /** + * Verifies a FieldOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @param message FieldOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + + /** OptionRetention enum. */ + enum OptionRetention { + RETENTION_UNKNOWN = 0, + RETENTION_RUNTIME = 1, + RETENTION_SOURCE = 2 + } + + /** OptionTargetType enum. */ + enum OptionTargetType { + TARGET_TYPE_UNKNOWN = 0, + TARGET_TYPE_FILE = 1, + TARGET_TYPE_EXTENSION_RANGE = 2, + TARGET_TYPE_MESSAGE = 3, + TARGET_TYPE_FIELD = 4, + TARGET_TYPE_ONEOF = 5, + TARGET_TYPE_ENUM = 6, + TARGET_TYPE_ENUM_ENTRY = 7, + TARGET_TYPE_SERVICE = 8, + TARGET_TYPE_METHOD = 9 + } + + /** Properties of an EditionDefault. */ + interface IEditionDefault { + + /** EditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** EditionDefault value */ + value?: (string|null); + } + + /** Represents an EditionDefault. */ + class EditionDefault implements IEditionDefault { + + /** + * Constructs a new EditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IEditionDefault); + + /** EditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** EditionDefault value. */ + public value: string; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns EditionDefault instance + */ + public static create(properties?: google.protobuf.FieldOptions.IEditionDefault): google.protobuf.FieldOptions.EditionDefault; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.EditionDefault; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.EditionDefault; + + /** + * Verifies an EditionDefault message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.EditionDefault; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @param message EditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.EditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { + + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); + + /** OneofOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofOptions instance + */ + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; + + /** + * Verifies an OneofOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @param message OneofOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** EnumOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { + + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); + + /** EnumOptions allowAlias. */ + public allowAlias: boolean; + + /** EnumOptions deprecated. */ + public deprecated: boolean; + + /** EnumOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** EnumOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; + + /** + * Verifies an EnumOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact */ + debugRedact?: (boolean|null); + + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { + + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); + + /** EnumValueOptions deprecated. */ + public deprecated: boolean; + + /** EnumValueOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact. */ + public debugRedact: boolean; + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; + + /** + * Verifies an EnumValueOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + + /** ServiceOptions .google.api.apiVersion */ + ".google.api.apiVersion"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|Buffer|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|Buffer|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a FeatureSet. */ + interface IFeatureSet { + + /** FeatureSet fieldPresence */ + fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); + + /** FeatureSet enumType */ + enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); + + /** FeatureSet repeatedFieldEncoding */ + repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); + + /** FeatureSet utf8Validation */ + utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); + + /** FeatureSet messageEncoding */ + messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); + + /** FeatureSet jsonFormat */ + jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); + } + + /** Represents a FeatureSet. */ + class FeatureSet implements IFeatureSet { + + /** + * Constructs a new FeatureSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSet); + + /** FeatureSet fieldPresence. */ + public fieldPresence: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence); + + /** FeatureSet enumType. */ + public enumType: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType); + + /** FeatureSet repeatedFieldEncoding. */ + public repeatedFieldEncoding: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding); + + /** FeatureSet utf8Validation. */ + public utf8Validation: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation); + + /** FeatureSet messageEncoding. */ + public messageEncoding: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding); + + /** FeatureSet jsonFormat. */ + public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); + + /** + * Creates a new FeatureSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSet instance + */ + public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet; + + /** + * Verifies a FeatureSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @param message FeatureSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSet { + + /** FieldPresence enum. */ + enum FieldPresence { + FIELD_PRESENCE_UNKNOWN = 0, + EXPLICIT = 1, + IMPLICIT = 2, + LEGACY_REQUIRED = 3 + } + + /** EnumType enum. */ + enum EnumType { + ENUM_TYPE_UNKNOWN = 0, + OPEN = 1, + CLOSED = 2 + } + + /** RepeatedFieldEncoding enum. */ + enum RepeatedFieldEncoding { + REPEATED_FIELD_ENCODING_UNKNOWN = 0, + PACKED = 1, + EXPANDED = 2 + } + + /** Utf8Validation enum. */ + enum Utf8Validation { + UTF8_VALIDATION_UNKNOWN = 0, + VERIFY = 2, + NONE = 3 + } + + /** MessageEncoding enum. */ + enum MessageEncoding { + MESSAGE_ENCODING_UNKNOWN = 0, + LENGTH_PREFIXED = 1, + DELIMITED = 2 + } + + /** JsonFormat enum. */ + enum JsonFormat { + JSON_FORMAT_UNKNOWN = 0, + ALLOW = 1, + LEGACY_BEST_EFFORT = 2 + } + } + + /** Properties of a FeatureSetDefaults. */ + interface IFeatureSetDefaults { + + /** FeatureSetDefaults defaults */ + defaults?: (google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]|null); + + /** FeatureSetDefaults minimumEdition */ + minimumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetDefaults maximumEdition */ + maximumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSetDefaults. */ + class FeatureSetDefaults implements IFeatureSetDefaults { + + /** + * Constructs a new FeatureSetDefaults. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSetDefaults); + + /** FeatureSetDefaults defaults. */ + public defaults: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]; + + /** FeatureSetDefaults minimumEdition. */ + public minimumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetDefaults maximumEdition. */ + public maximumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetDefaults instance + */ + public static create(properties?: google.protobuf.IFeatureSetDefaults): google.protobuf.FeatureSetDefaults; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults; + + /** + * Verifies a FeatureSetDefaults message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetDefaults + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @param message FeatureSetDefaults + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetDefaults + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSetDefaults { + + /** Properties of a FeatureSetEditionDefault. */ + interface IFeatureSetEditionDefault { + + /** FeatureSetEditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetEditionDefault features */ + features?: (google.protobuf.IFeatureSet|null); + } + + /** Represents a FeatureSetEditionDefault. */ + class FeatureSetEditionDefault implements IFeatureSetEditionDefault { + + /** + * Constructs a new FeatureSetEditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault); + + /** FeatureSetEditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetEditionDefault features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetEditionDefault instance + */ + public static create(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Verifies a FeatureSetEditionDefault message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetEditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @param message FeatureSetEditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } + } + } + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long|string); + + /** Duration nanos. */ + public nanos: number; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; + + /** + * Verifies a Duration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Duration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|Buffer|string|null); + } + + /** Represents an Any. */ + class Any implements IAny { + + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); + + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: (Uint8Array|Buffer|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; + + /** + * Verifies an Any message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); + + /** + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance + */ + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; + + /** + * Verifies an Empty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Empty + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Empty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** DoubleValue value */ + value?: (number|null); + } + + /** Represents a DoubleValue. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDoubleValue); + + /** DoubleValue value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param message DoubleValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param message DoubleValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DoubleValue; + + /** + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DoubleValue; + + /** + * Verifies a DoubleValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DoubleValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DoubleValue; + + /** + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @param message DoubleValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DoubleValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DoubleValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** FloatValue value */ + value?: (number|null); + } + + /** Represents a FloatValue. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFloatValue); + + /** FloatValue value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param message FloatValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param message FloatValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FloatValue; + + /** + * Decodes a FloatValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FloatValue; + + /** + * Verifies a FloatValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FloatValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FloatValue; + + /** + * Creates a plain object from a FloatValue message. Also converts values to other types if specified. + * @param message FloatValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FloatValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FloatValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** Int64Value value */ + value?: (number|Long|string|null); + } + + /** Represents an Int64Value. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IInt64Value); + + /** Int64Value value. */ + public value: (number|Long|string); + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param message Int64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param message Int64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int64Value; + + /** + * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int64Value; + + /** + * Verifies an Int64Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Int64Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Int64Value; + + /** + * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * @param message Int64Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Int64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Int64Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** UInt64Value value */ + value?: (number|Long|string|null); + } + + /** Represents a UInt64Value. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUInt64Value); + + /** UInt64Value value. */ + public value: (number|Long|string); + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param message UInt64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param message UInt64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt64Value; + + /** + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt64Value; + + /** + * Verifies a UInt64Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UInt64Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UInt64Value; + + /** + * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. + * @param message UInt64Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UInt64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UInt64Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** Int32Value value */ + value?: (number|null); + } + + /** Represents an Int32Value. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IInt32Value); + + /** Int32Value value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param message Int32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param message Int32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int32Value; + + /** + * Decodes an Int32Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int32Value; + + /** + * Verifies an Int32Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Int32Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Int32Value; + + /** + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. + * @param message Int32Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Int32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Int32Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** UInt32Value value */ + value?: (number|null); + } + + /** Represents a UInt32Value. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUInt32Value); + + /** UInt32Value value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param message UInt32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param message UInt32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt32Value; + + /** + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt32Value; + + /** + * Verifies a UInt32Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UInt32Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UInt32Value; + + /** + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. + * @param message UInt32Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UInt32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UInt32Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** BoolValue value */ + value?: (boolean|null); + } + + /** Represents a BoolValue. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IBoolValue); + + /** BoolValue value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param message BoolValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param message BoolValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BoolValue; + + /** + * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BoolValue; + + /** + * Verifies a BoolValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoolValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.BoolValue; + + /** + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * @param message BoolValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.BoolValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoolValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** StringValue value */ + value?: (string|null); + } + + /** Represents a StringValue. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IStringValue); + + /** StringValue value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param message StringValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param message StringValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.StringValue; + + /** + * Decodes a StringValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.StringValue; + + /** + * Verifies a StringValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StringValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StringValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.StringValue; + + /** + * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * @param message StringValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.StringValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StringValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** BytesValue value */ + value?: (Uint8Array|Buffer|string|null); + } + + /** Represents a BytesValue. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IBytesValue); + + /** BytesValue value. */ + public value: (Uint8Array|Buffer|string); + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param message BytesValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param message BytesValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BytesValue; + + /** + * Decodes a BytesValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BytesValue; + + /** + * Verifies a BytesValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BytesValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.BytesValue; + + /** + * Creates a plain object from a BytesValue message. Also converts values to other types if specified. + * @param message BytesValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.BytesValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BytesValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldMask. */ + interface IFieldMask { + + /** FieldMask paths */ + paths?: (string[]|null); + } + + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { + + /** + * Constructs a new FieldMask. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldMask); + + /** FieldMask paths. */ + public paths: string[]; + + /** + * Creates a new FieldMask instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldMask instance + */ + public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; + + /** + * Verifies a FieldMask message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldMask + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @param message FieldMask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldMask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldMask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace longrunning. */ + namespace longrunning { + + /** Represents an Operations */ + class Operations extends $protobuf.rpc.Service { + + /** + * Constructs a new Operations service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Operations service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Operations; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOperationsResponse + */ + public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @returns Promise + */ + public listOperations(request: google.longrunning.IListOperationsRequest): Promise; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @returns Promise + */ + public getOperation(request: google.longrunning.IGetOperationRequest): Promise; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @returns Promise + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @returns Promise + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @returns Promise + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; + } + + namespace Operations { + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @param error Error, if any + * @param [response] ListOperationsResponse + */ + type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Operation. */ + interface IOperation { + + /** Operation name */ + name?: (string|null); + + /** Operation metadata */ + metadata?: (google.protobuf.IAny|null); + + /** Operation done */ + done?: (boolean|null); + + /** Operation error */ + error?: (google.rpc.IStatus|null); + + /** Operation response */ + response?: (google.protobuf.IAny|null); + } + + /** Represents an Operation. */ + class Operation implements IOperation { + + /** + * Constructs a new Operation. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperation); + + /** Operation name. */ + public name: string; + + /** Operation metadata. */ + public metadata?: (google.protobuf.IAny|null); + + /** Operation done. */ + public done: boolean; + + /** Operation error. */ + public error?: (google.rpc.IStatus|null); + + /** Operation response. */ + public response?: (google.protobuf.IAny|null); + + /** Operation result. */ + public result?: ("error"|"response"); + + /** + * Creates a new Operation instance using the specified properties. + * @param [properties] Properties to set + * @returns Operation instance + */ + public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.Operation; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.Operation; + + /** + * Verifies an Operation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Operation + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @param message Operation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Operation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Operation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetOperationRequest. */ + interface IGetOperationRequest { + + /** GetOperationRequest name */ + name?: (string|null); + } + + /** Represents a GetOperationRequest. */ + class GetOperationRequest implements IGetOperationRequest { + + /** + * Constructs a new GetOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IGetOperationRequest); + + /** GetOperationRequest name. */ + public name: string; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOperationRequest instance + */ + public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.GetOperationRequest; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.GetOperationRequest; + + /** + * Verifies a GetOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @param message GetOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsRequest. */ + interface IListOperationsRequest { + + /** ListOperationsRequest name */ + name?: (string|null); + + /** ListOperationsRequest filter */ + filter?: (string|null); + + /** ListOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOperationsRequest. */ + class ListOperationsRequest implements IListOperationsRequest { + + /** + * Constructs a new ListOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsRequest); + + /** ListOperationsRequest name. */ + public name: string; + + /** ListOperationsRequest filter. */ + public filter: string; + + /** ListOperationsRequest pageSize. */ + public pageSize: number; + + /** ListOperationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsRequest instance + */ + public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsRequest; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsRequest; + + /** + * Verifies a ListOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @param message ListOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsResponse. */ + interface IListOperationsResponse { + + /** ListOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOperationsResponse. */ + class ListOperationsResponse implements IListOperationsResponse { + + /** + * Constructs a new ListOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsResponse); + + /** ListOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsResponse instance + */ + public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsResponse; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsResponse; + + /** + * Verifies a ListOperationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @param message ListOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelOperationRequest. */ + interface ICancelOperationRequest { + + /** CancelOperationRequest name */ + name?: (string|null); + } + + /** Represents a CancelOperationRequest. */ + class CancelOperationRequest implements ICancelOperationRequest { + + /** + * Constructs a new CancelOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.ICancelOperationRequest); + + /** CancelOperationRequest name. */ + public name: string; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelOperationRequest instance + */ + public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.CancelOperationRequest; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.CancelOperationRequest; + + /** + * Verifies a CancelOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @param message CancelOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteOperationRequest. */ + interface IDeleteOperationRequest { + + /** DeleteOperationRequest name */ + name?: (string|null); + } + + /** Represents a DeleteOperationRequest. */ + class DeleteOperationRequest implements IDeleteOperationRequest { + + /** + * Constructs a new DeleteOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IDeleteOperationRequest); + + /** DeleteOperationRequest name. */ + public name: string; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOperationRequest instance + */ + public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.DeleteOperationRequest; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.DeleteOperationRequest; + + /** + * Verifies a DeleteOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @param message DeleteOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WaitOperationRequest. */ + interface IWaitOperationRequest { + + /** WaitOperationRequest name */ + name?: (string|null); + + /** WaitOperationRequest timeout */ + timeout?: (google.protobuf.IDuration|null); + } + + /** Represents a WaitOperationRequest. */ + class WaitOperationRequest implements IWaitOperationRequest { + + /** + * Constructs a new WaitOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IWaitOperationRequest); + + /** WaitOperationRequest name. */ + public name: string; + + /** WaitOperationRequest timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WaitOperationRequest instance + */ + public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.WaitOperationRequest; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.WaitOperationRequest; + + /** + * Verifies a WaitOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WaitOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @param message WaitOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WaitOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WaitOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationInfo. */ + interface IOperationInfo { + + /** OperationInfo responseType */ + responseType?: (string|null); + + /** OperationInfo metadataType */ + metadataType?: (string|null); + } + + /** Represents an OperationInfo. */ + class OperationInfo implements IOperationInfo { + + /** + * Constructs a new OperationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperationInfo); + + /** OperationInfo responseType. */ + public responseType: string; + + /** OperationInfo metadataType. */ + public metadataType: string; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationInfo instance + */ + public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.OperationInfo; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.OperationInfo; + + /** + * Verifies an OperationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationInfo + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @param message OperationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; + + /** + * Verifies a Status message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/protos/protos.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/protos/protos.js new file mode 100644 index 00000000000..5a027864748 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/protos/protos.js @@ -0,0 +1,35287 @@ +// 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. + +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +(function(global, factory) { /* global define, require, module */ + + /* AMD */ if (typeof define === 'function' && define.amd) + define(["protobufjs/minimal"], factory); + + /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) + module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal); + +})(this, function($protobuf) { + "use strict"; + + // Common aliases + var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + + // Exported root namespace + var $root = $protobuf.roots._google_cloud_speech_protos || ($protobuf.roots._google_cloud_speech_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.speech = (function() { + + /** + * Namespace speech. + * @memberof google.cloud + * @namespace + */ + var speech = {}; + + speech.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.speech + * @namespace + */ + var v1 = {}; + + v1.Speech = (function() { + + /** + * Constructs a new Speech service. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a Speech + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Speech(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Speech.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Speech; + + /** + * Creates new Speech service using the specified rpc implementation. + * @function create + * @memberof google.cloud.speech.v1.Speech + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Speech} RPC service. Useful where requests and/or responses are streamed. + */ + Speech.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.speech.v1.Speech|recognize}. + * @memberof google.cloud.speech.v1.Speech + * @typedef RecognizeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.speech.v1.RecognizeResponse} [response] RecognizeResponse + */ + + /** + * Calls Recognize. + * @function recognize + * @memberof google.cloud.speech.v1.Speech + * @instance + * @param {google.cloud.speech.v1.IRecognizeRequest} request RecognizeRequest message or plain object + * @param {google.cloud.speech.v1.Speech.RecognizeCallback} callback Node-style callback called with the error, if any, and RecognizeResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Speech.prototype.recognize = function recognize(request, callback) { + return this.rpcCall(recognize, $root.google.cloud.speech.v1.RecognizeRequest, $root.google.cloud.speech.v1.RecognizeResponse, request, callback); + }, "name", { value: "Recognize" }); + + /** + * Calls Recognize. + * @function recognize + * @memberof google.cloud.speech.v1.Speech + * @instance + * @param {google.cloud.speech.v1.IRecognizeRequest} request RecognizeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.speech.v1.Speech|longRunningRecognize}. + * @memberof google.cloud.speech.v1.Speech + * @typedef LongRunningRecognizeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls LongRunningRecognize. + * @function longRunningRecognize + * @memberof google.cloud.speech.v1.Speech + * @instance + * @param {google.cloud.speech.v1.ILongRunningRecognizeRequest} request LongRunningRecognizeRequest message or plain object + * @param {google.cloud.speech.v1.Speech.LongRunningRecognizeCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Speech.prototype.longRunningRecognize = function longRunningRecognize(request, callback) { + return this.rpcCall(longRunningRecognize, $root.google.cloud.speech.v1.LongRunningRecognizeRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "LongRunningRecognize" }); + + /** + * Calls LongRunningRecognize. + * @function longRunningRecognize + * @memberof google.cloud.speech.v1.Speech + * @instance + * @param {google.cloud.speech.v1.ILongRunningRecognizeRequest} request LongRunningRecognizeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.speech.v1.Speech|streamingRecognize}. + * @memberof google.cloud.speech.v1.Speech + * @typedef StreamingRecognizeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.speech.v1.StreamingRecognizeResponse} [response] StreamingRecognizeResponse + */ + + /** + * Calls StreamingRecognize. + * @function streamingRecognize + * @memberof google.cloud.speech.v1.Speech + * @instance + * @param {google.cloud.speech.v1.IStreamingRecognizeRequest} request StreamingRecognizeRequest message or plain object + * @param {google.cloud.speech.v1.Speech.StreamingRecognizeCallback} callback Node-style callback called with the error, if any, and StreamingRecognizeResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Speech.prototype.streamingRecognize = function streamingRecognize(request, callback) { + return this.rpcCall(streamingRecognize, $root.google.cloud.speech.v1.StreamingRecognizeRequest, $root.google.cloud.speech.v1.StreamingRecognizeResponse, request, callback); + }, "name", { value: "StreamingRecognize" }); + + /** + * Calls StreamingRecognize. + * @function streamingRecognize + * @memberof google.cloud.speech.v1.Speech + * @instance + * @param {google.cloud.speech.v1.IStreamingRecognizeRequest} request StreamingRecognizeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Speech; + })(); + + v1.RecognizeRequest = (function() { + + /** + * Properties of a RecognizeRequest. + * @memberof google.cloud.speech.v1 + * @interface IRecognizeRequest + * @property {google.cloud.speech.v1.IRecognitionConfig|null} [config] RecognizeRequest config + * @property {google.cloud.speech.v1.IRecognitionAudio|null} [audio] RecognizeRequest audio + */ + + /** + * Constructs a new RecognizeRequest. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a RecognizeRequest. + * @implements IRecognizeRequest + * @constructor + * @param {google.cloud.speech.v1.IRecognizeRequest=} [properties] Properties to set + */ + function RecognizeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RecognizeRequest config. + * @member {google.cloud.speech.v1.IRecognitionConfig|null|undefined} config + * @memberof google.cloud.speech.v1.RecognizeRequest + * @instance + */ + RecognizeRequest.prototype.config = null; + + /** + * RecognizeRequest audio. + * @member {google.cloud.speech.v1.IRecognitionAudio|null|undefined} audio + * @memberof google.cloud.speech.v1.RecognizeRequest + * @instance + */ + RecognizeRequest.prototype.audio = null; + + /** + * Creates a new RecognizeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.RecognizeRequest + * @static + * @param {google.cloud.speech.v1.IRecognizeRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v1.RecognizeRequest} RecognizeRequest instance + */ + RecognizeRequest.create = function create(properties) { + return new RecognizeRequest(properties); + }; + + /** + * Encodes the specified RecognizeRequest message. Does not implicitly {@link google.cloud.speech.v1.RecognizeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.RecognizeRequest + * @static + * @param {google.cloud.speech.v1.IRecognizeRequest} message RecognizeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecognizeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.cloud.speech.v1.RecognitionConfig.encode(message.config, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.audio != null && Object.hasOwnProperty.call(message, "audio")) + $root.google.cloud.speech.v1.RecognitionAudio.encode(message.audio, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RecognizeRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.RecognizeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.RecognizeRequest + * @static + * @param {google.cloud.speech.v1.IRecognizeRequest} message RecognizeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecognizeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RecognizeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.RecognizeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.RecognizeRequest} RecognizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecognizeRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.RecognizeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.config = $root.google.cloud.speech.v1.RecognitionConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.audio = $root.google.cloud.speech.v1.RecognitionAudio.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RecognizeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.RecognizeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.RecognizeRequest} RecognizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecognizeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RecognizeRequest message. + * @function verify + * @memberof google.cloud.speech.v1.RecognizeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RecognizeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.config != null && message.hasOwnProperty("config")) { + var error = $root.google.cloud.speech.v1.RecognitionConfig.verify(message.config); + if (error) + return "config." + error; + } + if (message.audio != null && message.hasOwnProperty("audio")) { + var error = $root.google.cloud.speech.v1.RecognitionAudio.verify(message.audio); + if (error) + return "audio." + error; + } + return null; + }; + + /** + * Creates a RecognizeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.RecognizeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.RecognizeRequest} RecognizeRequest + */ + RecognizeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.RecognizeRequest) + return object; + var message = new $root.google.cloud.speech.v1.RecognizeRequest(); + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.cloud.speech.v1.RecognizeRequest.config: object expected"); + message.config = $root.google.cloud.speech.v1.RecognitionConfig.fromObject(object.config); + } + if (object.audio != null) { + if (typeof object.audio !== "object") + throw TypeError(".google.cloud.speech.v1.RecognizeRequest.audio: object expected"); + message.audio = $root.google.cloud.speech.v1.RecognitionAudio.fromObject(object.audio); + } + return message; + }; + + /** + * Creates a plain object from a RecognizeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.RecognizeRequest + * @static + * @param {google.cloud.speech.v1.RecognizeRequest} message RecognizeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RecognizeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.config = null; + object.audio = null; + } + if (message.config != null && message.hasOwnProperty("config")) + object.config = $root.google.cloud.speech.v1.RecognitionConfig.toObject(message.config, options); + if (message.audio != null && message.hasOwnProperty("audio")) + object.audio = $root.google.cloud.speech.v1.RecognitionAudio.toObject(message.audio, options); + return object; + }; + + /** + * Converts this RecognizeRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.RecognizeRequest + * @instance + * @returns {Object.} JSON object + */ + RecognizeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RecognizeRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v1.RecognizeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RecognizeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.RecognizeRequest"; + }; + + return RecognizeRequest; + })(); + + v1.LongRunningRecognizeRequest = (function() { + + /** + * Properties of a LongRunningRecognizeRequest. + * @memberof google.cloud.speech.v1 + * @interface ILongRunningRecognizeRequest + * @property {google.cloud.speech.v1.IRecognitionConfig|null} [config] LongRunningRecognizeRequest config + * @property {google.cloud.speech.v1.IRecognitionAudio|null} [audio] LongRunningRecognizeRequest audio + * @property {google.cloud.speech.v1.ITranscriptOutputConfig|null} [outputConfig] LongRunningRecognizeRequest outputConfig + */ + + /** + * Constructs a new LongRunningRecognizeRequest. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a LongRunningRecognizeRequest. + * @implements ILongRunningRecognizeRequest + * @constructor + * @param {google.cloud.speech.v1.ILongRunningRecognizeRequest=} [properties] Properties to set + */ + function LongRunningRecognizeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LongRunningRecognizeRequest config. + * @member {google.cloud.speech.v1.IRecognitionConfig|null|undefined} config + * @memberof google.cloud.speech.v1.LongRunningRecognizeRequest + * @instance + */ + LongRunningRecognizeRequest.prototype.config = null; + + /** + * LongRunningRecognizeRequest audio. + * @member {google.cloud.speech.v1.IRecognitionAudio|null|undefined} audio + * @memberof google.cloud.speech.v1.LongRunningRecognizeRequest + * @instance + */ + LongRunningRecognizeRequest.prototype.audio = null; + + /** + * LongRunningRecognizeRequest outputConfig. + * @member {google.cloud.speech.v1.ITranscriptOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.speech.v1.LongRunningRecognizeRequest + * @instance + */ + LongRunningRecognizeRequest.prototype.outputConfig = null; + + /** + * Creates a new LongRunningRecognizeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.LongRunningRecognizeRequest + * @static + * @param {google.cloud.speech.v1.ILongRunningRecognizeRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v1.LongRunningRecognizeRequest} LongRunningRecognizeRequest instance + */ + LongRunningRecognizeRequest.create = function create(properties) { + return new LongRunningRecognizeRequest(properties); + }; + + /** + * Encodes the specified LongRunningRecognizeRequest message. Does not implicitly {@link google.cloud.speech.v1.LongRunningRecognizeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.LongRunningRecognizeRequest + * @static + * @param {google.cloud.speech.v1.ILongRunningRecognizeRequest} message LongRunningRecognizeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunningRecognizeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.cloud.speech.v1.RecognitionConfig.encode(message.config, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.audio != null && Object.hasOwnProperty.call(message, "audio")) + $root.google.cloud.speech.v1.RecognitionAudio.encode(message.audio, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) + $root.google.cloud.speech.v1.TranscriptOutputConfig.encode(message.outputConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LongRunningRecognizeRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.LongRunningRecognizeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.LongRunningRecognizeRequest + * @static + * @param {google.cloud.speech.v1.ILongRunningRecognizeRequest} message LongRunningRecognizeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunningRecognizeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LongRunningRecognizeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.LongRunningRecognizeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.LongRunningRecognizeRequest} LongRunningRecognizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunningRecognizeRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.LongRunningRecognizeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.config = $root.google.cloud.speech.v1.RecognitionConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.audio = $root.google.cloud.speech.v1.RecognitionAudio.decode(reader, reader.uint32()); + break; + } + case 4: { + message.outputConfig = $root.google.cloud.speech.v1.TranscriptOutputConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LongRunningRecognizeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.LongRunningRecognizeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.LongRunningRecognizeRequest} LongRunningRecognizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunningRecognizeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LongRunningRecognizeRequest message. + * @function verify + * @memberof google.cloud.speech.v1.LongRunningRecognizeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LongRunningRecognizeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.config != null && message.hasOwnProperty("config")) { + var error = $root.google.cloud.speech.v1.RecognitionConfig.verify(message.config); + if (error) + return "config." + error; + } + if (message.audio != null && message.hasOwnProperty("audio")) { + var error = $root.google.cloud.speech.v1.RecognitionAudio.verify(message.audio); + if (error) + return "audio." + error; + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.speech.v1.TranscriptOutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + return null; + }; + + /** + * Creates a LongRunningRecognizeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.LongRunningRecognizeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.LongRunningRecognizeRequest} LongRunningRecognizeRequest + */ + LongRunningRecognizeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.LongRunningRecognizeRequest) + return object; + var message = new $root.google.cloud.speech.v1.LongRunningRecognizeRequest(); + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.cloud.speech.v1.LongRunningRecognizeRequest.config: object expected"); + message.config = $root.google.cloud.speech.v1.RecognitionConfig.fromObject(object.config); + } + if (object.audio != null) { + if (typeof object.audio !== "object") + throw TypeError(".google.cloud.speech.v1.LongRunningRecognizeRequest.audio: object expected"); + message.audio = $root.google.cloud.speech.v1.RecognitionAudio.fromObject(object.audio); + } + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.speech.v1.LongRunningRecognizeRequest.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.speech.v1.TranscriptOutputConfig.fromObject(object.outputConfig); + } + return message; + }; + + /** + * Creates a plain object from a LongRunningRecognizeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.LongRunningRecognizeRequest + * @static + * @param {google.cloud.speech.v1.LongRunningRecognizeRequest} message LongRunningRecognizeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LongRunningRecognizeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.config = null; + object.audio = null; + object.outputConfig = null; + } + if (message.config != null && message.hasOwnProperty("config")) + object.config = $root.google.cloud.speech.v1.RecognitionConfig.toObject(message.config, options); + if (message.audio != null && message.hasOwnProperty("audio")) + object.audio = $root.google.cloud.speech.v1.RecognitionAudio.toObject(message.audio, options); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.speech.v1.TranscriptOutputConfig.toObject(message.outputConfig, options); + return object; + }; + + /** + * Converts this LongRunningRecognizeRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.LongRunningRecognizeRequest + * @instance + * @returns {Object.} JSON object + */ + LongRunningRecognizeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LongRunningRecognizeRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v1.LongRunningRecognizeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LongRunningRecognizeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.LongRunningRecognizeRequest"; + }; + + return LongRunningRecognizeRequest; + })(); + + v1.TranscriptOutputConfig = (function() { + + /** + * Properties of a TranscriptOutputConfig. + * @memberof google.cloud.speech.v1 + * @interface ITranscriptOutputConfig + * @property {string|null} [gcsUri] TranscriptOutputConfig gcsUri + */ + + /** + * Constructs a new TranscriptOutputConfig. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a TranscriptOutputConfig. + * @implements ITranscriptOutputConfig + * @constructor + * @param {google.cloud.speech.v1.ITranscriptOutputConfig=} [properties] Properties to set + */ + function TranscriptOutputConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TranscriptOutputConfig gcsUri. + * @member {string|null|undefined} gcsUri + * @memberof google.cloud.speech.v1.TranscriptOutputConfig + * @instance + */ + TranscriptOutputConfig.prototype.gcsUri = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TranscriptOutputConfig outputType. + * @member {"gcsUri"|undefined} outputType + * @memberof google.cloud.speech.v1.TranscriptOutputConfig + * @instance + */ + Object.defineProperty(TranscriptOutputConfig.prototype, "outputType", { + get: $util.oneOfGetter($oneOfFields = ["gcsUri"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TranscriptOutputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.TranscriptOutputConfig + * @static + * @param {google.cloud.speech.v1.ITranscriptOutputConfig=} [properties] Properties to set + * @returns {google.cloud.speech.v1.TranscriptOutputConfig} TranscriptOutputConfig instance + */ + TranscriptOutputConfig.create = function create(properties) { + return new TranscriptOutputConfig(properties); + }; + + /** + * Encodes the specified TranscriptOutputConfig message. Does not implicitly {@link google.cloud.speech.v1.TranscriptOutputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.TranscriptOutputConfig + * @static + * @param {google.cloud.speech.v1.ITranscriptOutputConfig} message TranscriptOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranscriptOutputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsUri != null && Object.hasOwnProperty.call(message, "gcsUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsUri); + return writer; + }; + + /** + * Encodes the specified TranscriptOutputConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v1.TranscriptOutputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.TranscriptOutputConfig + * @static + * @param {google.cloud.speech.v1.ITranscriptOutputConfig} message TranscriptOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranscriptOutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TranscriptOutputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.TranscriptOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.TranscriptOutputConfig} TranscriptOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranscriptOutputConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.TranscriptOutputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.gcsUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TranscriptOutputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.TranscriptOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.TranscriptOutputConfig} TranscriptOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranscriptOutputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TranscriptOutputConfig message. + * @function verify + * @memberof google.cloud.speech.v1.TranscriptOutputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TranscriptOutputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) { + properties.outputType = 1; + if (!$util.isString(message.gcsUri)) + return "gcsUri: string expected"; + } + return null; + }; + + /** + * Creates a TranscriptOutputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.TranscriptOutputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.TranscriptOutputConfig} TranscriptOutputConfig + */ + TranscriptOutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.TranscriptOutputConfig) + return object; + var message = new $root.google.cloud.speech.v1.TranscriptOutputConfig(); + if (object.gcsUri != null) + message.gcsUri = String(object.gcsUri); + return message; + }; + + /** + * Creates a plain object from a TranscriptOutputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.TranscriptOutputConfig + * @static + * @param {google.cloud.speech.v1.TranscriptOutputConfig} message TranscriptOutputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TranscriptOutputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) { + object.gcsUri = message.gcsUri; + if (options.oneofs) + object.outputType = "gcsUri"; + } + return object; + }; + + /** + * Converts this TranscriptOutputConfig to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.TranscriptOutputConfig + * @instance + * @returns {Object.} JSON object + */ + TranscriptOutputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TranscriptOutputConfig + * @function getTypeUrl + * @memberof google.cloud.speech.v1.TranscriptOutputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TranscriptOutputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.TranscriptOutputConfig"; + }; + + return TranscriptOutputConfig; + })(); + + v1.StreamingRecognizeRequest = (function() { + + /** + * Properties of a StreamingRecognizeRequest. + * @memberof google.cloud.speech.v1 + * @interface IStreamingRecognizeRequest + * @property {google.cloud.speech.v1.IStreamingRecognitionConfig|null} [streamingConfig] StreamingRecognizeRequest streamingConfig + * @property {Uint8Array|null} [audioContent] StreamingRecognizeRequest audioContent + */ + + /** + * Constructs a new StreamingRecognizeRequest. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a StreamingRecognizeRequest. + * @implements IStreamingRecognizeRequest + * @constructor + * @param {google.cloud.speech.v1.IStreamingRecognizeRequest=} [properties] Properties to set + */ + function StreamingRecognizeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamingRecognizeRequest streamingConfig. + * @member {google.cloud.speech.v1.IStreamingRecognitionConfig|null|undefined} streamingConfig + * @memberof google.cloud.speech.v1.StreamingRecognizeRequest + * @instance + */ + StreamingRecognizeRequest.prototype.streamingConfig = null; + + /** + * StreamingRecognizeRequest audioContent. + * @member {Uint8Array|null|undefined} audioContent + * @memberof google.cloud.speech.v1.StreamingRecognizeRequest + * @instance + */ + StreamingRecognizeRequest.prototype.audioContent = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * StreamingRecognizeRequest streamingRequest. + * @member {"streamingConfig"|"audioContent"|undefined} streamingRequest + * @memberof google.cloud.speech.v1.StreamingRecognizeRequest + * @instance + */ + Object.defineProperty(StreamingRecognizeRequest.prototype, "streamingRequest", { + get: $util.oneOfGetter($oneOfFields = ["streamingConfig", "audioContent"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StreamingRecognizeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.StreamingRecognizeRequest + * @static + * @param {google.cloud.speech.v1.IStreamingRecognizeRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v1.StreamingRecognizeRequest} StreamingRecognizeRequest instance + */ + StreamingRecognizeRequest.create = function create(properties) { + return new StreamingRecognizeRequest(properties); + }; + + /** + * Encodes the specified StreamingRecognizeRequest message. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognizeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.StreamingRecognizeRequest + * @static + * @param {google.cloud.speech.v1.IStreamingRecognizeRequest} message StreamingRecognizeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingRecognizeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.streamingConfig != null && Object.hasOwnProperty.call(message, "streamingConfig")) + $root.google.cloud.speech.v1.StreamingRecognitionConfig.encode(message.streamingConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.audioContent != null && Object.hasOwnProperty.call(message, "audioContent")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.audioContent); + return writer; + }; + + /** + * Encodes the specified StreamingRecognizeRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognizeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.StreamingRecognizeRequest + * @static + * @param {google.cloud.speech.v1.IStreamingRecognizeRequest} message StreamingRecognizeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingRecognizeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamingRecognizeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.StreamingRecognizeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.StreamingRecognizeRequest} StreamingRecognizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingRecognizeRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.StreamingRecognizeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.streamingConfig = $root.google.cloud.speech.v1.StreamingRecognitionConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.audioContent = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamingRecognizeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.StreamingRecognizeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.StreamingRecognizeRequest} StreamingRecognizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingRecognizeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamingRecognizeRequest message. + * @function verify + * @memberof google.cloud.speech.v1.StreamingRecognizeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingRecognizeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.streamingConfig != null && message.hasOwnProperty("streamingConfig")) { + properties.streamingRequest = 1; + { + var error = $root.google.cloud.speech.v1.StreamingRecognitionConfig.verify(message.streamingConfig); + if (error) + return "streamingConfig." + error; + } + } + if (message.audioContent != null && message.hasOwnProperty("audioContent")) { + if (properties.streamingRequest === 1) + return "streamingRequest: multiple values"; + properties.streamingRequest = 1; + if (!(message.audioContent && typeof message.audioContent.length === "number" || $util.isString(message.audioContent))) + return "audioContent: buffer expected"; + } + return null; + }; + + /** + * Creates a StreamingRecognizeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.StreamingRecognizeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.StreamingRecognizeRequest} StreamingRecognizeRequest + */ + StreamingRecognizeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.StreamingRecognizeRequest) + return object; + var message = new $root.google.cloud.speech.v1.StreamingRecognizeRequest(); + if (object.streamingConfig != null) { + if (typeof object.streamingConfig !== "object") + throw TypeError(".google.cloud.speech.v1.StreamingRecognizeRequest.streamingConfig: object expected"); + message.streamingConfig = $root.google.cloud.speech.v1.StreamingRecognitionConfig.fromObject(object.streamingConfig); + } + if (object.audioContent != null) + if (typeof object.audioContent === "string") + $util.base64.decode(object.audioContent, message.audioContent = $util.newBuffer($util.base64.length(object.audioContent)), 0); + else if (object.audioContent.length >= 0) + message.audioContent = object.audioContent; + return message; + }; + + /** + * Creates a plain object from a StreamingRecognizeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.StreamingRecognizeRequest + * @static + * @param {google.cloud.speech.v1.StreamingRecognizeRequest} message StreamingRecognizeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingRecognizeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.streamingConfig != null && message.hasOwnProperty("streamingConfig")) { + object.streamingConfig = $root.google.cloud.speech.v1.StreamingRecognitionConfig.toObject(message.streamingConfig, options); + if (options.oneofs) + object.streamingRequest = "streamingConfig"; + } + if (message.audioContent != null && message.hasOwnProperty("audioContent")) { + object.audioContent = options.bytes === String ? $util.base64.encode(message.audioContent, 0, message.audioContent.length) : options.bytes === Array ? Array.prototype.slice.call(message.audioContent) : message.audioContent; + if (options.oneofs) + object.streamingRequest = "audioContent"; + } + return object; + }; + + /** + * Converts this StreamingRecognizeRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.StreamingRecognizeRequest + * @instance + * @returns {Object.} JSON object + */ + StreamingRecognizeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamingRecognizeRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v1.StreamingRecognizeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamingRecognizeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.StreamingRecognizeRequest"; + }; + + return StreamingRecognizeRequest; + })(); + + v1.StreamingRecognitionConfig = (function() { + + /** + * Properties of a StreamingRecognitionConfig. + * @memberof google.cloud.speech.v1 + * @interface IStreamingRecognitionConfig + * @property {google.cloud.speech.v1.IRecognitionConfig|null} [config] StreamingRecognitionConfig config + * @property {boolean|null} [singleUtterance] StreamingRecognitionConfig singleUtterance + * @property {boolean|null} [interimResults] StreamingRecognitionConfig interimResults + * @property {boolean|null} [enableVoiceActivityEvents] StreamingRecognitionConfig enableVoiceActivityEvents + * @property {google.cloud.speech.v1.StreamingRecognitionConfig.IVoiceActivityTimeout|null} [voiceActivityTimeout] StreamingRecognitionConfig voiceActivityTimeout + */ + + /** + * Constructs a new StreamingRecognitionConfig. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a StreamingRecognitionConfig. + * @implements IStreamingRecognitionConfig + * @constructor + * @param {google.cloud.speech.v1.IStreamingRecognitionConfig=} [properties] Properties to set + */ + function StreamingRecognitionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamingRecognitionConfig config. + * @member {google.cloud.speech.v1.IRecognitionConfig|null|undefined} config + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig + * @instance + */ + StreamingRecognitionConfig.prototype.config = null; + + /** + * StreamingRecognitionConfig singleUtterance. + * @member {boolean} singleUtterance + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig + * @instance + */ + StreamingRecognitionConfig.prototype.singleUtterance = false; + + /** + * StreamingRecognitionConfig interimResults. + * @member {boolean} interimResults + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig + * @instance + */ + StreamingRecognitionConfig.prototype.interimResults = false; + + /** + * StreamingRecognitionConfig enableVoiceActivityEvents. + * @member {boolean} enableVoiceActivityEvents + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig + * @instance + */ + StreamingRecognitionConfig.prototype.enableVoiceActivityEvents = false; + + /** + * StreamingRecognitionConfig voiceActivityTimeout. + * @member {google.cloud.speech.v1.StreamingRecognitionConfig.IVoiceActivityTimeout|null|undefined} voiceActivityTimeout + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig + * @instance + */ + StreamingRecognitionConfig.prototype.voiceActivityTimeout = null; + + /** + * Creates a new StreamingRecognitionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig + * @static + * @param {google.cloud.speech.v1.IStreamingRecognitionConfig=} [properties] Properties to set + * @returns {google.cloud.speech.v1.StreamingRecognitionConfig} StreamingRecognitionConfig instance + */ + StreamingRecognitionConfig.create = function create(properties) { + return new StreamingRecognitionConfig(properties); + }; + + /** + * Encodes the specified StreamingRecognitionConfig message. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognitionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig + * @static + * @param {google.cloud.speech.v1.IStreamingRecognitionConfig} message StreamingRecognitionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingRecognitionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.cloud.speech.v1.RecognitionConfig.encode(message.config, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.singleUtterance != null && Object.hasOwnProperty.call(message, "singleUtterance")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.singleUtterance); + if (message.interimResults != null && Object.hasOwnProperty.call(message, "interimResults")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.interimResults); + if (message.enableVoiceActivityEvents != null && Object.hasOwnProperty.call(message, "enableVoiceActivityEvents")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.enableVoiceActivityEvents); + if (message.voiceActivityTimeout != null && Object.hasOwnProperty.call(message, "voiceActivityTimeout")) + $root.google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout.encode(message.voiceActivityTimeout, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StreamingRecognitionConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognitionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig + * @static + * @param {google.cloud.speech.v1.IStreamingRecognitionConfig} message StreamingRecognitionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingRecognitionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamingRecognitionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.StreamingRecognitionConfig} StreamingRecognitionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingRecognitionConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.StreamingRecognitionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.config = $root.google.cloud.speech.v1.RecognitionConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.singleUtterance = reader.bool(); + break; + } + case 3: { + message.interimResults = reader.bool(); + break; + } + case 5: { + message.enableVoiceActivityEvents = reader.bool(); + break; + } + case 6: { + message.voiceActivityTimeout = $root.google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamingRecognitionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.StreamingRecognitionConfig} StreamingRecognitionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingRecognitionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamingRecognitionConfig message. + * @function verify + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingRecognitionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.config != null && message.hasOwnProperty("config")) { + var error = $root.google.cloud.speech.v1.RecognitionConfig.verify(message.config); + if (error) + return "config." + error; + } + if (message.singleUtterance != null && message.hasOwnProperty("singleUtterance")) + if (typeof message.singleUtterance !== "boolean") + return "singleUtterance: boolean expected"; + if (message.interimResults != null && message.hasOwnProperty("interimResults")) + if (typeof message.interimResults !== "boolean") + return "interimResults: boolean expected"; + if (message.enableVoiceActivityEvents != null && message.hasOwnProperty("enableVoiceActivityEvents")) + if (typeof message.enableVoiceActivityEvents !== "boolean") + return "enableVoiceActivityEvents: boolean expected"; + if (message.voiceActivityTimeout != null && message.hasOwnProperty("voiceActivityTimeout")) { + var error = $root.google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout.verify(message.voiceActivityTimeout); + if (error) + return "voiceActivityTimeout." + error; + } + return null; + }; + + /** + * Creates a StreamingRecognitionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.StreamingRecognitionConfig} StreamingRecognitionConfig + */ + StreamingRecognitionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.StreamingRecognitionConfig) + return object; + var message = new $root.google.cloud.speech.v1.StreamingRecognitionConfig(); + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.cloud.speech.v1.StreamingRecognitionConfig.config: object expected"); + message.config = $root.google.cloud.speech.v1.RecognitionConfig.fromObject(object.config); + } + if (object.singleUtterance != null) + message.singleUtterance = Boolean(object.singleUtterance); + if (object.interimResults != null) + message.interimResults = Boolean(object.interimResults); + if (object.enableVoiceActivityEvents != null) + message.enableVoiceActivityEvents = Boolean(object.enableVoiceActivityEvents); + if (object.voiceActivityTimeout != null) { + if (typeof object.voiceActivityTimeout !== "object") + throw TypeError(".google.cloud.speech.v1.StreamingRecognitionConfig.voiceActivityTimeout: object expected"); + message.voiceActivityTimeout = $root.google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout.fromObject(object.voiceActivityTimeout); + } + return message; + }; + + /** + * Creates a plain object from a StreamingRecognitionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig + * @static + * @param {google.cloud.speech.v1.StreamingRecognitionConfig} message StreamingRecognitionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingRecognitionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.config = null; + object.singleUtterance = false; + object.interimResults = false; + object.enableVoiceActivityEvents = false; + object.voiceActivityTimeout = null; + } + if (message.config != null && message.hasOwnProperty("config")) + object.config = $root.google.cloud.speech.v1.RecognitionConfig.toObject(message.config, options); + if (message.singleUtterance != null && message.hasOwnProperty("singleUtterance")) + object.singleUtterance = message.singleUtterance; + if (message.interimResults != null && message.hasOwnProperty("interimResults")) + object.interimResults = message.interimResults; + if (message.enableVoiceActivityEvents != null && message.hasOwnProperty("enableVoiceActivityEvents")) + object.enableVoiceActivityEvents = message.enableVoiceActivityEvents; + if (message.voiceActivityTimeout != null && message.hasOwnProperty("voiceActivityTimeout")) + object.voiceActivityTimeout = $root.google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout.toObject(message.voiceActivityTimeout, options); + return object; + }; + + /** + * Converts this StreamingRecognitionConfig to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig + * @instance + * @returns {Object.} JSON object + */ + StreamingRecognitionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamingRecognitionConfig + * @function getTypeUrl + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamingRecognitionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.StreamingRecognitionConfig"; + }; + + StreamingRecognitionConfig.VoiceActivityTimeout = (function() { + + /** + * Properties of a VoiceActivityTimeout. + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig + * @interface IVoiceActivityTimeout + * @property {google.protobuf.IDuration|null} [speechStartTimeout] VoiceActivityTimeout speechStartTimeout + * @property {google.protobuf.IDuration|null} [speechEndTimeout] VoiceActivityTimeout speechEndTimeout + */ + + /** + * Constructs a new VoiceActivityTimeout. + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig + * @classdesc Represents a VoiceActivityTimeout. + * @implements IVoiceActivityTimeout + * @constructor + * @param {google.cloud.speech.v1.StreamingRecognitionConfig.IVoiceActivityTimeout=} [properties] Properties to set + */ + function VoiceActivityTimeout(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VoiceActivityTimeout speechStartTimeout. + * @member {google.protobuf.IDuration|null|undefined} speechStartTimeout + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout + * @instance + */ + VoiceActivityTimeout.prototype.speechStartTimeout = null; + + /** + * VoiceActivityTimeout speechEndTimeout. + * @member {google.protobuf.IDuration|null|undefined} speechEndTimeout + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout + * @instance + */ + VoiceActivityTimeout.prototype.speechEndTimeout = null; + + /** + * Creates a new VoiceActivityTimeout instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout + * @static + * @param {google.cloud.speech.v1.StreamingRecognitionConfig.IVoiceActivityTimeout=} [properties] Properties to set + * @returns {google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout} VoiceActivityTimeout instance + */ + VoiceActivityTimeout.create = function create(properties) { + return new VoiceActivityTimeout(properties); + }; + + /** + * Encodes the specified VoiceActivityTimeout message. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout + * @static + * @param {google.cloud.speech.v1.StreamingRecognitionConfig.IVoiceActivityTimeout} message VoiceActivityTimeout message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VoiceActivityTimeout.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.speechStartTimeout != null && Object.hasOwnProperty.call(message, "speechStartTimeout")) + $root.google.protobuf.Duration.encode(message.speechStartTimeout, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.speechEndTimeout != null && Object.hasOwnProperty.call(message, "speechEndTimeout")) + $root.google.protobuf.Duration.encode(message.speechEndTimeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VoiceActivityTimeout message, length delimited. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout + * @static + * @param {google.cloud.speech.v1.StreamingRecognitionConfig.IVoiceActivityTimeout} message VoiceActivityTimeout message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VoiceActivityTimeout.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VoiceActivityTimeout message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout} VoiceActivityTimeout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VoiceActivityTimeout.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.speechStartTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.speechEndTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VoiceActivityTimeout message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout} VoiceActivityTimeout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VoiceActivityTimeout.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VoiceActivityTimeout message. + * @function verify + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VoiceActivityTimeout.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.speechStartTimeout != null && message.hasOwnProperty("speechStartTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.speechStartTimeout); + if (error) + return "speechStartTimeout." + error; + } + if (message.speechEndTimeout != null && message.hasOwnProperty("speechEndTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.speechEndTimeout); + if (error) + return "speechEndTimeout." + error; + } + return null; + }; + + /** + * Creates a VoiceActivityTimeout message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout} VoiceActivityTimeout + */ + VoiceActivityTimeout.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout) + return object; + var message = new $root.google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout(); + if (object.speechStartTimeout != null) { + if (typeof object.speechStartTimeout !== "object") + throw TypeError(".google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout.speechStartTimeout: object expected"); + message.speechStartTimeout = $root.google.protobuf.Duration.fromObject(object.speechStartTimeout); + } + if (object.speechEndTimeout != null) { + if (typeof object.speechEndTimeout !== "object") + throw TypeError(".google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout.speechEndTimeout: object expected"); + message.speechEndTimeout = $root.google.protobuf.Duration.fromObject(object.speechEndTimeout); + } + return message; + }; + + /** + * Creates a plain object from a VoiceActivityTimeout message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout + * @static + * @param {google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout} message VoiceActivityTimeout + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VoiceActivityTimeout.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.speechStartTimeout = null; + object.speechEndTimeout = null; + } + if (message.speechStartTimeout != null && message.hasOwnProperty("speechStartTimeout")) + object.speechStartTimeout = $root.google.protobuf.Duration.toObject(message.speechStartTimeout, options); + if (message.speechEndTimeout != null && message.hasOwnProperty("speechEndTimeout")) + object.speechEndTimeout = $root.google.protobuf.Duration.toObject(message.speechEndTimeout, options); + return object; + }; + + /** + * Converts this VoiceActivityTimeout to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout + * @instance + * @returns {Object.} JSON object + */ + VoiceActivityTimeout.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VoiceActivityTimeout + * @function getTypeUrl + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VoiceActivityTimeout.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout"; + }; + + return VoiceActivityTimeout; + })(); + + return StreamingRecognitionConfig; + })(); + + v1.RecognitionConfig = (function() { + + /** + * Properties of a RecognitionConfig. + * @memberof google.cloud.speech.v1 + * @interface IRecognitionConfig + * @property {google.cloud.speech.v1.RecognitionConfig.AudioEncoding|null} [encoding] RecognitionConfig encoding + * @property {number|null} [sampleRateHertz] RecognitionConfig sampleRateHertz + * @property {number|null} [audioChannelCount] RecognitionConfig audioChannelCount + * @property {boolean|null} [enableSeparateRecognitionPerChannel] RecognitionConfig enableSeparateRecognitionPerChannel + * @property {string|null} [languageCode] RecognitionConfig languageCode + * @property {Array.|null} [alternativeLanguageCodes] RecognitionConfig alternativeLanguageCodes + * @property {number|null} [maxAlternatives] RecognitionConfig maxAlternatives + * @property {boolean|null} [profanityFilter] RecognitionConfig profanityFilter + * @property {google.cloud.speech.v1.ISpeechAdaptation|null} [adaptation] RecognitionConfig adaptation + * @property {google.cloud.speech.v1.ITranscriptNormalization|null} [transcriptNormalization] RecognitionConfig transcriptNormalization + * @property {Array.|null} [speechContexts] RecognitionConfig speechContexts + * @property {boolean|null} [enableWordTimeOffsets] RecognitionConfig enableWordTimeOffsets + * @property {boolean|null} [enableWordConfidence] RecognitionConfig enableWordConfidence + * @property {boolean|null} [enableAutomaticPunctuation] RecognitionConfig enableAutomaticPunctuation + * @property {google.protobuf.IBoolValue|null} [enableSpokenPunctuation] RecognitionConfig enableSpokenPunctuation + * @property {google.protobuf.IBoolValue|null} [enableSpokenEmojis] RecognitionConfig enableSpokenEmojis + * @property {google.cloud.speech.v1.ISpeakerDiarizationConfig|null} [diarizationConfig] RecognitionConfig diarizationConfig + * @property {google.cloud.speech.v1.IRecognitionMetadata|null} [metadata] RecognitionConfig metadata + * @property {string|null} [model] RecognitionConfig model + * @property {boolean|null} [useEnhanced] RecognitionConfig useEnhanced + */ + + /** + * Constructs a new RecognitionConfig. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a RecognitionConfig. + * @implements IRecognitionConfig + * @constructor + * @param {google.cloud.speech.v1.IRecognitionConfig=} [properties] Properties to set + */ + function RecognitionConfig(properties) { + this.alternativeLanguageCodes = []; + this.speechContexts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RecognitionConfig encoding. + * @member {google.cloud.speech.v1.RecognitionConfig.AudioEncoding} encoding + * @memberof google.cloud.speech.v1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.encoding = 0; + + /** + * RecognitionConfig sampleRateHertz. + * @member {number} sampleRateHertz + * @memberof google.cloud.speech.v1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.sampleRateHertz = 0; + + /** + * RecognitionConfig audioChannelCount. + * @member {number} audioChannelCount + * @memberof google.cloud.speech.v1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.audioChannelCount = 0; + + /** + * RecognitionConfig enableSeparateRecognitionPerChannel. + * @member {boolean} enableSeparateRecognitionPerChannel + * @memberof google.cloud.speech.v1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.enableSeparateRecognitionPerChannel = false; + + /** + * RecognitionConfig languageCode. + * @member {string} languageCode + * @memberof google.cloud.speech.v1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.languageCode = ""; + + /** + * RecognitionConfig alternativeLanguageCodes. + * @member {Array.} alternativeLanguageCodes + * @memberof google.cloud.speech.v1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.alternativeLanguageCodes = $util.emptyArray; + + /** + * RecognitionConfig maxAlternatives. + * @member {number} maxAlternatives + * @memberof google.cloud.speech.v1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.maxAlternatives = 0; + + /** + * RecognitionConfig profanityFilter. + * @member {boolean} profanityFilter + * @memberof google.cloud.speech.v1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.profanityFilter = false; + + /** + * RecognitionConfig adaptation. + * @member {google.cloud.speech.v1.ISpeechAdaptation|null|undefined} adaptation + * @memberof google.cloud.speech.v1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.adaptation = null; + + /** + * RecognitionConfig transcriptNormalization. + * @member {google.cloud.speech.v1.ITranscriptNormalization|null|undefined} transcriptNormalization + * @memberof google.cloud.speech.v1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.transcriptNormalization = null; + + /** + * RecognitionConfig speechContexts. + * @member {Array.} speechContexts + * @memberof google.cloud.speech.v1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.speechContexts = $util.emptyArray; + + /** + * RecognitionConfig enableWordTimeOffsets. + * @member {boolean} enableWordTimeOffsets + * @memberof google.cloud.speech.v1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.enableWordTimeOffsets = false; + + /** + * RecognitionConfig enableWordConfidence. + * @member {boolean} enableWordConfidence + * @memberof google.cloud.speech.v1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.enableWordConfidence = false; + + /** + * RecognitionConfig enableAutomaticPunctuation. + * @member {boolean} enableAutomaticPunctuation + * @memberof google.cloud.speech.v1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.enableAutomaticPunctuation = false; + + /** + * RecognitionConfig enableSpokenPunctuation. + * @member {google.protobuf.IBoolValue|null|undefined} enableSpokenPunctuation + * @memberof google.cloud.speech.v1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.enableSpokenPunctuation = null; + + /** + * RecognitionConfig enableSpokenEmojis. + * @member {google.protobuf.IBoolValue|null|undefined} enableSpokenEmojis + * @memberof google.cloud.speech.v1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.enableSpokenEmojis = null; + + /** + * RecognitionConfig diarizationConfig. + * @member {google.cloud.speech.v1.ISpeakerDiarizationConfig|null|undefined} diarizationConfig + * @memberof google.cloud.speech.v1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.diarizationConfig = null; + + /** + * RecognitionConfig metadata. + * @member {google.cloud.speech.v1.IRecognitionMetadata|null|undefined} metadata + * @memberof google.cloud.speech.v1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.metadata = null; + + /** + * RecognitionConfig model. + * @member {string} model + * @memberof google.cloud.speech.v1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.model = ""; + + /** + * RecognitionConfig useEnhanced. + * @member {boolean} useEnhanced + * @memberof google.cloud.speech.v1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.useEnhanced = false; + + /** + * Creates a new RecognitionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.RecognitionConfig + * @static + * @param {google.cloud.speech.v1.IRecognitionConfig=} [properties] Properties to set + * @returns {google.cloud.speech.v1.RecognitionConfig} RecognitionConfig instance + */ + RecognitionConfig.create = function create(properties) { + return new RecognitionConfig(properties); + }; + + /** + * Encodes the specified RecognitionConfig message. Does not implicitly {@link google.cloud.speech.v1.RecognitionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.RecognitionConfig + * @static + * @param {google.cloud.speech.v1.IRecognitionConfig} message RecognitionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecognitionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.encoding); + if (message.sampleRateHertz != null && Object.hasOwnProperty.call(message, "sampleRateHertz")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.sampleRateHertz); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); + if (message.maxAlternatives != null && Object.hasOwnProperty.call(message, "maxAlternatives")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.maxAlternatives); + if (message.profanityFilter != null && Object.hasOwnProperty.call(message, "profanityFilter")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.profanityFilter); + if (message.speechContexts != null && message.speechContexts.length) + for (var i = 0; i < message.speechContexts.length; ++i) + $root.google.cloud.speech.v1.SpeechContext.encode(message.speechContexts[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.audioChannelCount != null && Object.hasOwnProperty.call(message, "audioChannelCount")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.audioChannelCount); + if (message.enableWordTimeOffsets != null && Object.hasOwnProperty.call(message, "enableWordTimeOffsets")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.enableWordTimeOffsets); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.cloud.speech.v1.RecognitionMetadata.encode(message.metadata, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.enableAutomaticPunctuation != null && Object.hasOwnProperty.call(message, "enableAutomaticPunctuation")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.enableAutomaticPunctuation); + if (message.enableSeparateRecognitionPerChannel != null && Object.hasOwnProperty.call(message, "enableSeparateRecognitionPerChannel")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.enableSeparateRecognitionPerChannel); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.model); + if (message.useEnhanced != null && Object.hasOwnProperty.call(message, "useEnhanced")) + writer.uint32(/* id 14, wireType 0 =*/112).bool(message.useEnhanced); + if (message.enableWordConfidence != null && Object.hasOwnProperty.call(message, "enableWordConfidence")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.enableWordConfidence); + if (message.alternativeLanguageCodes != null && message.alternativeLanguageCodes.length) + for (var i = 0; i < message.alternativeLanguageCodes.length; ++i) + writer.uint32(/* id 18, wireType 2 =*/146).string(message.alternativeLanguageCodes[i]); + if (message.diarizationConfig != null && Object.hasOwnProperty.call(message, "diarizationConfig")) + $root.google.cloud.speech.v1.SpeakerDiarizationConfig.encode(message.diarizationConfig, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.adaptation != null && Object.hasOwnProperty.call(message, "adaptation")) + $root.google.cloud.speech.v1.SpeechAdaptation.encode(message.adaptation, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.enableSpokenPunctuation != null && Object.hasOwnProperty.call(message, "enableSpokenPunctuation")) + $root.google.protobuf.BoolValue.encode(message.enableSpokenPunctuation, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.enableSpokenEmojis != null && Object.hasOwnProperty.call(message, "enableSpokenEmojis")) + $root.google.protobuf.BoolValue.encode(message.enableSpokenEmojis, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.transcriptNormalization != null && Object.hasOwnProperty.call(message, "transcriptNormalization")) + $root.google.cloud.speech.v1.TranscriptNormalization.encode(message.transcriptNormalization, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RecognitionConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v1.RecognitionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.RecognitionConfig + * @static + * @param {google.cloud.speech.v1.IRecognitionConfig} message RecognitionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecognitionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RecognitionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.RecognitionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.RecognitionConfig} RecognitionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecognitionConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.RecognitionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.encoding = reader.int32(); + break; + } + case 2: { + message.sampleRateHertz = reader.int32(); + break; + } + case 7: { + message.audioChannelCount = reader.int32(); + break; + } + case 12: { + message.enableSeparateRecognitionPerChannel = reader.bool(); + break; + } + case 3: { + message.languageCode = reader.string(); + break; + } + case 18: { + if (!(message.alternativeLanguageCodes && message.alternativeLanguageCodes.length)) + message.alternativeLanguageCodes = []; + message.alternativeLanguageCodes.push(reader.string()); + break; + } + case 4: { + message.maxAlternatives = reader.int32(); + break; + } + case 5: { + message.profanityFilter = reader.bool(); + break; + } + case 20: { + message.adaptation = $root.google.cloud.speech.v1.SpeechAdaptation.decode(reader, reader.uint32()); + break; + } + case 24: { + message.transcriptNormalization = $root.google.cloud.speech.v1.TranscriptNormalization.decode(reader, reader.uint32()); + break; + } + case 6: { + if (!(message.speechContexts && message.speechContexts.length)) + message.speechContexts = []; + message.speechContexts.push($root.google.cloud.speech.v1.SpeechContext.decode(reader, reader.uint32())); + break; + } + case 8: { + message.enableWordTimeOffsets = reader.bool(); + break; + } + case 15: { + message.enableWordConfidence = reader.bool(); + break; + } + case 11: { + message.enableAutomaticPunctuation = reader.bool(); + break; + } + case 22: { + message.enableSpokenPunctuation = $root.google.protobuf.BoolValue.decode(reader, reader.uint32()); + break; + } + case 23: { + message.enableSpokenEmojis = $root.google.protobuf.BoolValue.decode(reader, reader.uint32()); + break; + } + case 19: { + message.diarizationConfig = $root.google.cloud.speech.v1.SpeakerDiarizationConfig.decode(reader, reader.uint32()); + break; + } + case 9: { + message.metadata = $root.google.cloud.speech.v1.RecognitionMetadata.decode(reader, reader.uint32()); + break; + } + case 13: { + message.model = reader.string(); + break; + } + case 14: { + message.useEnhanced = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RecognitionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.RecognitionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.RecognitionConfig} RecognitionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecognitionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RecognitionConfig message. + * @function verify + * @memberof google.cloud.speech.v1.RecognitionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RecognitionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.encoding != null && message.hasOwnProperty("encoding")) + switch (message.encoding) { + default: + return "encoding: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) + if (!$util.isInteger(message.sampleRateHertz)) + return "sampleRateHertz: integer expected"; + if (message.audioChannelCount != null && message.hasOwnProperty("audioChannelCount")) + if (!$util.isInteger(message.audioChannelCount)) + return "audioChannelCount: integer expected"; + if (message.enableSeparateRecognitionPerChannel != null && message.hasOwnProperty("enableSeparateRecognitionPerChannel")) + if (typeof message.enableSeparateRecognitionPerChannel !== "boolean") + return "enableSeparateRecognitionPerChannel: boolean expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.alternativeLanguageCodes != null && message.hasOwnProperty("alternativeLanguageCodes")) { + if (!Array.isArray(message.alternativeLanguageCodes)) + return "alternativeLanguageCodes: array expected"; + for (var i = 0; i < message.alternativeLanguageCodes.length; ++i) + if (!$util.isString(message.alternativeLanguageCodes[i])) + return "alternativeLanguageCodes: string[] expected"; + } + if (message.maxAlternatives != null && message.hasOwnProperty("maxAlternatives")) + if (!$util.isInteger(message.maxAlternatives)) + return "maxAlternatives: integer expected"; + if (message.profanityFilter != null && message.hasOwnProperty("profanityFilter")) + if (typeof message.profanityFilter !== "boolean") + return "profanityFilter: boolean expected"; + if (message.adaptation != null && message.hasOwnProperty("adaptation")) { + var error = $root.google.cloud.speech.v1.SpeechAdaptation.verify(message.adaptation); + if (error) + return "adaptation." + error; + } + if (message.transcriptNormalization != null && message.hasOwnProperty("transcriptNormalization")) { + var error = $root.google.cloud.speech.v1.TranscriptNormalization.verify(message.transcriptNormalization); + if (error) + return "transcriptNormalization." + error; + } + if (message.speechContexts != null && message.hasOwnProperty("speechContexts")) { + if (!Array.isArray(message.speechContexts)) + return "speechContexts: array expected"; + for (var i = 0; i < message.speechContexts.length; ++i) { + var error = $root.google.cloud.speech.v1.SpeechContext.verify(message.speechContexts[i]); + if (error) + return "speechContexts." + error; + } + } + if (message.enableWordTimeOffsets != null && message.hasOwnProperty("enableWordTimeOffsets")) + if (typeof message.enableWordTimeOffsets !== "boolean") + return "enableWordTimeOffsets: boolean expected"; + if (message.enableWordConfidence != null && message.hasOwnProperty("enableWordConfidence")) + if (typeof message.enableWordConfidence !== "boolean") + return "enableWordConfidence: boolean expected"; + if (message.enableAutomaticPunctuation != null && message.hasOwnProperty("enableAutomaticPunctuation")) + if (typeof message.enableAutomaticPunctuation !== "boolean") + return "enableAutomaticPunctuation: boolean expected"; + if (message.enableSpokenPunctuation != null && message.hasOwnProperty("enableSpokenPunctuation")) { + var error = $root.google.protobuf.BoolValue.verify(message.enableSpokenPunctuation); + if (error) + return "enableSpokenPunctuation." + error; + } + if (message.enableSpokenEmojis != null && message.hasOwnProperty("enableSpokenEmojis")) { + var error = $root.google.protobuf.BoolValue.verify(message.enableSpokenEmojis); + if (error) + return "enableSpokenEmojis." + error; + } + if (message.diarizationConfig != null && message.hasOwnProperty("diarizationConfig")) { + var error = $root.google.cloud.speech.v1.SpeakerDiarizationConfig.verify(message.diarizationConfig); + if (error) + return "diarizationConfig." + error; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.cloud.speech.v1.RecognitionMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.useEnhanced != null && message.hasOwnProperty("useEnhanced")) + if (typeof message.useEnhanced !== "boolean") + return "useEnhanced: boolean expected"; + return null; + }; + + /** + * Creates a RecognitionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.RecognitionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.RecognitionConfig} RecognitionConfig + */ + RecognitionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.RecognitionConfig) + return object; + var message = new $root.google.cloud.speech.v1.RecognitionConfig(); + switch (object.encoding) { + default: + if (typeof object.encoding === "number") { + message.encoding = object.encoding; + break; + } + break; + case "ENCODING_UNSPECIFIED": + case 0: + message.encoding = 0; + break; + case "LINEAR16": + case 1: + message.encoding = 1; + break; + case "FLAC": + case 2: + message.encoding = 2; + break; + case "MULAW": + case 3: + message.encoding = 3; + break; + case "AMR": + case 4: + message.encoding = 4; + break; + case "AMR_WB": + case 5: + message.encoding = 5; + break; + case "OGG_OPUS": + case 6: + message.encoding = 6; + break; + case "SPEEX_WITH_HEADER_BYTE": + case 7: + message.encoding = 7; + break; + case "MP3": + case 8: + message.encoding = 8; + break; + case "WEBM_OPUS": + case 9: + message.encoding = 9; + break; + } + if (object.sampleRateHertz != null) + message.sampleRateHertz = object.sampleRateHertz | 0; + if (object.audioChannelCount != null) + message.audioChannelCount = object.audioChannelCount | 0; + if (object.enableSeparateRecognitionPerChannel != null) + message.enableSeparateRecognitionPerChannel = Boolean(object.enableSeparateRecognitionPerChannel); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.alternativeLanguageCodes) { + if (!Array.isArray(object.alternativeLanguageCodes)) + throw TypeError(".google.cloud.speech.v1.RecognitionConfig.alternativeLanguageCodes: array expected"); + message.alternativeLanguageCodes = []; + for (var i = 0; i < object.alternativeLanguageCodes.length; ++i) + message.alternativeLanguageCodes[i] = String(object.alternativeLanguageCodes[i]); + } + if (object.maxAlternatives != null) + message.maxAlternatives = object.maxAlternatives | 0; + if (object.profanityFilter != null) + message.profanityFilter = Boolean(object.profanityFilter); + if (object.adaptation != null) { + if (typeof object.adaptation !== "object") + throw TypeError(".google.cloud.speech.v1.RecognitionConfig.adaptation: object expected"); + message.adaptation = $root.google.cloud.speech.v1.SpeechAdaptation.fromObject(object.adaptation); + } + if (object.transcriptNormalization != null) { + if (typeof object.transcriptNormalization !== "object") + throw TypeError(".google.cloud.speech.v1.RecognitionConfig.transcriptNormalization: object expected"); + message.transcriptNormalization = $root.google.cloud.speech.v1.TranscriptNormalization.fromObject(object.transcriptNormalization); + } + if (object.speechContexts) { + if (!Array.isArray(object.speechContexts)) + throw TypeError(".google.cloud.speech.v1.RecognitionConfig.speechContexts: array expected"); + message.speechContexts = []; + for (var i = 0; i < object.speechContexts.length; ++i) { + if (typeof object.speechContexts[i] !== "object") + throw TypeError(".google.cloud.speech.v1.RecognitionConfig.speechContexts: object expected"); + message.speechContexts[i] = $root.google.cloud.speech.v1.SpeechContext.fromObject(object.speechContexts[i]); + } + } + if (object.enableWordTimeOffsets != null) + message.enableWordTimeOffsets = Boolean(object.enableWordTimeOffsets); + if (object.enableWordConfidence != null) + message.enableWordConfidence = Boolean(object.enableWordConfidence); + if (object.enableAutomaticPunctuation != null) + message.enableAutomaticPunctuation = Boolean(object.enableAutomaticPunctuation); + if (object.enableSpokenPunctuation != null) { + if (typeof object.enableSpokenPunctuation !== "object") + throw TypeError(".google.cloud.speech.v1.RecognitionConfig.enableSpokenPunctuation: object expected"); + message.enableSpokenPunctuation = $root.google.protobuf.BoolValue.fromObject(object.enableSpokenPunctuation); + } + if (object.enableSpokenEmojis != null) { + if (typeof object.enableSpokenEmojis !== "object") + throw TypeError(".google.cloud.speech.v1.RecognitionConfig.enableSpokenEmojis: object expected"); + message.enableSpokenEmojis = $root.google.protobuf.BoolValue.fromObject(object.enableSpokenEmojis); + } + if (object.diarizationConfig != null) { + if (typeof object.diarizationConfig !== "object") + throw TypeError(".google.cloud.speech.v1.RecognitionConfig.diarizationConfig: object expected"); + message.diarizationConfig = $root.google.cloud.speech.v1.SpeakerDiarizationConfig.fromObject(object.diarizationConfig); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.speech.v1.RecognitionConfig.metadata: object expected"); + message.metadata = $root.google.cloud.speech.v1.RecognitionMetadata.fromObject(object.metadata); + } + if (object.model != null) + message.model = String(object.model); + if (object.useEnhanced != null) + message.useEnhanced = Boolean(object.useEnhanced); + return message; + }; + + /** + * Creates a plain object from a RecognitionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.RecognitionConfig + * @static + * @param {google.cloud.speech.v1.RecognitionConfig} message RecognitionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RecognitionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.speechContexts = []; + object.alternativeLanguageCodes = []; + } + if (options.defaults) { + object.encoding = options.enums === String ? "ENCODING_UNSPECIFIED" : 0; + object.sampleRateHertz = 0; + object.languageCode = ""; + object.maxAlternatives = 0; + object.profanityFilter = false; + object.audioChannelCount = 0; + object.enableWordTimeOffsets = false; + object.metadata = null; + object.enableAutomaticPunctuation = false; + object.enableSeparateRecognitionPerChannel = false; + object.model = ""; + object.useEnhanced = false; + object.enableWordConfidence = false; + object.diarizationConfig = null; + object.adaptation = null; + object.enableSpokenPunctuation = null; + object.enableSpokenEmojis = null; + object.transcriptNormalization = null; + } + if (message.encoding != null && message.hasOwnProperty("encoding")) + object.encoding = options.enums === String ? $root.google.cloud.speech.v1.RecognitionConfig.AudioEncoding[message.encoding] === undefined ? message.encoding : $root.google.cloud.speech.v1.RecognitionConfig.AudioEncoding[message.encoding] : message.encoding; + if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) + object.sampleRateHertz = message.sampleRateHertz; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.maxAlternatives != null && message.hasOwnProperty("maxAlternatives")) + object.maxAlternatives = message.maxAlternatives; + if (message.profanityFilter != null && message.hasOwnProperty("profanityFilter")) + object.profanityFilter = message.profanityFilter; + if (message.speechContexts && message.speechContexts.length) { + object.speechContexts = []; + for (var j = 0; j < message.speechContexts.length; ++j) + object.speechContexts[j] = $root.google.cloud.speech.v1.SpeechContext.toObject(message.speechContexts[j], options); + } + if (message.audioChannelCount != null && message.hasOwnProperty("audioChannelCount")) + object.audioChannelCount = message.audioChannelCount; + if (message.enableWordTimeOffsets != null && message.hasOwnProperty("enableWordTimeOffsets")) + object.enableWordTimeOffsets = message.enableWordTimeOffsets; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.cloud.speech.v1.RecognitionMetadata.toObject(message.metadata, options); + if (message.enableAutomaticPunctuation != null && message.hasOwnProperty("enableAutomaticPunctuation")) + object.enableAutomaticPunctuation = message.enableAutomaticPunctuation; + if (message.enableSeparateRecognitionPerChannel != null && message.hasOwnProperty("enableSeparateRecognitionPerChannel")) + object.enableSeparateRecognitionPerChannel = message.enableSeparateRecognitionPerChannel; + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.useEnhanced != null && message.hasOwnProperty("useEnhanced")) + object.useEnhanced = message.useEnhanced; + if (message.enableWordConfidence != null && message.hasOwnProperty("enableWordConfidence")) + object.enableWordConfidence = message.enableWordConfidence; + if (message.alternativeLanguageCodes && message.alternativeLanguageCodes.length) { + object.alternativeLanguageCodes = []; + for (var j = 0; j < message.alternativeLanguageCodes.length; ++j) + object.alternativeLanguageCodes[j] = message.alternativeLanguageCodes[j]; + } + if (message.diarizationConfig != null && message.hasOwnProperty("diarizationConfig")) + object.diarizationConfig = $root.google.cloud.speech.v1.SpeakerDiarizationConfig.toObject(message.diarizationConfig, options); + if (message.adaptation != null && message.hasOwnProperty("adaptation")) + object.adaptation = $root.google.cloud.speech.v1.SpeechAdaptation.toObject(message.adaptation, options); + if (message.enableSpokenPunctuation != null && message.hasOwnProperty("enableSpokenPunctuation")) + object.enableSpokenPunctuation = $root.google.protobuf.BoolValue.toObject(message.enableSpokenPunctuation, options); + if (message.enableSpokenEmojis != null && message.hasOwnProperty("enableSpokenEmojis")) + object.enableSpokenEmojis = $root.google.protobuf.BoolValue.toObject(message.enableSpokenEmojis, options); + if (message.transcriptNormalization != null && message.hasOwnProperty("transcriptNormalization")) + object.transcriptNormalization = $root.google.cloud.speech.v1.TranscriptNormalization.toObject(message.transcriptNormalization, options); + return object; + }; + + /** + * Converts this RecognitionConfig to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.RecognitionConfig + * @instance + * @returns {Object.} JSON object + */ + RecognitionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RecognitionConfig + * @function getTypeUrl + * @memberof google.cloud.speech.v1.RecognitionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RecognitionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.RecognitionConfig"; + }; + + /** + * AudioEncoding enum. + * @name google.cloud.speech.v1.RecognitionConfig.AudioEncoding + * @enum {number} + * @property {number} ENCODING_UNSPECIFIED=0 ENCODING_UNSPECIFIED value + * @property {number} LINEAR16=1 LINEAR16 value + * @property {number} FLAC=2 FLAC value + * @property {number} MULAW=3 MULAW value + * @property {number} AMR=4 AMR value + * @property {number} AMR_WB=5 AMR_WB value + * @property {number} OGG_OPUS=6 OGG_OPUS value + * @property {number} SPEEX_WITH_HEADER_BYTE=7 SPEEX_WITH_HEADER_BYTE value + * @property {number} MP3=8 MP3 value + * @property {number} WEBM_OPUS=9 WEBM_OPUS value + */ + RecognitionConfig.AudioEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENCODING_UNSPECIFIED"] = 0; + values[valuesById[1] = "LINEAR16"] = 1; + values[valuesById[2] = "FLAC"] = 2; + values[valuesById[3] = "MULAW"] = 3; + values[valuesById[4] = "AMR"] = 4; + values[valuesById[5] = "AMR_WB"] = 5; + values[valuesById[6] = "OGG_OPUS"] = 6; + values[valuesById[7] = "SPEEX_WITH_HEADER_BYTE"] = 7; + values[valuesById[8] = "MP3"] = 8; + values[valuesById[9] = "WEBM_OPUS"] = 9; + return values; + })(); + + return RecognitionConfig; + })(); + + v1.SpeakerDiarizationConfig = (function() { + + /** + * Properties of a SpeakerDiarizationConfig. + * @memberof google.cloud.speech.v1 + * @interface ISpeakerDiarizationConfig + * @property {boolean|null} [enableSpeakerDiarization] SpeakerDiarizationConfig enableSpeakerDiarization + * @property {number|null} [minSpeakerCount] SpeakerDiarizationConfig minSpeakerCount + * @property {number|null} [maxSpeakerCount] SpeakerDiarizationConfig maxSpeakerCount + * @property {number|null} [speakerTag] SpeakerDiarizationConfig speakerTag + */ + + /** + * Constructs a new SpeakerDiarizationConfig. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a SpeakerDiarizationConfig. + * @implements ISpeakerDiarizationConfig + * @constructor + * @param {google.cloud.speech.v1.ISpeakerDiarizationConfig=} [properties] Properties to set + */ + function SpeakerDiarizationConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpeakerDiarizationConfig enableSpeakerDiarization. + * @member {boolean} enableSpeakerDiarization + * @memberof google.cloud.speech.v1.SpeakerDiarizationConfig + * @instance + */ + SpeakerDiarizationConfig.prototype.enableSpeakerDiarization = false; + + /** + * SpeakerDiarizationConfig minSpeakerCount. + * @member {number} minSpeakerCount + * @memberof google.cloud.speech.v1.SpeakerDiarizationConfig + * @instance + */ + SpeakerDiarizationConfig.prototype.minSpeakerCount = 0; + + /** + * SpeakerDiarizationConfig maxSpeakerCount. + * @member {number} maxSpeakerCount + * @memberof google.cloud.speech.v1.SpeakerDiarizationConfig + * @instance + */ + SpeakerDiarizationConfig.prototype.maxSpeakerCount = 0; + + /** + * SpeakerDiarizationConfig speakerTag. + * @member {number} speakerTag + * @memberof google.cloud.speech.v1.SpeakerDiarizationConfig + * @instance + */ + SpeakerDiarizationConfig.prototype.speakerTag = 0; + + /** + * Creates a new SpeakerDiarizationConfig instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.SpeakerDiarizationConfig + * @static + * @param {google.cloud.speech.v1.ISpeakerDiarizationConfig=} [properties] Properties to set + * @returns {google.cloud.speech.v1.SpeakerDiarizationConfig} SpeakerDiarizationConfig instance + */ + SpeakerDiarizationConfig.create = function create(properties) { + return new SpeakerDiarizationConfig(properties); + }; + + /** + * Encodes the specified SpeakerDiarizationConfig message. Does not implicitly {@link google.cloud.speech.v1.SpeakerDiarizationConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.SpeakerDiarizationConfig + * @static + * @param {google.cloud.speech.v1.ISpeakerDiarizationConfig} message SpeakerDiarizationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeakerDiarizationConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableSpeakerDiarization != null && Object.hasOwnProperty.call(message, "enableSpeakerDiarization")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableSpeakerDiarization); + if (message.minSpeakerCount != null && Object.hasOwnProperty.call(message, "minSpeakerCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.minSpeakerCount); + if (message.maxSpeakerCount != null && Object.hasOwnProperty.call(message, "maxSpeakerCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.maxSpeakerCount); + if (message.speakerTag != null && Object.hasOwnProperty.call(message, "speakerTag")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.speakerTag); + return writer; + }; + + /** + * Encodes the specified SpeakerDiarizationConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v1.SpeakerDiarizationConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.SpeakerDiarizationConfig + * @static + * @param {google.cloud.speech.v1.ISpeakerDiarizationConfig} message SpeakerDiarizationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeakerDiarizationConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpeakerDiarizationConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.SpeakerDiarizationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.SpeakerDiarizationConfig} SpeakerDiarizationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeakerDiarizationConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.SpeakerDiarizationConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enableSpeakerDiarization = reader.bool(); + break; + } + case 2: { + message.minSpeakerCount = reader.int32(); + break; + } + case 3: { + message.maxSpeakerCount = reader.int32(); + break; + } + case 5: { + message.speakerTag = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpeakerDiarizationConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.SpeakerDiarizationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.SpeakerDiarizationConfig} SpeakerDiarizationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeakerDiarizationConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpeakerDiarizationConfig message. + * @function verify + * @memberof google.cloud.speech.v1.SpeakerDiarizationConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpeakerDiarizationConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enableSpeakerDiarization != null && message.hasOwnProperty("enableSpeakerDiarization")) + if (typeof message.enableSpeakerDiarization !== "boolean") + return "enableSpeakerDiarization: boolean expected"; + if (message.minSpeakerCount != null && message.hasOwnProperty("minSpeakerCount")) + if (!$util.isInteger(message.minSpeakerCount)) + return "minSpeakerCount: integer expected"; + if (message.maxSpeakerCount != null && message.hasOwnProperty("maxSpeakerCount")) + if (!$util.isInteger(message.maxSpeakerCount)) + return "maxSpeakerCount: integer expected"; + if (message.speakerTag != null && message.hasOwnProperty("speakerTag")) + if (!$util.isInteger(message.speakerTag)) + return "speakerTag: integer expected"; + return null; + }; + + /** + * Creates a SpeakerDiarizationConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.SpeakerDiarizationConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.SpeakerDiarizationConfig} SpeakerDiarizationConfig + */ + SpeakerDiarizationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.SpeakerDiarizationConfig) + return object; + var message = new $root.google.cloud.speech.v1.SpeakerDiarizationConfig(); + if (object.enableSpeakerDiarization != null) + message.enableSpeakerDiarization = Boolean(object.enableSpeakerDiarization); + if (object.minSpeakerCount != null) + message.minSpeakerCount = object.minSpeakerCount | 0; + if (object.maxSpeakerCount != null) + message.maxSpeakerCount = object.maxSpeakerCount | 0; + if (object.speakerTag != null) + message.speakerTag = object.speakerTag | 0; + return message; + }; + + /** + * Creates a plain object from a SpeakerDiarizationConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.SpeakerDiarizationConfig + * @static + * @param {google.cloud.speech.v1.SpeakerDiarizationConfig} message SpeakerDiarizationConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpeakerDiarizationConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.enableSpeakerDiarization = false; + object.minSpeakerCount = 0; + object.maxSpeakerCount = 0; + object.speakerTag = 0; + } + if (message.enableSpeakerDiarization != null && message.hasOwnProperty("enableSpeakerDiarization")) + object.enableSpeakerDiarization = message.enableSpeakerDiarization; + if (message.minSpeakerCount != null && message.hasOwnProperty("minSpeakerCount")) + object.minSpeakerCount = message.minSpeakerCount; + if (message.maxSpeakerCount != null && message.hasOwnProperty("maxSpeakerCount")) + object.maxSpeakerCount = message.maxSpeakerCount; + if (message.speakerTag != null && message.hasOwnProperty("speakerTag")) + object.speakerTag = message.speakerTag; + return object; + }; + + /** + * Converts this SpeakerDiarizationConfig to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.SpeakerDiarizationConfig + * @instance + * @returns {Object.} JSON object + */ + SpeakerDiarizationConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpeakerDiarizationConfig + * @function getTypeUrl + * @memberof google.cloud.speech.v1.SpeakerDiarizationConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpeakerDiarizationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.SpeakerDiarizationConfig"; + }; + + return SpeakerDiarizationConfig; + })(); + + v1.RecognitionMetadata = (function() { + + /** + * Properties of a RecognitionMetadata. + * @memberof google.cloud.speech.v1 + * @interface IRecognitionMetadata + * @property {google.cloud.speech.v1.RecognitionMetadata.InteractionType|null} [interactionType] RecognitionMetadata interactionType + * @property {number|null} [industryNaicsCodeOfAudio] RecognitionMetadata industryNaicsCodeOfAudio + * @property {google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance|null} [microphoneDistance] RecognitionMetadata microphoneDistance + * @property {google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType|null} [originalMediaType] RecognitionMetadata originalMediaType + * @property {google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType|null} [recordingDeviceType] RecognitionMetadata recordingDeviceType + * @property {string|null} [recordingDeviceName] RecognitionMetadata recordingDeviceName + * @property {string|null} [originalMimeType] RecognitionMetadata originalMimeType + * @property {string|null} [audioTopic] RecognitionMetadata audioTopic + */ + + /** + * Constructs a new RecognitionMetadata. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a RecognitionMetadata. + * @implements IRecognitionMetadata + * @constructor + * @param {google.cloud.speech.v1.IRecognitionMetadata=} [properties] Properties to set + */ + function RecognitionMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RecognitionMetadata interactionType. + * @member {google.cloud.speech.v1.RecognitionMetadata.InteractionType} interactionType + * @memberof google.cloud.speech.v1.RecognitionMetadata + * @instance + */ + RecognitionMetadata.prototype.interactionType = 0; + + /** + * RecognitionMetadata industryNaicsCodeOfAudio. + * @member {number} industryNaicsCodeOfAudio + * @memberof google.cloud.speech.v1.RecognitionMetadata + * @instance + */ + RecognitionMetadata.prototype.industryNaicsCodeOfAudio = 0; + + /** + * RecognitionMetadata microphoneDistance. + * @member {google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance} microphoneDistance + * @memberof google.cloud.speech.v1.RecognitionMetadata + * @instance + */ + RecognitionMetadata.prototype.microphoneDistance = 0; + + /** + * RecognitionMetadata originalMediaType. + * @member {google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType} originalMediaType + * @memberof google.cloud.speech.v1.RecognitionMetadata + * @instance + */ + RecognitionMetadata.prototype.originalMediaType = 0; + + /** + * RecognitionMetadata recordingDeviceType. + * @member {google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType} recordingDeviceType + * @memberof google.cloud.speech.v1.RecognitionMetadata + * @instance + */ + RecognitionMetadata.prototype.recordingDeviceType = 0; + + /** + * RecognitionMetadata recordingDeviceName. + * @member {string} recordingDeviceName + * @memberof google.cloud.speech.v1.RecognitionMetadata + * @instance + */ + RecognitionMetadata.prototype.recordingDeviceName = ""; + + /** + * RecognitionMetadata originalMimeType. + * @member {string} originalMimeType + * @memberof google.cloud.speech.v1.RecognitionMetadata + * @instance + */ + RecognitionMetadata.prototype.originalMimeType = ""; + + /** + * RecognitionMetadata audioTopic. + * @member {string} audioTopic + * @memberof google.cloud.speech.v1.RecognitionMetadata + * @instance + */ + RecognitionMetadata.prototype.audioTopic = ""; + + /** + * Creates a new RecognitionMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.RecognitionMetadata + * @static + * @param {google.cloud.speech.v1.IRecognitionMetadata=} [properties] Properties to set + * @returns {google.cloud.speech.v1.RecognitionMetadata} RecognitionMetadata instance + */ + RecognitionMetadata.create = function create(properties) { + return new RecognitionMetadata(properties); + }; + + /** + * Encodes the specified RecognitionMetadata message. Does not implicitly {@link google.cloud.speech.v1.RecognitionMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.RecognitionMetadata + * @static + * @param {google.cloud.speech.v1.IRecognitionMetadata} message RecognitionMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecognitionMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.interactionType != null && Object.hasOwnProperty.call(message, "interactionType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.interactionType); + if (message.industryNaicsCodeOfAudio != null && Object.hasOwnProperty.call(message, "industryNaicsCodeOfAudio")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.industryNaicsCodeOfAudio); + if (message.microphoneDistance != null && Object.hasOwnProperty.call(message, "microphoneDistance")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.microphoneDistance); + if (message.originalMediaType != null && Object.hasOwnProperty.call(message, "originalMediaType")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.originalMediaType); + if (message.recordingDeviceType != null && Object.hasOwnProperty.call(message, "recordingDeviceType")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.recordingDeviceType); + if (message.recordingDeviceName != null && Object.hasOwnProperty.call(message, "recordingDeviceName")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.recordingDeviceName); + if (message.originalMimeType != null && Object.hasOwnProperty.call(message, "originalMimeType")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.originalMimeType); + if (message.audioTopic != null && Object.hasOwnProperty.call(message, "audioTopic")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.audioTopic); + return writer; + }; + + /** + * Encodes the specified RecognitionMetadata message, length delimited. Does not implicitly {@link google.cloud.speech.v1.RecognitionMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.RecognitionMetadata + * @static + * @param {google.cloud.speech.v1.IRecognitionMetadata} message RecognitionMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecognitionMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RecognitionMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.RecognitionMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.RecognitionMetadata} RecognitionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecognitionMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.RecognitionMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.interactionType = reader.int32(); + break; + } + case 3: { + message.industryNaicsCodeOfAudio = reader.uint32(); + break; + } + case 4: { + message.microphoneDistance = reader.int32(); + break; + } + case 5: { + message.originalMediaType = reader.int32(); + break; + } + case 6: { + message.recordingDeviceType = reader.int32(); + break; + } + case 7: { + message.recordingDeviceName = reader.string(); + break; + } + case 8: { + message.originalMimeType = reader.string(); + break; + } + case 10: { + message.audioTopic = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RecognitionMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.RecognitionMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.RecognitionMetadata} RecognitionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecognitionMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RecognitionMetadata message. + * @function verify + * @memberof google.cloud.speech.v1.RecognitionMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RecognitionMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.interactionType != null && message.hasOwnProperty("interactionType")) + switch (message.interactionType) { + default: + return "interactionType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + if (message.industryNaicsCodeOfAudio != null && message.hasOwnProperty("industryNaicsCodeOfAudio")) + if (!$util.isInteger(message.industryNaicsCodeOfAudio)) + return "industryNaicsCodeOfAudio: integer expected"; + if (message.microphoneDistance != null && message.hasOwnProperty("microphoneDistance")) + switch (message.microphoneDistance) { + default: + return "microphoneDistance: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.originalMediaType != null && message.hasOwnProperty("originalMediaType")) + switch (message.originalMediaType) { + default: + return "originalMediaType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.recordingDeviceType != null && message.hasOwnProperty("recordingDeviceType")) + switch (message.recordingDeviceType) { + default: + return "recordingDeviceType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.recordingDeviceName != null && message.hasOwnProperty("recordingDeviceName")) + if (!$util.isString(message.recordingDeviceName)) + return "recordingDeviceName: string expected"; + if (message.originalMimeType != null && message.hasOwnProperty("originalMimeType")) + if (!$util.isString(message.originalMimeType)) + return "originalMimeType: string expected"; + if (message.audioTopic != null && message.hasOwnProperty("audioTopic")) + if (!$util.isString(message.audioTopic)) + return "audioTopic: string expected"; + return null; + }; + + /** + * Creates a RecognitionMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.RecognitionMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.RecognitionMetadata} RecognitionMetadata + */ + RecognitionMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.RecognitionMetadata) + return object; + var message = new $root.google.cloud.speech.v1.RecognitionMetadata(); + switch (object.interactionType) { + default: + if (typeof object.interactionType === "number") { + message.interactionType = object.interactionType; + break; + } + break; + case "INTERACTION_TYPE_UNSPECIFIED": + case 0: + message.interactionType = 0; + break; + case "DISCUSSION": + case 1: + message.interactionType = 1; + break; + case "PRESENTATION": + case 2: + message.interactionType = 2; + break; + case "PHONE_CALL": + case 3: + message.interactionType = 3; + break; + case "VOICEMAIL": + case 4: + message.interactionType = 4; + break; + case "PROFESSIONALLY_PRODUCED": + case 5: + message.interactionType = 5; + break; + case "VOICE_SEARCH": + case 6: + message.interactionType = 6; + break; + case "VOICE_COMMAND": + case 7: + message.interactionType = 7; + break; + case "DICTATION": + case 8: + message.interactionType = 8; + break; + } + if (object.industryNaicsCodeOfAudio != null) + message.industryNaicsCodeOfAudio = object.industryNaicsCodeOfAudio >>> 0; + switch (object.microphoneDistance) { + default: + if (typeof object.microphoneDistance === "number") { + message.microphoneDistance = object.microphoneDistance; + break; + } + break; + case "MICROPHONE_DISTANCE_UNSPECIFIED": + case 0: + message.microphoneDistance = 0; + break; + case "NEARFIELD": + case 1: + message.microphoneDistance = 1; + break; + case "MIDFIELD": + case 2: + message.microphoneDistance = 2; + break; + case "FARFIELD": + case 3: + message.microphoneDistance = 3; + break; + } + switch (object.originalMediaType) { + default: + if (typeof object.originalMediaType === "number") { + message.originalMediaType = object.originalMediaType; + break; + } + break; + case "ORIGINAL_MEDIA_TYPE_UNSPECIFIED": + case 0: + message.originalMediaType = 0; + break; + case "AUDIO": + case 1: + message.originalMediaType = 1; + break; + case "VIDEO": + case 2: + message.originalMediaType = 2; + break; + } + switch (object.recordingDeviceType) { + default: + if (typeof object.recordingDeviceType === "number") { + message.recordingDeviceType = object.recordingDeviceType; + break; + } + break; + case "RECORDING_DEVICE_TYPE_UNSPECIFIED": + case 0: + message.recordingDeviceType = 0; + break; + case "SMARTPHONE": + case 1: + message.recordingDeviceType = 1; + break; + case "PC": + case 2: + message.recordingDeviceType = 2; + break; + case "PHONE_LINE": + case 3: + message.recordingDeviceType = 3; + break; + case "VEHICLE": + case 4: + message.recordingDeviceType = 4; + break; + case "OTHER_OUTDOOR_DEVICE": + case 5: + message.recordingDeviceType = 5; + break; + case "OTHER_INDOOR_DEVICE": + case 6: + message.recordingDeviceType = 6; + break; + } + if (object.recordingDeviceName != null) + message.recordingDeviceName = String(object.recordingDeviceName); + if (object.originalMimeType != null) + message.originalMimeType = String(object.originalMimeType); + if (object.audioTopic != null) + message.audioTopic = String(object.audioTopic); + return message; + }; + + /** + * Creates a plain object from a RecognitionMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.RecognitionMetadata + * @static + * @param {google.cloud.speech.v1.RecognitionMetadata} message RecognitionMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RecognitionMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.interactionType = options.enums === String ? "INTERACTION_TYPE_UNSPECIFIED" : 0; + object.industryNaicsCodeOfAudio = 0; + object.microphoneDistance = options.enums === String ? "MICROPHONE_DISTANCE_UNSPECIFIED" : 0; + object.originalMediaType = options.enums === String ? "ORIGINAL_MEDIA_TYPE_UNSPECIFIED" : 0; + object.recordingDeviceType = options.enums === String ? "RECORDING_DEVICE_TYPE_UNSPECIFIED" : 0; + object.recordingDeviceName = ""; + object.originalMimeType = ""; + object.audioTopic = ""; + } + if (message.interactionType != null && message.hasOwnProperty("interactionType")) + object.interactionType = options.enums === String ? $root.google.cloud.speech.v1.RecognitionMetadata.InteractionType[message.interactionType] === undefined ? message.interactionType : $root.google.cloud.speech.v1.RecognitionMetadata.InteractionType[message.interactionType] : message.interactionType; + if (message.industryNaicsCodeOfAudio != null && message.hasOwnProperty("industryNaicsCodeOfAudio")) + object.industryNaicsCodeOfAudio = message.industryNaicsCodeOfAudio; + if (message.microphoneDistance != null && message.hasOwnProperty("microphoneDistance")) + object.microphoneDistance = options.enums === String ? $root.google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance[message.microphoneDistance] === undefined ? message.microphoneDistance : $root.google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance[message.microphoneDistance] : message.microphoneDistance; + if (message.originalMediaType != null && message.hasOwnProperty("originalMediaType")) + object.originalMediaType = options.enums === String ? $root.google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType[message.originalMediaType] === undefined ? message.originalMediaType : $root.google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType[message.originalMediaType] : message.originalMediaType; + if (message.recordingDeviceType != null && message.hasOwnProperty("recordingDeviceType")) + object.recordingDeviceType = options.enums === String ? $root.google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType[message.recordingDeviceType] === undefined ? message.recordingDeviceType : $root.google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType[message.recordingDeviceType] : message.recordingDeviceType; + if (message.recordingDeviceName != null && message.hasOwnProperty("recordingDeviceName")) + object.recordingDeviceName = message.recordingDeviceName; + if (message.originalMimeType != null && message.hasOwnProperty("originalMimeType")) + object.originalMimeType = message.originalMimeType; + if (message.audioTopic != null && message.hasOwnProperty("audioTopic")) + object.audioTopic = message.audioTopic; + return object; + }; + + /** + * Converts this RecognitionMetadata to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.RecognitionMetadata + * @instance + * @returns {Object.} JSON object + */ + RecognitionMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RecognitionMetadata + * @function getTypeUrl + * @memberof google.cloud.speech.v1.RecognitionMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RecognitionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.RecognitionMetadata"; + }; + + /** + * InteractionType enum. + * @name google.cloud.speech.v1.RecognitionMetadata.InteractionType + * @enum {number} + * @property {number} INTERACTION_TYPE_UNSPECIFIED=0 INTERACTION_TYPE_UNSPECIFIED value + * @property {number} DISCUSSION=1 DISCUSSION value + * @property {number} PRESENTATION=2 PRESENTATION value + * @property {number} PHONE_CALL=3 PHONE_CALL value + * @property {number} VOICEMAIL=4 VOICEMAIL value + * @property {number} PROFESSIONALLY_PRODUCED=5 PROFESSIONALLY_PRODUCED value + * @property {number} VOICE_SEARCH=6 VOICE_SEARCH value + * @property {number} VOICE_COMMAND=7 VOICE_COMMAND value + * @property {number} DICTATION=8 DICTATION value + */ + RecognitionMetadata.InteractionType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INTERACTION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DISCUSSION"] = 1; + values[valuesById[2] = "PRESENTATION"] = 2; + values[valuesById[3] = "PHONE_CALL"] = 3; + values[valuesById[4] = "VOICEMAIL"] = 4; + values[valuesById[5] = "PROFESSIONALLY_PRODUCED"] = 5; + values[valuesById[6] = "VOICE_SEARCH"] = 6; + values[valuesById[7] = "VOICE_COMMAND"] = 7; + values[valuesById[8] = "DICTATION"] = 8; + return values; + })(); + + /** + * MicrophoneDistance enum. + * @name google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance + * @enum {number} + * @property {number} MICROPHONE_DISTANCE_UNSPECIFIED=0 MICROPHONE_DISTANCE_UNSPECIFIED value + * @property {number} NEARFIELD=1 NEARFIELD value + * @property {number} MIDFIELD=2 MIDFIELD value + * @property {number} FARFIELD=3 FARFIELD value + */ + RecognitionMetadata.MicrophoneDistance = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MICROPHONE_DISTANCE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NEARFIELD"] = 1; + values[valuesById[2] = "MIDFIELD"] = 2; + values[valuesById[3] = "FARFIELD"] = 3; + return values; + })(); + + /** + * OriginalMediaType enum. + * @name google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType + * @enum {number} + * @property {number} ORIGINAL_MEDIA_TYPE_UNSPECIFIED=0 ORIGINAL_MEDIA_TYPE_UNSPECIFIED value + * @property {number} AUDIO=1 AUDIO value + * @property {number} VIDEO=2 VIDEO value + */ + RecognitionMetadata.OriginalMediaType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ORIGINAL_MEDIA_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "AUDIO"] = 1; + values[valuesById[2] = "VIDEO"] = 2; + return values; + })(); + + /** + * RecordingDeviceType enum. + * @name google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType + * @enum {number} + * @property {number} RECORDING_DEVICE_TYPE_UNSPECIFIED=0 RECORDING_DEVICE_TYPE_UNSPECIFIED value + * @property {number} SMARTPHONE=1 SMARTPHONE value + * @property {number} PC=2 PC value + * @property {number} PHONE_LINE=3 PHONE_LINE value + * @property {number} VEHICLE=4 VEHICLE value + * @property {number} OTHER_OUTDOOR_DEVICE=5 OTHER_OUTDOOR_DEVICE value + * @property {number} OTHER_INDOOR_DEVICE=6 OTHER_INDOOR_DEVICE value + */ + RecognitionMetadata.RecordingDeviceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RECORDING_DEVICE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SMARTPHONE"] = 1; + values[valuesById[2] = "PC"] = 2; + values[valuesById[3] = "PHONE_LINE"] = 3; + values[valuesById[4] = "VEHICLE"] = 4; + values[valuesById[5] = "OTHER_OUTDOOR_DEVICE"] = 5; + values[valuesById[6] = "OTHER_INDOOR_DEVICE"] = 6; + return values; + })(); + + return RecognitionMetadata; + })(); + + v1.SpeechContext = (function() { + + /** + * Properties of a SpeechContext. + * @memberof google.cloud.speech.v1 + * @interface ISpeechContext + * @property {Array.|null} [phrases] SpeechContext phrases + * @property {number|null} [boost] SpeechContext boost + */ + + /** + * Constructs a new SpeechContext. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a SpeechContext. + * @implements ISpeechContext + * @constructor + * @param {google.cloud.speech.v1.ISpeechContext=} [properties] Properties to set + */ + function SpeechContext(properties) { + this.phrases = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpeechContext phrases. + * @member {Array.} phrases + * @memberof google.cloud.speech.v1.SpeechContext + * @instance + */ + SpeechContext.prototype.phrases = $util.emptyArray; + + /** + * SpeechContext boost. + * @member {number} boost + * @memberof google.cloud.speech.v1.SpeechContext + * @instance + */ + SpeechContext.prototype.boost = 0; + + /** + * Creates a new SpeechContext instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.SpeechContext + * @static + * @param {google.cloud.speech.v1.ISpeechContext=} [properties] Properties to set + * @returns {google.cloud.speech.v1.SpeechContext} SpeechContext instance + */ + SpeechContext.create = function create(properties) { + return new SpeechContext(properties); + }; + + /** + * Encodes the specified SpeechContext message. Does not implicitly {@link google.cloud.speech.v1.SpeechContext.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.SpeechContext + * @static + * @param {google.cloud.speech.v1.ISpeechContext} message SpeechContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechContext.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.phrases != null && message.phrases.length) + for (var i = 0; i < message.phrases.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.phrases[i]); + if (message.boost != null && Object.hasOwnProperty.call(message, "boost")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.boost); + return writer; + }; + + /** + * Encodes the specified SpeechContext message, length delimited. Does not implicitly {@link google.cloud.speech.v1.SpeechContext.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.SpeechContext + * @static + * @param {google.cloud.speech.v1.ISpeechContext} message SpeechContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechContext.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpeechContext message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.SpeechContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.SpeechContext} SpeechContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechContext.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.SpeechContext(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.phrases && message.phrases.length)) + message.phrases = []; + message.phrases.push(reader.string()); + break; + } + case 4: { + message.boost = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpeechContext message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.SpeechContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.SpeechContext} SpeechContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechContext.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpeechContext message. + * @function verify + * @memberof google.cloud.speech.v1.SpeechContext + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpeechContext.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.phrases != null && message.hasOwnProperty("phrases")) { + if (!Array.isArray(message.phrases)) + return "phrases: array expected"; + for (var i = 0; i < message.phrases.length; ++i) + if (!$util.isString(message.phrases[i])) + return "phrases: string[] expected"; + } + if (message.boost != null && message.hasOwnProperty("boost")) + if (typeof message.boost !== "number") + return "boost: number expected"; + return null; + }; + + /** + * Creates a SpeechContext message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.SpeechContext + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.SpeechContext} SpeechContext + */ + SpeechContext.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.SpeechContext) + return object; + var message = new $root.google.cloud.speech.v1.SpeechContext(); + if (object.phrases) { + if (!Array.isArray(object.phrases)) + throw TypeError(".google.cloud.speech.v1.SpeechContext.phrases: array expected"); + message.phrases = []; + for (var i = 0; i < object.phrases.length; ++i) + message.phrases[i] = String(object.phrases[i]); + } + if (object.boost != null) + message.boost = Number(object.boost); + return message; + }; + + /** + * Creates a plain object from a SpeechContext message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.SpeechContext + * @static + * @param {google.cloud.speech.v1.SpeechContext} message SpeechContext + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpeechContext.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.phrases = []; + if (options.defaults) + object.boost = 0; + if (message.phrases && message.phrases.length) { + object.phrases = []; + for (var j = 0; j < message.phrases.length; ++j) + object.phrases[j] = message.phrases[j]; + } + if (message.boost != null && message.hasOwnProperty("boost")) + object.boost = options.json && !isFinite(message.boost) ? String(message.boost) : message.boost; + return object; + }; + + /** + * Converts this SpeechContext to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.SpeechContext + * @instance + * @returns {Object.} JSON object + */ + SpeechContext.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpeechContext + * @function getTypeUrl + * @memberof google.cloud.speech.v1.SpeechContext + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpeechContext.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.SpeechContext"; + }; + + return SpeechContext; + })(); + + v1.RecognitionAudio = (function() { + + /** + * Properties of a RecognitionAudio. + * @memberof google.cloud.speech.v1 + * @interface IRecognitionAudio + * @property {Uint8Array|null} [content] RecognitionAudio content + * @property {string|null} [uri] RecognitionAudio uri + */ + + /** + * Constructs a new RecognitionAudio. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a RecognitionAudio. + * @implements IRecognitionAudio + * @constructor + * @param {google.cloud.speech.v1.IRecognitionAudio=} [properties] Properties to set + */ + function RecognitionAudio(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RecognitionAudio content. + * @member {Uint8Array|null|undefined} content + * @memberof google.cloud.speech.v1.RecognitionAudio + * @instance + */ + RecognitionAudio.prototype.content = null; + + /** + * RecognitionAudio uri. + * @member {string|null|undefined} uri + * @memberof google.cloud.speech.v1.RecognitionAudio + * @instance + */ + RecognitionAudio.prototype.uri = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RecognitionAudio audioSource. + * @member {"content"|"uri"|undefined} audioSource + * @memberof google.cloud.speech.v1.RecognitionAudio + * @instance + */ + Object.defineProperty(RecognitionAudio.prototype, "audioSource", { + get: $util.oneOfGetter($oneOfFields = ["content", "uri"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RecognitionAudio instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.RecognitionAudio + * @static + * @param {google.cloud.speech.v1.IRecognitionAudio=} [properties] Properties to set + * @returns {google.cloud.speech.v1.RecognitionAudio} RecognitionAudio instance + */ + RecognitionAudio.create = function create(properties) { + return new RecognitionAudio(properties); + }; + + /** + * Encodes the specified RecognitionAudio message. Does not implicitly {@link google.cloud.speech.v1.RecognitionAudio.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.RecognitionAudio + * @static + * @param {google.cloud.speech.v1.IRecognitionAudio} message RecognitionAudio message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecognitionAudio.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.content); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uri); + return writer; + }; + + /** + * Encodes the specified RecognitionAudio message, length delimited. Does not implicitly {@link google.cloud.speech.v1.RecognitionAudio.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.RecognitionAudio + * @static + * @param {google.cloud.speech.v1.IRecognitionAudio} message RecognitionAudio message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecognitionAudio.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RecognitionAudio message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.RecognitionAudio + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.RecognitionAudio} RecognitionAudio + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecognitionAudio.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.RecognitionAudio(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.content = reader.bytes(); + break; + } + case 2: { + message.uri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RecognitionAudio message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.RecognitionAudio + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.RecognitionAudio} RecognitionAudio + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecognitionAudio.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RecognitionAudio message. + * @function verify + * @memberof google.cloud.speech.v1.RecognitionAudio + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RecognitionAudio.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.content != null && message.hasOwnProperty("content")) { + properties.audioSource = 1; + if (!(message.content && typeof message.content.length === "number" || $util.isString(message.content))) + return "content: buffer expected"; + } + if (message.uri != null && message.hasOwnProperty("uri")) { + if (properties.audioSource === 1) + return "audioSource: multiple values"; + properties.audioSource = 1; + if (!$util.isString(message.uri)) + return "uri: string expected"; + } + return null; + }; + + /** + * Creates a RecognitionAudio message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.RecognitionAudio + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.RecognitionAudio} RecognitionAudio + */ + RecognitionAudio.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.RecognitionAudio) + return object; + var message = new $root.google.cloud.speech.v1.RecognitionAudio(); + if (object.content != null) + if (typeof object.content === "string") + $util.base64.decode(object.content, message.content = $util.newBuffer($util.base64.length(object.content)), 0); + else if (object.content.length >= 0) + message.content = object.content; + if (object.uri != null) + message.uri = String(object.uri); + return message; + }; + + /** + * Creates a plain object from a RecognitionAudio message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.RecognitionAudio + * @static + * @param {google.cloud.speech.v1.RecognitionAudio} message RecognitionAudio + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RecognitionAudio.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.content != null && message.hasOwnProperty("content")) { + object.content = options.bytes === String ? $util.base64.encode(message.content, 0, message.content.length) : options.bytes === Array ? Array.prototype.slice.call(message.content) : message.content; + if (options.oneofs) + object.audioSource = "content"; + } + if (message.uri != null && message.hasOwnProperty("uri")) { + object.uri = message.uri; + if (options.oneofs) + object.audioSource = "uri"; + } + return object; + }; + + /** + * Converts this RecognitionAudio to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.RecognitionAudio + * @instance + * @returns {Object.} JSON object + */ + RecognitionAudio.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RecognitionAudio + * @function getTypeUrl + * @memberof google.cloud.speech.v1.RecognitionAudio + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RecognitionAudio.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.RecognitionAudio"; + }; + + return RecognitionAudio; + })(); + + v1.RecognizeResponse = (function() { + + /** + * Properties of a RecognizeResponse. + * @memberof google.cloud.speech.v1 + * @interface IRecognizeResponse + * @property {Array.|null} [results] RecognizeResponse results + * @property {google.protobuf.IDuration|null} [totalBilledTime] RecognizeResponse totalBilledTime + * @property {google.cloud.speech.v1.ISpeechAdaptationInfo|null} [speechAdaptationInfo] RecognizeResponse speechAdaptationInfo + * @property {number|Long|null} [requestId] RecognizeResponse requestId + */ + + /** + * Constructs a new RecognizeResponse. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a RecognizeResponse. + * @implements IRecognizeResponse + * @constructor + * @param {google.cloud.speech.v1.IRecognizeResponse=} [properties] Properties to set + */ + function RecognizeResponse(properties) { + this.results = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RecognizeResponse results. + * @member {Array.} results + * @memberof google.cloud.speech.v1.RecognizeResponse + * @instance + */ + RecognizeResponse.prototype.results = $util.emptyArray; + + /** + * RecognizeResponse totalBilledTime. + * @member {google.protobuf.IDuration|null|undefined} totalBilledTime + * @memberof google.cloud.speech.v1.RecognizeResponse + * @instance + */ + RecognizeResponse.prototype.totalBilledTime = null; + + /** + * RecognizeResponse speechAdaptationInfo. + * @member {google.cloud.speech.v1.ISpeechAdaptationInfo|null|undefined} speechAdaptationInfo + * @memberof google.cloud.speech.v1.RecognizeResponse + * @instance + */ + RecognizeResponse.prototype.speechAdaptationInfo = null; + + /** + * RecognizeResponse requestId. + * @member {number|Long} requestId + * @memberof google.cloud.speech.v1.RecognizeResponse + * @instance + */ + RecognizeResponse.prototype.requestId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RecognizeResponse instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.RecognizeResponse + * @static + * @param {google.cloud.speech.v1.IRecognizeResponse=} [properties] Properties to set + * @returns {google.cloud.speech.v1.RecognizeResponse} RecognizeResponse instance + */ + RecognizeResponse.create = function create(properties) { + return new RecognizeResponse(properties); + }; + + /** + * Encodes the specified RecognizeResponse message. Does not implicitly {@link google.cloud.speech.v1.RecognizeResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.RecognizeResponse + * @static + * @param {google.cloud.speech.v1.IRecognizeResponse} message RecognizeResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecognizeResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.results != null && message.results.length) + for (var i = 0; i < message.results.length; ++i) + $root.google.cloud.speech.v1.SpeechRecognitionResult.encode(message.results[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.totalBilledTime != null && Object.hasOwnProperty.call(message, "totalBilledTime")) + $root.google.protobuf.Duration.encode(message.totalBilledTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.speechAdaptationInfo != null && Object.hasOwnProperty.call(message, "speechAdaptationInfo")) + $root.google.cloud.speech.v1.SpeechAdaptationInfo.encode(message.speechAdaptationInfo, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 8, wireType 0 =*/64).int64(message.requestId); + return writer; + }; + + /** + * Encodes the specified RecognizeResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v1.RecognizeResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.RecognizeResponse + * @static + * @param {google.cloud.speech.v1.IRecognizeResponse} message RecognizeResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecognizeResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RecognizeResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.RecognizeResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.RecognizeResponse} RecognizeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecognizeResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.RecognizeResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.results && message.results.length)) + message.results = []; + message.results.push($root.google.cloud.speech.v1.SpeechRecognitionResult.decode(reader, reader.uint32())); + break; + } + case 3: { + message.totalBilledTime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 7: { + message.speechAdaptationInfo = $root.google.cloud.speech.v1.SpeechAdaptationInfo.decode(reader, reader.uint32()); + break; + } + case 8: { + message.requestId = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RecognizeResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.RecognizeResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.RecognizeResponse} RecognizeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecognizeResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RecognizeResponse message. + * @function verify + * @memberof google.cloud.speech.v1.RecognizeResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RecognizeResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.results != null && message.hasOwnProperty("results")) { + if (!Array.isArray(message.results)) + return "results: array expected"; + for (var i = 0; i < message.results.length; ++i) { + var error = $root.google.cloud.speech.v1.SpeechRecognitionResult.verify(message.results[i]); + if (error) + return "results." + error; + } + } + if (message.totalBilledTime != null && message.hasOwnProperty("totalBilledTime")) { + var error = $root.google.protobuf.Duration.verify(message.totalBilledTime); + if (error) + return "totalBilledTime." + error; + } + if (message.speechAdaptationInfo != null && message.hasOwnProperty("speechAdaptationInfo")) { + var error = $root.google.cloud.speech.v1.SpeechAdaptationInfo.verify(message.speechAdaptationInfo); + if (error) + return "speechAdaptationInfo." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isInteger(message.requestId) && !(message.requestId && $util.isInteger(message.requestId.low) && $util.isInteger(message.requestId.high))) + return "requestId: integer|Long expected"; + return null; + }; + + /** + * Creates a RecognizeResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.RecognizeResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.RecognizeResponse} RecognizeResponse + */ + RecognizeResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.RecognizeResponse) + return object; + var message = new $root.google.cloud.speech.v1.RecognizeResponse(); + if (object.results) { + if (!Array.isArray(object.results)) + throw TypeError(".google.cloud.speech.v1.RecognizeResponse.results: array expected"); + message.results = []; + for (var i = 0; i < object.results.length; ++i) { + if (typeof object.results[i] !== "object") + throw TypeError(".google.cloud.speech.v1.RecognizeResponse.results: object expected"); + message.results[i] = $root.google.cloud.speech.v1.SpeechRecognitionResult.fromObject(object.results[i]); + } + } + if (object.totalBilledTime != null) { + if (typeof object.totalBilledTime !== "object") + throw TypeError(".google.cloud.speech.v1.RecognizeResponse.totalBilledTime: object expected"); + message.totalBilledTime = $root.google.protobuf.Duration.fromObject(object.totalBilledTime); + } + if (object.speechAdaptationInfo != null) { + if (typeof object.speechAdaptationInfo !== "object") + throw TypeError(".google.cloud.speech.v1.RecognizeResponse.speechAdaptationInfo: object expected"); + message.speechAdaptationInfo = $root.google.cloud.speech.v1.SpeechAdaptationInfo.fromObject(object.speechAdaptationInfo); + } + if (object.requestId != null) + if ($util.Long) + (message.requestId = $util.Long.fromValue(object.requestId)).unsigned = false; + else if (typeof object.requestId === "string") + message.requestId = parseInt(object.requestId, 10); + else if (typeof object.requestId === "number") + message.requestId = object.requestId; + else if (typeof object.requestId === "object") + message.requestId = new $util.LongBits(object.requestId.low >>> 0, object.requestId.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a RecognizeResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.RecognizeResponse + * @static + * @param {google.cloud.speech.v1.RecognizeResponse} message RecognizeResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RecognizeResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.results = []; + if (options.defaults) { + object.totalBilledTime = null; + object.speechAdaptationInfo = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.requestId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.requestId = options.longs === String ? "0" : 0; + } + if (message.results && message.results.length) { + object.results = []; + for (var j = 0; j < message.results.length; ++j) + object.results[j] = $root.google.cloud.speech.v1.SpeechRecognitionResult.toObject(message.results[j], options); + } + if (message.totalBilledTime != null && message.hasOwnProperty("totalBilledTime")) + object.totalBilledTime = $root.google.protobuf.Duration.toObject(message.totalBilledTime, options); + if (message.speechAdaptationInfo != null && message.hasOwnProperty("speechAdaptationInfo")) + object.speechAdaptationInfo = $root.google.cloud.speech.v1.SpeechAdaptationInfo.toObject(message.speechAdaptationInfo, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (typeof message.requestId === "number") + object.requestId = options.longs === String ? String(message.requestId) : message.requestId; + else + object.requestId = options.longs === String ? $util.Long.prototype.toString.call(message.requestId) : options.longs === Number ? new $util.LongBits(message.requestId.low >>> 0, message.requestId.high >>> 0).toNumber() : message.requestId; + return object; + }; + + /** + * Converts this RecognizeResponse to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.RecognizeResponse + * @instance + * @returns {Object.} JSON object + */ + RecognizeResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RecognizeResponse + * @function getTypeUrl + * @memberof google.cloud.speech.v1.RecognizeResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RecognizeResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.RecognizeResponse"; + }; + + return RecognizeResponse; + })(); + + v1.LongRunningRecognizeResponse = (function() { + + /** + * Properties of a LongRunningRecognizeResponse. + * @memberof google.cloud.speech.v1 + * @interface ILongRunningRecognizeResponse + * @property {Array.|null} [results] LongRunningRecognizeResponse results + * @property {google.protobuf.IDuration|null} [totalBilledTime] LongRunningRecognizeResponse totalBilledTime + * @property {google.cloud.speech.v1.ITranscriptOutputConfig|null} [outputConfig] LongRunningRecognizeResponse outputConfig + * @property {google.rpc.IStatus|null} [outputError] LongRunningRecognizeResponse outputError + * @property {google.cloud.speech.v1.ISpeechAdaptationInfo|null} [speechAdaptationInfo] LongRunningRecognizeResponse speechAdaptationInfo + * @property {number|Long|null} [requestId] LongRunningRecognizeResponse requestId + */ + + /** + * Constructs a new LongRunningRecognizeResponse. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a LongRunningRecognizeResponse. + * @implements ILongRunningRecognizeResponse + * @constructor + * @param {google.cloud.speech.v1.ILongRunningRecognizeResponse=} [properties] Properties to set + */ + function LongRunningRecognizeResponse(properties) { + this.results = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LongRunningRecognizeResponse results. + * @member {Array.} results + * @memberof google.cloud.speech.v1.LongRunningRecognizeResponse + * @instance + */ + LongRunningRecognizeResponse.prototype.results = $util.emptyArray; + + /** + * LongRunningRecognizeResponse totalBilledTime. + * @member {google.protobuf.IDuration|null|undefined} totalBilledTime + * @memberof google.cloud.speech.v1.LongRunningRecognizeResponse + * @instance + */ + LongRunningRecognizeResponse.prototype.totalBilledTime = null; + + /** + * LongRunningRecognizeResponse outputConfig. + * @member {google.cloud.speech.v1.ITranscriptOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.speech.v1.LongRunningRecognizeResponse + * @instance + */ + LongRunningRecognizeResponse.prototype.outputConfig = null; + + /** + * LongRunningRecognizeResponse outputError. + * @member {google.rpc.IStatus|null|undefined} outputError + * @memberof google.cloud.speech.v1.LongRunningRecognizeResponse + * @instance + */ + LongRunningRecognizeResponse.prototype.outputError = null; + + /** + * LongRunningRecognizeResponse speechAdaptationInfo. + * @member {google.cloud.speech.v1.ISpeechAdaptationInfo|null|undefined} speechAdaptationInfo + * @memberof google.cloud.speech.v1.LongRunningRecognizeResponse + * @instance + */ + LongRunningRecognizeResponse.prototype.speechAdaptationInfo = null; + + /** + * LongRunningRecognizeResponse requestId. + * @member {number|Long} requestId + * @memberof google.cloud.speech.v1.LongRunningRecognizeResponse + * @instance + */ + LongRunningRecognizeResponse.prototype.requestId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new LongRunningRecognizeResponse instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.LongRunningRecognizeResponse + * @static + * @param {google.cloud.speech.v1.ILongRunningRecognizeResponse=} [properties] Properties to set + * @returns {google.cloud.speech.v1.LongRunningRecognizeResponse} LongRunningRecognizeResponse instance + */ + LongRunningRecognizeResponse.create = function create(properties) { + return new LongRunningRecognizeResponse(properties); + }; + + /** + * Encodes the specified LongRunningRecognizeResponse message. Does not implicitly {@link google.cloud.speech.v1.LongRunningRecognizeResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.LongRunningRecognizeResponse + * @static + * @param {google.cloud.speech.v1.ILongRunningRecognizeResponse} message LongRunningRecognizeResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunningRecognizeResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.results != null && message.results.length) + for (var i = 0; i < message.results.length; ++i) + $root.google.cloud.speech.v1.SpeechRecognitionResult.encode(message.results[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.totalBilledTime != null && Object.hasOwnProperty.call(message, "totalBilledTime")) + $root.google.protobuf.Duration.encode(message.totalBilledTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) + $root.google.cloud.speech.v1.TranscriptOutputConfig.encode(message.outputConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.outputError != null && Object.hasOwnProperty.call(message, "outputError")) + $root.google.rpc.Status.encode(message.outputError, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.speechAdaptationInfo != null && Object.hasOwnProperty.call(message, "speechAdaptationInfo")) + $root.google.cloud.speech.v1.SpeechAdaptationInfo.encode(message.speechAdaptationInfo, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 9, wireType 0 =*/72).int64(message.requestId); + return writer; + }; + + /** + * Encodes the specified LongRunningRecognizeResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v1.LongRunningRecognizeResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.LongRunningRecognizeResponse + * @static + * @param {google.cloud.speech.v1.ILongRunningRecognizeResponse} message LongRunningRecognizeResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunningRecognizeResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LongRunningRecognizeResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.LongRunningRecognizeResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.LongRunningRecognizeResponse} LongRunningRecognizeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunningRecognizeResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.LongRunningRecognizeResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.results && message.results.length)) + message.results = []; + message.results.push($root.google.cloud.speech.v1.SpeechRecognitionResult.decode(reader, reader.uint32())); + break; + } + case 3: { + message.totalBilledTime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 6: { + message.outputConfig = $root.google.cloud.speech.v1.TranscriptOutputConfig.decode(reader, reader.uint32()); + break; + } + case 7: { + message.outputError = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 8: { + message.speechAdaptationInfo = $root.google.cloud.speech.v1.SpeechAdaptationInfo.decode(reader, reader.uint32()); + break; + } + case 9: { + message.requestId = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LongRunningRecognizeResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.LongRunningRecognizeResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.LongRunningRecognizeResponse} LongRunningRecognizeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunningRecognizeResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LongRunningRecognizeResponse message. + * @function verify + * @memberof google.cloud.speech.v1.LongRunningRecognizeResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LongRunningRecognizeResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.results != null && message.hasOwnProperty("results")) { + if (!Array.isArray(message.results)) + return "results: array expected"; + for (var i = 0; i < message.results.length; ++i) { + var error = $root.google.cloud.speech.v1.SpeechRecognitionResult.verify(message.results[i]); + if (error) + return "results." + error; + } + } + if (message.totalBilledTime != null && message.hasOwnProperty("totalBilledTime")) { + var error = $root.google.protobuf.Duration.verify(message.totalBilledTime); + if (error) + return "totalBilledTime." + error; + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.speech.v1.TranscriptOutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + if (message.outputError != null && message.hasOwnProperty("outputError")) { + var error = $root.google.rpc.Status.verify(message.outputError); + if (error) + return "outputError." + error; + } + if (message.speechAdaptationInfo != null && message.hasOwnProperty("speechAdaptationInfo")) { + var error = $root.google.cloud.speech.v1.SpeechAdaptationInfo.verify(message.speechAdaptationInfo); + if (error) + return "speechAdaptationInfo." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isInteger(message.requestId) && !(message.requestId && $util.isInteger(message.requestId.low) && $util.isInteger(message.requestId.high))) + return "requestId: integer|Long expected"; + return null; + }; + + /** + * Creates a LongRunningRecognizeResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.LongRunningRecognizeResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.LongRunningRecognizeResponse} LongRunningRecognizeResponse + */ + LongRunningRecognizeResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.LongRunningRecognizeResponse) + return object; + var message = new $root.google.cloud.speech.v1.LongRunningRecognizeResponse(); + if (object.results) { + if (!Array.isArray(object.results)) + throw TypeError(".google.cloud.speech.v1.LongRunningRecognizeResponse.results: array expected"); + message.results = []; + for (var i = 0; i < object.results.length; ++i) { + if (typeof object.results[i] !== "object") + throw TypeError(".google.cloud.speech.v1.LongRunningRecognizeResponse.results: object expected"); + message.results[i] = $root.google.cloud.speech.v1.SpeechRecognitionResult.fromObject(object.results[i]); + } + } + if (object.totalBilledTime != null) { + if (typeof object.totalBilledTime !== "object") + throw TypeError(".google.cloud.speech.v1.LongRunningRecognizeResponse.totalBilledTime: object expected"); + message.totalBilledTime = $root.google.protobuf.Duration.fromObject(object.totalBilledTime); + } + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.speech.v1.LongRunningRecognizeResponse.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.speech.v1.TranscriptOutputConfig.fromObject(object.outputConfig); + } + if (object.outputError != null) { + if (typeof object.outputError !== "object") + throw TypeError(".google.cloud.speech.v1.LongRunningRecognizeResponse.outputError: object expected"); + message.outputError = $root.google.rpc.Status.fromObject(object.outputError); + } + if (object.speechAdaptationInfo != null) { + if (typeof object.speechAdaptationInfo !== "object") + throw TypeError(".google.cloud.speech.v1.LongRunningRecognizeResponse.speechAdaptationInfo: object expected"); + message.speechAdaptationInfo = $root.google.cloud.speech.v1.SpeechAdaptationInfo.fromObject(object.speechAdaptationInfo); + } + if (object.requestId != null) + if ($util.Long) + (message.requestId = $util.Long.fromValue(object.requestId)).unsigned = false; + else if (typeof object.requestId === "string") + message.requestId = parseInt(object.requestId, 10); + else if (typeof object.requestId === "number") + message.requestId = object.requestId; + else if (typeof object.requestId === "object") + message.requestId = new $util.LongBits(object.requestId.low >>> 0, object.requestId.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a LongRunningRecognizeResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.LongRunningRecognizeResponse + * @static + * @param {google.cloud.speech.v1.LongRunningRecognizeResponse} message LongRunningRecognizeResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LongRunningRecognizeResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.results = []; + if (options.defaults) { + object.totalBilledTime = null; + object.outputConfig = null; + object.outputError = null; + object.speechAdaptationInfo = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.requestId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.requestId = options.longs === String ? "0" : 0; + } + if (message.results && message.results.length) { + object.results = []; + for (var j = 0; j < message.results.length; ++j) + object.results[j] = $root.google.cloud.speech.v1.SpeechRecognitionResult.toObject(message.results[j], options); + } + if (message.totalBilledTime != null && message.hasOwnProperty("totalBilledTime")) + object.totalBilledTime = $root.google.protobuf.Duration.toObject(message.totalBilledTime, options); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.speech.v1.TranscriptOutputConfig.toObject(message.outputConfig, options); + if (message.outputError != null && message.hasOwnProperty("outputError")) + object.outputError = $root.google.rpc.Status.toObject(message.outputError, options); + if (message.speechAdaptationInfo != null && message.hasOwnProperty("speechAdaptationInfo")) + object.speechAdaptationInfo = $root.google.cloud.speech.v1.SpeechAdaptationInfo.toObject(message.speechAdaptationInfo, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (typeof message.requestId === "number") + object.requestId = options.longs === String ? String(message.requestId) : message.requestId; + else + object.requestId = options.longs === String ? $util.Long.prototype.toString.call(message.requestId) : options.longs === Number ? new $util.LongBits(message.requestId.low >>> 0, message.requestId.high >>> 0).toNumber() : message.requestId; + return object; + }; + + /** + * Converts this LongRunningRecognizeResponse to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.LongRunningRecognizeResponse + * @instance + * @returns {Object.} JSON object + */ + LongRunningRecognizeResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LongRunningRecognizeResponse + * @function getTypeUrl + * @memberof google.cloud.speech.v1.LongRunningRecognizeResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LongRunningRecognizeResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.LongRunningRecognizeResponse"; + }; + + return LongRunningRecognizeResponse; + })(); + + v1.LongRunningRecognizeMetadata = (function() { + + /** + * Properties of a LongRunningRecognizeMetadata. + * @memberof google.cloud.speech.v1 + * @interface ILongRunningRecognizeMetadata + * @property {number|null} [progressPercent] LongRunningRecognizeMetadata progressPercent + * @property {google.protobuf.ITimestamp|null} [startTime] LongRunningRecognizeMetadata startTime + * @property {google.protobuf.ITimestamp|null} [lastUpdateTime] LongRunningRecognizeMetadata lastUpdateTime + * @property {string|null} [uri] LongRunningRecognizeMetadata uri + */ + + /** + * Constructs a new LongRunningRecognizeMetadata. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a LongRunningRecognizeMetadata. + * @implements ILongRunningRecognizeMetadata + * @constructor + * @param {google.cloud.speech.v1.ILongRunningRecognizeMetadata=} [properties] Properties to set + */ + function LongRunningRecognizeMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LongRunningRecognizeMetadata progressPercent. + * @member {number} progressPercent + * @memberof google.cloud.speech.v1.LongRunningRecognizeMetadata + * @instance + */ + LongRunningRecognizeMetadata.prototype.progressPercent = 0; + + /** + * LongRunningRecognizeMetadata startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.speech.v1.LongRunningRecognizeMetadata + * @instance + */ + LongRunningRecognizeMetadata.prototype.startTime = null; + + /** + * LongRunningRecognizeMetadata lastUpdateTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastUpdateTime + * @memberof google.cloud.speech.v1.LongRunningRecognizeMetadata + * @instance + */ + LongRunningRecognizeMetadata.prototype.lastUpdateTime = null; + + /** + * LongRunningRecognizeMetadata uri. + * @member {string} uri + * @memberof google.cloud.speech.v1.LongRunningRecognizeMetadata + * @instance + */ + LongRunningRecognizeMetadata.prototype.uri = ""; + + /** + * Creates a new LongRunningRecognizeMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.LongRunningRecognizeMetadata + * @static + * @param {google.cloud.speech.v1.ILongRunningRecognizeMetadata=} [properties] Properties to set + * @returns {google.cloud.speech.v1.LongRunningRecognizeMetadata} LongRunningRecognizeMetadata instance + */ + LongRunningRecognizeMetadata.create = function create(properties) { + return new LongRunningRecognizeMetadata(properties); + }; + + /** + * Encodes the specified LongRunningRecognizeMetadata message. Does not implicitly {@link google.cloud.speech.v1.LongRunningRecognizeMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.LongRunningRecognizeMetadata + * @static + * @param {google.cloud.speech.v1.ILongRunningRecognizeMetadata} message LongRunningRecognizeMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunningRecognizeMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.progressPercent != null && Object.hasOwnProperty.call(message, "progressPercent")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.progressPercent); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.lastUpdateTime != null && Object.hasOwnProperty.call(message, "lastUpdateTime")) + $root.google.protobuf.Timestamp.encode(message.lastUpdateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.uri); + return writer; + }; + + /** + * Encodes the specified LongRunningRecognizeMetadata message, length delimited. Does not implicitly {@link google.cloud.speech.v1.LongRunningRecognizeMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.LongRunningRecognizeMetadata + * @static + * @param {google.cloud.speech.v1.ILongRunningRecognizeMetadata} message LongRunningRecognizeMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunningRecognizeMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LongRunningRecognizeMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.LongRunningRecognizeMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.LongRunningRecognizeMetadata} LongRunningRecognizeMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunningRecognizeMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.LongRunningRecognizeMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.progressPercent = reader.int32(); + break; + } + case 2: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.lastUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.uri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LongRunningRecognizeMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.LongRunningRecognizeMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.LongRunningRecognizeMetadata} LongRunningRecognizeMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunningRecognizeMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LongRunningRecognizeMetadata message. + * @function verify + * @memberof google.cloud.speech.v1.LongRunningRecognizeMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LongRunningRecognizeMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + if (!$util.isInteger(message.progressPercent)) + return "progressPercent: integer expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.lastUpdateTime != null && message.hasOwnProperty("lastUpdateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastUpdateTime); + if (error) + return "lastUpdateTime." + error; + } + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + return null; + }; + + /** + * Creates a LongRunningRecognizeMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.LongRunningRecognizeMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.LongRunningRecognizeMetadata} LongRunningRecognizeMetadata + */ + LongRunningRecognizeMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.LongRunningRecognizeMetadata) + return object; + var message = new $root.google.cloud.speech.v1.LongRunningRecognizeMetadata(); + if (object.progressPercent != null) + message.progressPercent = object.progressPercent | 0; + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.speech.v1.LongRunningRecognizeMetadata.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.lastUpdateTime != null) { + if (typeof object.lastUpdateTime !== "object") + throw TypeError(".google.cloud.speech.v1.LongRunningRecognizeMetadata.lastUpdateTime: object expected"); + message.lastUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.lastUpdateTime); + } + if (object.uri != null) + message.uri = String(object.uri); + return message; + }; + + /** + * Creates a plain object from a LongRunningRecognizeMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.LongRunningRecognizeMetadata + * @static + * @param {google.cloud.speech.v1.LongRunningRecognizeMetadata} message LongRunningRecognizeMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LongRunningRecognizeMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.progressPercent = 0; + object.startTime = null; + object.lastUpdateTime = null; + object.uri = ""; + } + if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + object.progressPercent = message.progressPercent; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.lastUpdateTime != null && message.hasOwnProperty("lastUpdateTime")) + object.lastUpdateTime = $root.google.protobuf.Timestamp.toObject(message.lastUpdateTime, options); + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + return object; + }; + + /** + * Converts this LongRunningRecognizeMetadata to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.LongRunningRecognizeMetadata + * @instance + * @returns {Object.} JSON object + */ + LongRunningRecognizeMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LongRunningRecognizeMetadata + * @function getTypeUrl + * @memberof google.cloud.speech.v1.LongRunningRecognizeMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LongRunningRecognizeMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.LongRunningRecognizeMetadata"; + }; + + return LongRunningRecognizeMetadata; + })(); + + v1.StreamingRecognizeResponse = (function() { + + /** + * Properties of a StreamingRecognizeResponse. + * @memberof google.cloud.speech.v1 + * @interface IStreamingRecognizeResponse + * @property {google.rpc.IStatus|null} [error] StreamingRecognizeResponse error + * @property {Array.|null} [results] StreamingRecognizeResponse results + * @property {google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType|null} [speechEventType] StreamingRecognizeResponse speechEventType + * @property {google.protobuf.IDuration|null} [speechEventTime] StreamingRecognizeResponse speechEventTime + * @property {google.protobuf.IDuration|null} [totalBilledTime] StreamingRecognizeResponse totalBilledTime + * @property {google.cloud.speech.v1.ISpeechAdaptationInfo|null} [speechAdaptationInfo] StreamingRecognizeResponse speechAdaptationInfo + * @property {number|Long|null} [requestId] StreamingRecognizeResponse requestId + */ + + /** + * Constructs a new StreamingRecognizeResponse. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a StreamingRecognizeResponse. + * @implements IStreamingRecognizeResponse + * @constructor + * @param {google.cloud.speech.v1.IStreamingRecognizeResponse=} [properties] Properties to set + */ + function StreamingRecognizeResponse(properties) { + this.results = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamingRecognizeResponse error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.speech.v1.StreamingRecognizeResponse + * @instance + */ + StreamingRecognizeResponse.prototype.error = null; + + /** + * StreamingRecognizeResponse results. + * @member {Array.} results + * @memberof google.cloud.speech.v1.StreamingRecognizeResponse + * @instance + */ + StreamingRecognizeResponse.prototype.results = $util.emptyArray; + + /** + * StreamingRecognizeResponse speechEventType. + * @member {google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType} speechEventType + * @memberof google.cloud.speech.v1.StreamingRecognizeResponse + * @instance + */ + StreamingRecognizeResponse.prototype.speechEventType = 0; + + /** + * StreamingRecognizeResponse speechEventTime. + * @member {google.protobuf.IDuration|null|undefined} speechEventTime + * @memberof google.cloud.speech.v1.StreamingRecognizeResponse + * @instance + */ + StreamingRecognizeResponse.prototype.speechEventTime = null; + + /** + * StreamingRecognizeResponse totalBilledTime. + * @member {google.protobuf.IDuration|null|undefined} totalBilledTime + * @memberof google.cloud.speech.v1.StreamingRecognizeResponse + * @instance + */ + StreamingRecognizeResponse.prototype.totalBilledTime = null; + + /** + * StreamingRecognizeResponse speechAdaptationInfo. + * @member {google.cloud.speech.v1.ISpeechAdaptationInfo|null|undefined} speechAdaptationInfo + * @memberof google.cloud.speech.v1.StreamingRecognizeResponse + * @instance + */ + StreamingRecognizeResponse.prototype.speechAdaptationInfo = null; + + /** + * StreamingRecognizeResponse requestId. + * @member {number|Long} requestId + * @memberof google.cloud.speech.v1.StreamingRecognizeResponse + * @instance + */ + StreamingRecognizeResponse.prototype.requestId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new StreamingRecognizeResponse instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.StreamingRecognizeResponse + * @static + * @param {google.cloud.speech.v1.IStreamingRecognizeResponse=} [properties] Properties to set + * @returns {google.cloud.speech.v1.StreamingRecognizeResponse} StreamingRecognizeResponse instance + */ + StreamingRecognizeResponse.create = function create(properties) { + return new StreamingRecognizeResponse(properties); + }; + + /** + * Encodes the specified StreamingRecognizeResponse message. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognizeResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.StreamingRecognizeResponse + * @static + * @param {google.cloud.speech.v1.IStreamingRecognizeResponse} message StreamingRecognizeResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingRecognizeResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.results != null && message.results.length) + for (var i = 0; i < message.results.length; ++i) + $root.google.cloud.speech.v1.StreamingRecognitionResult.encode(message.results[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.speechEventType != null && Object.hasOwnProperty.call(message, "speechEventType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.speechEventType); + if (message.totalBilledTime != null && Object.hasOwnProperty.call(message, "totalBilledTime")) + $root.google.protobuf.Duration.encode(message.totalBilledTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.speechEventTime != null && Object.hasOwnProperty.call(message, "speechEventTime")) + $root.google.protobuf.Duration.encode(message.speechEventTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.speechAdaptationInfo != null && Object.hasOwnProperty.call(message, "speechAdaptationInfo")) + $root.google.cloud.speech.v1.SpeechAdaptationInfo.encode(message.speechAdaptationInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 10, wireType 0 =*/80).int64(message.requestId); + return writer; + }; + + /** + * Encodes the specified StreamingRecognizeResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognizeResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.StreamingRecognizeResponse + * @static + * @param {google.cloud.speech.v1.IStreamingRecognizeResponse} message StreamingRecognizeResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingRecognizeResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamingRecognizeResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.StreamingRecognizeResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.StreamingRecognizeResponse} StreamingRecognizeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingRecognizeResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.StreamingRecognizeResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.results && message.results.length)) + message.results = []; + message.results.push($root.google.cloud.speech.v1.StreamingRecognitionResult.decode(reader, reader.uint32())); + break; + } + case 4: { + message.speechEventType = reader.int32(); + break; + } + case 8: { + message.speechEventTime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 5: { + message.totalBilledTime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 9: { + message.speechAdaptationInfo = $root.google.cloud.speech.v1.SpeechAdaptationInfo.decode(reader, reader.uint32()); + break; + } + case 10: { + message.requestId = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamingRecognizeResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.StreamingRecognizeResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.StreamingRecognizeResponse} StreamingRecognizeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingRecognizeResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamingRecognizeResponse message. + * @function verify + * @memberof google.cloud.speech.v1.StreamingRecognizeResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingRecognizeResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.error != null && message.hasOwnProperty("error")) { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + if (message.results != null && message.hasOwnProperty("results")) { + if (!Array.isArray(message.results)) + return "results: array expected"; + for (var i = 0; i < message.results.length; ++i) { + var error = $root.google.cloud.speech.v1.StreamingRecognitionResult.verify(message.results[i]); + if (error) + return "results." + error; + } + } + if (message.speechEventType != null && message.hasOwnProperty("speechEventType")) + switch (message.speechEventType) { + default: + return "speechEventType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.speechEventTime != null && message.hasOwnProperty("speechEventTime")) { + var error = $root.google.protobuf.Duration.verify(message.speechEventTime); + if (error) + return "speechEventTime." + error; + } + if (message.totalBilledTime != null && message.hasOwnProperty("totalBilledTime")) { + var error = $root.google.protobuf.Duration.verify(message.totalBilledTime); + if (error) + return "totalBilledTime." + error; + } + if (message.speechAdaptationInfo != null && message.hasOwnProperty("speechAdaptationInfo")) { + var error = $root.google.cloud.speech.v1.SpeechAdaptationInfo.verify(message.speechAdaptationInfo); + if (error) + return "speechAdaptationInfo." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isInteger(message.requestId) && !(message.requestId && $util.isInteger(message.requestId.low) && $util.isInteger(message.requestId.high))) + return "requestId: integer|Long expected"; + return null; + }; + + /** + * Creates a StreamingRecognizeResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.StreamingRecognizeResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.StreamingRecognizeResponse} StreamingRecognizeResponse + */ + StreamingRecognizeResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.StreamingRecognizeResponse) + return object; + var message = new $root.google.cloud.speech.v1.StreamingRecognizeResponse(); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.speech.v1.StreamingRecognizeResponse.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.results) { + if (!Array.isArray(object.results)) + throw TypeError(".google.cloud.speech.v1.StreamingRecognizeResponse.results: array expected"); + message.results = []; + for (var i = 0; i < object.results.length; ++i) { + if (typeof object.results[i] !== "object") + throw TypeError(".google.cloud.speech.v1.StreamingRecognizeResponse.results: object expected"); + message.results[i] = $root.google.cloud.speech.v1.StreamingRecognitionResult.fromObject(object.results[i]); + } + } + switch (object.speechEventType) { + default: + if (typeof object.speechEventType === "number") { + message.speechEventType = object.speechEventType; + break; + } + break; + case "SPEECH_EVENT_UNSPECIFIED": + case 0: + message.speechEventType = 0; + break; + case "END_OF_SINGLE_UTTERANCE": + case 1: + message.speechEventType = 1; + break; + case "SPEECH_ACTIVITY_BEGIN": + case 2: + message.speechEventType = 2; + break; + case "SPEECH_ACTIVITY_END": + case 3: + message.speechEventType = 3; + break; + case "SPEECH_ACTIVITY_TIMEOUT": + case 4: + message.speechEventType = 4; + break; + } + if (object.speechEventTime != null) { + if (typeof object.speechEventTime !== "object") + throw TypeError(".google.cloud.speech.v1.StreamingRecognizeResponse.speechEventTime: object expected"); + message.speechEventTime = $root.google.protobuf.Duration.fromObject(object.speechEventTime); + } + if (object.totalBilledTime != null) { + if (typeof object.totalBilledTime !== "object") + throw TypeError(".google.cloud.speech.v1.StreamingRecognizeResponse.totalBilledTime: object expected"); + message.totalBilledTime = $root.google.protobuf.Duration.fromObject(object.totalBilledTime); + } + if (object.speechAdaptationInfo != null) { + if (typeof object.speechAdaptationInfo !== "object") + throw TypeError(".google.cloud.speech.v1.StreamingRecognizeResponse.speechAdaptationInfo: object expected"); + message.speechAdaptationInfo = $root.google.cloud.speech.v1.SpeechAdaptationInfo.fromObject(object.speechAdaptationInfo); + } + if (object.requestId != null) + if ($util.Long) + (message.requestId = $util.Long.fromValue(object.requestId)).unsigned = false; + else if (typeof object.requestId === "string") + message.requestId = parseInt(object.requestId, 10); + else if (typeof object.requestId === "number") + message.requestId = object.requestId; + else if (typeof object.requestId === "object") + message.requestId = new $util.LongBits(object.requestId.low >>> 0, object.requestId.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a StreamingRecognizeResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.StreamingRecognizeResponse + * @static + * @param {google.cloud.speech.v1.StreamingRecognizeResponse} message StreamingRecognizeResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingRecognizeResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.results = []; + if (options.defaults) { + object.error = null; + object.speechEventType = options.enums === String ? "SPEECH_EVENT_UNSPECIFIED" : 0; + object.totalBilledTime = null; + object.speechEventTime = null; + object.speechAdaptationInfo = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.requestId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.requestId = options.longs === String ? "0" : 0; + } + if (message.error != null && message.hasOwnProperty("error")) + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (message.results && message.results.length) { + object.results = []; + for (var j = 0; j < message.results.length; ++j) + object.results[j] = $root.google.cloud.speech.v1.StreamingRecognitionResult.toObject(message.results[j], options); + } + if (message.speechEventType != null && message.hasOwnProperty("speechEventType")) + object.speechEventType = options.enums === String ? $root.google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType[message.speechEventType] === undefined ? message.speechEventType : $root.google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType[message.speechEventType] : message.speechEventType; + if (message.totalBilledTime != null && message.hasOwnProperty("totalBilledTime")) + object.totalBilledTime = $root.google.protobuf.Duration.toObject(message.totalBilledTime, options); + if (message.speechEventTime != null && message.hasOwnProperty("speechEventTime")) + object.speechEventTime = $root.google.protobuf.Duration.toObject(message.speechEventTime, options); + if (message.speechAdaptationInfo != null && message.hasOwnProperty("speechAdaptationInfo")) + object.speechAdaptationInfo = $root.google.cloud.speech.v1.SpeechAdaptationInfo.toObject(message.speechAdaptationInfo, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (typeof message.requestId === "number") + object.requestId = options.longs === String ? String(message.requestId) : message.requestId; + else + object.requestId = options.longs === String ? $util.Long.prototype.toString.call(message.requestId) : options.longs === Number ? new $util.LongBits(message.requestId.low >>> 0, message.requestId.high >>> 0).toNumber() : message.requestId; + return object; + }; + + /** + * Converts this StreamingRecognizeResponse to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.StreamingRecognizeResponse + * @instance + * @returns {Object.} JSON object + */ + StreamingRecognizeResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamingRecognizeResponse + * @function getTypeUrl + * @memberof google.cloud.speech.v1.StreamingRecognizeResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamingRecognizeResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.StreamingRecognizeResponse"; + }; + + /** + * SpeechEventType enum. + * @name google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType + * @enum {number} + * @property {number} SPEECH_EVENT_UNSPECIFIED=0 SPEECH_EVENT_UNSPECIFIED value + * @property {number} END_OF_SINGLE_UTTERANCE=1 END_OF_SINGLE_UTTERANCE value + * @property {number} SPEECH_ACTIVITY_BEGIN=2 SPEECH_ACTIVITY_BEGIN value + * @property {number} SPEECH_ACTIVITY_END=3 SPEECH_ACTIVITY_END value + * @property {number} SPEECH_ACTIVITY_TIMEOUT=4 SPEECH_ACTIVITY_TIMEOUT value + */ + StreamingRecognizeResponse.SpeechEventType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SPEECH_EVENT_UNSPECIFIED"] = 0; + values[valuesById[1] = "END_OF_SINGLE_UTTERANCE"] = 1; + values[valuesById[2] = "SPEECH_ACTIVITY_BEGIN"] = 2; + values[valuesById[3] = "SPEECH_ACTIVITY_END"] = 3; + values[valuesById[4] = "SPEECH_ACTIVITY_TIMEOUT"] = 4; + return values; + })(); + + return StreamingRecognizeResponse; + })(); + + v1.StreamingRecognitionResult = (function() { + + /** + * Properties of a StreamingRecognitionResult. + * @memberof google.cloud.speech.v1 + * @interface IStreamingRecognitionResult + * @property {Array.|null} [alternatives] StreamingRecognitionResult alternatives + * @property {boolean|null} [isFinal] StreamingRecognitionResult isFinal + * @property {number|null} [stability] StreamingRecognitionResult stability + * @property {google.protobuf.IDuration|null} [resultEndTime] StreamingRecognitionResult resultEndTime + * @property {number|null} [channelTag] StreamingRecognitionResult channelTag + * @property {string|null} [languageCode] StreamingRecognitionResult languageCode + */ + + /** + * Constructs a new StreamingRecognitionResult. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a StreamingRecognitionResult. + * @implements IStreamingRecognitionResult + * @constructor + * @param {google.cloud.speech.v1.IStreamingRecognitionResult=} [properties] Properties to set + */ + function StreamingRecognitionResult(properties) { + this.alternatives = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamingRecognitionResult alternatives. + * @member {Array.} alternatives + * @memberof google.cloud.speech.v1.StreamingRecognitionResult + * @instance + */ + StreamingRecognitionResult.prototype.alternatives = $util.emptyArray; + + /** + * StreamingRecognitionResult isFinal. + * @member {boolean} isFinal + * @memberof google.cloud.speech.v1.StreamingRecognitionResult + * @instance + */ + StreamingRecognitionResult.prototype.isFinal = false; + + /** + * StreamingRecognitionResult stability. + * @member {number} stability + * @memberof google.cloud.speech.v1.StreamingRecognitionResult + * @instance + */ + StreamingRecognitionResult.prototype.stability = 0; + + /** + * StreamingRecognitionResult resultEndTime. + * @member {google.protobuf.IDuration|null|undefined} resultEndTime + * @memberof google.cloud.speech.v1.StreamingRecognitionResult + * @instance + */ + StreamingRecognitionResult.prototype.resultEndTime = null; + + /** + * StreamingRecognitionResult channelTag. + * @member {number} channelTag + * @memberof google.cloud.speech.v1.StreamingRecognitionResult + * @instance + */ + StreamingRecognitionResult.prototype.channelTag = 0; + + /** + * StreamingRecognitionResult languageCode. + * @member {string} languageCode + * @memberof google.cloud.speech.v1.StreamingRecognitionResult + * @instance + */ + StreamingRecognitionResult.prototype.languageCode = ""; + + /** + * Creates a new StreamingRecognitionResult instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.StreamingRecognitionResult + * @static + * @param {google.cloud.speech.v1.IStreamingRecognitionResult=} [properties] Properties to set + * @returns {google.cloud.speech.v1.StreamingRecognitionResult} StreamingRecognitionResult instance + */ + StreamingRecognitionResult.create = function create(properties) { + return new StreamingRecognitionResult(properties); + }; + + /** + * Encodes the specified StreamingRecognitionResult message. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognitionResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.StreamingRecognitionResult + * @static + * @param {google.cloud.speech.v1.IStreamingRecognitionResult} message StreamingRecognitionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingRecognitionResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.alternatives != null && message.alternatives.length) + for (var i = 0; i < message.alternatives.length; ++i) + $root.google.cloud.speech.v1.SpeechRecognitionAlternative.encode(message.alternatives[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.isFinal != null && Object.hasOwnProperty.call(message, "isFinal")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isFinal); + if (message.stability != null && Object.hasOwnProperty.call(message, "stability")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.stability); + if (message.resultEndTime != null && Object.hasOwnProperty.call(message, "resultEndTime")) + $root.google.protobuf.Duration.encode(message.resultEndTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.channelTag != null && Object.hasOwnProperty.call(message, "channelTag")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.channelTag); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified StreamingRecognitionResult message, length delimited. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognitionResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.StreamingRecognitionResult + * @static + * @param {google.cloud.speech.v1.IStreamingRecognitionResult} message StreamingRecognitionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingRecognitionResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamingRecognitionResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.StreamingRecognitionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.StreamingRecognitionResult} StreamingRecognitionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingRecognitionResult.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.StreamingRecognitionResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.alternatives && message.alternatives.length)) + message.alternatives = []; + message.alternatives.push($root.google.cloud.speech.v1.SpeechRecognitionAlternative.decode(reader, reader.uint32())); + break; + } + case 2: { + message.isFinal = reader.bool(); + break; + } + case 3: { + message.stability = reader.float(); + break; + } + case 4: { + message.resultEndTime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 5: { + message.channelTag = reader.int32(); + break; + } + case 6: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamingRecognitionResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.StreamingRecognitionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.StreamingRecognitionResult} StreamingRecognitionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingRecognitionResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamingRecognitionResult message. + * @function verify + * @memberof google.cloud.speech.v1.StreamingRecognitionResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingRecognitionResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.alternatives != null && message.hasOwnProperty("alternatives")) { + if (!Array.isArray(message.alternatives)) + return "alternatives: array expected"; + for (var i = 0; i < message.alternatives.length; ++i) { + var error = $root.google.cloud.speech.v1.SpeechRecognitionAlternative.verify(message.alternatives[i]); + if (error) + return "alternatives." + error; + } + } + if (message.isFinal != null && message.hasOwnProperty("isFinal")) + if (typeof message.isFinal !== "boolean") + return "isFinal: boolean expected"; + if (message.stability != null && message.hasOwnProperty("stability")) + if (typeof message.stability !== "number") + return "stability: number expected"; + if (message.resultEndTime != null && message.hasOwnProperty("resultEndTime")) { + var error = $root.google.protobuf.Duration.verify(message.resultEndTime); + if (error) + return "resultEndTime." + error; + } + if (message.channelTag != null && message.hasOwnProperty("channelTag")) + if (!$util.isInteger(message.channelTag)) + return "channelTag: integer expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a StreamingRecognitionResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.StreamingRecognitionResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.StreamingRecognitionResult} StreamingRecognitionResult + */ + StreamingRecognitionResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.StreamingRecognitionResult) + return object; + var message = new $root.google.cloud.speech.v1.StreamingRecognitionResult(); + if (object.alternatives) { + if (!Array.isArray(object.alternatives)) + throw TypeError(".google.cloud.speech.v1.StreamingRecognitionResult.alternatives: array expected"); + message.alternatives = []; + for (var i = 0; i < object.alternatives.length; ++i) { + if (typeof object.alternatives[i] !== "object") + throw TypeError(".google.cloud.speech.v1.StreamingRecognitionResult.alternatives: object expected"); + message.alternatives[i] = $root.google.cloud.speech.v1.SpeechRecognitionAlternative.fromObject(object.alternatives[i]); + } + } + if (object.isFinal != null) + message.isFinal = Boolean(object.isFinal); + if (object.stability != null) + message.stability = Number(object.stability); + if (object.resultEndTime != null) { + if (typeof object.resultEndTime !== "object") + throw TypeError(".google.cloud.speech.v1.StreamingRecognitionResult.resultEndTime: object expected"); + message.resultEndTime = $root.google.protobuf.Duration.fromObject(object.resultEndTime); + } + if (object.channelTag != null) + message.channelTag = object.channelTag | 0; + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a StreamingRecognitionResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.StreamingRecognitionResult + * @static + * @param {google.cloud.speech.v1.StreamingRecognitionResult} message StreamingRecognitionResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingRecognitionResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.alternatives = []; + if (options.defaults) { + object.isFinal = false; + object.stability = 0; + object.resultEndTime = null; + object.channelTag = 0; + object.languageCode = ""; + } + if (message.alternatives && message.alternatives.length) { + object.alternatives = []; + for (var j = 0; j < message.alternatives.length; ++j) + object.alternatives[j] = $root.google.cloud.speech.v1.SpeechRecognitionAlternative.toObject(message.alternatives[j], options); + } + if (message.isFinal != null && message.hasOwnProperty("isFinal")) + object.isFinal = message.isFinal; + if (message.stability != null && message.hasOwnProperty("stability")) + object.stability = options.json && !isFinite(message.stability) ? String(message.stability) : message.stability; + if (message.resultEndTime != null && message.hasOwnProperty("resultEndTime")) + object.resultEndTime = $root.google.protobuf.Duration.toObject(message.resultEndTime, options); + if (message.channelTag != null && message.hasOwnProperty("channelTag")) + object.channelTag = message.channelTag; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this StreamingRecognitionResult to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.StreamingRecognitionResult + * @instance + * @returns {Object.} JSON object + */ + StreamingRecognitionResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamingRecognitionResult + * @function getTypeUrl + * @memberof google.cloud.speech.v1.StreamingRecognitionResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamingRecognitionResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.StreamingRecognitionResult"; + }; + + return StreamingRecognitionResult; + })(); + + v1.SpeechRecognitionResult = (function() { + + /** + * Properties of a SpeechRecognitionResult. + * @memberof google.cloud.speech.v1 + * @interface ISpeechRecognitionResult + * @property {Array.|null} [alternatives] SpeechRecognitionResult alternatives + * @property {number|null} [channelTag] SpeechRecognitionResult channelTag + * @property {google.protobuf.IDuration|null} [resultEndTime] SpeechRecognitionResult resultEndTime + * @property {string|null} [languageCode] SpeechRecognitionResult languageCode + */ + + /** + * Constructs a new SpeechRecognitionResult. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a SpeechRecognitionResult. + * @implements ISpeechRecognitionResult + * @constructor + * @param {google.cloud.speech.v1.ISpeechRecognitionResult=} [properties] Properties to set + */ + function SpeechRecognitionResult(properties) { + this.alternatives = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpeechRecognitionResult alternatives. + * @member {Array.} alternatives + * @memberof google.cloud.speech.v1.SpeechRecognitionResult + * @instance + */ + SpeechRecognitionResult.prototype.alternatives = $util.emptyArray; + + /** + * SpeechRecognitionResult channelTag. + * @member {number} channelTag + * @memberof google.cloud.speech.v1.SpeechRecognitionResult + * @instance + */ + SpeechRecognitionResult.prototype.channelTag = 0; + + /** + * SpeechRecognitionResult resultEndTime. + * @member {google.protobuf.IDuration|null|undefined} resultEndTime + * @memberof google.cloud.speech.v1.SpeechRecognitionResult + * @instance + */ + SpeechRecognitionResult.prototype.resultEndTime = null; + + /** + * SpeechRecognitionResult languageCode. + * @member {string} languageCode + * @memberof google.cloud.speech.v1.SpeechRecognitionResult + * @instance + */ + SpeechRecognitionResult.prototype.languageCode = ""; + + /** + * Creates a new SpeechRecognitionResult instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.SpeechRecognitionResult + * @static + * @param {google.cloud.speech.v1.ISpeechRecognitionResult=} [properties] Properties to set + * @returns {google.cloud.speech.v1.SpeechRecognitionResult} SpeechRecognitionResult instance + */ + SpeechRecognitionResult.create = function create(properties) { + return new SpeechRecognitionResult(properties); + }; + + /** + * Encodes the specified SpeechRecognitionResult message. Does not implicitly {@link google.cloud.speech.v1.SpeechRecognitionResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.SpeechRecognitionResult + * @static + * @param {google.cloud.speech.v1.ISpeechRecognitionResult} message SpeechRecognitionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechRecognitionResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.alternatives != null && message.alternatives.length) + for (var i = 0; i < message.alternatives.length; ++i) + $root.google.cloud.speech.v1.SpeechRecognitionAlternative.encode(message.alternatives[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.channelTag != null && Object.hasOwnProperty.call(message, "channelTag")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.channelTag); + if (message.resultEndTime != null && Object.hasOwnProperty.call(message, "resultEndTime")) + $root.google.protobuf.Duration.encode(message.resultEndTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified SpeechRecognitionResult message, length delimited. Does not implicitly {@link google.cloud.speech.v1.SpeechRecognitionResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.SpeechRecognitionResult + * @static + * @param {google.cloud.speech.v1.ISpeechRecognitionResult} message SpeechRecognitionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechRecognitionResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpeechRecognitionResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.SpeechRecognitionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.SpeechRecognitionResult} SpeechRecognitionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechRecognitionResult.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.SpeechRecognitionResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.alternatives && message.alternatives.length)) + message.alternatives = []; + message.alternatives.push($root.google.cloud.speech.v1.SpeechRecognitionAlternative.decode(reader, reader.uint32())); + break; + } + case 2: { + message.channelTag = reader.int32(); + break; + } + case 4: { + message.resultEndTime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 5: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpeechRecognitionResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.SpeechRecognitionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.SpeechRecognitionResult} SpeechRecognitionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechRecognitionResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpeechRecognitionResult message. + * @function verify + * @memberof google.cloud.speech.v1.SpeechRecognitionResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpeechRecognitionResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.alternatives != null && message.hasOwnProperty("alternatives")) { + if (!Array.isArray(message.alternatives)) + return "alternatives: array expected"; + for (var i = 0; i < message.alternatives.length; ++i) { + var error = $root.google.cloud.speech.v1.SpeechRecognitionAlternative.verify(message.alternatives[i]); + if (error) + return "alternatives." + error; + } + } + if (message.channelTag != null && message.hasOwnProperty("channelTag")) + if (!$util.isInteger(message.channelTag)) + return "channelTag: integer expected"; + if (message.resultEndTime != null && message.hasOwnProperty("resultEndTime")) { + var error = $root.google.protobuf.Duration.verify(message.resultEndTime); + if (error) + return "resultEndTime." + error; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a SpeechRecognitionResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.SpeechRecognitionResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.SpeechRecognitionResult} SpeechRecognitionResult + */ + SpeechRecognitionResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.SpeechRecognitionResult) + return object; + var message = new $root.google.cloud.speech.v1.SpeechRecognitionResult(); + if (object.alternatives) { + if (!Array.isArray(object.alternatives)) + throw TypeError(".google.cloud.speech.v1.SpeechRecognitionResult.alternatives: array expected"); + message.alternatives = []; + for (var i = 0; i < object.alternatives.length; ++i) { + if (typeof object.alternatives[i] !== "object") + throw TypeError(".google.cloud.speech.v1.SpeechRecognitionResult.alternatives: object expected"); + message.alternatives[i] = $root.google.cloud.speech.v1.SpeechRecognitionAlternative.fromObject(object.alternatives[i]); + } + } + if (object.channelTag != null) + message.channelTag = object.channelTag | 0; + if (object.resultEndTime != null) { + if (typeof object.resultEndTime !== "object") + throw TypeError(".google.cloud.speech.v1.SpeechRecognitionResult.resultEndTime: object expected"); + message.resultEndTime = $root.google.protobuf.Duration.fromObject(object.resultEndTime); + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a SpeechRecognitionResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.SpeechRecognitionResult + * @static + * @param {google.cloud.speech.v1.SpeechRecognitionResult} message SpeechRecognitionResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpeechRecognitionResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.alternatives = []; + if (options.defaults) { + object.channelTag = 0; + object.resultEndTime = null; + object.languageCode = ""; + } + if (message.alternatives && message.alternatives.length) { + object.alternatives = []; + for (var j = 0; j < message.alternatives.length; ++j) + object.alternatives[j] = $root.google.cloud.speech.v1.SpeechRecognitionAlternative.toObject(message.alternatives[j], options); + } + if (message.channelTag != null && message.hasOwnProperty("channelTag")) + object.channelTag = message.channelTag; + if (message.resultEndTime != null && message.hasOwnProperty("resultEndTime")) + object.resultEndTime = $root.google.protobuf.Duration.toObject(message.resultEndTime, options); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this SpeechRecognitionResult to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.SpeechRecognitionResult + * @instance + * @returns {Object.} JSON object + */ + SpeechRecognitionResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpeechRecognitionResult + * @function getTypeUrl + * @memberof google.cloud.speech.v1.SpeechRecognitionResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpeechRecognitionResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.SpeechRecognitionResult"; + }; + + return SpeechRecognitionResult; + })(); + + v1.SpeechRecognitionAlternative = (function() { + + /** + * Properties of a SpeechRecognitionAlternative. + * @memberof google.cloud.speech.v1 + * @interface ISpeechRecognitionAlternative + * @property {string|null} [transcript] SpeechRecognitionAlternative transcript + * @property {number|null} [confidence] SpeechRecognitionAlternative confidence + * @property {Array.|null} [words] SpeechRecognitionAlternative words + */ + + /** + * Constructs a new SpeechRecognitionAlternative. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a SpeechRecognitionAlternative. + * @implements ISpeechRecognitionAlternative + * @constructor + * @param {google.cloud.speech.v1.ISpeechRecognitionAlternative=} [properties] Properties to set + */ + function SpeechRecognitionAlternative(properties) { + this.words = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpeechRecognitionAlternative transcript. + * @member {string} transcript + * @memberof google.cloud.speech.v1.SpeechRecognitionAlternative + * @instance + */ + SpeechRecognitionAlternative.prototype.transcript = ""; + + /** + * SpeechRecognitionAlternative confidence. + * @member {number} confidence + * @memberof google.cloud.speech.v1.SpeechRecognitionAlternative + * @instance + */ + SpeechRecognitionAlternative.prototype.confidence = 0; + + /** + * SpeechRecognitionAlternative words. + * @member {Array.} words + * @memberof google.cloud.speech.v1.SpeechRecognitionAlternative + * @instance + */ + SpeechRecognitionAlternative.prototype.words = $util.emptyArray; + + /** + * Creates a new SpeechRecognitionAlternative instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.SpeechRecognitionAlternative + * @static + * @param {google.cloud.speech.v1.ISpeechRecognitionAlternative=} [properties] Properties to set + * @returns {google.cloud.speech.v1.SpeechRecognitionAlternative} SpeechRecognitionAlternative instance + */ + SpeechRecognitionAlternative.create = function create(properties) { + return new SpeechRecognitionAlternative(properties); + }; + + /** + * Encodes the specified SpeechRecognitionAlternative message. Does not implicitly {@link google.cloud.speech.v1.SpeechRecognitionAlternative.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.SpeechRecognitionAlternative + * @static + * @param {google.cloud.speech.v1.ISpeechRecognitionAlternative} message SpeechRecognitionAlternative message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechRecognitionAlternative.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.transcript != null && Object.hasOwnProperty.call(message, "transcript")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.transcript); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence); + if (message.words != null && message.words.length) + for (var i = 0; i < message.words.length; ++i) + $root.google.cloud.speech.v1.WordInfo.encode(message.words[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SpeechRecognitionAlternative message, length delimited. Does not implicitly {@link google.cloud.speech.v1.SpeechRecognitionAlternative.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.SpeechRecognitionAlternative + * @static + * @param {google.cloud.speech.v1.ISpeechRecognitionAlternative} message SpeechRecognitionAlternative message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechRecognitionAlternative.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpeechRecognitionAlternative message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.SpeechRecognitionAlternative + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.SpeechRecognitionAlternative} SpeechRecognitionAlternative + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechRecognitionAlternative.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.SpeechRecognitionAlternative(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.transcript = reader.string(); + break; + } + case 2: { + message.confidence = reader.float(); + break; + } + case 3: { + if (!(message.words && message.words.length)) + message.words = []; + message.words.push($root.google.cloud.speech.v1.WordInfo.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpeechRecognitionAlternative message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.SpeechRecognitionAlternative + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.SpeechRecognitionAlternative} SpeechRecognitionAlternative + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechRecognitionAlternative.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpeechRecognitionAlternative message. + * @function verify + * @memberof google.cloud.speech.v1.SpeechRecognitionAlternative + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpeechRecognitionAlternative.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.transcript != null && message.hasOwnProperty("transcript")) + if (!$util.isString(message.transcript)) + return "transcript: string expected"; + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + if (message.words != null && message.hasOwnProperty("words")) { + if (!Array.isArray(message.words)) + return "words: array expected"; + for (var i = 0; i < message.words.length; ++i) { + var error = $root.google.cloud.speech.v1.WordInfo.verify(message.words[i]); + if (error) + return "words." + error; + } + } + return null; + }; + + /** + * Creates a SpeechRecognitionAlternative message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.SpeechRecognitionAlternative + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.SpeechRecognitionAlternative} SpeechRecognitionAlternative + */ + SpeechRecognitionAlternative.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.SpeechRecognitionAlternative) + return object; + var message = new $root.google.cloud.speech.v1.SpeechRecognitionAlternative(); + if (object.transcript != null) + message.transcript = String(object.transcript); + if (object.confidence != null) + message.confidence = Number(object.confidence); + if (object.words) { + if (!Array.isArray(object.words)) + throw TypeError(".google.cloud.speech.v1.SpeechRecognitionAlternative.words: array expected"); + message.words = []; + for (var i = 0; i < object.words.length; ++i) { + if (typeof object.words[i] !== "object") + throw TypeError(".google.cloud.speech.v1.SpeechRecognitionAlternative.words: object expected"); + message.words[i] = $root.google.cloud.speech.v1.WordInfo.fromObject(object.words[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SpeechRecognitionAlternative message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.SpeechRecognitionAlternative + * @static + * @param {google.cloud.speech.v1.SpeechRecognitionAlternative} message SpeechRecognitionAlternative + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpeechRecognitionAlternative.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.words = []; + if (options.defaults) { + object.transcript = ""; + object.confidence = 0; + } + if (message.transcript != null && message.hasOwnProperty("transcript")) + object.transcript = message.transcript; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + if (message.words && message.words.length) { + object.words = []; + for (var j = 0; j < message.words.length; ++j) + object.words[j] = $root.google.cloud.speech.v1.WordInfo.toObject(message.words[j], options); + } + return object; + }; + + /** + * Converts this SpeechRecognitionAlternative to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.SpeechRecognitionAlternative + * @instance + * @returns {Object.} JSON object + */ + SpeechRecognitionAlternative.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpeechRecognitionAlternative + * @function getTypeUrl + * @memberof google.cloud.speech.v1.SpeechRecognitionAlternative + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpeechRecognitionAlternative.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.SpeechRecognitionAlternative"; + }; + + return SpeechRecognitionAlternative; + })(); + + v1.WordInfo = (function() { + + /** + * Properties of a WordInfo. + * @memberof google.cloud.speech.v1 + * @interface IWordInfo + * @property {google.protobuf.IDuration|null} [startTime] WordInfo startTime + * @property {google.protobuf.IDuration|null} [endTime] WordInfo endTime + * @property {string|null} [word] WordInfo word + * @property {number|null} [confidence] WordInfo confidence + * @property {number|null} [speakerTag] WordInfo speakerTag + * @property {string|null} [speakerLabel] WordInfo speakerLabel + */ + + /** + * Constructs a new WordInfo. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a WordInfo. + * @implements IWordInfo + * @constructor + * @param {google.cloud.speech.v1.IWordInfo=} [properties] Properties to set + */ + function WordInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WordInfo startTime. + * @member {google.protobuf.IDuration|null|undefined} startTime + * @memberof google.cloud.speech.v1.WordInfo + * @instance + */ + WordInfo.prototype.startTime = null; + + /** + * WordInfo endTime. + * @member {google.protobuf.IDuration|null|undefined} endTime + * @memberof google.cloud.speech.v1.WordInfo + * @instance + */ + WordInfo.prototype.endTime = null; + + /** + * WordInfo word. + * @member {string} word + * @memberof google.cloud.speech.v1.WordInfo + * @instance + */ + WordInfo.prototype.word = ""; + + /** + * WordInfo confidence. + * @member {number} confidence + * @memberof google.cloud.speech.v1.WordInfo + * @instance + */ + WordInfo.prototype.confidence = 0; + + /** + * WordInfo speakerTag. + * @member {number} speakerTag + * @memberof google.cloud.speech.v1.WordInfo + * @instance + */ + WordInfo.prototype.speakerTag = 0; + + /** + * WordInfo speakerLabel. + * @member {string} speakerLabel + * @memberof google.cloud.speech.v1.WordInfo + * @instance + */ + WordInfo.prototype.speakerLabel = ""; + + /** + * Creates a new WordInfo instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.WordInfo + * @static + * @param {google.cloud.speech.v1.IWordInfo=} [properties] Properties to set + * @returns {google.cloud.speech.v1.WordInfo} WordInfo instance + */ + WordInfo.create = function create(properties) { + return new WordInfo(properties); + }; + + /** + * Encodes the specified WordInfo message. Does not implicitly {@link google.cloud.speech.v1.WordInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.WordInfo + * @static + * @param {google.cloud.speech.v1.IWordInfo} message WordInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WordInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Duration.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Duration.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.word != null && Object.hasOwnProperty.call(message, "word")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.word); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.confidence); + if (message.speakerTag != null && Object.hasOwnProperty.call(message, "speakerTag")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.speakerTag); + if (message.speakerLabel != null && Object.hasOwnProperty.call(message, "speakerLabel")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.speakerLabel); + return writer; + }; + + /** + * Encodes the specified WordInfo message, length delimited. Does not implicitly {@link google.cloud.speech.v1.WordInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.WordInfo + * @static + * @param {google.cloud.speech.v1.IWordInfo} message WordInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WordInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WordInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.WordInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.WordInfo} WordInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WordInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.WordInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.startTime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 3: { + message.word = reader.string(); + break; + } + case 4: { + message.confidence = reader.float(); + break; + } + case 5: { + message.speakerTag = reader.int32(); + break; + } + case 6: { + message.speakerLabel = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WordInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.WordInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.WordInfo} WordInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WordInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WordInfo message. + * @function verify + * @memberof google.cloud.speech.v1.WordInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WordInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Duration.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Duration.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.word != null && message.hasOwnProperty("word")) + if (!$util.isString(message.word)) + return "word: string expected"; + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + if (message.speakerTag != null && message.hasOwnProperty("speakerTag")) + if (!$util.isInteger(message.speakerTag)) + return "speakerTag: integer expected"; + if (message.speakerLabel != null && message.hasOwnProperty("speakerLabel")) + if (!$util.isString(message.speakerLabel)) + return "speakerLabel: string expected"; + return null; + }; + + /** + * Creates a WordInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.WordInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.WordInfo} WordInfo + */ + WordInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.WordInfo) + return object; + var message = new $root.google.cloud.speech.v1.WordInfo(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.speech.v1.WordInfo.startTime: object expected"); + message.startTime = $root.google.protobuf.Duration.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.speech.v1.WordInfo.endTime: object expected"); + message.endTime = $root.google.protobuf.Duration.fromObject(object.endTime); + } + if (object.word != null) + message.word = String(object.word); + if (object.confidence != null) + message.confidence = Number(object.confidence); + if (object.speakerTag != null) + message.speakerTag = object.speakerTag | 0; + if (object.speakerLabel != null) + message.speakerLabel = String(object.speakerLabel); + return message; + }; + + /** + * Creates a plain object from a WordInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.WordInfo + * @static + * @param {google.cloud.speech.v1.WordInfo} message WordInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WordInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startTime = null; + object.endTime = null; + object.word = ""; + object.confidence = 0; + object.speakerTag = 0; + object.speakerLabel = ""; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Duration.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Duration.toObject(message.endTime, options); + if (message.word != null && message.hasOwnProperty("word")) + object.word = message.word; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + if (message.speakerTag != null && message.hasOwnProperty("speakerTag")) + object.speakerTag = message.speakerTag; + if (message.speakerLabel != null && message.hasOwnProperty("speakerLabel")) + object.speakerLabel = message.speakerLabel; + return object; + }; + + /** + * Converts this WordInfo to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.WordInfo + * @instance + * @returns {Object.} JSON object + */ + WordInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WordInfo + * @function getTypeUrl + * @memberof google.cloud.speech.v1.WordInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WordInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.WordInfo"; + }; + + return WordInfo; + })(); + + v1.SpeechAdaptationInfo = (function() { + + /** + * Properties of a SpeechAdaptationInfo. + * @memberof google.cloud.speech.v1 + * @interface ISpeechAdaptationInfo + * @property {boolean|null} [adaptationTimeout] SpeechAdaptationInfo adaptationTimeout + * @property {string|null} [timeoutMessage] SpeechAdaptationInfo timeoutMessage + */ + + /** + * Constructs a new SpeechAdaptationInfo. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a SpeechAdaptationInfo. + * @implements ISpeechAdaptationInfo + * @constructor + * @param {google.cloud.speech.v1.ISpeechAdaptationInfo=} [properties] Properties to set + */ + function SpeechAdaptationInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpeechAdaptationInfo adaptationTimeout. + * @member {boolean} adaptationTimeout + * @memberof google.cloud.speech.v1.SpeechAdaptationInfo + * @instance + */ + SpeechAdaptationInfo.prototype.adaptationTimeout = false; + + /** + * SpeechAdaptationInfo timeoutMessage. + * @member {string} timeoutMessage + * @memberof google.cloud.speech.v1.SpeechAdaptationInfo + * @instance + */ + SpeechAdaptationInfo.prototype.timeoutMessage = ""; + + /** + * Creates a new SpeechAdaptationInfo instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.SpeechAdaptationInfo + * @static + * @param {google.cloud.speech.v1.ISpeechAdaptationInfo=} [properties] Properties to set + * @returns {google.cloud.speech.v1.SpeechAdaptationInfo} SpeechAdaptationInfo instance + */ + SpeechAdaptationInfo.create = function create(properties) { + return new SpeechAdaptationInfo(properties); + }; + + /** + * Encodes the specified SpeechAdaptationInfo message. Does not implicitly {@link google.cloud.speech.v1.SpeechAdaptationInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.SpeechAdaptationInfo + * @static + * @param {google.cloud.speech.v1.ISpeechAdaptationInfo} message SpeechAdaptationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechAdaptationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.adaptationTimeout != null && Object.hasOwnProperty.call(message, "adaptationTimeout")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.adaptationTimeout); + if (message.timeoutMessage != null && Object.hasOwnProperty.call(message, "timeoutMessage")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.timeoutMessage); + return writer; + }; + + /** + * Encodes the specified SpeechAdaptationInfo message, length delimited. Does not implicitly {@link google.cloud.speech.v1.SpeechAdaptationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.SpeechAdaptationInfo + * @static + * @param {google.cloud.speech.v1.ISpeechAdaptationInfo} message SpeechAdaptationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechAdaptationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpeechAdaptationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.SpeechAdaptationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.SpeechAdaptationInfo} SpeechAdaptationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechAdaptationInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.SpeechAdaptationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.adaptationTimeout = reader.bool(); + break; + } + case 4: { + message.timeoutMessage = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpeechAdaptationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.SpeechAdaptationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.SpeechAdaptationInfo} SpeechAdaptationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechAdaptationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpeechAdaptationInfo message. + * @function verify + * @memberof google.cloud.speech.v1.SpeechAdaptationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpeechAdaptationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.adaptationTimeout != null && message.hasOwnProperty("adaptationTimeout")) + if (typeof message.adaptationTimeout !== "boolean") + return "adaptationTimeout: boolean expected"; + if (message.timeoutMessage != null && message.hasOwnProperty("timeoutMessage")) + if (!$util.isString(message.timeoutMessage)) + return "timeoutMessage: string expected"; + return null; + }; + + /** + * Creates a SpeechAdaptationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.SpeechAdaptationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.SpeechAdaptationInfo} SpeechAdaptationInfo + */ + SpeechAdaptationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.SpeechAdaptationInfo) + return object; + var message = new $root.google.cloud.speech.v1.SpeechAdaptationInfo(); + if (object.adaptationTimeout != null) + message.adaptationTimeout = Boolean(object.adaptationTimeout); + if (object.timeoutMessage != null) + message.timeoutMessage = String(object.timeoutMessage); + return message; + }; + + /** + * Creates a plain object from a SpeechAdaptationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.SpeechAdaptationInfo + * @static + * @param {google.cloud.speech.v1.SpeechAdaptationInfo} message SpeechAdaptationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpeechAdaptationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.adaptationTimeout = false; + object.timeoutMessage = ""; + } + if (message.adaptationTimeout != null && message.hasOwnProperty("adaptationTimeout")) + object.adaptationTimeout = message.adaptationTimeout; + if (message.timeoutMessage != null && message.hasOwnProperty("timeoutMessage")) + object.timeoutMessage = message.timeoutMessage; + return object; + }; + + /** + * Converts this SpeechAdaptationInfo to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.SpeechAdaptationInfo + * @instance + * @returns {Object.} JSON object + */ + SpeechAdaptationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpeechAdaptationInfo + * @function getTypeUrl + * @memberof google.cloud.speech.v1.SpeechAdaptationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpeechAdaptationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.SpeechAdaptationInfo"; + }; + + return SpeechAdaptationInfo; + })(); + + v1.CustomClass = (function() { + + /** + * Properties of a CustomClass. + * @memberof google.cloud.speech.v1 + * @interface ICustomClass + * @property {string|null} [name] CustomClass name + * @property {string|null} [customClassId] CustomClass customClassId + * @property {Array.|null} [items] CustomClass items + */ + + /** + * Constructs a new CustomClass. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a CustomClass. + * @implements ICustomClass + * @constructor + * @param {google.cloud.speech.v1.ICustomClass=} [properties] Properties to set + */ + function CustomClass(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomClass name. + * @member {string} name + * @memberof google.cloud.speech.v1.CustomClass + * @instance + */ + CustomClass.prototype.name = ""; + + /** + * CustomClass customClassId. + * @member {string} customClassId + * @memberof google.cloud.speech.v1.CustomClass + * @instance + */ + CustomClass.prototype.customClassId = ""; + + /** + * CustomClass items. + * @member {Array.} items + * @memberof google.cloud.speech.v1.CustomClass + * @instance + */ + CustomClass.prototype.items = $util.emptyArray; + + /** + * Creates a new CustomClass instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.CustomClass + * @static + * @param {google.cloud.speech.v1.ICustomClass=} [properties] Properties to set + * @returns {google.cloud.speech.v1.CustomClass} CustomClass instance + */ + CustomClass.create = function create(properties) { + return new CustomClass(properties); + }; + + /** + * Encodes the specified CustomClass message. Does not implicitly {@link google.cloud.speech.v1.CustomClass.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.CustomClass + * @static + * @param {google.cloud.speech.v1.ICustomClass} message CustomClass message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomClass.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.customClassId != null && Object.hasOwnProperty.call(message, "customClassId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.customClassId); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.speech.v1.CustomClass.ClassItem.encode(message.items[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CustomClass message, length delimited. Does not implicitly {@link google.cloud.speech.v1.CustomClass.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.CustomClass + * @static + * @param {google.cloud.speech.v1.ICustomClass} message CustomClass message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomClass.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomClass message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.CustomClass + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.CustomClass} CustomClass + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomClass.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.CustomClass(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.customClassId = reader.string(); + break; + } + case 3: { + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.speech.v1.CustomClass.ClassItem.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomClass message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.CustomClass + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.CustomClass} CustomClass + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomClass.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomClass message. + * @function verify + * @memberof google.cloud.speech.v1.CustomClass + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomClass.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.customClassId != null && message.hasOwnProperty("customClassId")) + if (!$util.isString(message.customClassId)) + return "customClassId: string expected"; + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.speech.v1.CustomClass.ClassItem.verify(message.items[i]); + if (error) + return "items." + error; + } + } + return null; + }; + + /** + * Creates a CustomClass message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.CustomClass + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.CustomClass} CustomClass + */ + CustomClass.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.CustomClass) + return object; + var message = new $root.google.cloud.speech.v1.CustomClass(); + if (object.name != null) + message.name = String(object.name); + if (object.customClassId != null) + message.customClassId = String(object.customClassId); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.speech.v1.CustomClass.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.speech.v1.CustomClass.items: object expected"); + message.items[i] = $root.google.cloud.speech.v1.CustomClass.ClassItem.fromObject(object.items[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CustomClass message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.CustomClass + * @static + * @param {google.cloud.speech.v1.CustomClass} message CustomClass + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomClass.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (options.defaults) { + object.name = ""; + object.customClassId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.customClassId != null && message.hasOwnProperty("customClassId")) + object.customClassId = message.customClassId; + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.speech.v1.CustomClass.ClassItem.toObject(message.items[j], options); + } + return object; + }; + + /** + * Converts this CustomClass to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.CustomClass + * @instance + * @returns {Object.} JSON object + */ + CustomClass.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomClass + * @function getTypeUrl + * @memberof google.cloud.speech.v1.CustomClass + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomClass.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.CustomClass"; + }; + + CustomClass.ClassItem = (function() { + + /** + * Properties of a ClassItem. + * @memberof google.cloud.speech.v1.CustomClass + * @interface IClassItem + * @property {string|null} [value] ClassItem value + */ + + /** + * Constructs a new ClassItem. + * @memberof google.cloud.speech.v1.CustomClass + * @classdesc Represents a ClassItem. + * @implements IClassItem + * @constructor + * @param {google.cloud.speech.v1.CustomClass.IClassItem=} [properties] Properties to set + */ + function ClassItem(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClassItem value. + * @member {string} value + * @memberof google.cloud.speech.v1.CustomClass.ClassItem + * @instance + */ + ClassItem.prototype.value = ""; + + /** + * Creates a new ClassItem instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.CustomClass.ClassItem + * @static + * @param {google.cloud.speech.v1.CustomClass.IClassItem=} [properties] Properties to set + * @returns {google.cloud.speech.v1.CustomClass.ClassItem} ClassItem instance + */ + ClassItem.create = function create(properties) { + return new ClassItem(properties); + }; + + /** + * Encodes the specified ClassItem message. Does not implicitly {@link google.cloud.speech.v1.CustomClass.ClassItem.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.CustomClass.ClassItem + * @static + * @param {google.cloud.speech.v1.CustomClass.IClassItem} message ClassItem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClassItem.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + return writer; + }; + + /** + * Encodes the specified ClassItem message, length delimited. Does not implicitly {@link google.cloud.speech.v1.CustomClass.ClassItem.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.CustomClass.ClassItem + * @static + * @param {google.cloud.speech.v1.CustomClass.IClassItem} message ClassItem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClassItem.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClassItem message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.CustomClass.ClassItem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.CustomClass.ClassItem} ClassItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClassItem.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.CustomClass.ClassItem(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClassItem message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.CustomClass.ClassItem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.CustomClass.ClassItem} ClassItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClassItem.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClassItem message. + * @function verify + * @memberof google.cloud.speech.v1.CustomClass.ClassItem + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClassItem.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates a ClassItem message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.CustomClass.ClassItem + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.CustomClass.ClassItem} ClassItem + */ + ClassItem.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.CustomClass.ClassItem) + return object; + var message = new $root.google.cloud.speech.v1.CustomClass.ClassItem(); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a ClassItem message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.CustomClass.ClassItem + * @static + * @param {google.cloud.speech.v1.CustomClass.ClassItem} message ClassItem + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClassItem.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = ""; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this ClassItem to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.CustomClass.ClassItem + * @instance + * @returns {Object.} JSON object + */ + ClassItem.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClassItem + * @function getTypeUrl + * @memberof google.cloud.speech.v1.CustomClass.ClassItem + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClassItem.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.CustomClass.ClassItem"; + }; + + return ClassItem; + })(); + + return CustomClass; + })(); + + v1.PhraseSet = (function() { + + /** + * Properties of a PhraseSet. + * @memberof google.cloud.speech.v1 + * @interface IPhraseSet + * @property {string|null} [name] PhraseSet name + * @property {Array.|null} [phrases] PhraseSet phrases + * @property {number|null} [boost] PhraseSet boost + */ + + /** + * Constructs a new PhraseSet. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a PhraseSet. + * @implements IPhraseSet + * @constructor + * @param {google.cloud.speech.v1.IPhraseSet=} [properties] Properties to set + */ + function PhraseSet(properties) { + this.phrases = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PhraseSet name. + * @member {string} name + * @memberof google.cloud.speech.v1.PhraseSet + * @instance + */ + PhraseSet.prototype.name = ""; + + /** + * PhraseSet phrases. + * @member {Array.} phrases + * @memberof google.cloud.speech.v1.PhraseSet + * @instance + */ + PhraseSet.prototype.phrases = $util.emptyArray; + + /** + * PhraseSet boost. + * @member {number} boost + * @memberof google.cloud.speech.v1.PhraseSet + * @instance + */ + PhraseSet.prototype.boost = 0; + + /** + * Creates a new PhraseSet instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.PhraseSet + * @static + * @param {google.cloud.speech.v1.IPhraseSet=} [properties] Properties to set + * @returns {google.cloud.speech.v1.PhraseSet} PhraseSet instance + */ + PhraseSet.create = function create(properties) { + return new PhraseSet(properties); + }; + + /** + * Encodes the specified PhraseSet message. Does not implicitly {@link google.cloud.speech.v1.PhraseSet.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.PhraseSet + * @static + * @param {google.cloud.speech.v1.IPhraseSet} message PhraseSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhraseSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.phrases != null && message.phrases.length) + for (var i = 0; i < message.phrases.length; ++i) + $root.google.cloud.speech.v1.PhraseSet.Phrase.encode(message.phrases[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.boost != null && Object.hasOwnProperty.call(message, "boost")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.boost); + return writer; + }; + + /** + * Encodes the specified PhraseSet message, length delimited. Does not implicitly {@link google.cloud.speech.v1.PhraseSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.PhraseSet + * @static + * @param {google.cloud.speech.v1.IPhraseSet} message PhraseSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhraseSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PhraseSet message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.PhraseSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.PhraseSet} PhraseSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhraseSet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.PhraseSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.phrases && message.phrases.length)) + message.phrases = []; + message.phrases.push($root.google.cloud.speech.v1.PhraseSet.Phrase.decode(reader, reader.uint32())); + break; + } + case 4: { + message.boost = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PhraseSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.PhraseSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.PhraseSet} PhraseSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhraseSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PhraseSet message. + * @function verify + * @memberof google.cloud.speech.v1.PhraseSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PhraseSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.phrases != null && message.hasOwnProperty("phrases")) { + if (!Array.isArray(message.phrases)) + return "phrases: array expected"; + for (var i = 0; i < message.phrases.length; ++i) { + var error = $root.google.cloud.speech.v1.PhraseSet.Phrase.verify(message.phrases[i]); + if (error) + return "phrases." + error; + } + } + if (message.boost != null && message.hasOwnProperty("boost")) + if (typeof message.boost !== "number") + return "boost: number expected"; + return null; + }; + + /** + * Creates a PhraseSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.PhraseSet + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.PhraseSet} PhraseSet + */ + PhraseSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.PhraseSet) + return object; + var message = new $root.google.cloud.speech.v1.PhraseSet(); + if (object.name != null) + message.name = String(object.name); + if (object.phrases) { + if (!Array.isArray(object.phrases)) + throw TypeError(".google.cloud.speech.v1.PhraseSet.phrases: array expected"); + message.phrases = []; + for (var i = 0; i < object.phrases.length; ++i) { + if (typeof object.phrases[i] !== "object") + throw TypeError(".google.cloud.speech.v1.PhraseSet.phrases: object expected"); + message.phrases[i] = $root.google.cloud.speech.v1.PhraseSet.Phrase.fromObject(object.phrases[i]); + } + } + if (object.boost != null) + message.boost = Number(object.boost); + return message; + }; + + /** + * Creates a plain object from a PhraseSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.PhraseSet + * @static + * @param {google.cloud.speech.v1.PhraseSet} message PhraseSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PhraseSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.phrases = []; + if (options.defaults) { + object.name = ""; + object.boost = 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.phrases && message.phrases.length) { + object.phrases = []; + for (var j = 0; j < message.phrases.length; ++j) + object.phrases[j] = $root.google.cloud.speech.v1.PhraseSet.Phrase.toObject(message.phrases[j], options); + } + if (message.boost != null && message.hasOwnProperty("boost")) + object.boost = options.json && !isFinite(message.boost) ? String(message.boost) : message.boost; + return object; + }; + + /** + * Converts this PhraseSet to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.PhraseSet + * @instance + * @returns {Object.} JSON object + */ + PhraseSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PhraseSet + * @function getTypeUrl + * @memberof google.cloud.speech.v1.PhraseSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PhraseSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.PhraseSet"; + }; + + PhraseSet.Phrase = (function() { + + /** + * Properties of a Phrase. + * @memberof google.cloud.speech.v1.PhraseSet + * @interface IPhrase + * @property {string|null} [value] Phrase value + * @property {number|null} [boost] Phrase boost + */ + + /** + * Constructs a new Phrase. + * @memberof google.cloud.speech.v1.PhraseSet + * @classdesc Represents a Phrase. + * @implements IPhrase + * @constructor + * @param {google.cloud.speech.v1.PhraseSet.IPhrase=} [properties] Properties to set + */ + function Phrase(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Phrase value. + * @member {string} value + * @memberof google.cloud.speech.v1.PhraseSet.Phrase + * @instance + */ + Phrase.prototype.value = ""; + + /** + * Phrase boost. + * @member {number} boost + * @memberof google.cloud.speech.v1.PhraseSet.Phrase + * @instance + */ + Phrase.prototype.boost = 0; + + /** + * Creates a new Phrase instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.PhraseSet.Phrase + * @static + * @param {google.cloud.speech.v1.PhraseSet.IPhrase=} [properties] Properties to set + * @returns {google.cloud.speech.v1.PhraseSet.Phrase} Phrase instance + */ + Phrase.create = function create(properties) { + return new Phrase(properties); + }; + + /** + * Encodes the specified Phrase message. Does not implicitly {@link google.cloud.speech.v1.PhraseSet.Phrase.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.PhraseSet.Phrase + * @static + * @param {google.cloud.speech.v1.PhraseSet.IPhrase} message Phrase message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Phrase.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + if (message.boost != null && Object.hasOwnProperty.call(message, "boost")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.boost); + return writer; + }; + + /** + * Encodes the specified Phrase message, length delimited. Does not implicitly {@link google.cloud.speech.v1.PhraseSet.Phrase.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.PhraseSet.Phrase + * @static + * @param {google.cloud.speech.v1.PhraseSet.IPhrase} message Phrase message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Phrase.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Phrase message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.PhraseSet.Phrase + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.PhraseSet.Phrase} Phrase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Phrase.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.PhraseSet.Phrase(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.string(); + break; + } + case 2: { + message.boost = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Phrase message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.PhraseSet.Phrase + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.PhraseSet.Phrase} Phrase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Phrase.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Phrase message. + * @function verify + * @memberof google.cloud.speech.v1.PhraseSet.Phrase + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Phrase.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + if (message.boost != null && message.hasOwnProperty("boost")) + if (typeof message.boost !== "number") + return "boost: number expected"; + return null; + }; + + /** + * Creates a Phrase message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.PhraseSet.Phrase + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.PhraseSet.Phrase} Phrase + */ + Phrase.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.PhraseSet.Phrase) + return object; + var message = new $root.google.cloud.speech.v1.PhraseSet.Phrase(); + if (object.value != null) + message.value = String(object.value); + if (object.boost != null) + message.boost = Number(object.boost); + return message; + }; + + /** + * Creates a plain object from a Phrase message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.PhraseSet.Phrase + * @static + * @param {google.cloud.speech.v1.PhraseSet.Phrase} message Phrase + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Phrase.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + object.boost = 0; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.boost != null && message.hasOwnProperty("boost")) + object.boost = options.json && !isFinite(message.boost) ? String(message.boost) : message.boost; + return object; + }; + + /** + * Converts this Phrase to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.PhraseSet.Phrase + * @instance + * @returns {Object.} JSON object + */ + Phrase.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Phrase + * @function getTypeUrl + * @memberof google.cloud.speech.v1.PhraseSet.Phrase + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Phrase.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.PhraseSet.Phrase"; + }; + + return Phrase; + })(); + + return PhraseSet; + })(); + + v1.SpeechAdaptation = (function() { + + /** + * Properties of a SpeechAdaptation. + * @memberof google.cloud.speech.v1 + * @interface ISpeechAdaptation + * @property {Array.|null} [phraseSets] SpeechAdaptation phraseSets + * @property {Array.|null} [phraseSetReferences] SpeechAdaptation phraseSetReferences + * @property {Array.|null} [customClasses] SpeechAdaptation customClasses + * @property {google.cloud.speech.v1.SpeechAdaptation.IABNFGrammar|null} [abnfGrammar] SpeechAdaptation abnfGrammar + */ + + /** + * Constructs a new SpeechAdaptation. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a SpeechAdaptation. + * @implements ISpeechAdaptation + * @constructor + * @param {google.cloud.speech.v1.ISpeechAdaptation=} [properties] Properties to set + */ + function SpeechAdaptation(properties) { + this.phraseSets = []; + this.phraseSetReferences = []; + this.customClasses = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpeechAdaptation phraseSets. + * @member {Array.} phraseSets + * @memberof google.cloud.speech.v1.SpeechAdaptation + * @instance + */ + SpeechAdaptation.prototype.phraseSets = $util.emptyArray; + + /** + * SpeechAdaptation phraseSetReferences. + * @member {Array.} phraseSetReferences + * @memberof google.cloud.speech.v1.SpeechAdaptation + * @instance + */ + SpeechAdaptation.prototype.phraseSetReferences = $util.emptyArray; + + /** + * SpeechAdaptation customClasses. + * @member {Array.} customClasses + * @memberof google.cloud.speech.v1.SpeechAdaptation + * @instance + */ + SpeechAdaptation.prototype.customClasses = $util.emptyArray; + + /** + * SpeechAdaptation abnfGrammar. + * @member {google.cloud.speech.v1.SpeechAdaptation.IABNFGrammar|null|undefined} abnfGrammar + * @memberof google.cloud.speech.v1.SpeechAdaptation + * @instance + */ + SpeechAdaptation.prototype.abnfGrammar = null; + + /** + * Creates a new SpeechAdaptation instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.SpeechAdaptation + * @static + * @param {google.cloud.speech.v1.ISpeechAdaptation=} [properties] Properties to set + * @returns {google.cloud.speech.v1.SpeechAdaptation} SpeechAdaptation instance + */ + SpeechAdaptation.create = function create(properties) { + return new SpeechAdaptation(properties); + }; + + /** + * Encodes the specified SpeechAdaptation message. Does not implicitly {@link google.cloud.speech.v1.SpeechAdaptation.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.SpeechAdaptation + * @static + * @param {google.cloud.speech.v1.ISpeechAdaptation} message SpeechAdaptation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechAdaptation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.phraseSets != null && message.phraseSets.length) + for (var i = 0; i < message.phraseSets.length; ++i) + $root.google.cloud.speech.v1.PhraseSet.encode(message.phraseSets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.phraseSetReferences != null && message.phraseSetReferences.length) + for (var i = 0; i < message.phraseSetReferences.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.phraseSetReferences[i]); + if (message.customClasses != null && message.customClasses.length) + for (var i = 0; i < message.customClasses.length; ++i) + $root.google.cloud.speech.v1.CustomClass.encode(message.customClasses[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.abnfGrammar != null && Object.hasOwnProperty.call(message, "abnfGrammar")) + $root.google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar.encode(message.abnfGrammar, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SpeechAdaptation message, length delimited. Does not implicitly {@link google.cloud.speech.v1.SpeechAdaptation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.SpeechAdaptation + * @static + * @param {google.cloud.speech.v1.ISpeechAdaptation} message SpeechAdaptation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechAdaptation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpeechAdaptation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.SpeechAdaptation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.SpeechAdaptation} SpeechAdaptation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechAdaptation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.SpeechAdaptation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.phraseSets && message.phraseSets.length)) + message.phraseSets = []; + message.phraseSets.push($root.google.cloud.speech.v1.PhraseSet.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.phraseSetReferences && message.phraseSetReferences.length)) + message.phraseSetReferences = []; + message.phraseSetReferences.push(reader.string()); + break; + } + case 3: { + if (!(message.customClasses && message.customClasses.length)) + message.customClasses = []; + message.customClasses.push($root.google.cloud.speech.v1.CustomClass.decode(reader, reader.uint32())); + break; + } + case 4: { + message.abnfGrammar = $root.google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpeechAdaptation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.SpeechAdaptation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.SpeechAdaptation} SpeechAdaptation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechAdaptation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpeechAdaptation message. + * @function verify + * @memberof google.cloud.speech.v1.SpeechAdaptation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpeechAdaptation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.phraseSets != null && message.hasOwnProperty("phraseSets")) { + if (!Array.isArray(message.phraseSets)) + return "phraseSets: array expected"; + for (var i = 0; i < message.phraseSets.length; ++i) { + var error = $root.google.cloud.speech.v1.PhraseSet.verify(message.phraseSets[i]); + if (error) + return "phraseSets." + error; + } + } + if (message.phraseSetReferences != null && message.hasOwnProperty("phraseSetReferences")) { + if (!Array.isArray(message.phraseSetReferences)) + return "phraseSetReferences: array expected"; + for (var i = 0; i < message.phraseSetReferences.length; ++i) + if (!$util.isString(message.phraseSetReferences[i])) + return "phraseSetReferences: string[] expected"; + } + if (message.customClasses != null && message.hasOwnProperty("customClasses")) { + if (!Array.isArray(message.customClasses)) + return "customClasses: array expected"; + for (var i = 0; i < message.customClasses.length; ++i) { + var error = $root.google.cloud.speech.v1.CustomClass.verify(message.customClasses[i]); + if (error) + return "customClasses." + error; + } + } + if (message.abnfGrammar != null && message.hasOwnProperty("abnfGrammar")) { + var error = $root.google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar.verify(message.abnfGrammar); + if (error) + return "abnfGrammar." + error; + } + return null; + }; + + /** + * Creates a SpeechAdaptation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.SpeechAdaptation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.SpeechAdaptation} SpeechAdaptation + */ + SpeechAdaptation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.SpeechAdaptation) + return object; + var message = new $root.google.cloud.speech.v1.SpeechAdaptation(); + if (object.phraseSets) { + if (!Array.isArray(object.phraseSets)) + throw TypeError(".google.cloud.speech.v1.SpeechAdaptation.phraseSets: array expected"); + message.phraseSets = []; + for (var i = 0; i < object.phraseSets.length; ++i) { + if (typeof object.phraseSets[i] !== "object") + throw TypeError(".google.cloud.speech.v1.SpeechAdaptation.phraseSets: object expected"); + message.phraseSets[i] = $root.google.cloud.speech.v1.PhraseSet.fromObject(object.phraseSets[i]); + } + } + if (object.phraseSetReferences) { + if (!Array.isArray(object.phraseSetReferences)) + throw TypeError(".google.cloud.speech.v1.SpeechAdaptation.phraseSetReferences: array expected"); + message.phraseSetReferences = []; + for (var i = 0; i < object.phraseSetReferences.length; ++i) + message.phraseSetReferences[i] = String(object.phraseSetReferences[i]); + } + if (object.customClasses) { + if (!Array.isArray(object.customClasses)) + throw TypeError(".google.cloud.speech.v1.SpeechAdaptation.customClasses: array expected"); + message.customClasses = []; + for (var i = 0; i < object.customClasses.length; ++i) { + if (typeof object.customClasses[i] !== "object") + throw TypeError(".google.cloud.speech.v1.SpeechAdaptation.customClasses: object expected"); + message.customClasses[i] = $root.google.cloud.speech.v1.CustomClass.fromObject(object.customClasses[i]); + } + } + if (object.abnfGrammar != null) { + if (typeof object.abnfGrammar !== "object") + throw TypeError(".google.cloud.speech.v1.SpeechAdaptation.abnfGrammar: object expected"); + message.abnfGrammar = $root.google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar.fromObject(object.abnfGrammar); + } + return message; + }; + + /** + * Creates a plain object from a SpeechAdaptation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.SpeechAdaptation + * @static + * @param {google.cloud.speech.v1.SpeechAdaptation} message SpeechAdaptation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpeechAdaptation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.phraseSets = []; + object.phraseSetReferences = []; + object.customClasses = []; + } + if (options.defaults) + object.abnfGrammar = null; + if (message.phraseSets && message.phraseSets.length) { + object.phraseSets = []; + for (var j = 0; j < message.phraseSets.length; ++j) + object.phraseSets[j] = $root.google.cloud.speech.v1.PhraseSet.toObject(message.phraseSets[j], options); + } + if (message.phraseSetReferences && message.phraseSetReferences.length) { + object.phraseSetReferences = []; + for (var j = 0; j < message.phraseSetReferences.length; ++j) + object.phraseSetReferences[j] = message.phraseSetReferences[j]; + } + if (message.customClasses && message.customClasses.length) { + object.customClasses = []; + for (var j = 0; j < message.customClasses.length; ++j) + object.customClasses[j] = $root.google.cloud.speech.v1.CustomClass.toObject(message.customClasses[j], options); + } + if (message.abnfGrammar != null && message.hasOwnProperty("abnfGrammar")) + object.abnfGrammar = $root.google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar.toObject(message.abnfGrammar, options); + return object; + }; + + /** + * Converts this SpeechAdaptation to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.SpeechAdaptation + * @instance + * @returns {Object.} JSON object + */ + SpeechAdaptation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpeechAdaptation + * @function getTypeUrl + * @memberof google.cloud.speech.v1.SpeechAdaptation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpeechAdaptation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.SpeechAdaptation"; + }; + + SpeechAdaptation.ABNFGrammar = (function() { + + /** + * Properties of a ABNFGrammar. + * @memberof google.cloud.speech.v1.SpeechAdaptation + * @interface IABNFGrammar + * @property {Array.|null} [abnfStrings] ABNFGrammar abnfStrings + */ + + /** + * Constructs a new ABNFGrammar. + * @memberof google.cloud.speech.v1.SpeechAdaptation + * @classdesc Represents a ABNFGrammar. + * @implements IABNFGrammar + * @constructor + * @param {google.cloud.speech.v1.SpeechAdaptation.IABNFGrammar=} [properties] Properties to set + */ + function ABNFGrammar(properties) { + this.abnfStrings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ABNFGrammar abnfStrings. + * @member {Array.} abnfStrings + * @memberof google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar + * @instance + */ + ABNFGrammar.prototype.abnfStrings = $util.emptyArray; + + /** + * Creates a new ABNFGrammar instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar + * @static + * @param {google.cloud.speech.v1.SpeechAdaptation.IABNFGrammar=} [properties] Properties to set + * @returns {google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar} ABNFGrammar instance + */ + ABNFGrammar.create = function create(properties) { + return new ABNFGrammar(properties); + }; + + /** + * Encodes the specified ABNFGrammar message. Does not implicitly {@link google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar + * @static + * @param {google.cloud.speech.v1.SpeechAdaptation.IABNFGrammar} message ABNFGrammar message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ABNFGrammar.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.abnfStrings != null && message.abnfStrings.length) + for (var i = 0; i < message.abnfStrings.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.abnfStrings[i]); + return writer; + }; + + /** + * Encodes the specified ABNFGrammar message, length delimited. Does not implicitly {@link google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar + * @static + * @param {google.cloud.speech.v1.SpeechAdaptation.IABNFGrammar} message ABNFGrammar message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ABNFGrammar.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ABNFGrammar message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar} ABNFGrammar + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ABNFGrammar.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.abnfStrings && message.abnfStrings.length)) + message.abnfStrings = []; + message.abnfStrings.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ABNFGrammar message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar} ABNFGrammar + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ABNFGrammar.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ABNFGrammar message. + * @function verify + * @memberof google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ABNFGrammar.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.abnfStrings != null && message.hasOwnProperty("abnfStrings")) { + if (!Array.isArray(message.abnfStrings)) + return "abnfStrings: array expected"; + for (var i = 0; i < message.abnfStrings.length; ++i) + if (!$util.isString(message.abnfStrings[i])) + return "abnfStrings: string[] expected"; + } + return null; + }; + + /** + * Creates a ABNFGrammar message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar} ABNFGrammar + */ + ABNFGrammar.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar) + return object; + var message = new $root.google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar(); + if (object.abnfStrings) { + if (!Array.isArray(object.abnfStrings)) + throw TypeError(".google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar.abnfStrings: array expected"); + message.abnfStrings = []; + for (var i = 0; i < object.abnfStrings.length; ++i) + message.abnfStrings[i] = String(object.abnfStrings[i]); + } + return message; + }; + + /** + * Creates a plain object from a ABNFGrammar message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar + * @static + * @param {google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar} message ABNFGrammar + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ABNFGrammar.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.abnfStrings = []; + if (message.abnfStrings && message.abnfStrings.length) { + object.abnfStrings = []; + for (var j = 0; j < message.abnfStrings.length; ++j) + object.abnfStrings[j] = message.abnfStrings[j]; + } + return object; + }; + + /** + * Converts this ABNFGrammar to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar + * @instance + * @returns {Object.} JSON object + */ + ABNFGrammar.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ABNFGrammar + * @function getTypeUrl + * @memberof google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ABNFGrammar.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar"; + }; + + return ABNFGrammar; + })(); + + return SpeechAdaptation; + })(); + + v1.TranscriptNormalization = (function() { + + /** + * Properties of a TranscriptNormalization. + * @memberof google.cloud.speech.v1 + * @interface ITranscriptNormalization + * @property {Array.|null} [entries] TranscriptNormalization entries + */ + + /** + * Constructs a new TranscriptNormalization. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a TranscriptNormalization. + * @implements ITranscriptNormalization + * @constructor + * @param {google.cloud.speech.v1.ITranscriptNormalization=} [properties] Properties to set + */ + function TranscriptNormalization(properties) { + this.entries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TranscriptNormalization entries. + * @member {Array.} entries + * @memberof google.cloud.speech.v1.TranscriptNormalization + * @instance + */ + TranscriptNormalization.prototype.entries = $util.emptyArray; + + /** + * Creates a new TranscriptNormalization instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.TranscriptNormalization + * @static + * @param {google.cloud.speech.v1.ITranscriptNormalization=} [properties] Properties to set + * @returns {google.cloud.speech.v1.TranscriptNormalization} TranscriptNormalization instance + */ + TranscriptNormalization.create = function create(properties) { + return new TranscriptNormalization(properties); + }; + + /** + * Encodes the specified TranscriptNormalization message. Does not implicitly {@link google.cloud.speech.v1.TranscriptNormalization.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.TranscriptNormalization + * @static + * @param {google.cloud.speech.v1.ITranscriptNormalization} message TranscriptNormalization message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranscriptNormalization.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entries != null && message.entries.length) + for (var i = 0; i < message.entries.length; ++i) + $root.google.cloud.speech.v1.TranscriptNormalization.Entry.encode(message.entries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TranscriptNormalization message, length delimited. Does not implicitly {@link google.cloud.speech.v1.TranscriptNormalization.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.TranscriptNormalization + * @static + * @param {google.cloud.speech.v1.ITranscriptNormalization} message TranscriptNormalization message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranscriptNormalization.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TranscriptNormalization message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.TranscriptNormalization + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.TranscriptNormalization} TranscriptNormalization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranscriptNormalization.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.TranscriptNormalization(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.entries && message.entries.length)) + message.entries = []; + message.entries.push($root.google.cloud.speech.v1.TranscriptNormalization.Entry.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TranscriptNormalization message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.TranscriptNormalization + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.TranscriptNormalization} TranscriptNormalization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranscriptNormalization.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TranscriptNormalization message. + * @function verify + * @memberof google.cloud.speech.v1.TranscriptNormalization + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TranscriptNormalization.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entries != null && message.hasOwnProperty("entries")) { + if (!Array.isArray(message.entries)) + return "entries: array expected"; + for (var i = 0; i < message.entries.length; ++i) { + var error = $root.google.cloud.speech.v1.TranscriptNormalization.Entry.verify(message.entries[i]); + if (error) + return "entries." + error; + } + } + return null; + }; + + /** + * Creates a TranscriptNormalization message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.TranscriptNormalization + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.TranscriptNormalization} TranscriptNormalization + */ + TranscriptNormalization.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.TranscriptNormalization) + return object; + var message = new $root.google.cloud.speech.v1.TranscriptNormalization(); + if (object.entries) { + if (!Array.isArray(object.entries)) + throw TypeError(".google.cloud.speech.v1.TranscriptNormalization.entries: array expected"); + message.entries = []; + for (var i = 0; i < object.entries.length; ++i) { + if (typeof object.entries[i] !== "object") + throw TypeError(".google.cloud.speech.v1.TranscriptNormalization.entries: object expected"); + message.entries[i] = $root.google.cloud.speech.v1.TranscriptNormalization.Entry.fromObject(object.entries[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TranscriptNormalization message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.TranscriptNormalization + * @static + * @param {google.cloud.speech.v1.TranscriptNormalization} message TranscriptNormalization + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TranscriptNormalization.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.entries = []; + if (message.entries && message.entries.length) { + object.entries = []; + for (var j = 0; j < message.entries.length; ++j) + object.entries[j] = $root.google.cloud.speech.v1.TranscriptNormalization.Entry.toObject(message.entries[j], options); + } + return object; + }; + + /** + * Converts this TranscriptNormalization to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.TranscriptNormalization + * @instance + * @returns {Object.} JSON object + */ + TranscriptNormalization.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TranscriptNormalization + * @function getTypeUrl + * @memberof google.cloud.speech.v1.TranscriptNormalization + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TranscriptNormalization.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.TranscriptNormalization"; + }; + + TranscriptNormalization.Entry = (function() { + + /** + * Properties of an Entry. + * @memberof google.cloud.speech.v1.TranscriptNormalization + * @interface IEntry + * @property {string|null} [search] Entry search + * @property {string|null} [replace] Entry replace + * @property {boolean|null} [caseSensitive] Entry caseSensitive + */ + + /** + * Constructs a new Entry. + * @memberof google.cloud.speech.v1.TranscriptNormalization + * @classdesc Represents an Entry. + * @implements IEntry + * @constructor + * @param {google.cloud.speech.v1.TranscriptNormalization.IEntry=} [properties] Properties to set + */ + function Entry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Entry search. + * @member {string} search + * @memberof google.cloud.speech.v1.TranscriptNormalization.Entry + * @instance + */ + Entry.prototype.search = ""; + + /** + * Entry replace. + * @member {string} replace + * @memberof google.cloud.speech.v1.TranscriptNormalization.Entry + * @instance + */ + Entry.prototype.replace = ""; + + /** + * Entry caseSensitive. + * @member {boolean} caseSensitive + * @memberof google.cloud.speech.v1.TranscriptNormalization.Entry + * @instance + */ + Entry.prototype.caseSensitive = false; + + /** + * Creates a new Entry instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.TranscriptNormalization.Entry + * @static + * @param {google.cloud.speech.v1.TranscriptNormalization.IEntry=} [properties] Properties to set + * @returns {google.cloud.speech.v1.TranscriptNormalization.Entry} Entry instance + */ + Entry.create = function create(properties) { + return new Entry(properties); + }; + + /** + * Encodes the specified Entry message. Does not implicitly {@link google.cloud.speech.v1.TranscriptNormalization.Entry.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.TranscriptNormalization.Entry + * @static + * @param {google.cloud.speech.v1.TranscriptNormalization.IEntry} message Entry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.search != null && Object.hasOwnProperty.call(message, "search")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.search); + if (message.replace != null && Object.hasOwnProperty.call(message, "replace")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.replace); + if (message.caseSensitive != null && Object.hasOwnProperty.call(message, "caseSensitive")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.caseSensitive); + return writer; + }; + + /** + * Encodes the specified Entry message, length delimited. Does not implicitly {@link google.cloud.speech.v1.TranscriptNormalization.Entry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.TranscriptNormalization.Entry + * @static + * @param {google.cloud.speech.v1.TranscriptNormalization.IEntry} message Entry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Entry message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.TranscriptNormalization.Entry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.TranscriptNormalization.Entry} Entry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entry.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.TranscriptNormalization.Entry(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.search = reader.string(); + break; + } + case 2: { + message.replace = reader.string(); + break; + } + case 3: { + message.caseSensitive = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Entry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.TranscriptNormalization.Entry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.TranscriptNormalization.Entry} Entry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Entry message. + * @function verify + * @memberof google.cloud.speech.v1.TranscriptNormalization.Entry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Entry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.search != null && message.hasOwnProperty("search")) + if (!$util.isString(message.search)) + return "search: string expected"; + if (message.replace != null && message.hasOwnProperty("replace")) + if (!$util.isString(message.replace)) + return "replace: string expected"; + if (message.caseSensitive != null && message.hasOwnProperty("caseSensitive")) + if (typeof message.caseSensitive !== "boolean") + return "caseSensitive: boolean expected"; + return null; + }; + + /** + * Creates an Entry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.TranscriptNormalization.Entry + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.TranscriptNormalization.Entry} Entry + */ + Entry.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.TranscriptNormalization.Entry) + return object; + var message = new $root.google.cloud.speech.v1.TranscriptNormalization.Entry(); + if (object.search != null) + message.search = String(object.search); + if (object.replace != null) + message.replace = String(object.replace); + if (object.caseSensitive != null) + message.caseSensitive = Boolean(object.caseSensitive); + return message; + }; + + /** + * Creates a plain object from an Entry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.TranscriptNormalization.Entry + * @static + * @param {google.cloud.speech.v1.TranscriptNormalization.Entry} message Entry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Entry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.search = ""; + object.replace = ""; + object.caseSensitive = false; + } + if (message.search != null && message.hasOwnProperty("search")) + object.search = message.search; + if (message.replace != null && message.hasOwnProperty("replace")) + object.replace = message.replace; + if (message.caseSensitive != null && message.hasOwnProperty("caseSensitive")) + object.caseSensitive = message.caseSensitive; + return object; + }; + + /** + * Converts this Entry to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.TranscriptNormalization.Entry + * @instance + * @returns {Object.} JSON object + */ + Entry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Entry + * @function getTypeUrl + * @memberof google.cloud.speech.v1.TranscriptNormalization.Entry + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Entry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.TranscriptNormalization.Entry"; + }; + + return Entry; + })(); + + return TranscriptNormalization; + })(); + + v1.Adaptation = (function() { + + /** + * Constructs a new Adaptation service. + * @memberof google.cloud.speech.v1 + * @classdesc Represents an Adaptation + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Adaptation(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Adaptation.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Adaptation; + + /** + * Creates new Adaptation service using the specified rpc implementation. + * @function create + * @memberof google.cloud.speech.v1.Adaptation + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Adaptation} RPC service. Useful where requests and/or responses are streamed. + */ + Adaptation.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.speech.v1.Adaptation|createPhraseSet}. + * @memberof google.cloud.speech.v1.Adaptation + * @typedef CreatePhraseSetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.speech.v1.PhraseSet} [response] PhraseSet + */ + + /** + * Calls CreatePhraseSet. + * @function createPhraseSet + * @memberof google.cloud.speech.v1.Adaptation + * @instance + * @param {google.cloud.speech.v1.ICreatePhraseSetRequest} request CreatePhraseSetRequest message or plain object + * @param {google.cloud.speech.v1.Adaptation.CreatePhraseSetCallback} callback Node-style callback called with the error, if any, and PhraseSet + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Adaptation.prototype.createPhraseSet = function createPhraseSet(request, callback) { + return this.rpcCall(createPhraseSet, $root.google.cloud.speech.v1.CreatePhraseSetRequest, $root.google.cloud.speech.v1.PhraseSet, request, callback); + }, "name", { value: "CreatePhraseSet" }); + + /** + * Calls CreatePhraseSet. + * @function createPhraseSet + * @memberof google.cloud.speech.v1.Adaptation + * @instance + * @param {google.cloud.speech.v1.ICreatePhraseSetRequest} request CreatePhraseSetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.speech.v1.Adaptation|getPhraseSet}. + * @memberof google.cloud.speech.v1.Adaptation + * @typedef GetPhraseSetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.speech.v1.PhraseSet} [response] PhraseSet + */ + + /** + * Calls GetPhraseSet. + * @function getPhraseSet + * @memberof google.cloud.speech.v1.Adaptation + * @instance + * @param {google.cloud.speech.v1.IGetPhraseSetRequest} request GetPhraseSetRequest message or plain object + * @param {google.cloud.speech.v1.Adaptation.GetPhraseSetCallback} callback Node-style callback called with the error, if any, and PhraseSet + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Adaptation.prototype.getPhraseSet = function getPhraseSet(request, callback) { + return this.rpcCall(getPhraseSet, $root.google.cloud.speech.v1.GetPhraseSetRequest, $root.google.cloud.speech.v1.PhraseSet, request, callback); + }, "name", { value: "GetPhraseSet" }); + + /** + * Calls GetPhraseSet. + * @function getPhraseSet + * @memberof google.cloud.speech.v1.Adaptation + * @instance + * @param {google.cloud.speech.v1.IGetPhraseSetRequest} request GetPhraseSetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.speech.v1.Adaptation|listPhraseSet}. + * @memberof google.cloud.speech.v1.Adaptation + * @typedef ListPhraseSetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.speech.v1.ListPhraseSetResponse} [response] ListPhraseSetResponse + */ + + /** + * Calls ListPhraseSet. + * @function listPhraseSet + * @memberof google.cloud.speech.v1.Adaptation + * @instance + * @param {google.cloud.speech.v1.IListPhraseSetRequest} request ListPhraseSetRequest message or plain object + * @param {google.cloud.speech.v1.Adaptation.ListPhraseSetCallback} callback Node-style callback called with the error, if any, and ListPhraseSetResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Adaptation.prototype.listPhraseSet = function listPhraseSet(request, callback) { + return this.rpcCall(listPhraseSet, $root.google.cloud.speech.v1.ListPhraseSetRequest, $root.google.cloud.speech.v1.ListPhraseSetResponse, request, callback); + }, "name", { value: "ListPhraseSet" }); + + /** + * Calls ListPhraseSet. + * @function listPhraseSet + * @memberof google.cloud.speech.v1.Adaptation + * @instance + * @param {google.cloud.speech.v1.IListPhraseSetRequest} request ListPhraseSetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.speech.v1.Adaptation|updatePhraseSet}. + * @memberof google.cloud.speech.v1.Adaptation + * @typedef UpdatePhraseSetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.speech.v1.PhraseSet} [response] PhraseSet + */ + + /** + * Calls UpdatePhraseSet. + * @function updatePhraseSet + * @memberof google.cloud.speech.v1.Adaptation + * @instance + * @param {google.cloud.speech.v1.IUpdatePhraseSetRequest} request UpdatePhraseSetRequest message or plain object + * @param {google.cloud.speech.v1.Adaptation.UpdatePhraseSetCallback} callback Node-style callback called with the error, if any, and PhraseSet + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Adaptation.prototype.updatePhraseSet = function updatePhraseSet(request, callback) { + return this.rpcCall(updatePhraseSet, $root.google.cloud.speech.v1.UpdatePhraseSetRequest, $root.google.cloud.speech.v1.PhraseSet, request, callback); + }, "name", { value: "UpdatePhraseSet" }); + + /** + * Calls UpdatePhraseSet. + * @function updatePhraseSet + * @memberof google.cloud.speech.v1.Adaptation + * @instance + * @param {google.cloud.speech.v1.IUpdatePhraseSetRequest} request UpdatePhraseSetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.speech.v1.Adaptation|deletePhraseSet}. + * @memberof google.cloud.speech.v1.Adaptation + * @typedef DeletePhraseSetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeletePhraseSet. + * @function deletePhraseSet + * @memberof google.cloud.speech.v1.Adaptation + * @instance + * @param {google.cloud.speech.v1.IDeletePhraseSetRequest} request DeletePhraseSetRequest message or plain object + * @param {google.cloud.speech.v1.Adaptation.DeletePhraseSetCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Adaptation.prototype.deletePhraseSet = function deletePhraseSet(request, callback) { + return this.rpcCall(deletePhraseSet, $root.google.cloud.speech.v1.DeletePhraseSetRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeletePhraseSet" }); + + /** + * Calls DeletePhraseSet. + * @function deletePhraseSet + * @memberof google.cloud.speech.v1.Adaptation + * @instance + * @param {google.cloud.speech.v1.IDeletePhraseSetRequest} request DeletePhraseSetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.speech.v1.Adaptation|createCustomClass}. + * @memberof google.cloud.speech.v1.Adaptation + * @typedef CreateCustomClassCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.speech.v1.CustomClass} [response] CustomClass + */ + + /** + * Calls CreateCustomClass. + * @function createCustomClass + * @memberof google.cloud.speech.v1.Adaptation + * @instance + * @param {google.cloud.speech.v1.ICreateCustomClassRequest} request CreateCustomClassRequest message or plain object + * @param {google.cloud.speech.v1.Adaptation.CreateCustomClassCallback} callback Node-style callback called with the error, if any, and CustomClass + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Adaptation.prototype.createCustomClass = function createCustomClass(request, callback) { + return this.rpcCall(createCustomClass, $root.google.cloud.speech.v1.CreateCustomClassRequest, $root.google.cloud.speech.v1.CustomClass, request, callback); + }, "name", { value: "CreateCustomClass" }); + + /** + * Calls CreateCustomClass. + * @function createCustomClass + * @memberof google.cloud.speech.v1.Adaptation + * @instance + * @param {google.cloud.speech.v1.ICreateCustomClassRequest} request CreateCustomClassRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.speech.v1.Adaptation|getCustomClass}. + * @memberof google.cloud.speech.v1.Adaptation + * @typedef GetCustomClassCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.speech.v1.CustomClass} [response] CustomClass + */ + + /** + * Calls GetCustomClass. + * @function getCustomClass + * @memberof google.cloud.speech.v1.Adaptation + * @instance + * @param {google.cloud.speech.v1.IGetCustomClassRequest} request GetCustomClassRequest message or plain object + * @param {google.cloud.speech.v1.Adaptation.GetCustomClassCallback} callback Node-style callback called with the error, if any, and CustomClass + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Adaptation.prototype.getCustomClass = function getCustomClass(request, callback) { + return this.rpcCall(getCustomClass, $root.google.cloud.speech.v1.GetCustomClassRequest, $root.google.cloud.speech.v1.CustomClass, request, callback); + }, "name", { value: "GetCustomClass" }); + + /** + * Calls GetCustomClass. + * @function getCustomClass + * @memberof google.cloud.speech.v1.Adaptation + * @instance + * @param {google.cloud.speech.v1.IGetCustomClassRequest} request GetCustomClassRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.speech.v1.Adaptation|listCustomClasses}. + * @memberof google.cloud.speech.v1.Adaptation + * @typedef ListCustomClassesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.speech.v1.ListCustomClassesResponse} [response] ListCustomClassesResponse + */ + + /** + * Calls ListCustomClasses. + * @function listCustomClasses + * @memberof google.cloud.speech.v1.Adaptation + * @instance + * @param {google.cloud.speech.v1.IListCustomClassesRequest} request ListCustomClassesRequest message or plain object + * @param {google.cloud.speech.v1.Adaptation.ListCustomClassesCallback} callback Node-style callback called with the error, if any, and ListCustomClassesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Adaptation.prototype.listCustomClasses = function listCustomClasses(request, callback) { + return this.rpcCall(listCustomClasses, $root.google.cloud.speech.v1.ListCustomClassesRequest, $root.google.cloud.speech.v1.ListCustomClassesResponse, request, callback); + }, "name", { value: "ListCustomClasses" }); + + /** + * Calls ListCustomClasses. + * @function listCustomClasses + * @memberof google.cloud.speech.v1.Adaptation + * @instance + * @param {google.cloud.speech.v1.IListCustomClassesRequest} request ListCustomClassesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.speech.v1.Adaptation|updateCustomClass}. + * @memberof google.cloud.speech.v1.Adaptation + * @typedef UpdateCustomClassCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.speech.v1.CustomClass} [response] CustomClass + */ + + /** + * Calls UpdateCustomClass. + * @function updateCustomClass + * @memberof google.cloud.speech.v1.Adaptation + * @instance + * @param {google.cloud.speech.v1.IUpdateCustomClassRequest} request UpdateCustomClassRequest message or plain object + * @param {google.cloud.speech.v1.Adaptation.UpdateCustomClassCallback} callback Node-style callback called with the error, if any, and CustomClass + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Adaptation.prototype.updateCustomClass = function updateCustomClass(request, callback) { + return this.rpcCall(updateCustomClass, $root.google.cloud.speech.v1.UpdateCustomClassRequest, $root.google.cloud.speech.v1.CustomClass, request, callback); + }, "name", { value: "UpdateCustomClass" }); + + /** + * Calls UpdateCustomClass. + * @function updateCustomClass + * @memberof google.cloud.speech.v1.Adaptation + * @instance + * @param {google.cloud.speech.v1.IUpdateCustomClassRequest} request UpdateCustomClassRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.speech.v1.Adaptation|deleteCustomClass}. + * @memberof google.cloud.speech.v1.Adaptation + * @typedef DeleteCustomClassCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteCustomClass. + * @function deleteCustomClass + * @memberof google.cloud.speech.v1.Adaptation + * @instance + * @param {google.cloud.speech.v1.IDeleteCustomClassRequest} request DeleteCustomClassRequest message or plain object + * @param {google.cloud.speech.v1.Adaptation.DeleteCustomClassCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Adaptation.prototype.deleteCustomClass = function deleteCustomClass(request, callback) { + return this.rpcCall(deleteCustomClass, $root.google.cloud.speech.v1.DeleteCustomClassRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteCustomClass" }); + + /** + * Calls DeleteCustomClass. + * @function deleteCustomClass + * @memberof google.cloud.speech.v1.Adaptation + * @instance + * @param {google.cloud.speech.v1.IDeleteCustomClassRequest} request DeleteCustomClassRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Adaptation; + })(); + + v1.CreatePhraseSetRequest = (function() { + + /** + * Properties of a CreatePhraseSetRequest. + * @memberof google.cloud.speech.v1 + * @interface ICreatePhraseSetRequest + * @property {string|null} [parent] CreatePhraseSetRequest parent + * @property {string|null} [phraseSetId] CreatePhraseSetRequest phraseSetId + * @property {google.cloud.speech.v1.IPhraseSet|null} [phraseSet] CreatePhraseSetRequest phraseSet + */ + + /** + * Constructs a new CreatePhraseSetRequest. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a CreatePhraseSetRequest. + * @implements ICreatePhraseSetRequest + * @constructor + * @param {google.cloud.speech.v1.ICreatePhraseSetRequest=} [properties] Properties to set + */ + function CreatePhraseSetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreatePhraseSetRequest parent. + * @member {string} parent + * @memberof google.cloud.speech.v1.CreatePhraseSetRequest + * @instance + */ + CreatePhraseSetRequest.prototype.parent = ""; + + /** + * CreatePhraseSetRequest phraseSetId. + * @member {string} phraseSetId + * @memberof google.cloud.speech.v1.CreatePhraseSetRequest + * @instance + */ + CreatePhraseSetRequest.prototype.phraseSetId = ""; + + /** + * CreatePhraseSetRequest phraseSet. + * @member {google.cloud.speech.v1.IPhraseSet|null|undefined} phraseSet + * @memberof google.cloud.speech.v1.CreatePhraseSetRequest + * @instance + */ + CreatePhraseSetRequest.prototype.phraseSet = null; + + /** + * Creates a new CreatePhraseSetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.CreatePhraseSetRequest + * @static + * @param {google.cloud.speech.v1.ICreatePhraseSetRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v1.CreatePhraseSetRequest} CreatePhraseSetRequest instance + */ + CreatePhraseSetRequest.create = function create(properties) { + return new CreatePhraseSetRequest(properties); + }; + + /** + * Encodes the specified CreatePhraseSetRequest message. Does not implicitly {@link google.cloud.speech.v1.CreatePhraseSetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.CreatePhraseSetRequest + * @static + * @param {google.cloud.speech.v1.ICreatePhraseSetRequest} message CreatePhraseSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreatePhraseSetRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.phraseSetId != null && Object.hasOwnProperty.call(message, "phraseSetId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.phraseSetId); + if (message.phraseSet != null && Object.hasOwnProperty.call(message, "phraseSet")) + $root.google.cloud.speech.v1.PhraseSet.encode(message.phraseSet, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreatePhraseSetRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.CreatePhraseSetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.CreatePhraseSetRequest + * @static + * @param {google.cloud.speech.v1.ICreatePhraseSetRequest} message CreatePhraseSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreatePhraseSetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreatePhraseSetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.CreatePhraseSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.CreatePhraseSetRequest} CreatePhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreatePhraseSetRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.CreatePhraseSetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.phraseSetId = reader.string(); + break; + } + case 3: { + message.phraseSet = $root.google.cloud.speech.v1.PhraseSet.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreatePhraseSetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.CreatePhraseSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.CreatePhraseSetRequest} CreatePhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreatePhraseSetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreatePhraseSetRequest message. + * @function verify + * @memberof google.cloud.speech.v1.CreatePhraseSetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreatePhraseSetRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.phraseSetId != null && message.hasOwnProperty("phraseSetId")) + if (!$util.isString(message.phraseSetId)) + return "phraseSetId: string expected"; + if (message.phraseSet != null && message.hasOwnProperty("phraseSet")) { + var error = $root.google.cloud.speech.v1.PhraseSet.verify(message.phraseSet); + if (error) + return "phraseSet." + error; + } + return null; + }; + + /** + * Creates a CreatePhraseSetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.CreatePhraseSetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.CreatePhraseSetRequest} CreatePhraseSetRequest + */ + CreatePhraseSetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.CreatePhraseSetRequest) + return object; + var message = new $root.google.cloud.speech.v1.CreatePhraseSetRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.phraseSetId != null) + message.phraseSetId = String(object.phraseSetId); + if (object.phraseSet != null) { + if (typeof object.phraseSet !== "object") + throw TypeError(".google.cloud.speech.v1.CreatePhraseSetRequest.phraseSet: object expected"); + message.phraseSet = $root.google.cloud.speech.v1.PhraseSet.fromObject(object.phraseSet); + } + return message; + }; + + /** + * Creates a plain object from a CreatePhraseSetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.CreatePhraseSetRequest + * @static + * @param {google.cloud.speech.v1.CreatePhraseSetRequest} message CreatePhraseSetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreatePhraseSetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.phraseSetId = ""; + object.phraseSet = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.phraseSetId != null && message.hasOwnProperty("phraseSetId")) + object.phraseSetId = message.phraseSetId; + if (message.phraseSet != null && message.hasOwnProperty("phraseSet")) + object.phraseSet = $root.google.cloud.speech.v1.PhraseSet.toObject(message.phraseSet, options); + return object; + }; + + /** + * Converts this CreatePhraseSetRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.CreatePhraseSetRequest + * @instance + * @returns {Object.} JSON object + */ + CreatePhraseSetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreatePhraseSetRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v1.CreatePhraseSetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreatePhraseSetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.CreatePhraseSetRequest"; + }; + + return CreatePhraseSetRequest; + })(); + + v1.UpdatePhraseSetRequest = (function() { + + /** + * Properties of an UpdatePhraseSetRequest. + * @memberof google.cloud.speech.v1 + * @interface IUpdatePhraseSetRequest + * @property {google.cloud.speech.v1.IPhraseSet|null} [phraseSet] UpdatePhraseSetRequest phraseSet + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdatePhraseSetRequest updateMask + */ + + /** + * Constructs a new UpdatePhraseSetRequest. + * @memberof google.cloud.speech.v1 + * @classdesc Represents an UpdatePhraseSetRequest. + * @implements IUpdatePhraseSetRequest + * @constructor + * @param {google.cloud.speech.v1.IUpdatePhraseSetRequest=} [properties] Properties to set + */ + function UpdatePhraseSetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdatePhraseSetRequest phraseSet. + * @member {google.cloud.speech.v1.IPhraseSet|null|undefined} phraseSet + * @memberof google.cloud.speech.v1.UpdatePhraseSetRequest + * @instance + */ + UpdatePhraseSetRequest.prototype.phraseSet = null; + + /** + * UpdatePhraseSetRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.speech.v1.UpdatePhraseSetRequest + * @instance + */ + UpdatePhraseSetRequest.prototype.updateMask = null; + + /** + * Creates a new UpdatePhraseSetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.UpdatePhraseSetRequest + * @static + * @param {google.cloud.speech.v1.IUpdatePhraseSetRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v1.UpdatePhraseSetRequest} UpdatePhraseSetRequest instance + */ + UpdatePhraseSetRequest.create = function create(properties) { + return new UpdatePhraseSetRequest(properties); + }; + + /** + * Encodes the specified UpdatePhraseSetRequest message. Does not implicitly {@link google.cloud.speech.v1.UpdatePhraseSetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.UpdatePhraseSetRequest + * @static + * @param {google.cloud.speech.v1.IUpdatePhraseSetRequest} message UpdatePhraseSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdatePhraseSetRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.phraseSet != null && Object.hasOwnProperty.call(message, "phraseSet")) + $root.google.cloud.speech.v1.PhraseSet.encode(message.phraseSet, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdatePhraseSetRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.UpdatePhraseSetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.UpdatePhraseSetRequest + * @static + * @param {google.cloud.speech.v1.IUpdatePhraseSetRequest} message UpdatePhraseSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdatePhraseSetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdatePhraseSetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.UpdatePhraseSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.UpdatePhraseSetRequest} UpdatePhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdatePhraseSetRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.UpdatePhraseSetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.phraseSet = $root.google.cloud.speech.v1.PhraseSet.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdatePhraseSetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.UpdatePhraseSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.UpdatePhraseSetRequest} UpdatePhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdatePhraseSetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdatePhraseSetRequest message. + * @function verify + * @memberof google.cloud.speech.v1.UpdatePhraseSetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdatePhraseSetRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.phraseSet != null && message.hasOwnProperty("phraseSet")) { + var error = $root.google.cloud.speech.v1.PhraseSet.verify(message.phraseSet); + if (error) + return "phraseSet." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdatePhraseSetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.UpdatePhraseSetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.UpdatePhraseSetRequest} UpdatePhraseSetRequest + */ + UpdatePhraseSetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.UpdatePhraseSetRequest) + return object; + var message = new $root.google.cloud.speech.v1.UpdatePhraseSetRequest(); + if (object.phraseSet != null) { + if (typeof object.phraseSet !== "object") + throw TypeError(".google.cloud.speech.v1.UpdatePhraseSetRequest.phraseSet: object expected"); + message.phraseSet = $root.google.cloud.speech.v1.PhraseSet.fromObject(object.phraseSet); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.speech.v1.UpdatePhraseSetRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdatePhraseSetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.UpdatePhraseSetRequest + * @static + * @param {google.cloud.speech.v1.UpdatePhraseSetRequest} message UpdatePhraseSetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdatePhraseSetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.phraseSet = null; + object.updateMask = null; + } + if (message.phraseSet != null && message.hasOwnProperty("phraseSet")) + object.phraseSet = $root.google.cloud.speech.v1.PhraseSet.toObject(message.phraseSet, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdatePhraseSetRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.UpdatePhraseSetRequest + * @instance + * @returns {Object.} JSON object + */ + UpdatePhraseSetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdatePhraseSetRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v1.UpdatePhraseSetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdatePhraseSetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.UpdatePhraseSetRequest"; + }; + + return UpdatePhraseSetRequest; + })(); + + v1.GetPhraseSetRequest = (function() { + + /** + * Properties of a GetPhraseSetRequest. + * @memberof google.cloud.speech.v1 + * @interface IGetPhraseSetRequest + * @property {string|null} [name] GetPhraseSetRequest name + */ + + /** + * Constructs a new GetPhraseSetRequest. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a GetPhraseSetRequest. + * @implements IGetPhraseSetRequest + * @constructor + * @param {google.cloud.speech.v1.IGetPhraseSetRequest=} [properties] Properties to set + */ + function GetPhraseSetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetPhraseSetRequest name. + * @member {string} name + * @memberof google.cloud.speech.v1.GetPhraseSetRequest + * @instance + */ + GetPhraseSetRequest.prototype.name = ""; + + /** + * Creates a new GetPhraseSetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.GetPhraseSetRequest + * @static + * @param {google.cloud.speech.v1.IGetPhraseSetRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v1.GetPhraseSetRequest} GetPhraseSetRequest instance + */ + GetPhraseSetRequest.create = function create(properties) { + return new GetPhraseSetRequest(properties); + }; + + /** + * Encodes the specified GetPhraseSetRequest message. Does not implicitly {@link google.cloud.speech.v1.GetPhraseSetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.GetPhraseSetRequest + * @static + * @param {google.cloud.speech.v1.IGetPhraseSetRequest} message GetPhraseSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPhraseSetRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetPhraseSetRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.GetPhraseSetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.GetPhraseSetRequest + * @static + * @param {google.cloud.speech.v1.IGetPhraseSetRequest} message GetPhraseSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPhraseSetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPhraseSetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.GetPhraseSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.GetPhraseSetRequest} GetPhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPhraseSetRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.GetPhraseSetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetPhraseSetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.GetPhraseSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.GetPhraseSetRequest} GetPhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPhraseSetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPhraseSetRequest message. + * @function verify + * @memberof google.cloud.speech.v1.GetPhraseSetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPhraseSetRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetPhraseSetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.GetPhraseSetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.GetPhraseSetRequest} GetPhraseSetRequest + */ + GetPhraseSetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.GetPhraseSetRequest) + return object; + var message = new $root.google.cloud.speech.v1.GetPhraseSetRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetPhraseSetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.GetPhraseSetRequest + * @static + * @param {google.cloud.speech.v1.GetPhraseSetRequest} message GetPhraseSetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPhraseSetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetPhraseSetRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.GetPhraseSetRequest + * @instance + * @returns {Object.} JSON object + */ + GetPhraseSetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetPhraseSetRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v1.GetPhraseSetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetPhraseSetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.GetPhraseSetRequest"; + }; + + return GetPhraseSetRequest; + })(); + + v1.ListPhraseSetRequest = (function() { + + /** + * Properties of a ListPhraseSetRequest. + * @memberof google.cloud.speech.v1 + * @interface IListPhraseSetRequest + * @property {string|null} [parent] ListPhraseSetRequest parent + * @property {number|null} [pageSize] ListPhraseSetRequest pageSize + * @property {string|null} [pageToken] ListPhraseSetRequest pageToken + */ + + /** + * Constructs a new ListPhraseSetRequest. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a ListPhraseSetRequest. + * @implements IListPhraseSetRequest + * @constructor + * @param {google.cloud.speech.v1.IListPhraseSetRequest=} [properties] Properties to set + */ + function ListPhraseSetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListPhraseSetRequest parent. + * @member {string} parent + * @memberof google.cloud.speech.v1.ListPhraseSetRequest + * @instance + */ + ListPhraseSetRequest.prototype.parent = ""; + + /** + * ListPhraseSetRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.speech.v1.ListPhraseSetRequest + * @instance + */ + ListPhraseSetRequest.prototype.pageSize = 0; + + /** + * ListPhraseSetRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.speech.v1.ListPhraseSetRequest + * @instance + */ + ListPhraseSetRequest.prototype.pageToken = ""; + + /** + * Creates a new ListPhraseSetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.ListPhraseSetRequest + * @static + * @param {google.cloud.speech.v1.IListPhraseSetRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v1.ListPhraseSetRequest} ListPhraseSetRequest instance + */ + ListPhraseSetRequest.create = function create(properties) { + return new ListPhraseSetRequest(properties); + }; + + /** + * Encodes the specified ListPhraseSetRequest message. Does not implicitly {@link google.cloud.speech.v1.ListPhraseSetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.ListPhraseSetRequest + * @static + * @param {google.cloud.speech.v1.IListPhraseSetRequest} message ListPhraseSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPhraseSetRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListPhraseSetRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.ListPhraseSetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.ListPhraseSetRequest + * @static + * @param {google.cloud.speech.v1.IListPhraseSetRequest} message ListPhraseSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPhraseSetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPhraseSetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.ListPhraseSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.ListPhraseSetRequest} ListPhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPhraseSetRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.ListPhraseSetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListPhraseSetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.ListPhraseSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.ListPhraseSetRequest} ListPhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPhraseSetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPhraseSetRequest message. + * @function verify + * @memberof google.cloud.speech.v1.ListPhraseSetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPhraseSetRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListPhraseSetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.ListPhraseSetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.ListPhraseSetRequest} ListPhraseSetRequest + */ + ListPhraseSetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.ListPhraseSetRequest) + return object; + var message = new $root.google.cloud.speech.v1.ListPhraseSetRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListPhraseSetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.ListPhraseSetRequest + * @static + * @param {google.cloud.speech.v1.ListPhraseSetRequest} message ListPhraseSetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPhraseSetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListPhraseSetRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.ListPhraseSetRequest + * @instance + * @returns {Object.} JSON object + */ + ListPhraseSetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListPhraseSetRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v1.ListPhraseSetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPhraseSetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.ListPhraseSetRequest"; + }; + + return ListPhraseSetRequest; + })(); + + v1.ListPhraseSetResponse = (function() { + + /** + * Properties of a ListPhraseSetResponse. + * @memberof google.cloud.speech.v1 + * @interface IListPhraseSetResponse + * @property {Array.|null} [phraseSets] ListPhraseSetResponse phraseSets + * @property {string|null} [nextPageToken] ListPhraseSetResponse nextPageToken + */ + + /** + * Constructs a new ListPhraseSetResponse. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a ListPhraseSetResponse. + * @implements IListPhraseSetResponse + * @constructor + * @param {google.cloud.speech.v1.IListPhraseSetResponse=} [properties] Properties to set + */ + function ListPhraseSetResponse(properties) { + this.phraseSets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListPhraseSetResponse phraseSets. + * @member {Array.} phraseSets + * @memberof google.cloud.speech.v1.ListPhraseSetResponse + * @instance + */ + ListPhraseSetResponse.prototype.phraseSets = $util.emptyArray; + + /** + * ListPhraseSetResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.speech.v1.ListPhraseSetResponse + * @instance + */ + ListPhraseSetResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListPhraseSetResponse instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.ListPhraseSetResponse + * @static + * @param {google.cloud.speech.v1.IListPhraseSetResponse=} [properties] Properties to set + * @returns {google.cloud.speech.v1.ListPhraseSetResponse} ListPhraseSetResponse instance + */ + ListPhraseSetResponse.create = function create(properties) { + return new ListPhraseSetResponse(properties); + }; + + /** + * Encodes the specified ListPhraseSetResponse message. Does not implicitly {@link google.cloud.speech.v1.ListPhraseSetResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.ListPhraseSetResponse + * @static + * @param {google.cloud.speech.v1.IListPhraseSetResponse} message ListPhraseSetResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPhraseSetResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.phraseSets != null && message.phraseSets.length) + for (var i = 0; i < message.phraseSets.length; ++i) + $root.google.cloud.speech.v1.PhraseSet.encode(message.phraseSets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListPhraseSetResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v1.ListPhraseSetResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.ListPhraseSetResponse + * @static + * @param {google.cloud.speech.v1.IListPhraseSetResponse} message ListPhraseSetResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPhraseSetResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPhraseSetResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.ListPhraseSetResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.ListPhraseSetResponse} ListPhraseSetResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPhraseSetResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.ListPhraseSetResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.phraseSets && message.phraseSets.length)) + message.phraseSets = []; + message.phraseSets.push($root.google.cloud.speech.v1.PhraseSet.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListPhraseSetResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.ListPhraseSetResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.ListPhraseSetResponse} ListPhraseSetResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPhraseSetResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPhraseSetResponse message. + * @function verify + * @memberof google.cloud.speech.v1.ListPhraseSetResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPhraseSetResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.phraseSets != null && message.hasOwnProperty("phraseSets")) { + if (!Array.isArray(message.phraseSets)) + return "phraseSets: array expected"; + for (var i = 0; i < message.phraseSets.length; ++i) { + var error = $root.google.cloud.speech.v1.PhraseSet.verify(message.phraseSets[i]); + if (error) + return "phraseSets." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListPhraseSetResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.ListPhraseSetResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.ListPhraseSetResponse} ListPhraseSetResponse + */ + ListPhraseSetResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.ListPhraseSetResponse) + return object; + var message = new $root.google.cloud.speech.v1.ListPhraseSetResponse(); + if (object.phraseSets) { + if (!Array.isArray(object.phraseSets)) + throw TypeError(".google.cloud.speech.v1.ListPhraseSetResponse.phraseSets: array expected"); + message.phraseSets = []; + for (var i = 0; i < object.phraseSets.length; ++i) { + if (typeof object.phraseSets[i] !== "object") + throw TypeError(".google.cloud.speech.v1.ListPhraseSetResponse.phraseSets: object expected"); + message.phraseSets[i] = $root.google.cloud.speech.v1.PhraseSet.fromObject(object.phraseSets[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListPhraseSetResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.ListPhraseSetResponse + * @static + * @param {google.cloud.speech.v1.ListPhraseSetResponse} message ListPhraseSetResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPhraseSetResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.phraseSets = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.phraseSets && message.phraseSets.length) { + object.phraseSets = []; + for (var j = 0; j < message.phraseSets.length; ++j) + object.phraseSets[j] = $root.google.cloud.speech.v1.PhraseSet.toObject(message.phraseSets[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListPhraseSetResponse to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.ListPhraseSetResponse + * @instance + * @returns {Object.} JSON object + */ + ListPhraseSetResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListPhraseSetResponse + * @function getTypeUrl + * @memberof google.cloud.speech.v1.ListPhraseSetResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPhraseSetResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.ListPhraseSetResponse"; + }; + + return ListPhraseSetResponse; + })(); + + v1.DeletePhraseSetRequest = (function() { + + /** + * Properties of a DeletePhraseSetRequest. + * @memberof google.cloud.speech.v1 + * @interface IDeletePhraseSetRequest + * @property {string|null} [name] DeletePhraseSetRequest name + */ + + /** + * Constructs a new DeletePhraseSetRequest. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a DeletePhraseSetRequest. + * @implements IDeletePhraseSetRequest + * @constructor + * @param {google.cloud.speech.v1.IDeletePhraseSetRequest=} [properties] Properties to set + */ + function DeletePhraseSetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeletePhraseSetRequest name. + * @member {string} name + * @memberof google.cloud.speech.v1.DeletePhraseSetRequest + * @instance + */ + DeletePhraseSetRequest.prototype.name = ""; + + /** + * Creates a new DeletePhraseSetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.DeletePhraseSetRequest + * @static + * @param {google.cloud.speech.v1.IDeletePhraseSetRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v1.DeletePhraseSetRequest} DeletePhraseSetRequest instance + */ + DeletePhraseSetRequest.create = function create(properties) { + return new DeletePhraseSetRequest(properties); + }; + + /** + * Encodes the specified DeletePhraseSetRequest message. Does not implicitly {@link google.cloud.speech.v1.DeletePhraseSetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.DeletePhraseSetRequest + * @static + * @param {google.cloud.speech.v1.IDeletePhraseSetRequest} message DeletePhraseSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeletePhraseSetRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeletePhraseSetRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.DeletePhraseSetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.DeletePhraseSetRequest + * @static + * @param {google.cloud.speech.v1.IDeletePhraseSetRequest} message DeletePhraseSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeletePhraseSetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeletePhraseSetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.DeletePhraseSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.DeletePhraseSetRequest} DeletePhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeletePhraseSetRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.DeletePhraseSetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeletePhraseSetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.DeletePhraseSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.DeletePhraseSetRequest} DeletePhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeletePhraseSetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeletePhraseSetRequest message. + * @function verify + * @memberof google.cloud.speech.v1.DeletePhraseSetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeletePhraseSetRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeletePhraseSetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.DeletePhraseSetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.DeletePhraseSetRequest} DeletePhraseSetRequest + */ + DeletePhraseSetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.DeletePhraseSetRequest) + return object; + var message = new $root.google.cloud.speech.v1.DeletePhraseSetRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeletePhraseSetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.DeletePhraseSetRequest + * @static + * @param {google.cloud.speech.v1.DeletePhraseSetRequest} message DeletePhraseSetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeletePhraseSetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeletePhraseSetRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.DeletePhraseSetRequest + * @instance + * @returns {Object.} JSON object + */ + DeletePhraseSetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeletePhraseSetRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v1.DeletePhraseSetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeletePhraseSetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.DeletePhraseSetRequest"; + }; + + return DeletePhraseSetRequest; + })(); + + v1.CreateCustomClassRequest = (function() { + + /** + * Properties of a CreateCustomClassRequest. + * @memberof google.cloud.speech.v1 + * @interface ICreateCustomClassRequest + * @property {string|null} [parent] CreateCustomClassRequest parent + * @property {string|null} [customClassId] CreateCustomClassRequest customClassId + * @property {google.cloud.speech.v1.ICustomClass|null} [customClass] CreateCustomClassRequest customClass + */ + + /** + * Constructs a new CreateCustomClassRequest. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a CreateCustomClassRequest. + * @implements ICreateCustomClassRequest + * @constructor + * @param {google.cloud.speech.v1.ICreateCustomClassRequest=} [properties] Properties to set + */ + function CreateCustomClassRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateCustomClassRequest parent. + * @member {string} parent + * @memberof google.cloud.speech.v1.CreateCustomClassRequest + * @instance + */ + CreateCustomClassRequest.prototype.parent = ""; + + /** + * CreateCustomClassRequest customClassId. + * @member {string} customClassId + * @memberof google.cloud.speech.v1.CreateCustomClassRequest + * @instance + */ + CreateCustomClassRequest.prototype.customClassId = ""; + + /** + * CreateCustomClassRequest customClass. + * @member {google.cloud.speech.v1.ICustomClass|null|undefined} customClass + * @memberof google.cloud.speech.v1.CreateCustomClassRequest + * @instance + */ + CreateCustomClassRequest.prototype.customClass = null; + + /** + * Creates a new CreateCustomClassRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.CreateCustomClassRequest + * @static + * @param {google.cloud.speech.v1.ICreateCustomClassRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v1.CreateCustomClassRequest} CreateCustomClassRequest instance + */ + CreateCustomClassRequest.create = function create(properties) { + return new CreateCustomClassRequest(properties); + }; + + /** + * Encodes the specified CreateCustomClassRequest message. Does not implicitly {@link google.cloud.speech.v1.CreateCustomClassRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.CreateCustomClassRequest + * @static + * @param {google.cloud.speech.v1.ICreateCustomClassRequest} message CreateCustomClassRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCustomClassRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.customClassId != null && Object.hasOwnProperty.call(message, "customClassId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.customClassId); + if (message.customClass != null && Object.hasOwnProperty.call(message, "customClass")) + $root.google.cloud.speech.v1.CustomClass.encode(message.customClass, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateCustomClassRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.CreateCustomClassRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.CreateCustomClassRequest + * @static + * @param {google.cloud.speech.v1.ICreateCustomClassRequest} message CreateCustomClassRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCustomClassRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateCustomClassRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.CreateCustomClassRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.CreateCustomClassRequest} CreateCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCustomClassRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.CreateCustomClassRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.customClassId = reader.string(); + break; + } + case 3: { + message.customClass = $root.google.cloud.speech.v1.CustomClass.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateCustomClassRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.CreateCustomClassRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.CreateCustomClassRequest} CreateCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCustomClassRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateCustomClassRequest message. + * @function verify + * @memberof google.cloud.speech.v1.CreateCustomClassRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateCustomClassRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.customClassId != null && message.hasOwnProperty("customClassId")) + if (!$util.isString(message.customClassId)) + return "customClassId: string expected"; + if (message.customClass != null && message.hasOwnProperty("customClass")) { + var error = $root.google.cloud.speech.v1.CustomClass.verify(message.customClass); + if (error) + return "customClass." + error; + } + return null; + }; + + /** + * Creates a CreateCustomClassRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.CreateCustomClassRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.CreateCustomClassRequest} CreateCustomClassRequest + */ + CreateCustomClassRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.CreateCustomClassRequest) + return object; + var message = new $root.google.cloud.speech.v1.CreateCustomClassRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.customClassId != null) + message.customClassId = String(object.customClassId); + if (object.customClass != null) { + if (typeof object.customClass !== "object") + throw TypeError(".google.cloud.speech.v1.CreateCustomClassRequest.customClass: object expected"); + message.customClass = $root.google.cloud.speech.v1.CustomClass.fromObject(object.customClass); + } + return message; + }; + + /** + * Creates a plain object from a CreateCustomClassRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.CreateCustomClassRequest + * @static + * @param {google.cloud.speech.v1.CreateCustomClassRequest} message CreateCustomClassRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateCustomClassRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.customClassId = ""; + object.customClass = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.customClassId != null && message.hasOwnProperty("customClassId")) + object.customClassId = message.customClassId; + if (message.customClass != null && message.hasOwnProperty("customClass")) + object.customClass = $root.google.cloud.speech.v1.CustomClass.toObject(message.customClass, options); + return object; + }; + + /** + * Converts this CreateCustomClassRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.CreateCustomClassRequest + * @instance + * @returns {Object.} JSON object + */ + CreateCustomClassRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateCustomClassRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v1.CreateCustomClassRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateCustomClassRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.CreateCustomClassRequest"; + }; + + return CreateCustomClassRequest; + })(); + + v1.UpdateCustomClassRequest = (function() { + + /** + * Properties of an UpdateCustomClassRequest. + * @memberof google.cloud.speech.v1 + * @interface IUpdateCustomClassRequest + * @property {google.cloud.speech.v1.ICustomClass|null} [customClass] UpdateCustomClassRequest customClass + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCustomClassRequest updateMask + */ + + /** + * Constructs a new UpdateCustomClassRequest. + * @memberof google.cloud.speech.v1 + * @classdesc Represents an UpdateCustomClassRequest. + * @implements IUpdateCustomClassRequest + * @constructor + * @param {google.cloud.speech.v1.IUpdateCustomClassRequest=} [properties] Properties to set + */ + function UpdateCustomClassRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateCustomClassRequest customClass. + * @member {google.cloud.speech.v1.ICustomClass|null|undefined} customClass + * @memberof google.cloud.speech.v1.UpdateCustomClassRequest + * @instance + */ + UpdateCustomClassRequest.prototype.customClass = null; + + /** + * UpdateCustomClassRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.speech.v1.UpdateCustomClassRequest + * @instance + */ + UpdateCustomClassRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateCustomClassRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.UpdateCustomClassRequest + * @static + * @param {google.cloud.speech.v1.IUpdateCustomClassRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v1.UpdateCustomClassRequest} UpdateCustomClassRequest instance + */ + UpdateCustomClassRequest.create = function create(properties) { + return new UpdateCustomClassRequest(properties); + }; + + /** + * Encodes the specified UpdateCustomClassRequest message. Does not implicitly {@link google.cloud.speech.v1.UpdateCustomClassRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.UpdateCustomClassRequest + * @static + * @param {google.cloud.speech.v1.IUpdateCustomClassRequest} message UpdateCustomClassRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCustomClassRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.customClass != null && Object.hasOwnProperty.call(message, "customClass")) + $root.google.cloud.speech.v1.CustomClass.encode(message.customClass, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateCustomClassRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.UpdateCustomClassRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.UpdateCustomClassRequest + * @static + * @param {google.cloud.speech.v1.IUpdateCustomClassRequest} message UpdateCustomClassRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCustomClassRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateCustomClassRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.UpdateCustomClassRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.UpdateCustomClassRequest} UpdateCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCustomClassRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.UpdateCustomClassRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.customClass = $root.google.cloud.speech.v1.CustomClass.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateCustomClassRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.UpdateCustomClassRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.UpdateCustomClassRequest} UpdateCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCustomClassRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateCustomClassRequest message. + * @function verify + * @memberof google.cloud.speech.v1.UpdateCustomClassRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateCustomClassRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.customClass != null && message.hasOwnProperty("customClass")) { + var error = $root.google.cloud.speech.v1.CustomClass.verify(message.customClass); + if (error) + return "customClass." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateCustomClassRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.UpdateCustomClassRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.UpdateCustomClassRequest} UpdateCustomClassRequest + */ + UpdateCustomClassRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.UpdateCustomClassRequest) + return object; + var message = new $root.google.cloud.speech.v1.UpdateCustomClassRequest(); + if (object.customClass != null) { + if (typeof object.customClass !== "object") + throw TypeError(".google.cloud.speech.v1.UpdateCustomClassRequest.customClass: object expected"); + message.customClass = $root.google.cloud.speech.v1.CustomClass.fromObject(object.customClass); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.speech.v1.UpdateCustomClassRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateCustomClassRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.UpdateCustomClassRequest + * @static + * @param {google.cloud.speech.v1.UpdateCustomClassRequest} message UpdateCustomClassRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateCustomClassRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.customClass = null; + object.updateMask = null; + } + if (message.customClass != null && message.hasOwnProperty("customClass")) + object.customClass = $root.google.cloud.speech.v1.CustomClass.toObject(message.customClass, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateCustomClassRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.UpdateCustomClassRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateCustomClassRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateCustomClassRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v1.UpdateCustomClassRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateCustomClassRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.UpdateCustomClassRequest"; + }; + + return UpdateCustomClassRequest; + })(); + + v1.GetCustomClassRequest = (function() { + + /** + * Properties of a GetCustomClassRequest. + * @memberof google.cloud.speech.v1 + * @interface IGetCustomClassRequest + * @property {string|null} [name] GetCustomClassRequest name + */ + + /** + * Constructs a new GetCustomClassRequest. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a GetCustomClassRequest. + * @implements IGetCustomClassRequest + * @constructor + * @param {google.cloud.speech.v1.IGetCustomClassRequest=} [properties] Properties to set + */ + function GetCustomClassRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetCustomClassRequest name. + * @member {string} name + * @memberof google.cloud.speech.v1.GetCustomClassRequest + * @instance + */ + GetCustomClassRequest.prototype.name = ""; + + /** + * Creates a new GetCustomClassRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.GetCustomClassRequest + * @static + * @param {google.cloud.speech.v1.IGetCustomClassRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v1.GetCustomClassRequest} GetCustomClassRequest instance + */ + GetCustomClassRequest.create = function create(properties) { + return new GetCustomClassRequest(properties); + }; + + /** + * Encodes the specified GetCustomClassRequest message. Does not implicitly {@link google.cloud.speech.v1.GetCustomClassRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.GetCustomClassRequest + * @static + * @param {google.cloud.speech.v1.IGetCustomClassRequest} message GetCustomClassRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCustomClassRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetCustomClassRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.GetCustomClassRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.GetCustomClassRequest + * @static + * @param {google.cloud.speech.v1.IGetCustomClassRequest} message GetCustomClassRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCustomClassRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetCustomClassRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.GetCustomClassRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.GetCustomClassRequest} GetCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCustomClassRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.GetCustomClassRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetCustomClassRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.GetCustomClassRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.GetCustomClassRequest} GetCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCustomClassRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetCustomClassRequest message. + * @function verify + * @memberof google.cloud.speech.v1.GetCustomClassRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetCustomClassRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetCustomClassRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.GetCustomClassRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.GetCustomClassRequest} GetCustomClassRequest + */ + GetCustomClassRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.GetCustomClassRequest) + return object; + var message = new $root.google.cloud.speech.v1.GetCustomClassRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetCustomClassRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.GetCustomClassRequest + * @static + * @param {google.cloud.speech.v1.GetCustomClassRequest} message GetCustomClassRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetCustomClassRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetCustomClassRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.GetCustomClassRequest + * @instance + * @returns {Object.} JSON object + */ + GetCustomClassRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetCustomClassRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v1.GetCustomClassRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetCustomClassRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.GetCustomClassRequest"; + }; + + return GetCustomClassRequest; + })(); + + v1.ListCustomClassesRequest = (function() { + + /** + * Properties of a ListCustomClassesRequest. + * @memberof google.cloud.speech.v1 + * @interface IListCustomClassesRequest + * @property {string|null} [parent] ListCustomClassesRequest parent + * @property {number|null} [pageSize] ListCustomClassesRequest pageSize + * @property {string|null} [pageToken] ListCustomClassesRequest pageToken + */ + + /** + * Constructs a new ListCustomClassesRequest. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a ListCustomClassesRequest. + * @implements IListCustomClassesRequest + * @constructor + * @param {google.cloud.speech.v1.IListCustomClassesRequest=} [properties] Properties to set + */ + function ListCustomClassesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCustomClassesRequest parent. + * @member {string} parent + * @memberof google.cloud.speech.v1.ListCustomClassesRequest + * @instance + */ + ListCustomClassesRequest.prototype.parent = ""; + + /** + * ListCustomClassesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.speech.v1.ListCustomClassesRequest + * @instance + */ + ListCustomClassesRequest.prototype.pageSize = 0; + + /** + * ListCustomClassesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.speech.v1.ListCustomClassesRequest + * @instance + */ + ListCustomClassesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListCustomClassesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.ListCustomClassesRequest + * @static + * @param {google.cloud.speech.v1.IListCustomClassesRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v1.ListCustomClassesRequest} ListCustomClassesRequest instance + */ + ListCustomClassesRequest.create = function create(properties) { + return new ListCustomClassesRequest(properties); + }; + + /** + * Encodes the specified ListCustomClassesRequest message. Does not implicitly {@link google.cloud.speech.v1.ListCustomClassesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.ListCustomClassesRequest + * @static + * @param {google.cloud.speech.v1.IListCustomClassesRequest} message ListCustomClassesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCustomClassesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListCustomClassesRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.ListCustomClassesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.ListCustomClassesRequest + * @static + * @param {google.cloud.speech.v1.IListCustomClassesRequest} message ListCustomClassesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCustomClassesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCustomClassesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.ListCustomClassesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.ListCustomClassesRequest} ListCustomClassesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCustomClassesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.ListCustomClassesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCustomClassesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.ListCustomClassesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.ListCustomClassesRequest} ListCustomClassesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCustomClassesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCustomClassesRequest message. + * @function verify + * @memberof google.cloud.speech.v1.ListCustomClassesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCustomClassesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListCustomClassesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.ListCustomClassesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.ListCustomClassesRequest} ListCustomClassesRequest + */ + ListCustomClassesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.ListCustomClassesRequest) + return object; + var message = new $root.google.cloud.speech.v1.ListCustomClassesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListCustomClassesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.ListCustomClassesRequest + * @static + * @param {google.cloud.speech.v1.ListCustomClassesRequest} message ListCustomClassesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCustomClassesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListCustomClassesRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.ListCustomClassesRequest + * @instance + * @returns {Object.} JSON object + */ + ListCustomClassesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCustomClassesRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v1.ListCustomClassesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCustomClassesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.ListCustomClassesRequest"; + }; + + return ListCustomClassesRequest; + })(); + + v1.ListCustomClassesResponse = (function() { + + /** + * Properties of a ListCustomClassesResponse. + * @memberof google.cloud.speech.v1 + * @interface IListCustomClassesResponse + * @property {Array.|null} [customClasses] ListCustomClassesResponse customClasses + * @property {string|null} [nextPageToken] ListCustomClassesResponse nextPageToken + */ + + /** + * Constructs a new ListCustomClassesResponse. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a ListCustomClassesResponse. + * @implements IListCustomClassesResponse + * @constructor + * @param {google.cloud.speech.v1.IListCustomClassesResponse=} [properties] Properties to set + */ + function ListCustomClassesResponse(properties) { + this.customClasses = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCustomClassesResponse customClasses. + * @member {Array.} customClasses + * @memberof google.cloud.speech.v1.ListCustomClassesResponse + * @instance + */ + ListCustomClassesResponse.prototype.customClasses = $util.emptyArray; + + /** + * ListCustomClassesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.speech.v1.ListCustomClassesResponse + * @instance + */ + ListCustomClassesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListCustomClassesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.ListCustomClassesResponse + * @static + * @param {google.cloud.speech.v1.IListCustomClassesResponse=} [properties] Properties to set + * @returns {google.cloud.speech.v1.ListCustomClassesResponse} ListCustomClassesResponse instance + */ + ListCustomClassesResponse.create = function create(properties) { + return new ListCustomClassesResponse(properties); + }; + + /** + * Encodes the specified ListCustomClassesResponse message. Does not implicitly {@link google.cloud.speech.v1.ListCustomClassesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.ListCustomClassesResponse + * @static + * @param {google.cloud.speech.v1.IListCustomClassesResponse} message ListCustomClassesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCustomClassesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.customClasses != null && message.customClasses.length) + for (var i = 0; i < message.customClasses.length; ++i) + $root.google.cloud.speech.v1.CustomClass.encode(message.customClasses[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListCustomClassesResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v1.ListCustomClassesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.ListCustomClassesResponse + * @static + * @param {google.cloud.speech.v1.IListCustomClassesResponse} message ListCustomClassesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCustomClassesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCustomClassesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.ListCustomClassesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.ListCustomClassesResponse} ListCustomClassesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCustomClassesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.ListCustomClassesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.customClasses && message.customClasses.length)) + message.customClasses = []; + message.customClasses.push($root.google.cloud.speech.v1.CustomClass.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCustomClassesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.ListCustomClassesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.ListCustomClassesResponse} ListCustomClassesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCustomClassesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCustomClassesResponse message. + * @function verify + * @memberof google.cloud.speech.v1.ListCustomClassesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCustomClassesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.customClasses != null && message.hasOwnProperty("customClasses")) { + if (!Array.isArray(message.customClasses)) + return "customClasses: array expected"; + for (var i = 0; i < message.customClasses.length; ++i) { + var error = $root.google.cloud.speech.v1.CustomClass.verify(message.customClasses[i]); + if (error) + return "customClasses." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListCustomClassesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.ListCustomClassesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.ListCustomClassesResponse} ListCustomClassesResponse + */ + ListCustomClassesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.ListCustomClassesResponse) + return object; + var message = new $root.google.cloud.speech.v1.ListCustomClassesResponse(); + if (object.customClasses) { + if (!Array.isArray(object.customClasses)) + throw TypeError(".google.cloud.speech.v1.ListCustomClassesResponse.customClasses: array expected"); + message.customClasses = []; + for (var i = 0; i < object.customClasses.length; ++i) { + if (typeof object.customClasses[i] !== "object") + throw TypeError(".google.cloud.speech.v1.ListCustomClassesResponse.customClasses: object expected"); + message.customClasses[i] = $root.google.cloud.speech.v1.CustomClass.fromObject(object.customClasses[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListCustomClassesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.ListCustomClassesResponse + * @static + * @param {google.cloud.speech.v1.ListCustomClassesResponse} message ListCustomClassesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCustomClassesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.customClasses = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.customClasses && message.customClasses.length) { + object.customClasses = []; + for (var j = 0; j < message.customClasses.length; ++j) + object.customClasses[j] = $root.google.cloud.speech.v1.CustomClass.toObject(message.customClasses[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListCustomClassesResponse to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.ListCustomClassesResponse + * @instance + * @returns {Object.} JSON object + */ + ListCustomClassesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCustomClassesResponse + * @function getTypeUrl + * @memberof google.cloud.speech.v1.ListCustomClassesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCustomClassesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.ListCustomClassesResponse"; + }; + + return ListCustomClassesResponse; + })(); + + v1.DeleteCustomClassRequest = (function() { + + /** + * Properties of a DeleteCustomClassRequest. + * @memberof google.cloud.speech.v1 + * @interface IDeleteCustomClassRequest + * @property {string|null} [name] DeleteCustomClassRequest name + */ + + /** + * Constructs a new DeleteCustomClassRequest. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a DeleteCustomClassRequest. + * @implements IDeleteCustomClassRequest + * @constructor + * @param {google.cloud.speech.v1.IDeleteCustomClassRequest=} [properties] Properties to set + */ + function DeleteCustomClassRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteCustomClassRequest name. + * @member {string} name + * @memberof google.cloud.speech.v1.DeleteCustomClassRequest + * @instance + */ + DeleteCustomClassRequest.prototype.name = ""; + + /** + * Creates a new DeleteCustomClassRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.DeleteCustomClassRequest + * @static + * @param {google.cloud.speech.v1.IDeleteCustomClassRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v1.DeleteCustomClassRequest} DeleteCustomClassRequest instance + */ + DeleteCustomClassRequest.create = function create(properties) { + return new DeleteCustomClassRequest(properties); + }; + + /** + * Encodes the specified DeleteCustomClassRequest message. Does not implicitly {@link google.cloud.speech.v1.DeleteCustomClassRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.DeleteCustomClassRequest + * @static + * @param {google.cloud.speech.v1.IDeleteCustomClassRequest} message DeleteCustomClassRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteCustomClassRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteCustomClassRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.DeleteCustomClassRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.DeleteCustomClassRequest + * @static + * @param {google.cloud.speech.v1.IDeleteCustomClassRequest} message DeleteCustomClassRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteCustomClassRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteCustomClassRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.DeleteCustomClassRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.DeleteCustomClassRequest} DeleteCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteCustomClassRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.DeleteCustomClassRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteCustomClassRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.DeleteCustomClassRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.DeleteCustomClassRequest} DeleteCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteCustomClassRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteCustomClassRequest message. + * @function verify + * @memberof google.cloud.speech.v1.DeleteCustomClassRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteCustomClassRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteCustomClassRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.DeleteCustomClassRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.DeleteCustomClassRequest} DeleteCustomClassRequest + */ + DeleteCustomClassRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.DeleteCustomClassRequest) + return object; + var message = new $root.google.cloud.speech.v1.DeleteCustomClassRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteCustomClassRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.DeleteCustomClassRequest + * @static + * @param {google.cloud.speech.v1.DeleteCustomClassRequest} message DeleteCustomClassRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteCustomClassRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteCustomClassRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.DeleteCustomClassRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteCustomClassRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteCustomClassRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v1.DeleteCustomClassRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteCustomClassRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.DeleteCustomClassRequest"; + }; + + return DeleteCustomClassRequest; + })(); + + return v1; + })(); + + return speech; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.fullyDecodeReservedExpansion = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Http + * @function getTypeUrl + * @memberof google.api.Http + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Http"; + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; + + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.get = reader.string(); + break; + } + case 3: { + message.put = reader.string(); + break; + } + case 4: { + message.post = reader.string(); + break; + } + case 5: { + message["delete"] = reader.string(); + break; + } + case 6: { + message.patch = reader.string(); + break; + } + case 8: { + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + } + case 7: { + message.body = reader.string(); + break; + } + case 12: { + message.responseBody = reader.string(); + break; + } + case 11: { + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) + return object; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + return object; + }; + + /** + * Converts this HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpRule + * @function getTypeUrl + * @memberof google.api.HttpRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpRule"; + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomHttpPattern + * @function getTypeUrl + * @memberof google.api.CustomHttpPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CustomHttpPattern"; + }; + + return CustomHttpPattern; + })(); + + api.CommonLanguageSettings = (function() { + + /** + * Properties of a CommonLanguageSettings. + * @memberof google.api + * @interface ICommonLanguageSettings + * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri + * @property {Array.|null} [destinations] CommonLanguageSettings destinations + */ + + /** + * Constructs a new CommonLanguageSettings. + * @memberof google.api + * @classdesc Represents a CommonLanguageSettings. + * @implements ICommonLanguageSettings + * @constructor + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + */ + function CommonLanguageSettings(properties) { + this.destinations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommonLanguageSettings referenceDocsUri. + * @member {string} referenceDocsUri + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.referenceDocsUri = ""; + + /** + * CommonLanguageSettings destinations. + * @member {Array.} destinations + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.destinations = $util.emptyArray; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @function create + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings instance + */ + CommonLanguageSettings.create = function create(properties) { + return new CommonLanguageSettings(properties); + }; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.referenceDocsUri); + if (message.destinations != null && message.destinations.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.destinations.length; ++i) + writer.int32(message.destinations[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CommonLanguageSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.referenceDocsUri = reader.string(); + break; + } + case 2: { + if (!(message.destinations && message.destinations.length)) + message.destinations = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.destinations.push(reader.int32()); + } else + message.destinations.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommonLanguageSettings message. + * @function verify + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommonLanguageSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + if (!$util.isString(message.referenceDocsUri)) + return "referenceDocsUri: string expected"; + if (message.destinations != null && message.hasOwnProperty("destinations")) { + if (!Array.isArray(message.destinations)) + return "destinations: array expected"; + for (var i = 0; i < message.destinations.length; ++i) + switch (message.destinations[i]) { + default: + return "destinations: enum value[] expected"; + case 0: + case 10: + case 20: + break; + } + } + return null; + }; + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + */ + CommonLanguageSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CommonLanguageSettings) + return object; + var message = new $root.google.api.CommonLanguageSettings(); + if (object.referenceDocsUri != null) + message.referenceDocsUri = String(object.referenceDocsUri); + if (object.destinations) { + if (!Array.isArray(object.destinations)) + throw TypeError(".google.api.CommonLanguageSettings.destinations: array expected"); + message.destinations = []; + for (var i = 0; i < object.destinations.length; ++i) + switch (object.destinations[i]) { + default: + if (typeof object.destinations[i] === "number") { + message.destinations[i] = object.destinations[i]; + break; + } + case "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": + case 0: + message.destinations[i] = 0; + break; + case "GITHUB": + case 10: + message.destinations[i] = 10; + break; + case "PACKAGE_MANAGER": + case 20: + message.destinations[i] = 20; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommonLanguageSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.destinations = []; + if (options.defaults) + object.referenceDocsUri = ""; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + object.referenceDocsUri = message.referenceDocsUri; + if (message.destinations && message.destinations.length) { + object.destinations = []; + for (var j = 0; j < message.destinations.length; ++j) + object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; + } + return object; + }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @function toJSON + * @memberof google.api.CommonLanguageSettings + * @instance + * @returns {Object.} JSON object + */ + CommonLanguageSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommonLanguageSettings + * @function getTypeUrl + * @memberof google.api.CommonLanguageSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CommonLanguageSettings"; + }; + + return CommonLanguageSettings; + })(); + + api.ClientLibrarySettings = (function() { + + /** + * Properties of a ClientLibrarySettings. + * @memberof google.api + * @interface IClientLibrarySettings + * @property {string|null} [version] ClientLibrarySettings version + * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage + * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums + * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings + * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings + * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings + * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings + * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings + * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings + * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings + * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings + */ + + /** + * Constructs a new ClientLibrarySettings. + * @memberof google.api + * @classdesc Represents a ClientLibrarySettings. + * @implements IClientLibrarySettings + * @constructor + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + */ + function ClientLibrarySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClientLibrarySettings version. + * @member {string} version + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.version = ""; + + /** + * ClientLibrarySettings launchStage. + * @member {google.api.LaunchStage} launchStage + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.launchStage = 0; + + /** + * ClientLibrarySettings restNumericEnums. + * @member {boolean} restNumericEnums + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.restNumericEnums = false; + + /** + * ClientLibrarySettings javaSettings. + * @member {google.api.IJavaSettings|null|undefined} javaSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.javaSettings = null; + + /** + * ClientLibrarySettings cppSettings. + * @member {google.api.ICppSettings|null|undefined} cppSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.cppSettings = null; + + /** + * ClientLibrarySettings phpSettings. + * @member {google.api.IPhpSettings|null|undefined} phpSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.phpSettings = null; + + /** + * ClientLibrarySettings pythonSettings. + * @member {google.api.IPythonSettings|null|undefined} pythonSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.pythonSettings = null; + + /** + * ClientLibrarySettings nodeSettings. + * @member {google.api.INodeSettings|null|undefined} nodeSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.nodeSettings = null; + + /** + * ClientLibrarySettings dotnetSettings. + * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.dotnetSettings = null; + + /** + * ClientLibrarySettings rubySettings. + * @member {google.api.IRubySettings|null|undefined} rubySettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.rubySettings = null; + + /** + * ClientLibrarySettings goSettings. + * @member {google.api.IGoSettings|null|undefined} goSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.goSettings = null; + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @function create + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance + */ + ClientLibrarySettings.create = function create(properties) { + return new ClientLibrarySettings(properties); + }; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage); + if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums); + if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) + $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) + $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) + $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) + $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) + $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) + $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) + $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) + $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ClientLibrarySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.version = reader.string(); + break; + } + case 2: { + message.launchStage = reader.int32(); + break; + } + case 3: { + message.restNumericEnums = reader.bool(); + break; + } + case 21: { + message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32()); + break; + } + case 22: { + message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32()); + break; + } + case 23: { + message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32()); + break; + } + case 24: { + message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32()); + break; + } + case 25: { + message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32()); + break; + } + case 26: { + message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32()); + break; + } + case 27: { + message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32()); + break; + } + case 28: { + message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientLibrarySettings message. + * @function verify + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientLibrarySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + switch (message.launchStage) { + default: + return "launchStage: enum value expected"; + case 0: + case 6: + case 7: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + if (typeof message.restNumericEnums !== "boolean") + return "restNumericEnums: boolean expected"; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) { + var error = $root.google.api.JavaSettings.verify(message.javaSettings); + if (error) + return "javaSettings." + error; + } + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) { + var error = $root.google.api.CppSettings.verify(message.cppSettings); + if (error) + return "cppSettings." + error; + } + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) { + var error = $root.google.api.PhpSettings.verify(message.phpSettings); + if (error) + return "phpSettings." + error; + } + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) { + var error = $root.google.api.PythonSettings.verify(message.pythonSettings); + if (error) + return "pythonSettings." + error; + } + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) { + var error = $root.google.api.NodeSettings.verify(message.nodeSettings); + if (error) + return "nodeSettings." + error; + } + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) { + var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings); + if (error) + return "dotnetSettings." + error; + } + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) { + var error = $root.google.api.RubySettings.verify(message.rubySettings); + if (error) + return "rubySettings." + error; + } + if (message.goSettings != null && message.hasOwnProperty("goSettings")) { + var error = $root.google.api.GoSettings.verify(message.goSettings); + if (error) + return "goSettings." + error; + } + return null; + }; + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + */ + ClientLibrarySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ClientLibrarySettings) + return object; + var message = new $root.google.api.ClientLibrarySettings(); + if (object.version != null) + message.version = String(object.version); + switch (object.launchStage) { + default: + if (typeof object.launchStage === "number") { + message.launchStage = object.launchStage; + break; + } + break; + case "LAUNCH_STAGE_UNSPECIFIED": + case 0: + message.launchStage = 0; + break; + case "UNIMPLEMENTED": + case 6: + message.launchStage = 6; + break; + case "PRELAUNCH": + case 7: + message.launchStage = 7; + break; + case "EARLY_ACCESS": + case 1: + message.launchStage = 1; + break; + case "ALPHA": + case 2: + message.launchStage = 2; + break; + case "BETA": + case 3: + message.launchStage = 3; + break; + case "GA": + case 4: + message.launchStage = 4; + break; + case "DEPRECATED": + case 5: + message.launchStage = 5; + break; + } + if (object.restNumericEnums != null) + message.restNumericEnums = Boolean(object.restNumericEnums); + if (object.javaSettings != null) { + if (typeof object.javaSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); + message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings); + } + if (object.cppSettings != null) { + if (typeof object.cppSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); + message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings); + } + if (object.phpSettings != null) { + if (typeof object.phpSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); + message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings); + } + if (object.pythonSettings != null) { + if (typeof object.pythonSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); + message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings); + } + if (object.nodeSettings != null) { + if (typeof object.nodeSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); + message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings); + } + if (object.dotnetSettings != null) { + if (typeof object.dotnetSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); + message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings); + } + if (object.rubySettings != null) { + if (typeof object.rubySettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); + message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings); + } + if (object.goSettings != null) { + if (typeof object.goSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); + message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings); + } + return message; + }; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientLibrarySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + object.restNumericEnums = false; + object.javaSettings = null; + object.cppSettings = null; + object.phpSettings = null; + object.pythonSettings = null; + object.nodeSettings = null; + object.dotnetSettings = null; + object.rubySettings = null; + object.goSettings = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + object.restNumericEnums = message.restNumericEnums; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) + object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options); + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) + object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options); + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) + object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options); + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) + object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options); + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) + object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options); + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) + object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options); + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) + object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options); + if (message.goSettings != null && message.hasOwnProperty("goSettings")) + object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options); + return object; + }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @function toJSON + * @memberof google.api.ClientLibrarySettings + * @instance + * @returns {Object.} JSON object + */ + ClientLibrarySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientLibrarySettings + * @function getTypeUrl + * @memberof google.api.ClientLibrarySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ClientLibrarySettings"; + }; + + return ClientLibrarySettings; + })(); + + api.Publishing = (function() { + + /** + * Properties of a Publishing. + * @memberof google.api + * @interface IPublishing + * @property {Array.|null} [methodSettings] Publishing methodSettings + * @property {string|null} [newIssueUri] Publishing newIssueUri + * @property {string|null} [documentationUri] Publishing documentationUri + * @property {string|null} [apiShortName] Publishing apiShortName + * @property {string|null} [githubLabel] Publishing githubLabel + * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams + * @property {string|null} [docTagPrefix] Publishing docTagPrefix + * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization + * @property {Array.|null} [librarySettings] Publishing librarySettings + * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri + * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri + */ + + /** + * Constructs a new Publishing. + * @memberof google.api + * @classdesc Represents a Publishing. + * @implements IPublishing + * @constructor + * @param {google.api.IPublishing=} [properties] Properties to set + */ + function Publishing(properties) { + this.methodSettings = []; + this.codeownerGithubTeams = []; + this.librarySettings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Publishing methodSettings. + * @member {Array.} methodSettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.methodSettings = $util.emptyArray; + + /** + * Publishing newIssueUri. + * @member {string} newIssueUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.newIssueUri = ""; + + /** + * Publishing documentationUri. + * @member {string} documentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.documentationUri = ""; + + /** + * Publishing apiShortName. + * @member {string} apiShortName + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.apiShortName = ""; + + /** + * Publishing githubLabel. + * @member {string} githubLabel + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.githubLabel = ""; + + /** + * Publishing codeownerGithubTeams. + * @member {Array.} codeownerGithubTeams + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.codeownerGithubTeams = $util.emptyArray; + + /** + * Publishing docTagPrefix. + * @member {string} docTagPrefix + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.docTagPrefix = ""; + + /** + * Publishing organization. + * @member {google.api.ClientLibraryOrganization} organization + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.organization = 0; + + /** + * Publishing librarySettings. + * @member {Array.} librarySettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.librarySettings = $util.emptyArray; + + /** + * Publishing protoReferenceDocumentationUri. + * @member {string} protoReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.protoReferenceDocumentationUri = ""; + + /** + * Publishing restReferenceDocumentationUri. + * @member {string} restReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.restReferenceDocumentationUri = ""; + + /** + * Creates a new Publishing instance using the specified properties. + * @function create + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing=} [properties] Properties to set + * @returns {google.api.Publishing} Publishing instance + */ + Publishing.create = function create(properties) { + return new Publishing(properties); + }; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encode + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.methodSettings != null && message.methodSettings.length) + for (var i = 0; i < message.methodSettings.length; ++i) + $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) + writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri); + if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) + writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri); + if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) + writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName); + if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) + writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel); + if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length) + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]); + if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) + writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization); + if (message.librarySettings != null && message.librarySettings.length) + for (var i = 0; i < message.librarySettings.length; ++i) + $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); + if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) + writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); + if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) + writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); + return writer; + }; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @function decode + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Publishing(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.methodSettings && message.methodSettings.length)) + message.methodSettings = []; + message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32())); + break; + } + case 101: { + message.newIssueUri = reader.string(); + break; + } + case 102: { + message.documentationUri = reader.string(); + break; + } + case 103: { + message.apiShortName = reader.string(); + break; + } + case 104: { + message.githubLabel = reader.string(); + break; + } + case 105: { + if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) + message.codeownerGithubTeams = []; + message.codeownerGithubTeams.push(reader.string()); + break; + } + case 106: { + message.docTagPrefix = reader.string(); + break; + } + case 107: { + message.organization = reader.int32(); + break; + } + case 109: { + if (!(message.librarySettings && message.librarySettings.length)) + message.librarySettings = []; + message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32())); + break; + } + case 110: { + message.protoReferenceDocumentationUri = reader.string(); + break; + } + case 111: { + message.restReferenceDocumentationUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Publishing message. + * @function verify + * @memberof google.api.Publishing + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Publishing.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.methodSettings != null && message.hasOwnProperty("methodSettings")) { + if (!Array.isArray(message.methodSettings)) + return "methodSettings: array expected"; + for (var i = 0; i < message.methodSettings.length; ++i) { + var error = $root.google.api.MethodSettings.verify(message.methodSettings[i]); + if (error) + return "methodSettings." + error; + } + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + if (!$util.isString(message.newIssueUri)) + return "newIssueUri: string expected"; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + if (!$util.isString(message.documentationUri)) + return "documentationUri: string expected"; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + if (!$util.isString(message.apiShortName)) + return "apiShortName: string expected"; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + if (!$util.isString(message.githubLabel)) + return "githubLabel: string expected"; + if (message.codeownerGithubTeams != null && message.hasOwnProperty("codeownerGithubTeams")) { + if (!Array.isArray(message.codeownerGithubTeams)) + return "codeownerGithubTeams: array expected"; + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + if (!$util.isString(message.codeownerGithubTeams[i])) + return "codeownerGithubTeams: string[] expected"; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + if (!$util.isString(message.docTagPrefix)) + return "docTagPrefix: string expected"; + if (message.organization != null && message.hasOwnProperty("organization")) + switch (message.organization) { + default: + return "organization: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { + if (!Array.isArray(message.librarySettings)) + return "librarySettings: array expected"; + for (var i = 0; i < message.librarySettings.length; ++i) { + var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i]); + if (error) + return "librarySettings." + error; + } + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + if (!$util.isString(message.protoReferenceDocumentationUri)) + return "protoReferenceDocumentationUri: string expected"; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + if (!$util.isString(message.restReferenceDocumentationUri)) + return "restReferenceDocumentationUri: string expected"; + return null; + }; + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Publishing + * @static + * @param {Object.} object Plain object + * @returns {google.api.Publishing} Publishing + */ + Publishing.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Publishing) + return object; + var message = new $root.google.api.Publishing(); + if (object.methodSettings) { + if (!Array.isArray(object.methodSettings)) + throw TypeError(".google.api.Publishing.methodSettings: array expected"); + message.methodSettings = []; + for (var i = 0; i < object.methodSettings.length; ++i) { + if (typeof object.methodSettings[i] !== "object") + throw TypeError(".google.api.Publishing.methodSettings: object expected"); + message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i]); + } + } + if (object.newIssueUri != null) + message.newIssueUri = String(object.newIssueUri); + if (object.documentationUri != null) + message.documentationUri = String(object.documentationUri); + if (object.apiShortName != null) + message.apiShortName = String(object.apiShortName); + if (object.githubLabel != null) + message.githubLabel = String(object.githubLabel); + if (object.codeownerGithubTeams) { + if (!Array.isArray(object.codeownerGithubTeams)) + throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); + message.codeownerGithubTeams = []; + for (var i = 0; i < object.codeownerGithubTeams.length; ++i) + message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); + } + if (object.docTagPrefix != null) + message.docTagPrefix = String(object.docTagPrefix); + switch (object.organization) { + default: + if (typeof object.organization === "number") { + message.organization = object.organization; + break; + } + break; + case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": + case 0: + message.organization = 0; + break; + case "CLOUD": + case 1: + message.organization = 1; + break; + case "ADS": + case 2: + message.organization = 2; + break; + case "PHOTOS": + case 3: + message.organization = 3; + break; + case "STREET_VIEW": + case 4: + message.organization = 4; + break; + case "SHOPPING": + case 5: + message.organization = 5; + break; + case "GEO": + case 6: + message.organization = 6; + break; + case "GENERATIVE_AI": + case 7: + message.organization = 7; + break; + } + if (object.librarySettings) { + if (!Array.isArray(object.librarySettings)) + throw TypeError(".google.api.Publishing.librarySettings: array expected"); + message.librarySettings = []; + for (var i = 0; i < object.librarySettings.length; ++i) { + if (typeof object.librarySettings[i] !== "object") + throw TypeError(".google.api.Publishing.librarySettings: object expected"); + message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]); + } + } + if (object.protoReferenceDocumentationUri != null) + message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); + if (object.restReferenceDocumentationUri != null) + message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); + return message; + }; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Publishing + * @static + * @param {google.api.Publishing} message Publishing + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Publishing.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.methodSettings = []; + object.codeownerGithubTeams = []; + object.librarySettings = []; + } + if (options.defaults) { + object.newIssueUri = ""; + object.documentationUri = ""; + object.apiShortName = ""; + object.githubLabel = ""; + object.docTagPrefix = ""; + object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; + object.protoReferenceDocumentationUri = ""; + object.restReferenceDocumentationUri = ""; + } + if (message.methodSettings && message.methodSettings.length) { + object.methodSettings = []; + for (var j = 0; j < message.methodSettings.length; ++j) + object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options); + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + object.newIssueUri = message.newIssueUri; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + object.documentationUri = message.documentationUri; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + object.apiShortName = message.apiShortName; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + object.githubLabel = message.githubLabel; + if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { + object.codeownerGithubTeams = []; + for (var j = 0; j < message.codeownerGithubTeams.length; ++j) + object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + object.docTagPrefix = message.docTagPrefix; + if (message.organization != null && message.hasOwnProperty("organization")) + object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; + if (message.librarySettings && message.librarySettings.length) { + object.librarySettings = []; + for (var j = 0; j < message.librarySettings.length; ++j) + object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; + return object; + }; + + /** + * Converts this Publishing to JSON. + * @function toJSON + * @memberof google.api.Publishing + * @instance + * @returns {Object.} JSON object + */ + Publishing.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Publishing + * @function getTypeUrl + * @memberof google.api.Publishing + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Publishing"; + }; + + return Publishing; + })(); + + api.JavaSettings = (function() { + + /** + * Properties of a JavaSettings. + * @memberof google.api + * @interface IJavaSettings + * @property {string|null} [libraryPackage] JavaSettings libraryPackage + * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames + * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common + */ + + /** + * Constructs a new JavaSettings. + * @memberof google.api + * @classdesc Represents a JavaSettings. + * @implements IJavaSettings + * @constructor + * @param {google.api.IJavaSettings=} [properties] Properties to set + */ + function JavaSettings(properties) { + this.serviceClassNames = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JavaSettings libraryPackage. + * @member {string} libraryPackage + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.libraryPackage = ""; + + /** + * JavaSettings serviceClassNames. + * @member {Object.} serviceClassNames + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.serviceClassNames = $util.emptyObject; + + /** + * JavaSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.common = null; + + /** + * Creates a new JavaSettings instance using the specified properties. + * @function create + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings=} [properties] Properties to set + * @returns {google.api.JavaSettings} JavaSettings instance + */ + JavaSettings.create = function create(properties) { + return new JavaSettings(properties); + }; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encode + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage); + if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) + for (var keys = Object.keys(message.serviceClassNames), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.serviceClassNames[keys[i]]).ldelim(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.JavaSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.libraryPackage = reader.string(); + break; + } + case 2: { + if (message.serviceClassNames === $util.emptyObject) + message.serviceClassNames = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.serviceClassNames[key] = value; + break; + } + case 3: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JavaSettings message. + * @function verify + * @memberof google.api.JavaSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JavaSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + if (!$util.isString(message.libraryPackage)) + return "libraryPackage: string expected"; + if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) { + if (!$util.isObject(message.serviceClassNames)) + return "serviceClassNames: object expected"; + var key = Object.keys(message.serviceClassNames); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.serviceClassNames[key[i]])) + return "serviceClassNames: string{k:string} expected"; + } + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.JavaSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.JavaSettings} JavaSettings + */ + JavaSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.JavaSettings) + return object; + var message = new $root.google.api.JavaSettings(); + if (object.libraryPackage != null) + message.libraryPackage = String(object.libraryPackage); + if (object.serviceClassNames) { + if (typeof object.serviceClassNames !== "object") + throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); + message.serviceClassNames = {}; + for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) + message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); + } + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.JavaSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.JavaSettings + * @static + * @param {google.api.JavaSettings} message JavaSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JavaSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.serviceClassNames = {}; + if (options.defaults) { + object.libraryPackage = ""; + object.common = null; + } + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + object.libraryPackage = message.libraryPackage; + var keys2; + if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { + object.serviceClassNames = {}; + for (var j = 0; j < keys2.length; ++j) + object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; + } + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this JavaSettings to JSON. + * @function toJSON + * @memberof google.api.JavaSettings + * @instance + * @returns {Object.} JSON object + */ + JavaSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JavaSettings + * @function getTypeUrl + * @memberof google.api.JavaSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.JavaSettings"; + }; + + return JavaSettings; + })(); + + api.CppSettings = (function() { + + /** + * Properties of a CppSettings. + * @memberof google.api + * @interface ICppSettings + * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common + */ + + /** + * Constructs a new CppSettings. + * @memberof google.api + * @classdesc Represents a CppSettings. + * @implements ICppSettings + * @constructor + * @param {google.api.ICppSettings=} [properties] Properties to set + */ + function CppSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CppSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.CppSettings + * @instance + */ + CppSettings.prototype.common = null; + + /** + * Creates a new CppSettings instance using the specified properties. + * @function create + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings=} [properties] Properties to set + * @returns {google.api.CppSettings} CppSettings instance + */ + CppSettings.create = function create(properties) { + return new CppSettings(properties); + }; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CppSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CppSettings message. + * @function verify + * @memberof google.api.CppSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CppSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CppSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CppSettings} CppSettings + */ + CppSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CppSettings) + return object; + var message = new $root.google.api.CppSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.CppSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CppSettings + * @static + * @param {google.api.CppSettings} message CppSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CppSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this CppSettings to JSON. + * @function toJSON + * @memberof google.api.CppSettings + * @instance + * @returns {Object.} JSON object + */ + CppSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CppSettings + * @function getTypeUrl + * @memberof google.api.CppSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CppSettings"; + }; + + return CppSettings; + })(); + + api.PhpSettings = (function() { + + /** + * Properties of a PhpSettings. + * @memberof google.api + * @interface IPhpSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common + */ + + /** + * Constructs a new PhpSettings. + * @memberof google.api + * @classdesc Represents a PhpSettings. + * @implements IPhpSettings + * @constructor + * @param {google.api.IPhpSettings=} [properties] Properties to set + */ + function PhpSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PhpSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PhpSettings + * @instance + */ + PhpSettings.prototype.common = null; + + /** + * Creates a new PhpSettings instance using the specified properties. + * @function create + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings=} [properties] Properties to set + * @returns {google.api.PhpSettings} PhpSettings instance + */ + PhpSettings.create = function create(properties) { + return new PhpSettings(properties); + }; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PhpSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PhpSettings message. + * @function verify + * @memberof google.api.PhpSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PhpSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PhpSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PhpSettings} PhpSettings + */ + PhpSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PhpSettings) + return object; + var message = new $root.google.api.PhpSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PhpSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PhpSettings + * @static + * @param {google.api.PhpSettings} message PhpSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PhpSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PhpSettings to JSON. + * @function toJSON + * @memberof google.api.PhpSettings + * @instance + * @returns {Object.} JSON object + */ + PhpSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PhpSettings + * @function getTypeUrl + * @memberof google.api.PhpSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PhpSettings"; + }; + + return PhpSettings; + })(); + + api.PythonSettings = (function() { + + /** + * Properties of a PythonSettings. + * @memberof google.api + * @interface IPythonSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common + */ + + /** + * Constructs a new PythonSettings. + * @memberof google.api + * @classdesc Represents a PythonSettings. + * @implements IPythonSettings + * @constructor + * @param {google.api.IPythonSettings=} [properties] Properties to set + */ + function PythonSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PythonSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.common = null; + + /** + * Creates a new PythonSettings instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings=} [properties] Properties to set + * @returns {google.api.PythonSettings} PythonSettings instance + */ + PythonSettings.create = function create(properties) { + return new PythonSettings(properties); + }; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PythonSettings message. + * @function verify + * @memberof google.api.PythonSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PythonSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings} PythonSettings + */ + PythonSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PythonSettings) + return object; + var message = new $root.google.api.PythonSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PythonSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings + * @static + * @param {google.api.PythonSettings} message PythonSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PythonSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PythonSettings to JSON. + * @function toJSON + * @memberof google.api.PythonSettings + * @instance + * @returns {Object.} JSON object + */ + PythonSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PythonSettings + * @function getTypeUrl + * @memberof google.api.PythonSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings"; + }; + + return PythonSettings; + })(); + + api.NodeSettings = (function() { + + /** + * Properties of a NodeSettings. + * @memberof google.api + * @interface INodeSettings + * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common + */ + + /** + * Constructs a new NodeSettings. + * @memberof google.api + * @classdesc Represents a NodeSettings. + * @implements INodeSettings + * @constructor + * @param {google.api.INodeSettings=} [properties] Properties to set + */ + function NodeSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.NodeSettings + * @instance + */ + NodeSettings.prototype.common = null; + + /** + * Creates a new NodeSettings instance using the specified properties. + * @function create + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings=} [properties] Properties to set + * @returns {google.api.NodeSettings} NodeSettings instance + */ + NodeSettings.create = function create(properties) { + return new NodeSettings(properties); + }; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encode + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.NodeSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeSettings message. + * @function verify + * @memberof google.api.NodeSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.NodeSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.NodeSettings} NodeSettings + */ + NodeSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.NodeSettings) + return object; + var message = new $root.google.api.NodeSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.NodeSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.NodeSettings + * @static + * @param {google.api.NodeSettings} message NodeSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this NodeSettings to JSON. + * @function toJSON + * @memberof google.api.NodeSettings + * @instance + * @returns {Object.} JSON object + */ + NodeSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeSettings + * @function getTypeUrl + * @memberof google.api.NodeSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.NodeSettings"; + }; + + return NodeSettings; + })(); + + api.DotnetSettings = (function() { + + /** + * Properties of a DotnetSettings. + * @memberof google.api + * @interface IDotnetSettings + * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common + * @property {Object.|null} [renamedServices] DotnetSettings renamedServices + * @property {Object.|null} [renamedResources] DotnetSettings renamedResources + * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources + * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases + * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures + */ + + /** + * Constructs a new DotnetSettings. + * @memberof google.api + * @classdesc Represents a DotnetSettings. + * @implements IDotnetSettings + * @constructor + * @param {google.api.IDotnetSettings=} [properties] Properties to set + */ + function DotnetSettings(properties) { + this.renamedServices = {}; + this.renamedResources = {}; + this.ignoredResources = []; + this.forcedNamespaceAliases = []; + this.handwrittenSignatures = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DotnetSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.common = null; + + /** + * DotnetSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedServices = $util.emptyObject; + + /** + * DotnetSettings renamedResources. + * @member {Object.} renamedResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedResources = $util.emptyObject; + + /** + * DotnetSettings ignoredResources. + * @member {Array.} ignoredResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.ignoredResources = $util.emptyArray; + + /** + * DotnetSettings forcedNamespaceAliases. + * @member {Array.} forcedNamespaceAliases + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; + + /** + * DotnetSettings handwrittenSignatures. + * @member {Array.} handwrittenSignatures + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @function create + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings=} [properties] Properties to set + * @returns {google.api.DotnetSettings} DotnetSettings instance + */ + DotnetSettings.create = function create(properties) { + return new DotnetSettings(properties); + }; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encode + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); + if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) + for (var keys = Object.keys(message.renamedResources), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedResources[keys[i]]).ldelim(); + if (message.ignoredResources != null && message.ignoredResources.length) + for (var i = 0; i < message.ignoredResources.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]); + if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length) + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]); + if (message.handwrittenSignatures != null && message.handwrittenSignatures.length) + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]); + return writer; + }; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedServices[key] = value; + break; + } + case 3: { + if (message.renamedResources === $util.emptyObject) + message.renamedResources = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedResources[key] = value; + break; + } + case 4: { + if (!(message.ignoredResources && message.ignoredResources.length)) + message.ignoredResources = []; + message.ignoredResources.push(reader.string()); + break; + } + case 5: { + if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length)) + message.forcedNamespaceAliases = []; + message.forcedNamespaceAliases.push(reader.string()); + break; + } + case 6: { + if (!(message.handwrittenSignatures && message.handwrittenSignatures.length)) + message.handwrittenSignatures = []; + message.handwrittenSignatures.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DotnetSettings message. + * @function verify + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DotnetSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } + if (message.renamedResources != null && message.hasOwnProperty("renamedResources")) { + if (!$util.isObject(message.renamedResources)) + return "renamedResources: object expected"; + var key = Object.keys(message.renamedResources); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedResources[key[i]])) + return "renamedResources: string{k:string} expected"; + } + if (message.ignoredResources != null && message.hasOwnProperty("ignoredResources")) { + if (!Array.isArray(message.ignoredResources)) + return "ignoredResources: array expected"; + for (var i = 0; i < message.ignoredResources.length; ++i) + if (!$util.isString(message.ignoredResources[i])) + return "ignoredResources: string[] expected"; + } + if (message.forcedNamespaceAliases != null && message.hasOwnProperty("forcedNamespaceAliases")) { + if (!Array.isArray(message.forcedNamespaceAliases)) + return "forcedNamespaceAliases: array expected"; + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + if (!$util.isString(message.forcedNamespaceAliases[i])) + return "forcedNamespaceAliases: string[] expected"; + } + if (message.handwrittenSignatures != null && message.hasOwnProperty("handwrittenSignatures")) { + if (!Array.isArray(message.handwrittenSignatures)) + return "handwrittenSignatures: array expected"; + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + if (!$util.isString(message.handwrittenSignatures[i])) + return "handwrittenSignatures: string[] expected"; + } + return null; + }; + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.DotnetSettings} DotnetSettings + */ + DotnetSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.DotnetSettings) + return object; + var message = new $root.google.api.DotnetSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.DotnetSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + if (object.renamedServices) { + if (typeof object.renamedServices !== "object") + throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } + if (object.renamedResources) { + if (typeof object.renamedResources !== "object") + throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); + message.renamedResources = {}; + for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) + message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]); + } + if (object.ignoredResources) { + if (!Array.isArray(object.ignoredResources)) + throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected"); + message.ignoredResources = []; + for (var i = 0; i < object.ignoredResources.length; ++i) + message.ignoredResources[i] = String(object.ignoredResources[i]); + } + if (object.forcedNamespaceAliases) { + if (!Array.isArray(object.forcedNamespaceAliases)) + throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected"); + message.forcedNamespaceAliases = []; + for (var i = 0; i < object.forcedNamespaceAliases.length; ++i) + message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]); + } + if (object.handwrittenSignatures) { + if (!Array.isArray(object.handwrittenSignatures)) + throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected"); + message.handwrittenSignatures = []; + for (var i = 0; i < object.handwrittenSignatures.length; ++i) + message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]); + } + return message; + }; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.DotnetSettings} message DotnetSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DotnetSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ignoredResources = []; + object.forcedNamespaceAliases = []; + object.handwrittenSignatures = []; + } + if (options.objects || options.defaults) { + object.renamedServices = {}; + object.renamedResources = {}; + } + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } + if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) { + object.renamedResources = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]]; + } + if (message.ignoredResources && message.ignoredResources.length) { + object.ignoredResources = []; + for (var j = 0; j < message.ignoredResources.length; ++j) + object.ignoredResources[j] = message.ignoredResources[j]; + } + if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) { + object.forcedNamespaceAliases = []; + for (var j = 0; j < message.forcedNamespaceAliases.length; ++j) + object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j]; + } + if (message.handwrittenSignatures && message.handwrittenSignatures.length) { + object.handwrittenSignatures = []; + for (var j = 0; j < message.handwrittenSignatures.length; ++j) + object.handwrittenSignatures[j] = message.handwrittenSignatures[j]; + } + return object; + }; + + /** + * Converts this DotnetSettings to JSON. + * @function toJSON + * @memberof google.api.DotnetSettings + * @instance + * @returns {Object.} JSON object + */ + DotnetSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DotnetSettings + * @function getTypeUrl + * @memberof google.api.DotnetSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.DotnetSettings"; + }; + + return DotnetSettings; + })(); + + api.RubySettings = (function() { + + /** + * Properties of a RubySettings. + * @memberof google.api + * @interface IRubySettings + * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common + */ + + /** + * Constructs a new RubySettings. + * @memberof google.api + * @classdesc Represents a RubySettings. + * @implements IRubySettings + * @constructor + * @param {google.api.IRubySettings=} [properties] Properties to set + */ + function RubySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RubySettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.RubySettings + * @instance + */ + RubySettings.prototype.common = null; + + /** + * Creates a new RubySettings instance using the specified properties. + * @function create + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings=} [properties] Properties to set + * @returns {google.api.RubySettings} RubySettings instance + */ + RubySettings.create = function create(properties) { + return new RubySettings(properties); + }; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encode + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RubySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RubySettings message. + * @function verify + * @memberof google.api.RubySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RubySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.RubySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.RubySettings} RubySettings + */ + RubySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.RubySettings) + return object; + var message = new $root.google.api.RubySettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.RubySettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.RubySettings + * @static + * @param {google.api.RubySettings} message RubySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RubySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this RubySettings to JSON. + * @function toJSON + * @memberof google.api.RubySettings + * @instance + * @returns {Object.} JSON object + */ + RubySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RubySettings + * @function getTypeUrl + * @memberof google.api.RubySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.RubySettings"; + }; + + return RubySettings; + })(); + + api.GoSettings = (function() { + + /** + * Properties of a GoSettings. + * @memberof google.api + * @interface IGoSettings + * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common + */ + + /** + * Constructs a new GoSettings. + * @memberof google.api + * @classdesc Represents a GoSettings. + * @implements IGoSettings + * @constructor + * @param {google.api.IGoSettings=} [properties] Properties to set + */ + function GoSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GoSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.common = null; + + /** + * Creates a new GoSettings instance using the specified properties. + * @function create + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings=} [properties] Properties to set + * @returns {google.api.GoSettings} GoSettings instance + */ + GoSettings.create = function create(properties) { + return new GoSettings(properties); + }; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encode + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoSettings message. + * @function verify + * @memberof google.api.GoSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.GoSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.GoSettings} GoSettings + */ + GoSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.GoSettings) + return object; + var message = new $root.google.api.GoSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.GoSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.GoSettings + * @static + * @param {google.api.GoSettings} message GoSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this GoSettings to JSON. + * @function toJSON + * @memberof google.api.GoSettings + * @instance + * @returns {Object.} JSON object + */ + GoSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoSettings + * @function getTypeUrl + * @memberof google.api.GoSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.GoSettings"; + }; + + return GoSettings; + })(); + + api.MethodSettings = (function() { + + /** + * Properties of a MethodSettings. + * @memberof google.api + * @interface IMethodSettings + * @property {string|null} [selector] MethodSettings selector + * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning + * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields + */ + + /** + * Constructs a new MethodSettings. + * @memberof google.api + * @classdesc Represents a MethodSettings. + * @implements IMethodSettings + * @constructor + * @param {google.api.IMethodSettings=} [properties] Properties to set + */ + function MethodSettings(properties) { + this.autoPopulatedFields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodSettings selector. + * @member {string} selector + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.selector = ""; + + /** + * MethodSettings longRunning. + * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.longRunning = null; + + /** + * MethodSettings autoPopulatedFields. + * @member {Array.} autoPopulatedFields + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.autoPopulatedFields = $util.emptyArray; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings=} [properties] Properties to set + * @returns {google.api.MethodSettings} MethodSettings instance + */ + MethodSettings.create = function create(properties) { + return new MethodSettings(properties); + }; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) + $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.autoPopulatedFields != null && message.autoPopulatedFields.length) + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]); + return writer; + }; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.autoPopulatedFields && message.autoPopulatedFields.length)) + message.autoPopulatedFields = []; + message.autoPopulatedFields.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodSettings message. + * @function verify + * @memberof google.api.MethodSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) { + var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning); + if (error) + return "longRunning." + error; + } + if (message.autoPopulatedFields != null && message.hasOwnProperty("autoPopulatedFields")) { + if (!Array.isArray(message.autoPopulatedFields)) + return "autoPopulatedFields: array expected"; + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + if (!$util.isString(message.autoPopulatedFields[i])) + return "autoPopulatedFields: string[] expected"; + } + return null; + }; + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings} MethodSettings + */ + MethodSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings) + return object; + var message = new $root.google.api.MethodSettings(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.longRunning != null) { + if (typeof object.longRunning !== "object") + throw TypeError(".google.api.MethodSettings.longRunning: object expected"); + message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning); + } + if (object.autoPopulatedFields) { + if (!Array.isArray(object.autoPopulatedFields)) + throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected"); + message.autoPopulatedFields = []; + for (var i = 0; i < object.autoPopulatedFields.length; ++i) + message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]); + } + return message; + }; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings + * @static + * @param {google.api.MethodSettings} message MethodSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.autoPopulatedFields = []; + if (options.defaults) { + object.selector = ""; + object.longRunning = null; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) + object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options); + if (message.autoPopulatedFields && message.autoPopulatedFields.length) { + object.autoPopulatedFields = []; + for (var j = 0; j < message.autoPopulatedFields.length; ++j) + object.autoPopulatedFields[j] = message.autoPopulatedFields[j]; + } + return object; + }; + + /** + * Converts this MethodSettings to JSON. + * @function toJSON + * @memberof google.api.MethodSettings + * @instance + * @returns {Object.} JSON object + */ + MethodSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodSettings + * @function getTypeUrl + * @memberof google.api.MethodSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings"; + }; + + MethodSettings.LongRunning = (function() { + + /** + * Properties of a LongRunning. + * @memberof google.api.MethodSettings + * @interface ILongRunning + * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay + * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier + * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay + * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout + */ + + /** + * Constructs a new LongRunning. + * @memberof google.api.MethodSettings + * @classdesc Represents a LongRunning. + * @implements ILongRunning + * @constructor + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + */ + function LongRunning(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LongRunning initialPollDelay. + * @member {google.protobuf.IDuration|null|undefined} initialPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.initialPollDelay = null; + + /** + * LongRunning pollDelayMultiplier. + * @member {number} pollDelayMultiplier + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.pollDelayMultiplier = 0; + + /** + * LongRunning maxPollDelay. + * @member {google.protobuf.IDuration|null|undefined} maxPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.maxPollDelay = null; + + /** + * LongRunning totalPollTimeout. + * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.totalPollTimeout = null; + + /** + * Creates a new LongRunning instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + * @returns {google.api.MethodSettings.LongRunning} LongRunning instance + */ + LongRunning.create = function create(properties) { + return new LongRunning(properties); + }; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) + $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier); + if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) + $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) + $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings.LongRunning(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.pollDelayMultiplier = reader.float(); + break; + } + case 3: { + message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LongRunning message. + * @function verify + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LongRunning.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.initialPollDelay); + if (error) + return "initialPollDelay." + error; + } + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + if (typeof message.pollDelayMultiplier !== "number") + return "pollDelayMultiplier: number expected"; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.maxPollDelay); + if (error) + return "maxPollDelay." + error; + } + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout); + if (error) + return "totalPollTimeout." + error; + } + return null; + }; + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings.LongRunning} LongRunning + */ + LongRunning.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings.LongRunning) + return object; + var message = new $root.google.api.MethodSettings.LongRunning(); + if (object.initialPollDelay != null) { + if (typeof object.initialPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); + message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay); + } + if (object.pollDelayMultiplier != null) + message.pollDelayMultiplier = Number(object.pollDelayMultiplier); + if (object.maxPollDelay != null) { + if (typeof object.maxPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); + message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay); + } + if (object.totalPollTimeout != null) { + if (typeof object.totalPollTimeout !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); + message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout); + } + return message; + }; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.LongRunning} message LongRunning + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LongRunning.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.initialPollDelay = null; + object.pollDelayMultiplier = 0; + object.maxPollDelay = null; + object.totalPollTimeout = null; + } + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) + object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options); + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) + object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options); + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) + object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options); + return object; + }; + + /** + * Converts this LongRunning to JSON. + * @function toJSON + * @memberof google.api.MethodSettings.LongRunning + * @instance + * @returns {Object.} JSON object + */ + LongRunning.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LongRunning + * @function getTypeUrl + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; + }; + + return LongRunning; + })(); + + return MethodSettings; + })(); + + /** + * ClientLibraryOrganization enum. + * @name google.api.ClientLibraryOrganization + * @enum {number} + * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value + * @property {number} CLOUD=1 CLOUD value + * @property {number} ADS=2 ADS value + * @property {number} PHOTOS=3 PHOTOS value + * @property {number} STREET_VIEW=4 STREET_VIEW value + * @property {number} SHOPPING=5 SHOPPING value + * @property {number} GEO=6 GEO value + * @property {number} GENERATIVE_AI=7 GENERATIVE_AI value + */ + api.ClientLibraryOrganization = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD"] = 1; + values[valuesById[2] = "ADS"] = 2; + values[valuesById[3] = "PHOTOS"] = 3; + values[valuesById[4] = "STREET_VIEW"] = 4; + values[valuesById[5] = "SHOPPING"] = 5; + values[valuesById[6] = "GEO"] = 6; + values[valuesById[7] = "GENERATIVE_AI"] = 7; + return values; + })(); + + /** + * ClientLibraryDestination enum. + * @name google.api.ClientLibraryDestination + * @enum {number} + * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value + * @property {number} GITHUB=10 GITHUB value + * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value + */ + api.ClientLibraryDestination = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0; + values[valuesById[10] = "GITHUB"] = 10; + values[valuesById[20] = "PACKAGE_MANAGER"] = 20; + return values; + })(); + + /** + * LaunchStage enum. + * @name google.api.LaunchStage + * @enum {number} + * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value + * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value + * @property {number} PRELAUNCH=7 PRELAUNCH value + * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value + * @property {number} ALPHA=2 ALPHA value + * @property {number} BETA=3 BETA value + * @property {number} GA=4 GA value + * @property {number} DEPRECATED=5 DEPRECATED value + */ + api.LaunchStage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; + values[valuesById[6] = "UNIMPLEMENTED"] = 6; + values[valuesById[7] = "PRELAUNCH"] = 7; + values[valuesById[1] = "EARLY_ACCESS"] = 1; + values[valuesById[2] = "ALPHA"] = 2; + values[valuesById[3] = "BETA"] = 3; + values[valuesById[4] = "GA"] = 4; + values[valuesById[5] = "DEPRECATED"] = 5; + return values; + })(); + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {number} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value + * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value + * @property {number} IDENTIFIER=8 IDENTIFIER value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + values[valuesById[6] = "UNORDERED_LIST"] = 6; + values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; + values[valuesById[8] = "IDENTIFIER"] = 8; + return values; + })(); + + api.ResourceDescriptor = (function() { + + /** + * Properties of a ResourceDescriptor. + * @memberof google.api + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular + * @property {Array.|null} [style] ResourceDescriptor style + */ + + /** + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor + * @constructor + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + */ + function ResourceDescriptor(properties) { + this.pattern = []; + this.style = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.type = ""; + + /** + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; + + /** + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; + + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; + + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; + + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; + + /** + * ResourceDescriptor style. + * @member {Array.} style + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.style = $util.emptyArray; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @function create + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + */ + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); + }; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.style != null && message.style.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.style.length; ++i) + writer.int32(message.style[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + } + case 3: { + message.nameField = reader.string(); + break; + } + case 4: { + message.history = reader.int32(); + break; + } + case 5: { + message.plural = reader.string(); + break; + } + case 6: { + message.singular = reader.string(); + break; + } + case 10: { + if (!(message.style && message.style.length)) + message.style = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.style.push(reader.int32()); + } else + message.style.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + if (message.style != null && message.hasOwnProperty("style")) { + if (!Array.isArray(message.style)) + return "style: array expected"; + for (var i = 0; i < message.style.length; ++i) + switch (message.style[i]) { + default: + return "style: enum value[] expected"; + case 0: + case 1: + break; + } + } + return null; + }; + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) + return object; + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + default: + if (typeof object.history === "number") { + message.history = object.history; + break; + } + break; + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + if (object.style) { + if (!Array.isArray(object.style)) + throw TypeError(".google.api.ResourceDescriptor.style: array expected"); + message.style = []; + for (var i = 0; i < object.style.length; ++i) + switch (object.style[i]) { + default: + if (typeof object.style[i] === "number") { + message.style[i] = object.style[i]; + break; + } + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pattern = []; + object.style = []; + } + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + if (message.style && message.style.length) { + object.style = []; + for (var j = 0; j < message.style.length; ++j) + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + } + return object; + }; + + /** + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + ResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceDescriptor + * @function getTypeUrl + * @memberof google.api.ResourceDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceDescriptor"; + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {number} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); + + /** + * Style enum. + * @name google.api.ResourceDescriptor.Style + * @enum {number} + * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value + * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value + */ + ResourceDescriptor.Style = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; + return values; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.childType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceReference message. + * @function verify + * @memberof google.api.ResourceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; + return null; + }; + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceReference} ResourceReference + */ + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) + return object; + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); + return message; + }; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceReference + * @static + * @param {google.api.ResourceReference} message ResourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.childType = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; + return object; + }; + + /** + * Converts this ResourceReference to JSON. + * @function toJSON + * @memberof google.api.ResourceReference + * @instance + * @returns {Object.} JSON object + */ + ResourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceReference + * @function getTypeUrl + * @memberof google.api.ResourceReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceReference"; + }; + + return ResourceReference; + })(); + + return api; + })(); + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorSet + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; + }; + + return FileDescriptorSet; + })(); + + /** + * Edition enum. + * @name google.protobuf.Edition + * @enum {number} + * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value + * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value + * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value + * @property {number} EDITION_2023=1000 EDITION_2023 value + * @property {number} EDITION_2024=1001 EDITION_2024 value + * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value + * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value + * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value + * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value + * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value + * @property {number} EDITION_MAX=2147483647 EDITION_MAX value + */ + protobuf.Edition = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EDITION_UNKNOWN"] = 0; + values[valuesById[998] = "EDITION_PROTO2"] = 998; + values[valuesById[999] = "EDITION_PROTO3"] = 999; + values[valuesById[1000] = "EDITION_2023"] = 1000; + values[valuesById[1001] = "EDITION_2024"] = 1001; + values[valuesById[1] = "EDITION_1_TEST_ONLY"] = 1; + values[valuesById[2] = "EDITION_2_TEST_ONLY"] = 2; + values[valuesById[99997] = "EDITION_99997_TEST_ONLY"] = 99997; + values[valuesById[99998] = "EDITION_99998_TEST_ONLY"] = 99998; + values[valuesById[99999] = "EDITION_99999_TEST_ONLY"] = 99999; + values[valuesById[2147483647] = "EDITION_MAX"] = 2147483647; + return values; + })(); + + protobuf.FileDescriptorProto = (function() { + + /** + * Properties of a FileDescriptorProto. + * @memberof google.protobuf + * @interface IFileDescriptorProto + * @property {string|null} [name] FileDescriptorProto name + * @property {string|null} ["package"] FileDescriptorProto package + * @property {Array.|null} [dependency] FileDescriptorProto dependency + * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency + * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [messageType] FileDescriptorProto messageType + * @property {Array.|null} [enumType] FileDescriptorProto enumType + * @property {Array.|null} [service] FileDescriptorProto service + * @property {Array.|null} [extension] FileDescriptorProto extension + * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options + * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo + * @property {string|null} [syntax] FileDescriptorProto syntax + * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition + */ + + /** + * Constructs a new FileDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto + * @constructor + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + */ + function FileDescriptorProto(properties) { + this.dependency = []; + this.publicDependency = []; + this.weakDependency = []; + this.messageType = []; + this.enumType = []; + this.service = []; + this.extension = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; + + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; + + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; + + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; + + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; + + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; + + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; + + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; + + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; + + /** + * FileDescriptorProto edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = 0; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message["package"] = reader.string(); + break; + } + case 3: { + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + } + case 10: { + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + } + case 11: { + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + } + case 4: { + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 8: { + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + } + case 12: { + message.syntax = reader.string(); + break; + } + case 14: { + message.edition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorProto message. + * @function verify + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message["package"] != null && message.hasOwnProperty("package")) + if (!$util.isString(message["package"])) + return "package: string expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + if (!Array.isArray(message.dependency)) + return "dependency: array expected"; + for (var i = 0; i < message.dependency.length; ++i) + if (!$util.isString(message.dependency[i])) + return "dependency: string[] expected"; + } + if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { + if (!Array.isArray(message.publicDependency)) + return "publicDependency: array expected"; + for (var i = 0; i < message.publicDependency.length; ++i) + if (!$util.isInteger(message.publicDependency[i])) + return "publicDependency: integer[] expected"; + } + if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { + if (!Array.isArray(message.weakDependency)) + return "weakDependency: array expected"; + for (var i = 0; i < message.weakDependency.length; ++i) + if (!$util.isInteger(message.weakDependency[i])) + return "weakDependency: integer[] expected"; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (!Array.isArray(message.messageType)) + return "messageType: array expected"; + for (var i = 0; i < message.messageType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); + if (error) + return "messageType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.service != null && message.hasOwnProperty("service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); + if (error) + return "service." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + */ + FileDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) + return object; + var message = new $root.google.protobuf.FileDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object["package"] != null) + message["package"] = String(object["package"]); + if (object.dependency) { + if (!Array.isArray(object.dependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); + message.dependency = []; + for (var i = 0; i < object.dependency.length; ++i) + message.dependency[i] = String(object.dependency[i]); + } + if (object.publicDependency) { + if (!Array.isArray(object.publicDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); + message.publicDependency = []; + for (var i = 0; i < object.publicDependency.length; ++i) + message.publicDependency[i] = object.publicDependency[i] | 0; + } + if (object.weakDependency) { + if (!Array.isArray(object.weakDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); + message.weakDependency = []; + for (var i = 0; i < object.weakDependency.length; ++i) + message.weakDependency[i] = object.weakDependency[i] | 0; + } + if (object.messageType) { + if (!Array.isArray(object.messageType)) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); + message.messageType = []; + for (var i = 0; i < object.messageType.length; ++i) { + if (typeof object.messageType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); + message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (typeof object.service[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); + message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options); + } + if (object.sourceCodeInfo != null) { + if (typeof object.sourceCodeInfo !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message["package"] != null && message.hasOwnProperty("package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = message.syntax; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + */ + + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; + + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; + + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; + + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; + + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; + + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; + + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; + + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescriptorProto message. + * @function verify + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.field != null && message.hasOwnProperty("field")) { + if (!Array.isArray(message.field)) + return "field: array expected"; + for (var i = 0; i < message.field.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); + if (error) + return "field." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.nestedType != null && message.hasOwnProperty("nestedType")) { + if (!Array.isArray(message.nestedType)) + return "nestedType: array expected"; + for (var i = 0; i < message.nestedType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); + if (error) + return "nestedType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { + if (!Array.isArray(message.extensionRange)) + return "extensionRange: array expected"; + for (var i = 0; i < message.extensionRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); + if (error) + return "extensionRange." + error; + } + } + if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { + if (!Array.isArray(message.oneofDecl)) + return "oneofDecl: array expected"; + for (var i = 0; i < message.oneofDecl.length; ++i) { + var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); + if (error) + return "oneofDecl." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MessageOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto} DescriptorProto + */ + DescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto) + return object; + var message = new $root.google.protobuf.DescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.field) { + if (!Array.isArray(object.field)) + throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); + message.field = []; + for (var i = 0; i < object.field.length; ++i) { + if (typeof object.field[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); + message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.nestedType) { + if (!Array.isArray(object.nestedType)) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); + message.nestedType = []; + for (var i = 0; i < object.nestedType.length; ++i) { + if (typeof object.nestedType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); + message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (typeof object.extensionRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (typeof object.oneofDecl[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto"; + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReservedRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + * @property {Array.|null} [declaration] ExtensionRangeOptions declaration + * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features + * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification + */ + + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + this.declaration = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ExtensionRangeOptions declaration. + * @member {Array.} declaration + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.declaration = $util.emptyArray; + + /** + * ExtensionRangeOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.features = null; + + /** + * ExtensionRangeOptions verification. + * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.verification = 1; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + */ + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.declaration != null && message.declaration.length) + for (var i = 0; i < message.declaration.length; ++i) + $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.declaration && message.declaration.length)) + message.declaration = []; + message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32())); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.verification = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message.declaration != null && message.hasOwnProperty("declaration")) { + if (!Array.isArray(message.declaration)) + return "declaration: array expected"; + for (var i = 0; i < message.declaration.length; ++i) { + var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i]); + if (error) + return "declaration." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.verification != null && message.hasOwnProperty("verification")) + switch (message.verification) { + default: + return "verification: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object.declaration) { + if (!Array.isArray(object.declaration)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); + message.declaration = []; + for (var i = 0; i < object.declaration.length; ++i) { + if (typeof object.declaration[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); + message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + switch (object.verification) { + case "DECLARATION": + case 0: + message.verification = 0; + break; + default: + if (typeof object.verification === "number") { + message.verification = object.verification; + break; + } + break; + case "UNVERIFIED": + case 1: + message.verification = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.declaration = []; + object.uninterpretedOption = []; + } + if (options.defaults) { + object.verification = options.enums === String ? "UNVERIFIED" : 1; + object.features = null; + } + if (message.declaration && message.declaration.length) { + object.declaration = []; + for (var j = 0; j < message.declaration.length; ++j) + object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); + } + if (message.verification != null && message.hasOwnProperty("verification")) + object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + * @returns {Object.} JSON object + */ + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; + }; + + ExtensionRangeOptions.Declaration = (function() { + + /** + * Properties of a Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @interface IDeclaration + * @property {number|null} [number] Declaration number + * @property {string|null} [fullName] Declaration fullName + * @property {string|null} [type] Declaration type + * @property {boolean|null} [reserved] Declaration reserved + * @property {boolean|null} [repeated] Declaration repeated + */ + + /** + * Constructs a new Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @classdesc Represents a Declaration. + * @implements IDeclaration + * @constructor + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + */ + function Declaration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Declaration number. + * @member {number} number + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.number = 0; + + /** + * Declaration fullName. + * @member {string} fullName + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.fullName = ""; + + /** + * Declaration type. + * @member {string} type + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.type = ""; + + /** + * Declaration reserved. + * @member {boolean} reserved + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.reserved = false; + + /** + * Declaration repeated. + * @member {boolean} repeated + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.repeated = false; + + /** + * Creates a new Declaration instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance + */ + Declaration.create = function create(properties) { + return new Declaration(properties); + }; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); + if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); + if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); + return writer; + }; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.number = reader.int32(); + break; + } + case 2: { + message.fullName = reader.string(); + break; + } + case 3: { + message.type = reader.string(); + break; + } + case 5: { + message.reserved = reader.bool(); + break; + } + case 6: { + message.repeated = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Declaration message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Declaration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.fullName != null && message.hasOwnProperty("fullName")) + if (!$util.isString(message.fullName)) + return "fullName: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.reserved != null && message.hasOwnProperty("reserved")) + if (typeof message.reserved !== "boolean") + return "reserved: boolean expected"; + if (message.repeated != null && message.hasOwnProperty("repeated")) + if (typeof message.repeated !== "boolean") + return "repeated: boolean expected"; + return null; + }; + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + */ + Declaration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + if (object.number != null) + message.number = object.number | 0; + if (object.fullName != null) + message.fullName = String(object.fullName); + if (object.type != null) + message.type = String(object.type); + if (object.reserved != null) + message.reserved = Boolean(object.reserved); + if (object.repeated != null) + message.repeated = Boolean(object.repeated); + return message; + }; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Declaration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.number = 0; + object.fullName = ""; + object.type = ""; + object.reserved = false; + object.repeated = false; + } + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.fullName != null && message.hasOwnProperty("fullName")) + object.fullName = message.fullName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.reserved != null && message.hasOwnProperty("reserved")) + object.reserved = message.reserved; + if (message.repeated != null && message.hasOwnProperty("repeated")) + object.repeated = message.repeated; + return object; + }; + + /** + * Converts this Declaration to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + * @returns {Object.} JSON object + */ + Declaration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Declaration + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"; + }; + + return Declaration; + })(); + + /** + * VerificationState enum. + * @name google.protobuf.ExtensionRangeOptions.VerificationState + * @enum {number} + * @property {number} DECLARATION=0 DECLARATION value + * @property {number} UNVERIFIED=1 UNVERIFIED value + */ + ExtensionRangeOptions.VerificationState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DECLARATION"] = 0; + values[valuesById[1] = "UNVERIFIED"] = 1; + return values; + })(); + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.number = reader.int32(); + break; + } + case 4: { + message.label = reader.int32(); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.typeName = reader.string(); + break; + } + case 2: { + message.extendee = reader.string(); + break; + } + case 7: { + message.defaultValue = reader.string(); + break; + } + case 9: { + message.oneofIndex = reader.int32(); + break; + } + case 10: { + message.jsonName = reader.string(); + break; + } + case 8: { + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + } + case 17: { + message.proto3Optional = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 3: + case 2: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + object.proto3Optional = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {number} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; + }; + + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + */ + + /** + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + */ + function EnumDescriptorProto(properties) { + this.value = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; + + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; + + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) { + var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); + if (error) + return "value." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + */ + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (typeof object.value[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); + message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumReservedRange message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumReservedRange + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.number = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); + if (error) + return "method." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (typeof object.method[i] !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.inputType = reader.string(); + break; + } + case 3: { + message.outputType = reader.string(); + break; + } + case 4: { + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.clientStreaming = reader.bool(); + break; + } + case 6: { + message.serverStreaming = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = message.inputType; + if (message.outputType != null && message.hasOwnProperty("outputType")) + object.outputType = message.outputType; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {google.protobuf.IFeatureSet|null} [features] FileOptions features + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.resourceDefinition"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = true; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.features = null; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.javaPackage = reader.string(); + break; + } + case 8: { + message.javaOuterClassname = reader.string(); + break; + } + case 10: { + message.javaMultipleFiles = reader.bool(); + break; + } + case 20: { + message.javaGenerateEqualsAndHash = reader.bool(); + break; + } + case 27: { + message.javaStringCheckUtf8 = reader.bool(); + break; + } + case 9: { + message.optimizeFor = reader.int32(); + break; + } + case 11: { + message.goPackage = reader.string(); + break; + } + case 16: { + message.ccGenericServices = reader.bool(); + break; + } + case 17: { + message.javaGenericServices = reader.bool(); + break; + } + case 18: { + message.pyGenericServices = reader.bool(); + break; + } + case 23: { + message.deprecated = reader.bool(); + break; + } + case 31: { + message.ccEnableArenas = reader.bool(); + break; + } + case 36: { + message.objcClassPrefix = reader.string(); + break; + } + case 37: { + message.csharpNamespace = reader.string(); + break; + } + case 39: { + message.swiftPrefix = reader.string(); + break; + } + case 40: { + message.phpClassPrefix = reader.string(); + break; + } + case 41: { + message.phpNamespace = reader.string(); + break; + } + case 44: { + message.phpMetadataNamespace = reader.string(); + break; + } + case 45: { + message.rubyPackage = reader.string(); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) + message[".google.api.resourceDefinition"] = []; + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { + if (!Array.isArray(message[".google.api.resourceDefinition"])) + return ".google.api.resourceDefinition: array expected"; + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); + if (error) + return ".google.api.resourceDefinition." + error; + } + } + return null; + }; + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + default: + if (typeof object.optimizeFor === "number") { + message.optimizeFor = object.optimizeFor; + break; + } + break; + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.ccEnableArenas != null) + message.ccEnableArenas = Boolean(object.ccEnableArenas); + if (object.objcClassPrefix != null) + message.objcClassPrefix = String(object.objcClassPrefix); + if (object.csharpNamespace != null) + message.csharpNamespace = String(object.csharpNamespace); + if (object.swiftPrefix != null) + message.swiftPrefix = String(object.swiftPrefix); + if (object.phpClassPrefix != null) + message.phpClassPrefix = String(object.phpClassPrefix); + if (object.phpNamespace != null) + message.phpNamespace = String(object.phpNamespace); + if (object.phpMetadataNamespace != null) + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + if (object.rubyPackage != null) + message.rubyPackage = String(object.rubyPackage); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FileOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resourceDefinition"]) { + if (!Array.isArray(object[".google.api.resourceDefinition"])) + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); + message[".google.api.resourceDefinition"] = []; + for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { + if (typeof object[".google.api.resourceDefinition"][i] !== "object") + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); + message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + object.features = null; + } + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { + object[".google.api.resourceDefinition"] = []; + for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} JSON object + */ + FileOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileOptions + * @function getTypeUrl + * @memberof google.protobuf.FileOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileOptions"; + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {number} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { + + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * MessageOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.features = null; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.messageSetWireFormat = reader.bool(); + break; + } + case 2: { + message.noStandardDescriptorAccessor = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 7: { + message.mapEntry = reader.bool(); + break; + } + case 11: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 12: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); + if (error) + return ".google.api.resource." + error; + } + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MessageOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resource"] != null) { + if (typeof object[".google.api.resource"] !== "object") + throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); + } + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + object[".google.api.resource"] = null; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); + return object; + }; + + /** + * Converts this MessageOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MessageOptions + * @instance + * @returns {Object.} JSON object + */ + MessageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessageOptions + * @function getTypeUrl + * @memberof google.protobuf.MessageOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MessageOptions"; + }; + + return MessageOptions; + })(); + + protobuf.FieldOptions = (function() { + + /** + * Properties of a FieldOptions. + * @memberof google.protobuf + * @interface IFieldOptions + * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype + * @property {boolean|null} [packed] FieldOptions packed + * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype + * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {boolean|null} [debugRedact] FieldOptions debugRedact + * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention + * @property {Array.|null} [targets] FieldOptions targets + * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults + * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + */ + + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.targets = []; + this.editionDefaults = []; + this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; + + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; + + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; + + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; + + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; + + /** + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; + + /** + * FieldOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.debugRedact = false; + + /** + * FieldOptions retention. + * @member {google.protobuf.FieldOptions.OptionRetention} retention + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.retention = 0; + + /** + * FieldOptions targets. + * @member {Array.} targets + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.targets = $util.emptyArray; + + /** + * FieldOptions editionDefaults. + * @member {Array.} editionDefaults + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.editionDefaults = $util.emptyArray; + + /** + * FieldOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.features = null; + + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact); + if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention); + if (message.targets != null && message.targets.length) + for (var i = 0; i < message.targets.length; ++i) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]); + if (message.editionDefaults != null && message.editionDefaults.length) + for (var i = 0; i < message.editionDefaults.length; ++i) + $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.ctype = reader.int32(); + break; + } + case 2: { + message.packed = reader.bool(); + break; + } + case 6: { + message.jstype = reader.int32(); + break; + } + case 5: { + message.lazy = reader.bool(); + break; + } + case 15: { + message.unverifiedLazy = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 10: { + message.weak = reader.bool(); + break; + } + case 16: { + message.debugRedact = reader.bool(); + break; + } + case 17: { + message.retention = reader.int32(); + break; + } + case 19: { + if (!(message.targets && message.targets.length)) + message.targets = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.targets.push(reader.int32()); + } else + message.targets.push(reader.int32()); + break; + } + case 20: { + if (!(message.editionDefaults && message.editionDefaults.length)) + message.editionDefaults = []; + message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32())); + break; + } + case 21: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + if (typeof message.unverifiedLazy !== "boolean") + return "unverifiedLazy: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.retention != null && message.hasOwnProperty("retention")) + switch (message.retention) { + default: + return "retention: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.targets != null && message.hasOwnProperty("targets")) { + if (!Array.isArray(message.targets)) + return "targets: array expected"; + for (var i = 0; i < message.targets.length; ++i) + switch (message.targets[i]) { + default: + return "targets: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + } + if (message.editionDefaults != null && message.hasOwnProperty("editionDefaults")) { + if (!Array.isArray(message.editionDefaults)) + return "editionDefaults: array expected"; + for (var i = 0; i < message.editionDefaults.length; ++i) { + var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i]); + if (error) + return "editionDefaults." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + default: + if (typeof object.ctype === "number") { + message.ctype = object.ctype; + break; + } + break; + case "STRING": + case 0: + message.ctype = 0; + break; + case "CORD": + case 1: + message.ctype = 1; + break; + case "STRING_PIECE": + case 2: + message.ctype = 2; + break; + } + if (object.packed != null) + message.packed = Boolean(object.packed); + switch (object.jstype) { + default: + if (typeof object.jstype === "number") { + message.jstype = object.jstype; + break; + } + break; + case "JS_NORMAL": + case 0: + message.jstype = 0; + break; + case "JS_STRING": + case 1: + message.jstype = 1; + break; + case "JS_NUMBER": + case 2: + message.jstype = 2; + break; + } + if (object.lazy != null) + message.lazy = Boolean(object.lazy); + if (object.unverifiedLazy != null) + message.unverifiedLazy = Boolean(object.unverifiedLazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + switch (object.retention) { + default: + if (typeof object.retention === "number") { + message.retention = object.retention; + break; + } + break; + case "RETENTION_UNKNOWN": + case 0: + message.retention = 0; + break; + case "RETENTION_RUNTIME": + case 1: + message.retention = 1; + break; + case "RETENTION_SOURCE": + case 2: + message.retention = 2; + break; + } + if (object.targets) { + if (!Array.isArray(object.targets)) + throw TypeError(".google.protobuf.FieldOptions.targets: array expected"); + message.targets = []; + for (var i = 0; i < object.targets.length; ++i) + switch (object.targets[i]) { + default: + if (typeof object.targets[i] === "number") { + message.targets[i] = object.targets[i]; + break; + } + case "TARGET_TYPE_UNKNOWN": + case 0: + message.targets[i] = 0; + break; + case "TARGET_TYPE_FILE": + case 1: + message.targets[i] = 1; + break; + case "TARGET_TYPE_EXTENSION_RANGE": + case 2: + message.targets[i] = 2; + break; + case "TARGET_TYPE_MESSAGE": + case 3: + message.targets[i] = 3; + break; + case "TARGET_TYPE_FIELD": + case 4: + message.targets[i] = 4; + break; + case "TARGET_TYPE_ONEOF": + case 5: + message.targets[i] = 5; + break; + case "TARGET_TYPE_ENUM": + case 6: + message.targets[i] = 6; + break; + case "TARGET_TYPE_ENUM_ENTRY": + case 7: + message.targets[i] = 7; + break; + case "TARGET_TYPE_SERVICE": + case 8: + message.targets[i] = 8; + break; + case "TARGET_TYPE_METHOD": + case 9: + message.targets[i] = 9; + break; + } + } + if (object.editionDefaults) { + if (!Array.isArray(object.editionDefaults)) + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected"); + message.editionDefaults = []; + for (var i = 0; i < object.editionDefaults.length; ++i) { + if (typeof object.editionDefaults[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); + message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FieldOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; + case "IDENTIFIER": + case 8: + message[".google.api.fieldBehavior"][i] = 8; + break; + } + } + if (object[".google.api.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + } + return message; + }; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.targets = []; + object.editionDefaults = []; + object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } + if (options.defaults) { + object.ctype = options.enums === String ? "STRING" : 0; + object.packed = false; + object.deprecated = false; + object.lazy = false; + object.jstype = options.enums === String ? "JS_NORMAL" : 0; + object.weak = false; + object.unverifiedLazy = false; + object.debugRedact = false; + object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; + object.features = null; + object[".google.api.resourceReference"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + if (message.packed != null && message.hasOwnProperty("packed")) + object.packed = message.packed; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.lazy != null && message.hasOwnProperty("lazy")) + object.lazy = message.lazy; + if (message.jstype != null && message.hasOwnProperty("jstype")) + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + object.unverifiedLazy = message.unverifiedLazy; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.retention != null && message.hasOwnProperty("retention")) + object.retention = options.enums === String ? $root.google.protobuf.FieldOptions.OptionRetention[message.retention] === undefined ? message.retention : $root.google.protobuf.FieldOptions.OptionRetention[message.retention] : message.retention; + if (message.targets && message.targets.length) { + object.targets = []; + for (var j = 0; j < message.targets.length; ++j) + object.targets[j] = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] === undefined ? message.targets[j] : $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] : message.targets[j]; + } + if (message.editionDefaults && message.editionDefaults.length) { + object.editionDefaults = []; + for (var j = 0; j < message.editionDefaults.length; ++j) + object.editionDefaults[j] = $root.google.protobuf.FieldOptions.EditionDefault.toObject(message.editionDefaults[j], options); + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { + object[".google.api.fieldBehavior"] = []; + for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldOptions + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions"; + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + /** + * OptionRetention enum. + * @name google.protobuf.FieldOptions.OptionRetention + * @enum {number} + * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value + * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value + * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value + */ + FieldOptions.OptionRetention = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; + values[valuesById[1] = "RETENTION_RUNTIME"] = 1; + values[valuesById[2] = "RETENTION_SOURCE"] = 2; + return values; + })(); + + /** + * OptionTargetType enum. + * @name google.protobuf.FieldOptions.OptionTargetType + * @enum {number} + * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value + * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value + * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value + * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value + * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value + * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value + * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value + * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value + * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value + * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value + */ + FieldOptions.OptionTargetType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; + values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; + values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; + values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; + values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; + values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; + values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; + values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; + values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; + return values; + })(); + + FieldOptions.EditionDefault = (function() { + + /** + * Properties of an EditionDefault. + * @memberof google.protobuf.FieldOptions + * @interface IEditionDefault + * @property {google.protobuf.Edition|null} [edition] EditionDefault edition + * @property {string|null} [value] EditionDefault value + */ + + /** + * Constructs a new EditionDefault. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents an EditionDefault. + * @implements IEditionDefault + * @constructor + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + */ + function EditionDefault(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.edition = 0; + + /** + * EditionDefault value. + * @member {string} value + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.value = ""; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance + */ + EditionDefault.create = function create(properties) { + return new EditionDefault(properties); + }; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EditionDefault message. + * @function verify + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + */ + EditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) + return object; + var message = new $root.google.protobuf.FieldOptions.EditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this EditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + * @returns {Object.} JSON object + */ + EditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; + }; + + return EditionDefault; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.features = null; + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + var message = new $root.google.protobuf.OneofOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.OneofOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.features = null; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofOptions + * @function getTypeUrl + * @memberof google.protobuf.OneofOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofOptions"; + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * EnumOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.features = null; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.allowAlias = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 6: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 7: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumOptions"; + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features + * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.features = null; + + /** + * EnumValueOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.debugRedact = false; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.deprecated = reader.bool(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.debugRedact = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object.debugRedact = false; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.features = null; + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * ServiceOptions .google.api.apiVersion. + * @member {string} .google.api.apiVersion + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.apiVersion"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) + writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 34: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + case 525000001: { + message[".google.api.apiVersion"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + if (!$util.isString(message[".google.api.apiVersion"])) + return ".google.api.apiVersion: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + if (object[".google.api.apiVersion"] != null) + message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + object[".google.api.apiVersion"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {google.protobuf.IFeatureSet|null} [features] MethodOptions features + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo + */ + + /** + * Constructs a new MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions + * @constructor + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + */ + function MethodOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.features = null; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + + /** + * MethodOptions .google.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.longrunning.operationInfo"] = null; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance + */ + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) + $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 35: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + } + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } + case 1049: { + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { + var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); + if (error) + return ".google.longrunning.operationInfo." + error; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodOptions} MethodOptions + */ + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) + return object; + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MethodOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } + if (object[".google.longrunning.operationInfo"] != null) { + if (typeof object[".google.longrunning.operationInfo"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object.features = null; + object[".google.longrunning.operationInfo"] = null; + object[".google.api.http"] = null; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodOptions + * @function getTypeUrl + * @memberof google.protobuf.MethodOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + } + case 3: { + message.identifierValue = reader.string(); + break; + } + case 4: { + message.positiveIntValue = reader.uint64(); + break; + } + case 5: { + message.negativeIntValue = reader.int64(); + break; + } + case 6: { + message.doubleValue = reader.double(); + break; + } + case 7: { + message.stringValue = reader.bytes(); + break; + } + case 8: { + message.aggregateValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length >= 0) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.FeatureSet = (function() { + + /** + * Properties of a FeatureSet. + * @memberof google.protobuf + * @interface IFeatureSet + * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence + * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType + * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding + * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation + * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding + * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat + */ + + /** + * Constructs a new FeatureSet. + * @memberof google.protobuf + * @classdesc Represents a FeatureSet. + * @implements IFeatureSet + * @constructor + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + */ + function FeatureSet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSet fieldPresence. + * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.fieldPresence = 0; + + /** + * FeatureSet enumType. + * @member {google.protobuf.FeatureSet.EnumType} enumType + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enumType = 0; + + /** + * FeatureSet repeatedFieldEncoding. + * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.repeatedFieldEncoding = 0; + + /** + * FeatureSet utf8Validation. + * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.utf8Validation = 0; + + /** + * FeatureSet messageEncoding. + * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.messageEncoding = 0; + + /** + * FeatureSet jsonFormat. + * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.jsonFormat = 0; + + /** + * Creates a new FeatureSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet} FeatureSet instance + */ + FeatureSet.create = function create(properties) { + return new FeatureSet(properties); + }; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); + if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); + if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); + if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); + if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); + if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); + return writer; + }; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.fieldPresence = reader.int32(); + break; + } + case 2: { + message.enumType = reader.int32(); + break; + } + case 3: { + message.repeatedFieldEncoding = reader.int32(); + break; + } + case 4: { + message.utf8Validation = reader.int32(); + break; + } + case 5: { + message.messageEncoding = reader.int32(); + break; + } + case 6: { + message.jsonFormat = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSet message. + * @function verify + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + switch (message.fieldPresence) { + default: + return "fieldPresence: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.enumType != null && message.hasOwnProperty("enumType")) + switch (message.enumType) { + default: + return "enumType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + switch (message.repeatedFieldEncoding) { + default: + return "repeatedFieldEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + switch (message.utf8Validation) { + default: + return "utf8Validation: enum value expected"; + case 0: + case 2: + case 3: + break; + } + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + switch (message.messageEncoding) { + default: + return "messageEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + switch (message.jsonFormat) { + default: + return "jsonFormat: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet} FeatureSet + */ + FeatureSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSet) + return object; + var message = new $root.google.protobuf.FeatureSet(); + switch (object.fieldPresence) { + default: + if (typeof object.fieldPresence === "number") { + message.fieldPresence = object.fieldPresence; + break; + } + break; + case "FIELD_PRESENCE_UNKNOWN": + case 0: + message.fieldPresence = 0; + break; + case "EXPLICIT": + case 1: + message.fieldPresence = 1; + break; + case "IMPLICIT": + case 2: + message.fieldPresence = 2; + break; + case "LEGACY_REQUIRED": + case 3: + message.fieldPresence = 3; + break; + } + switch (object.enumType) { + default: + if (typeof object.enumType === "number") { + message.enumType = object.enumType; + break; + } + break; + case "ENUM_TYPE_UNKNOWN": + case 0: + message.enumType = 0; + break; + case "OPEN": + case 1: + message.enumType = 1; + break; + case "CLOSED": + case 2: + message.enumType = 2; + break; + } + switch (object.repeatedFieldEncoding) { + default: + if (typeof object.repeatedFieldEncoding === "number") { + message.repeatedFieldEncoding = object.repeatedFieldEncoding; + break; + } + break; + case "REPEATED_FIELD_ENCODING_UNKNOWN": + case 0: + message.repeatedFieldEncoding = 0; + break; + case "PACKED": + case 1: + message.repeatedFieldEncoding = 1; + break; + case "EXPANDED": + case 2: + message.repeatedFieldEncoding = 2; + break; + } + switch (object.utf8Validation) { + default: + if (typeof object.utf8Validation === "number") { + message.utf8Validation = object.utf8Validation; + break; + } + break; + case "UTF8_VALIDATION_UNKNOWN": + case 0: + message.utf8Validation = 0; + break; + case "VERIFY": + case 2: + message.utf8Validation = 2; + break; + case "NONE": + case 3: + message.utf8Validation = 3; + break; + } + switch (object.messageEncoding) { + default: + if (typeof object.messageEncoding === "number") { + message.messageEncoding = object.messageEncoding; + break; + } + break; + case "MESSAGE_ENCODING_UNKNOWN": + case 0: + message.messageEncoding = 0; + break; + case "LENGTH_PREFIXED": + case 1: + message.messageEncoding = 1; + break; + case "DELIMITED": + case 2: + message.messageEncoding = 2; + break; + } + switch (object.jsonFormat) { + default: + if (typeof object.jsonFormat === "number") { + message.jsonFormat = object.jsonFormat; + break; + } + break; + case "JSON_FORMAT_UNKNOWN": + case 0: + message.jsonFormat = 0; + break; + case "ALLOW": + case 1: + message.jsonFormat = 1; + break; + case "LEGACY_BEST_EFFORT": + case 2: + message.jsonFormat = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.FeatureSet} message FeatureSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; + object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; + object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; + object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; + object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; + object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; + } + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; + if (message.enumType != null && message.hasOwnProperty("enumType")) + object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType; + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding; + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation; + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; + return object; + }; + + /** + * Converts this FeatureSet to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet + * @instance + * @returns {Object.} JSON object + */ + FeatureSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSet + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet"; + }; + + /** + * FieldPresence enum. + * @name google.protobuf.FeatureSet.FieldPresence + * @enum {number} + * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value + * @property {number} EXPLICIT=1 EXPLICIT value + * @property {number} IMPLICIT=2 IMPLICIT value + * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value + */ + FeatureSet.FieldPresence = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; + values[valuesById[1] = "EXPLICIT"] = 1; + values[valuesById[2] = "IMPLICIT"] = 2; + values[valuesById[3] = "LEGACY_REQUIRED"] = 3; + return values; + })(); + + /** + * EnumType enum. + * @name google.protobuf.FeatureSet.EnumType + * @enum {number} + * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value + * @property {number} OPEN=1 OPEN value + * @property {number} CLOSED=2 CLOSED value + */ + FeatureSet.EnumType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "OPEN"] = 1; + values[valuesById[2] = "CLOSED"] = 2; + return values; + })(); + + /** + * RepeatedFieldEncoding enum. + * @name google.protobuf.FeatureSet.RepeatedFieldEncoding + * @enum {number} + * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value + * @property {number} PACKED=1 PACKED value + * @property {number} EXPANDED=2 EXPANDED value + */ + FeatureSet.RepeatedFieldEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "PACKED"] = 1; + values[valuesById[2] = "EXPANDED"] = 2; + return values; + })(); + + /** + * Utf8Validation enum. + * @name google.protobuf.FeatureSet.Utf8Validation + * @enum {number} + * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value + * @property {number} VERIFY=2 VERIFY value + * @property {number} NONE=3 NONE value + */ + FeatureSet.Utf8Validation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; + values[valuesById[2] = "VERIFY"] = 2; + values[valuesById[3] = "NONE"] = 3; + return values; + })(); + + /** + * MessageEncoding enum. + * @name google.protobuf.FeatureSet.MessageEncoding + * @enum {number} + * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value + * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value + * @property {number} DELIMITED=2 DELIMITED value + */ + FeatureSet.MessageEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "LENGTH_PREFIXED"] = 1; + values[valuesById[2] = "DELIMITED"] = 2; + return values; + })(); + + /** + * JsonFormat enum. + * @name google.protobuf.FeatureSet.JsonFormat + * @enum {number} + * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value + * @property {number} ALLOW=1 ALLOW value + * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value + */ + FeatureSet.JsonFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; + values[valuesById[1] = "ALLOW"] = 1; + values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; + return values; + })(); + + return FeatureSet; + })(); + + protobuf.FeatureSetDefaults = (function() { + + /** + * Properties of a FeatureSetDefaults. + * @memberof google.protobuf + * @interface IFeatureSetDefaults + * @property {Array.|null} [defaults] FeatureSetDefaults defaults + * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition + * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition + */ + + /** + * Constructs a new FeatureSetDefaults. + * @memberof google.protobuf + * @classdesc Represents a FeatureSetDefaults. + * @implements IFeatureSetDefaults + * @constructor + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + */ + function FeatureSetDefaults(properties) { + this.defaults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSetDefaults defaults. + * @member {Array.} defaults + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.defaults = $util.emptyArray; + + /** + * FeatureSetDefaults minimumEdition. + * @member {google.protobuf.Edition} minimumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.minimumEdition = 0; + + /** + * FeatureSetDefaults maximumEdition. + * @member {google.protobuf.Edition} maximumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.maximumEdition = 0; + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance + */ + FeatureSetDefaults.create = function create(properties) { + return new FeatureSetDefaults(properties); + }; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.defaults != null && message.defaults.length) + for (var i = 0; i < message.defaults.length; ++i) + $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); + if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); + return writer; + }; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.defaults && message.defaults.length)) + message.defaults = []; + message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32())); + break; + } + case 4: { + message.minimumEdition = reader.int32(); + break; + } + case 5: { + message.maximumEdition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetDefaults message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetDefaults.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.defaults != null && message.hasOwnProperty("defaults")) { + if (!Array.isArray(message.defaults)) + return "defaults: array expected"; + for (var i = 0; i < message.defaults.length; ++i) { + var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i]); + if (error) + return "defaults." + error; + } + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + switch (message.minimumEdition) { + default: + return "minimumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + switch (message.maximumEdition) { + default: + return "maximumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + */ + FeatureSetDefaults.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults(); + if (object.defaults) { + if (!Array.isArray(object.defaults)) + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected"); + message.defaults = []; + for (var i = 0; i < object.defaults.length; ++i) { + if (typeof object.defaults[i] !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected"); + message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i]); + } + } + switch (object.minimumEdition) { + default: + if (typeof object.minimumEdition === "number") { + message.minimumEdition = object.minimumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.minimumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.minimumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.minimumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.minimumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.minimumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.minimumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.minimumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.minimumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.minimumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.minimumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.minimumEdition = 2147483647; + break; + } + switch (object.maximumEdition) { + default: + if (typeof object.maximumEdition === "number") { + message.maximumEdition = object.maximumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.maximumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.maximumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.maximumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.maximumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.maximumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.maximumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.maximumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.maximumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.maximumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.maximumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.maximumEdition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetDefaults.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.defaults = []; + if (options.defaults) { + object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.defaults && message.defaults.length) { + object.defaults = []; + for (var j = 0; j < message.defaults.length; ++j) + object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options); + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; + return object; + }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults + * @instance + * @returns {Object.} JSON object + */ + FeatureSetDefaults.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetDefaults + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; + }; + + FeatureSetDefaults.FeatureSetEditionDefault = (function() { + + /** + * Properties of a FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @interface IFeatureSetEditionDefault + * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition + * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features + */ + + /** + * Constructs a new FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @classdesc Represents a FeatureSetEditionDefault. + * @implements IFeatureSetEditionDefault + * @constructor + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + */ + function FeatureSetEditionDefault(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSetEditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.edition = 0; + + /** + * FeatureSetEditionDefault features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.features = null; + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance + */ + FeatureSetEditionDefault.create = function create(properties) { + return new FeatureSetEditionDefault(properties); + }; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetEditionDefault message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetEditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + return null; + }; + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + */ + FeatureSetEditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetEditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.features = null; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + * @returns {Object.} JSON object + */ + FeatureSetEditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; + }; + + return FeatureSetEditionDefault; + })(); + + return FeatureSetDefaults; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + } + case 3: { + message.leadingComments = reader.string(); + break; + } + case 4: { + message.trailingComments = reader.string(); + break; + } + case 6: { + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + message.sourceFile = reader.string(); + break; + } + case 3: { + message.begin = reader.int32(); + break; + } + case 4: { + message.end = reader.int32(); + break; + } + case 5: { + message.semantic = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.semantic != null && message.hasOwnProperty("semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) + return object; + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof google.protobuf.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Duration"; + }; + + return Duration; + })(); + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + + return Any; + })(); + + protobuf.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + + return Empty; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.protobuf.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Timestamp"; + }; + + return Timestamp; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] DoubleValue value + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Represents a DoubleValue. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + */ + function DoubleValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DoubleValue value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.value); + return writer; + }; + + /** + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DoubleValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DoubleValue message. + * @function verify + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DoubleValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DoubleValue} DoubleValue + */ + DoubleValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DoubleValue) + return object; + var message = new $root.google.protobuf.DoubleValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.DoubleValue} message DoubleValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DoubleValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this DoubleValue to JSON. + * @function toJSON + * @memberof google.protobuf.DoubleValue + * @instance + * @returns {Object.} JSON object + */ + DoubleValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] FloatValue value + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Represents a FloatValue. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + */ + function FloatValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FloatValue value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.value); + return writer; + }; + + /** + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FloatValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FloatValue message. + * @function verify + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FloatValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FloatValue} FloatValue + */ + FloatValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FloatValue) + return object; + var message = new $root.google.protobuf.FloatValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a FloatValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.FloatValue} message FloatValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FloatValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this FloatValue to JSON. + * @function toJSON + * @memberof google.protobuf.FloatValue + * @instance + * @returns {Object.} JSON object + */ + FloatValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {number|Long|null} [value] Int64Value value + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Represents an Int64Value. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + */ + function Int64Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Int64Value value. + * @member {number|Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.value); + return writer; + }; + + /** + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int64Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int64Value message. + * @function verify + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int64Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + return null; + }; + + /** + * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int64Value} Int64Value + */ + Int64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int64Value) + return object; + var message = new $root.google.protobuf.Int64Value(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = false; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.Int64Value} message Int64Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int64Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value; + return object; + }; + + /** + * Converts this Int64Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int64Value + * @instance + * @returns {Object.} JSON object + */ + Int64Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {number|Long|null} [value] UInt64Value value + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Represents a UInt64Value. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + */ + function UInt64Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UInt64Value value. + * @member {number|Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.value); + return writer; + }; + + /** + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt64Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.uint64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UInt64Value message. + * @function verify + * @memberof google.protobuf.UInt64Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UInt64Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + return null; + }; + + /** + * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UInt64Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UInt64Value} UInt64Value + */ + UInt64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt64Value) + return object; + var message = new $root.google.protobuf.UInt64Value(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = true; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.UInt64Value} message UInt64Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UInt64Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber(true) : message.value; + return object; + }; + + /** + * Converts this UInt64Value to JSON. + * @function toJSON + * @memberof google.protobuf.UInt64Value + * @instance + * @returns {Object.} JSON object + */ + UInt64Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] Int32Value value + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Represents an Int32Value. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + */ + function Int32Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Int32Value value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.value); + return writer; + }; + + /** + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int32Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int32Value message. + * @function verify + * @memberof google.protobuf.Int32Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int32Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; + return null; + }; + + /** + * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int32Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int32Value} Int32Value + */ + Int32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int32Value) + return object; + var message = new $root.google.protobuf.Int32Value(); + if (object.value != null) + message.value = object.value | 0; + return message; + }; + + /** + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.Int32Value} message Int32Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int32Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this Int32Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int32Value + * @instance + * @returns {Object.} JSON object + */ + Int32Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] UInt32Value value + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Represents a UInt32Value. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + */ + function UInt32Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UInt32Value value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.value); + return writer; + }; + + /** + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt32Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.uint32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UInt32Value message. + * @function verify + * @memberof google.protobuf.UInt32Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UInt32Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; + return null; + }; + + /** + * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UInt32Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UInt32Value} UInt32Value + */ + UInt32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt32Value) + return object; + var message = new $root.google.protobuf.UInt32Value(); + if (object.value != null) + message.value = object.value >>> 0; + return message; + }; + + /** + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.UInt32Value} message UInt32Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UInt32Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this UInt32Value to JSON. + * @function toJSON + * @memberof google.protobuf.UInt32Value + * @instance + * @returns {Object.} JSON object + */ + UInt32Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] BoolValue value + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Represents a BoolValue. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + */ + function BoolValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BoolValue value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.value); + return writer; + }; + + /** + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BoolValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoolValue message. + * @function verify + * @memberof google.protobuf.BoolValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoolValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "boolean") + return "value: boolean expected"; + return null; + }; + + /** + * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.BoolValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.BoolValue} BoolValue + */ + BoolValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BoolValue) + return object; + var message = new $root.google.protobuf.BoolValue(); + if (object.value != null) + message.value = Boolean(object.value); + return message; + }; + + /** + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.BoolValue} message BoolValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoolValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = false; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this BoolValue to JSON. + * @function toJSON + * @memberof google.protobuf.BoolValue + * @instance + * @returns {Object.} JSON object + */ + BoolValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] StringValue value + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Represents a StringValue. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [properties] Properties to set + */ + function StringValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StringValue value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + return writer; + }; + + /** + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.StringValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StringValue message. + * @function verify + * @memberof google.protobuf.StringValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StringValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates a StringValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.StringValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.StringValue} StringValue + */ + StringValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.StringValue) + return object; + var message = new $root.google.protobuf.StringValue(); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.StringValue} message StringValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StringValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = ""; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this StringValue to JSON. + * @function toJSON + * @memberof google.protobuf.StringValue + * @instance + * @returns {Object.} JSON object + */ + StringValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] BytesValue value + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Represents a BytesValue. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + */ + function BytesValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BytesValue value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BytesValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BytesValue message. + * @function verify + * @memberof google.protobuf.BytesValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BytesValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.BytesValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.BytesValue} BytesValue + */ + BytesValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BytesValue) + return object; + var message = new $root.google.protobuf.BytesValue(); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from a BytesValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.BytesValue} message BytesValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BytesValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this BytesValue to JSON. + * @function toJSON + * @memberof google.protobuf.BytesValue + * @instance + * @returns {Object.} JSON object + */ + BytesValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.FieldMask = (function() { + + /** + * Properties of a FieldMask. + * @memberof google.protobuf + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths + */ + + /** + * Constructs a new FieldMask. + * @memberof google.protobuf + * @classdesc Represents a FieldMask. + * @implements IFieldMask + * @constructor + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + */ + function FieldMask(properties) { + this.paths = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask + * @instance + */ + FieldMask.prototype.paths = $util.emptyArray; + + /** + * Creates a new FieldMask instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance + */ + FieldMask.create = function create(properties) { + return new FieldMask(properties); + }; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); + return writer; + }; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldMask message. + * @function verify + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldMask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } + return null; + }; + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldMask} FieldMask + */ + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) + return object; + var message = new $root.google.protobuf.FieldMask(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.protobuf.FieldMask.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + return message; + }; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.FieldMask} message FieldMask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldMask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + return object; + }; + + /** + * Converts this FieldMask to JSON. + * @function toJSON + * @memberof google.protobuf.FieldMask + * @instance + * @returns {Object.} JSON object + */ + FieldMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldMask + * @function getTypeUrl + * @memberof google.protobuf.FieldMask + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldMask"; + }; + + return FieldMask; + })(); + + return protobuf; + })(); + + google.longrunning = (function() { + + /** + * Namespace longrunning. + * @memberof google + * @namespace + */ + var longrunning = {}; + + longrunning.Operations = (function() { + + /** + * Constructs a new Operations service. + * @memberof google.longrunning + * @classdesc Represents an Operations + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Operations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; + + /** + * Creates new Operations service using the specified rpc implementation. + * @function create + * @memberof google.longrunning.Operations + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Operations} RPC service. Useful where requests and/or responses are streamed. + */ + Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @memberof google.longrunning.Operations + * @typedef ListOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse + */ + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { + return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); + }, "name", { value: "ListOperations" }); + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @memberof google.longrunning.Operations + * @typedef GetOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { + return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "GetOperation" }); + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @memberof google.longrunning.Operations + * @typedef DeleteOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { + return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteOperation" }); + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @memberof google.longrunning.Operations + * @typedef CancelOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { + return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "CancelOperation" }); + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @memberof google.longrunning.Operations + * @typedef WaitOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { + return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "WaitOperation" }); + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Operations; + })(); + + longrunning.Operation = (function() { + + /** + * Properties of an Operation. + * @memberof google.longrunning + * @interface IOperation + * @property {string|null} [name] Operation name + * @property {google.protobuf.IAny|null} [metadata] Operation metadata + * @property {boolean|null} [done] Operation done + * @property {google.rpc.IStatus|null} [error] Operation error + * @property {google.protobuf.IAny|null} [response] Operation response + */ + + /** + * Constructs a new Operation. + * @memberof google.longrunning + * @classdesc Represents an Operation. + * @implements IOperation + * @constructor + * @param {google.longrunning.IOperation=} [properties] Properties to set + */ + function Operation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Operation name. + * @member {string} name + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.name = ""; + + /** + * Operation metadata. + * @member {google.protobuf.IAny|null|undefined} metadata + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.metadata = null; + + /** + * Operation done. + * @member {boolean} done + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.done = false; + + /** + * Operation error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.error = null; + + /** + * Operation response. + * @member {google.protobuf.IAny|null|undefined} response + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Operation result. + * @member {"error"|"response"|undefined} result + * @memberof google.longrunning.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["error", "response"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Operation instance using the specified properties. + * @function create + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation=} [properties] Properties to set + * @returns {google.longrunning.Operation} Operation instance + */ + Operation.create = function create(properties) { + return new Operation(properties); + }; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encode + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.done != null && Object.hasOwnProperty.call(message, "done")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + case 3: { + message.done = reader.bool(); + break; + } + case 4: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 5: { + message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Operation message. + * @function verify + * @memberof google.longrunning.Operation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Operation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Any.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.done != null && message.hasOwnProperty("done")) + if (typeof message.done !== "boolean") + return "done: boolean expected"; + if (message.error != null && message.hasOwnProperty("error")) { + properties.result = 1; + { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.response != null && message.hasOwnProperty("response")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.protobuf.Any.verify(message.response); + if (error) + return "response." + error; + } + } + return null; + }; + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.Operation + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.Operation} Operation + */ + Operation.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.Operation) + return object; + var message = new $root.google.longrunning.Operation(); + if (object.name != null) + message.name = String(object.name); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.longrunning.Operation.metadata: object expected"); + message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); + } + if (object.done != null) + message.done = Boolean(object.done); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.longrunning.Operation.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.longrunning.Operation.response: object expected"); + message.response = $root.google.protobuf.Any.fromObject(object.response); + } + return message; + }; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.Operation} message Operation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Operation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.metadata = null; + object.done = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); + if (message.done != null && message.hasOwnProperty("done")) + object.done = message.done; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; + } + if (message.response != null && message.hasOwnProperty("response")) { + object.response = $root.google.protobuf.Any.toObject(message.response, options); + if (options.oneofs) + object.result = "response"; + } + return object; + }; + + /** + * Converts this Operation to JSON. + * @function toJSON + * @memberof google.longrunning.Operation + * @instance + * @returns {Object.} JSON object + */ + Operation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Operation + * @function getTypeUrl + * @memberof google.longrunning.Operation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.Operation"; + }; + + return Operation; + })(); + + longrunning.GetOperationRequest = (function() { + + /** + * Properties of a GetOperationRequest. + * @memberof google.longrunning + * @interface IGetOperationRequest + * @property {string|null} [name] GetOperationRequest name + */ + + /** + * Constructs a new GetOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a GetOperationRequest. + * @implements IGetOperationRequest + * @constructor + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + */ + function GetOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetOperationRequest name. + * @member {string} name + * @memberof google.longrunning.GetOperationRequest + * @instance + */ + GetOperationRequest.prototype.name = ""; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance + */ + GetOperationRequest.create = function create(properties) { + return new GetOperationRequest(properties); + }; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOperationRequest message. + * @function verify + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + */ + GetOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.GetOperationRequest) + return object; + var message = new $root.google.longrunning.GetOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.GetOperationRequest} message GetOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.GetOperationRequest + * @instance + * @returns {Object.} JSON object + */ + GetOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; + }; + + return GetOperationRequest; + })(); + + longrunning.ListOperationsRequest = (function() { + + /** + * Properties of a ListOperationsRequest. + * @memberof google.longrunning + * @interface IListOperationsRequest + * @property {string|null} [name] ListOperationsRequest name + * @property {string|null} [filter] ListOperationsRequest filter + * @property {number|null} [pageSize] ListOperationsRequest pageSize + * @property {string|null} [pageToken] ListOperationsRequest pageToken + */ + + /** + * Constructs a new ListOperationsRequest. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsRequest. + * @implements IListOperationsRequest + * @constructor + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + */ + function ListOperationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsRequest name. + * @member {string} name + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.name = ""; + + /** + * ListOperationsRequest filter. + * @member {string} filter + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.filter = ""; + + /** + * ListOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageSize = 0; + + /** + * ListOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance + */ + ListOperationsRequest.create = function create(properties) { + return new ListOperationsRequest(properties); + }; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + return writer; + }; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 4: { + message.name = reader.string(); + break; + } + case 1: { + message.filter = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsRequest message. + * @function verify + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + */ + ListOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsRequest) + return object; + var message = new $root.google.longrunning.ListOperationsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.name = ""; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this ListOperationsRequest to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsRequest + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; + }; + + return ListOperationsRequest; + })(); + + longrunning.ListOperationsResponse = (function() { + + /** + * Properties of a ListOperationsResponse. + * @memberof google.longrunning + * @interface IListOperationsResponse + * @property {Array.|null} [operations] ListOperationsResponse operations + * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken + */ + + /** + * Constructs a new ListOperationsResponse. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsResponse. + * @implements IListOperationsResponse + * @constructor + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + */ + function ListOperationsResponse(properties) { + this.operations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsResponse operations. + * @member {Array.} operations + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.operations = $util.emptyArray; + + /** + * ListOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance + */ + ListOperationsResponse.create = function create(properties) { + return new ListOperationsResponse(properties); + }; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsResponse message. + * @function verify + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + */ + ListOperationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsResponse) + return object; + var message = new $root.google.longrunning.ListOperationsResponse(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); + message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListOperationsResponse to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListOperationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsResponse + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; + }; + + return ListOperationsResponse; + })(); + + longrunning.CancelOperationRequest = (function() { + + /** + * Properties of a CancelOperationRequest. + * @memberof google.longrunning + * @interface ICancelOperationRequest + * @property {string|null} [name] CancelOperationRequest name + */ + + /** + * Constructs a new CancelOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a CancelOperationRequest. + * @implements ICancelOperationRequest + * @constructor + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + */ + function CancelOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CancelOperationRequest name. + * @member {string} name + * @memberof google.longrunning.CancelOperationRequest + * @instance + */ + CancelOperationRequest.prototype.name = ""; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance + */ + CancelOperationRequest.create = function create(properties) { + return new CancelOperationRequest(properties); + }; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelOperationRequest message. + * @function verify + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + */ + CancelOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.CancelOperationRequest) + return object; + var message = new $root.google.longrunning.CancelOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this CancelOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.CancelOperationRequest + * @instance + * @returns {Object.} JSON object + */ + CancelOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; + }; + + return CancelOperationRequest; + })(); + + longrunning.DeleteOperationRequest = (function() { + + /** + * Properties of a DeleteOperationRequest. + * @memberof google.longrunning + * @interface IDeleteOperationRequest + * @property {string|null} [name] DeleteOperationRequest name + */ + + /** + * Constructs a new DeleteOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a DeleteOperationRequest. + * @implements IDeleteOperationRequest + * @constructor + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + */ + function DeleteOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteOperationRequest name. + * @member {string} name + * @memberof google.longrunning.DeleteOperationRequest + * @instance + */ + DeleteOperationRequest.prototype.name = ""; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance + */ + DeleteOperationRequest.create = function create(properties) { + return new DeleteOperationRequest(properties); + }; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteOperationRequest message. + * @function verify + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + */ + DeleteOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.DeleteOperationRequest) + return object; + var message = new $root.google.longrunning.DeleteOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.DeleteOperationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; + }; + + return DeleteOperationRequest; + })(); + + longrunning.WaitOperationRequest = (function() { + + /** + * Properties of a WaitOperationRequest. + * @memberof google.longrunning + * @interface IWaitOperationRequest + * @property {string|null} [name] WaitOperationRequest name + * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout + */ + + /** + * Constructs a new WaitOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a WaitOperationRequest. + * @implements IWaitOperationRequest + * @constructor + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + */ + function WaitOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WaitOperationRequest name. + * @member {string} name + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.name = ""; + + /** + * WaitOperationRequest timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.timeout = null; + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance + */ + WaitOperationRequest.create = function create(properties) { + return new WaitOperationRequest(properties); + }; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitOperationRequest message. + * @function verify + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + return null; + }; + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + */ + WaitOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.WaitOperationRequest) + return object; + var message = new $root.google.longrunning.WaitOperationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + return message; + }; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.timeout = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + return object; + }; + + /** + * Converts this WaitOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.WaitOperationRequest + * @instance + * @returns {Object.} JSON object + */ + WaitOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WaitOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; + }; + + return WaitOperationRequest; + })(); + + longrunning.OperationInfo = (function() { + + /** + * Properties of an OperationInfo. + * @memberof google.longrunning + * @interface IOperationInfo + * @property {string|null} [responseType] OperationInfo responseType + * @property {string|null} [metadataType] OperationInfo metadataType + */ + + /** + * Constructs a new OperationInfo. + * @memberof google.longrunning + * @classdesc Represents an OperationInfo. + * @implements IOperationInfo + * @constructor + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + */ + function OperationInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationInfo responseType. + * @member {string} responseType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.responseType = ""; + + /** + * OperationInfo metadataType. + * @member {string} metadataType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.metadataType = ""; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @function create + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + * @returns {google.longrunning.OperationInfo} OperationInfo instance + */ + OperationInfo.create = function create(properties) { + return new OperationInfo(properties); + }; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encode + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); + if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); + return writer; + }; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.responseType = reader.string(); + break; + } + case 2: { + message.metadataType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationInfo message. + * @function verify + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responseType != null && message.hasOwnProperty("responseType")) + if (!$util.isString(message.responseType)) + return "responseType: string expected"; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + if (!$util.isString(message.metadataType)) + return "metadataType: string expected"; + return null; + }; + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.OperationInfo} OperationInfo + */ + OperationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.OperationInfo) + return object; + var message = new $root.google.longrunning.OperationInfo(); + if (object.responseType != null) + message.responseType = String(object.responseType); + if (object.metadataType != null) + message.metadataType = String(object.metadataType); + return message; + }; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.OperationInfo} message OperationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.responseType = ""; + object.metadataType = ""; + } + if (message.responseType != null && message.hasOwnProperty("responseType")) + object.responseType = message.responseType; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + object.metadataType = message.metadataType; + return object; + }; + + /** + * Converts this OperationInfo to JSON. + * @function toJSON + * @memberof google.longrunning.OperationInfo + * @instance + * @returns {Object.} JSON object + */ + OperationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationInfo + * @function getTypeUrl + * @memberof google.longrunning.OperationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.OperationInfo"; + }; + + return OperationInfo; + })(); + + return longrunning; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + + return Status; + })(); + + return rpc; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/protos/protos.json b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/protos/protos.json new file mode 100644 index 00000000000..4ef5e6cc248 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/protos/protos.json @@ -0,0 +1,3393 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "speech": { + "nested": { + "v1": { + "options": { + "cc_enable_arenas": true, + "go_package": "cloud.google.com/go/speech/apiv1/speechpb;speechpb", + "java_multiple_files": true, + "java_outer_classname": "SpeechAdaptationProto", + "java_package": "com.google.cloud.speech.v1", + "objc_class_prefix": "GCS" + }, + "nested": { + "Speech": { + "options": { + "(google.api.default_host)": "speech.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "Recognize": { + "requestType": "RecognizeRequest", + "responseType": "RecognizeResponse", + "options": { + "(google.api.http).post": "/v1/speech:recognize", + "(google.api.http).body": "*", + "(google.api.method_signature)": "config,audio" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/speech:recognize", + "body": "*" + } + }, + { + "(google.api.method_signature)": "config,audio" + } + ] + }, + "LongRunningRecognize": { + "requestType": "LongRunningRecognizeRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/speech:longrunningrecognize", + "(google.api.http).body": "*", + "(google.api.method_signature)": "config,audio", + "(google.longrunning.operation_info).response_type": "LongRunningRecognizeResponse", + "(google.longrunning.operation_info).metadata_type": "LongRunningRecognizeMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/speech:longrunningrecognize", + "body": "*" + } + }, + { + "(google.api.method_signature)": "config,audio" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "LongRunningRecognizeResponse", + "metadata_type": "LongRunningRecognizeMetadata" + } + } + ] + }, + "StreamingRecognize": { + "requestType": "StreamingRecognizeRequest", + "requestStream": true, + "responseType": "StreamingRecognizeResponse", + "responseStream": true + } + } + }, + "RecognizeRequest": { + "fields": { + "config": { + "type": "RecognitionConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "audio": { + "type": "RecognitionAudio", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "LongRunningRecognizeRequest": { + "fields": { + "config": { + "type": "RecognitionConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "audio": { + "type": "RecognitionAudio", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "outputConfig": { + "type": "TranscriptOutputConfig", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "TranscriptOutputConfig": { + "oneofs": { + "outputType": { + "oneof": [ + "gcsUri" + ] + } + }, + "fields": { + "gcsUri": { + "type": "string", + "id": 1 + } + } + }, + "StreamingRecognizeRequest": { + "oneofs": { + "streamingRequest": { + "oneof": [ + "streamingConfig", + "audioContent" + ] + } + }, + "fields": { + "streamingConfig": { + "type": "StreamingRecognitionConfig", + "id": 1 + }, + "audioContent": { + "type": "bytes", + "id": 2 + } + } + }, + "StreamingRecognitionConfig": { + "fields": { + "config": { + "type": "RecognitionConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "singleUtterance": { + "type": "bool", + "id": 2 + }, + "interimResults": { + "type": "bool", + "id": 3 + }, + "enableVoiceActivityEvents": { + "type": "bool", + "id": 5 + }, + "voiceActivityTimeout": { + "type": "VoiceActivityTimeout", + "id": 6 + } + }, + "nested": { + "VoiceActivityTimeout": { + "fields": { + "speechStartTimeout": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "speechEndTimeout": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + } + } + }, + "RecognitionConfig": { + "fields": { + "encoding": { + "type": "AudioEncoding", + "id": 1 + }, + "sampleRateHertz": { + "type": "int32", + "id": 2 + }, + "audioChannelCount": { + "type": "int32", + "id": 7 + }, + "enableSeparateRecognitionPerChannel": { + "type": "bool", + "id": 12 + }, + "languageCode": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "alternativeLanguageCodes": { + "rule": "repeated", + "type": "string", + "id": 18 + }, + "maxAlternatives": { + "type": "int32", + "id": 4 + }, + "profanityFilter": { + "type": "bool", + "id": 5 + }, + "adaptation": { + "type": "SpeechAdaptation", + "id": 20 + }, + "transcriptNormalization": { + "type": "TranscriptNormalization", + "id": 24, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "speechContexts": { + "rule": "repeated", + "type": "SpeechContext", + "id": 6 + }, + "enableWordTimeOffsets": { + "type": "bool", + "id": 8 + }, + "enableWordConfidence": { + "type": "bool", + "id": 15 + }, + "enableAutomaticPunctuation": { + "type": "bool", + "id": 11 + }, + "enableSpokenPunctuation": { + "type": "google.protobuf.BoolValue", + "id": 22 + }, + "enableSpokenEmojis": { + "type": "google.protobuf.BoolValue", + "id": 23 + }, + "diarizationConfig": { + "type": "SpeakerDiarizationConfig", + "id": 19 + }, + "metadata": { + "type": "RecognitionMetadata", + "id": 9 + }, + "model": { + "type": "string", + "id": 13 + }, + "useEnhanced": { + "type": "bool", + "id": 14 + } + }, + "nested": { + "AudioEncoding": { + "values": { + "ENCODING_UNSPECIFIED": 0, + "LINEAR16": 1, + "FLAC": 2, + "MULAW": 3, + "AMR": 4, + "AMR_WB": 5, + "OGG_OPUS": 6, + "SPEEX_WITH_HEADER_BYTE": 7, + "MP3": 8, + "WEBM_OPUS": 9 + } + } + } + }, + "SpeakerDiarizationConfig": { + "fields": { + "enableSpeakerDiarization": { + "type": "bool", + "id": 1 + }, + "minSpeakerCount": { + "type": "int32", + "id": 2 + }, + "maxSpeakerCount": { + "type": "int32", + "id": 3 + }, + "speakerTag": { + "type": "int32", + "id": 5, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "RecognitionMetadata": { + "options": { + "deprecated": true + }, + "fields": { + "interactionType": { + "type": "InteractionType", + "id": 1 + }, + "industryNaicsCodeOfAudio": { + "type": "uint32", + "id": 3 + }, + "microphoneDistance": { + "type": "MicrophoneDistance", + "id": 4 + }, + "originalMediaType": { + "type": "OriginalMediaType", + "id": 5 + }, + "recordingDeviceType": { + "type": "RecordingDeviceType", + "id": 6 + }, + "recordingDeviceName": { + "type": "string", + "id": 7 + }, + "originalMimeType": { + "type": "string", + "id": 8 + }, + "audioTopic": { + "type": "string", + "id": 10 + } + }, + "nested": { + "InteractionType": { + "values": { + "INTERACTION_TYPE_UNSPECIFIED": 0, + "DISCUSSION": 1, + "PRESENTATION": 2, + "PHONE_CALL": 3, + "VOICEMAIL": 4, + "PROFESSIONALLY_PRODUCED": 5, + "VOICE_SEARCH": 6, + "VOICE_COMMAND": 7, + "DICTATION": 8 + } + }, + "MicrophoneDistance": { + "values": { + "MICROPHONE_DISTANCE_UNSPECIFIED": 0, + "NEARFIELD": 1, + "MIDFIELD": 2, + "FARFIELD": 3 + } + }, + "OriginalMediaType": { + "values": { + "ORIGINAL_MEDIA_TYPE_UNSPECIFIED": 0, + "AUDIO": 1, + "VIDEO": 2 + } + }, + "RecordingDeviceType": { + "values": { + "RECORDING_DEVICE_TYPE_UNSPECIFIED": 0, + "SMARTPHONE": 1, + "PC": 2, + "PHONE_LINE": 3, + "VEHICLE": 4, + "OTHER_OUTDOOR_DEVICE": 5, + "OTHER_INDOOR_DEVICE": 6 + } + } + } + }, + "SpeechContext": { + "fields": { + "phrases": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "boost": { + "type": "float", + "id": 4 + } + } + }, + "RecognitionAudio": { + "oneofs": { + "audioSource": { + "oneof": [ + "content", + "uri" + ] + } + }, + "fields": { + "content": { + "type": "bytes", + "id": 1 + }, + "uri": { + "type": "string", + "id": 2 + } + } + }, + "RecognizeResponse": { + "fields": { + "results": { + "rule": "repeated", + "type": "SpeechRecognitionResult", + "id": 2 + }, + "totalBilledTime": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "speechAdaptationInfo": { + "type": "SpeechAdaptationInfo", + "id": 7 + }, + "requestId": { + "type": "int64", + "id": 8 + } + } + }, + "LongRunningRecognizeResponse": { + "fields": { + "results": { + "rule": "repeated", + "type": "SpeechRecognitionResult", + "id": 2 + }, + "totalBilledTime": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "outputConfig": { + "type": "TranscriptOutputConfig", + "id": 6 + }, + "outputError": { + "type": "google.rpc.Status", + "id": 7 + }, + "speechAdaptationInfo": { + "type": "SpeechAdaptationInfo", + "id": 8 + }, + "requestId": { + "type": "int64", + "id": 9 + } + } + }, + "LongRunningRecognizeMetadata": { + "fields": { + "progressPercent": { + "type": "int32", + "id": 1 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "lastUpdateTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "uri": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "StreamingRecognizeResponse": { + "fields": { + "error": { + "type": "google.rpc.Status", + "id": 1 + }, + "results": { + "rule": "repeated", + "type": "StreamingRecognitionResult", + "id": 2 + }, + "speechEventType": { + "type": "SpeechEventType", + "id": 4 + }, + "speechEventTime": { + "type": "google.protobuf.Duration", + "id": 8 + }, + "totalBilledTime": { + "type": "google.protobuf.Duration", + "id": 5 + }, + "speechAdaptationInfo": { + "type": "SpeechAdaptationInfo", + "id": 9 + }, + "requestId": { + "type": "int64", + "id": 10 + } + }, + "nested": { + "SpeechEventType": { + "values": { + "SPEECH_EVENT_UNSPECIFIED": 0, + "END_OF_SINGLE_UTTERANCE": 1, + "SPEECH_ACTIVITY_BEGIN": 2, + "SPEECH_ACTIVITY_END": 3, + "SPEECH_ACTIVITY_TIMEOUT": 4 + } + } + } + }, + "StreamingRecognitionResult": { + "fields": { + "alternatives": { + "rule": "repeated", + "type": "SpeechRecognitionAlternative", + "id": 1 + }, + "isFinal": { + "type": "bool", + "id": 2 + }, + "stability": { + "type": "float", + "id": 3 + }, + "resultEndTime": { + "type": "google.protobuf.Duration", + "id": 4 + }, + "channelTag": { + "type": "int32", + "id": 5 + }, + "languageCode": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "SpeechRecognitionResult": { + "fields": { + "alternatives": { + "rule": "repeated", + "type": "SpeechRecognitionAlternative", + "id": 1 + }, + "channelTag": { + "type": "int32", + "id": 2 + }, + "resultEndTime": { + "type": "google.protobuf.Duration", + "id": 4 + }, + "languageCode": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "SpeechRecognitionAlternative": { + "fields": { + "transcript": { + "type": "string", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2 + }, + "words": { + "rule": "repeated", + "type": "WordInfo", + "id": 3 + } + } + }, + "WordInfo": { + "fields": { + "startTime": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Duration", + "id": 2 + }, + "word": { + "type": "string", + "id": 3 + }, + "confidence": { + "type": "float", + "id": 4 + }, + "speakerTag": { + "type": "int32", + "id": 5, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "speakerLabel": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "SpeechAdaptationInfo": { + "fields": { + "adaptationTimeout": { + "type": "bool", + "id": 1 + }, + "timeoutMessage": { + "type": "string", + "id": 4 + } + } + }, + "CustomClass": { + "options": { + "(google.api.resource).type": "speech.googleapis.com/CustomClass", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/customClasses/{custom_class}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "customClassId": { + "type": "string", + "id": 2 + }, + "items": { + "rule": "repeated", + "type": "ClassItem", + "id": 3 + } + }, + "nested": { + "ClassItem": { + "fields": { + "value": { + "type": "string", + "id": 1 + } + } + } + } + }, + "PhraseSet": { + "options": { + "(google.api.resource).type": "speech.googleapis.com/PhraseSet", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/phraseSets/{phrase_set}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "phrases": { + "rule": "repeated", + "type": "Phrase", + "id": 2 + }, + "boost": { + "type": "float", + "id": 4 + } + }, + "nested": { + "Phrase": { + "fields": { + "value": { + "type": "string", + "id": 1 + }, + "boost": { + "type": "float", + "id": 2 + } + } + } + } + }, + "SpeechAdaptation": { + "fields": { + "phraseSets": { + "rule": "repeated", + "type": "PhraseSet", + "id": 1 + }, + "phraseSetReferences": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "speech.googleapis.com/PhraseSet" + } + }, + "customClasses": { + "rule": "repeated", + "type": "CustomClass", + "id": 3 + }, + "abnfGrammar": { + "type": "ABNFGrammar", + "id": 4 + } + }, + "nested": { + "ABNFGrammar": { + "fields": { + "abnfStrings": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + } + } + }, + "TranscriptNormalization": { + "fields": { + "entries": { + "rule": "repeated", + "type": "Entry", + "id": 1 + } + }, + "nested": { + "Entry": { + "fields": { + "search": { + "type": "string", + "id": 1 + }, + "replace": { + "type": "string", + "id": 2 + }, + "caseSensitive": { + "type": "bool", + "id": 3 + } + } + } + } + }, + "Adaptation": { + "options": { + "(google.api.default_host)": "speech.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreatePhraseSet": { + "requestType": "CreatePhraseSetRequest", + "responseType": "PhraseSet", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/phraseSets", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,phrase_set,phrase_set_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/phraseSets", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,phrase_set,phrase_set_id" + } + ] + }, + "GetPhraseSet": { + "requestType": "GetPhraseSetRequest", + "responseType": "PhraseSet", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/phraseSets/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/phraseSets/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListPhraseSet": { + "requestType": "ListPhraseSetRequest", + "responseType": "ListPhraseSetResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/phraseSets", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/phraseSets" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdatePhraseSet": { + "requestType": "UpdatePhraseSetRequest", + "responseType": "PhraseSet", + "options": { + "(google.api.http).patch": "/v1/{phrase_set.name=projects/*/locations/*/phraseSets/*}", + "(google.api.http).body": "phrase_set", + "(google.api.method_signature)": "phrase_set,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{phrase_set.name=projects/*/locations/*/phraseSets/*}", + "body": "phrase_set" + } + }, + { + "(google.api.method_signature)": "phrase_set,update_mask" + } + ] + }, + "DeletePhraseSet": { + "requestType": "DeletePhraseSetRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/phraseSets/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/phraseSets/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateCustomClass": { + "requestType": "CreateCustomClassRequest", + "responseType": "CustomClass", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/customClasses", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,custom_class,custom_class_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/customClasses", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,custom_class,custom_class_id" + } + ] + }, + "GetCustomClass": { + "requestType": "GetCustomClassRequest", + "responseType": "CustomClass", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/customClasses/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/customClasses/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListCustomClasses": { + "requestType": "ListCustomClassesRequest", + "responseType": "ListCustomClassesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/customClasses", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/customClasses" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdateCustomClass": { + "requestType": "UpdateCustomClassRequest", + "responseType": "CustomClass", + "options": { + "(google.api.http).patch": "/v1/{custom_class.name=projects/*/locations/*/customClasses/*}", + "(google.api.http).body": "custom_class", + "(google.api.method_signature)": "custom_class,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{custom_class.name=projects/*/locations/*/customClasses/*}", + "body": "custom_class" + } + }, + { + "(google.api.method_signature)": "custom_class,update_mask" + } + ] + }, + "DeleteCustomClass": { + "requestType": "DeleteCustomClassRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/customClasses/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/customClasses/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "CreatePhraseSetRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "speech.googleapis.com/PhraseSet" + } + }, + "phraseSetId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "phraseSet": { + "type": "PhraseSet", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdatePhraseSetRequest": { + "fields": { + "phraseSet": { + "type": "PhraseSet", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "GetPhraseSetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "speech.googleapis.com/PhraseSet" + } + } + } + }, + "ListPhraseSetRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "speech.googleapis.com/PhraseSet" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListPhraseSetResponse": { + "fields": { + "phraseSets": { + "rule": "repeated", + "type": "PhraseSet", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DeletePhraseSetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "speech.googleapis.com/PhraseSet" + } + } + } + }, + "CreateCustomClassRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "speech.googleapis.com/CustomClass" + } + }, + "customClassId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "customClass": { + "type": "CustomClass", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateCustomClassRequest": { + "fields": { + "customClass": { + "type": "CustomClass", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "GetCustomClassRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "speech.googleapis.com/CustomClass" + } + } + } + }, + "ListCustomClassesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "speech.googleapis.com/CustomClass" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListCustomClassesResponse": { + "fields": { + "customClasses": { + "rule": "repeated", + "type": "CustomClass", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DeleteCustomClassRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "speech.googleapis.com/CustomClass" + } + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "ResourceProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + }, + "apiVersion": { + "type": "string", + "id": 525000001, + "extend": "google.protobuf.ServiceOptions" + }, + "CommonLanguageSettings": { + "fields": { + "referenceDocsUri": { + "type": "string", + "id": 1, + "options": { + "deprecated": true + } + }, + "destinations": { + "rule": "repeated", + "type": "ClientLibraryDestination", + "id": 2 + } + } + }, + "ClientLibrarySettings": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "launchStage": { + "type": "LaunchStage", + "id": 2 + }, + "restNumericEnums": { + "type": "bool", + "id": 3 + }, + "javaSettings": { + "type": "JavaSettings", + "id": 21 + }, + "cppSettings": { + "type": "CppSettings", + "id": 22 + }, + "phpSettings": { + "type": "PhpSettings", + "id": 23 + }, + "pythonSettings": { + "type": "PythonSettings", + "id": 24 + }, + "nodeSettings": { + "type": "NodeSettings", + "id": 25 + }, + "dotnetSettings": { + "type": "DotnetSettings", + "id": 26 + }, + "rubySettings": { + "type": "RubySettings", + "id": 27 + }, + "goSettings": { + "type": "GoSettings", + "id": 28 + } + } + }, + "Publishing": { + "fields": { + "methodSettings": { + "rule": "repeated", + "type": "MethodSettings", + "id": 2 + }, + "newIssueUri": { + "type": "string", + "id": 101 + }, + "documentationUri": { + "type": "string", + "id": 102 + }, + "apiShortName": { + "type": "string", + "id": 103 + }, + "githubLabel": { + "type": "string", + "id": 104 + }, + "codeownerGithubTeams": { + "rule": "repeated", + "type": "string", + "id": 105 + }, + "docTagPrefix": { + "type": "string", + "id": 106 + }, + "organization": { + "type": "ClientLibraryOrganization", + "id": 107 + }, + "librarySettings": { + "rule": "repeated", + "type": "ClientLibrarySettings", + "id": 109 + }, + "protoReferenceDocumentationUri": { + "type": "string", + "id": 110 + }, + "restReferenceDocumentationUri": { + "type": "string", + "id": 111 + } + } + }, + "JavaSettings": { + "fields": { + "libraryPackage": { + "type": "string", + "id": 1 + }, + "serviceClassNames": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "common": { + "type": "CommonLanguageSettings", + "id": 3 + } + } + }, + "CppSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PhpSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PythonSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "NodeSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "DotnetSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "renamedResources": { + "keyType": "string", + "type": "string", + "id": 3 + }, + "ignoredResources": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "forcedNamespaceAliases": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "handwrittenSignatures": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + }, + "RubySettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "GoSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "MethodSettings": { + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "longRunning": { + "type": "LongRunning", + "id": 2 + }, + "autoPopulatedFields": { + "rule": "repeated", + "type": "string", + "id": 3 + } + }, + "nested": { + "LongRunning": { + "fields": { + "initialPollDelay": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "pollDelayMultiplier": { + "type": "float", + "id": 2 + }, + "maxPollDelay": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "totalPollTimeout": { + "type": "google.protobuf.Duration", + "id": 4 + } + } + } + } + }, + "ClientLibraryOrganization": { + "values": { + "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, + "CLOUD": 1, + "ADS": 2, + "PHOTOS": 3, + "STREET_VIEW": 4, + "SHOPPING": 5, + "GEO": 6, + "GENERATIVE_AI": 7 + } + }, + "ClientLibraryDestination": { + "values": { + "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, + "GITHUB": 10, + "PACKAGE_MANAGER": 20 + } + }, + "LaunchStage": { + "values": { + "LAUNCH_STAGE_UNSPECIFIED": 0, + "UNIMPLEMENTED": 6, + "PRELAUNCH": 7, + "EARLY_ACCESS": 1, + "ALPHA": 2, + "BETA": 3, + "GA": 4, + "DEPRECATED": 5 + } + }, + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions", + "options": { + "packed": false + } + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5, + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7, + "IDENTIFIER": 8 + } + }, + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "protobuf": { + "options": { + "go_package": "google.golang.org/protobuf/types/descriptorpb", + "java_package": "com.google.protobuf", + "java_outer_classname": "DescriptorProtos", + "csharp_namespace": "Google.Protobuf.Reflection", + "objc_class_prefix": "GPB", + "cc_enable_arenas": true, + "optimize_for": "SPEED" + }, + "nested": { + "FileDescriptorSet": { + "edition": "proto2", + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "Edition": { + "edition": "proto2", + "values": { + "EDITION_UNKNOWN": 0, + "EDITION_PROTO2": 998, + "EDITION_PROTO3": 999, + "EDITION_2023": 1000, + "EDITION_2024": 1001, + "EDITION_1_TEST_ONLY": 1, + "EDITION_2_TEST_ONLY": 2, + "EDITION_99997_TEST_ONLY": 99997, + "EDITION_99998_TEST_ONLY": 99998, + "EDITION_99999_TEST_ONLY": 99999, + "EDITION_MAX": 2147483647 + } + }, + "FileDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "package": { + "type": "string", + "id": 2 + }, + "dependency": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "publicDependency": { + "rule": "repeated", + "type": "int32", + "id": 10 + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11 + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + }, + "edition": { + "type": "Edition", + "id": 14 + } + } + }, + "DescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "ExtensionRangeOptions": { + "edition": "proto2", + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + }, + "declaration": { + "rule": "repeated", + "type": "Declaration", + "id": 2, + "options": { + "retention": "RETENTION_SOURCE" + } + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "verification": { + "type": "VerificationState", + "id": 3, + "options": { + "default": "UNVERIFIED", + "retention": "RETENTION_SOURCE" + } + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "Declaration": { + "fields": { + "number": { + "type": "int32", + "id": 1 + }, + "fullName": { + "type": "string", + "id": 2 + }, + "type": { + "type": "string", + "id": 3 + }, + "reserved": { + "type": "bool", + "id": 5 + }, + "repeated": { + "type": "bool", + "id": 6 + } + }, + "reserved": [ + [ + 4, + 4 + ] + ] + }, + "VerificationState": { + "values": { + "DECLARATION": 0, + "UNVERIFIED": 1 + } + } + } + }, + "FieldDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REPEATED": 3, + "LABEL_REQUIRED": 2 + } + } + } + }, + "OneofDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputType": { + "type": "string", + "id": 2 + }, + "outputType": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "clientStreaming": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "serverStreaming": { + "type": "bool", + "id": 6, + "options": { + "default": false + } + } + } + }, + "FileOptions": { + "edition": "proto2", + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 42, + 42 + ], + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "edition": "proto2", + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 11, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 12 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "edition": "proto2", + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "debugRedact": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "retention": { + "type": "OptionRetention", + "id": 17 + }, + "targets": { + "rule": "repeated", + "type": "OptionTargetType", + "id": 19 + }, + "editionDefaults": { + "rule": "repeated", + "type": "EditionDefault", + "id": 20 + }, + "features": { + "type": "FeatureSet", + "id": 21 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 18, + 18 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + }, + "OptionRetention": { + "values": { + "RETENTION_UNKNOWN": 0, + "RETENTION_RUNTIME": 1, + "RETENTION_SOURCE": 2 + } + }, + "OptionTargetType": { + "values": { + "TARGET_TYPE_UNKNOWN": 0, + "TARGET_TYPE_FILE": 1, + "TARGET_TYPE_EXTENSION_RANGE": 2, + "TARGET_TYPE_MESSAGE": 3, + "TARGET_TYPE_FIELD": 4, + "TARGET_TYPE_ONEOF": 5, + "TARGET_TYPE_ENUM": 6, + "TARGET_TYPE_ENUM_ENTRY": 7, + "TARGET_TYPE_SERVICE": 8, + "TARGET_TYPE_METHOD": 9 + } + }, + "EditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "value": { + "type": "string", + "id": 2 + } + } + } + } + }, + "OneofOptions": { + "edition": "proto2", + "fields": { + "features": { + "type": "FeatureSet", + "id": 1 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "edition": "proto2", + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 6, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "edition": "proto2", + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "features": { + "type": "FeatureSet", + "id": 2 + }, + "debugRedact": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "edition": "proto2", + "fields": { + "features": { + "type": "FeatureSet", + "id": 34 + }, + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "edition": "proto2", + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "features": { + "type": "FeatureSet", + "id": 35 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "edition": "proto2", + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "FeatureSet": { + "edition": "proto2", + "fields": { + "fieldPresence": { + "type": "FieldPresence", + "id": 1, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_2023", + "edition_defaults.value": "EXPLICIT" + } + }, + "enumType": { + "type": "EnumType", + "id": 2, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "OPEN" + } + }, + "repeatedFieldEncoding": { + "type": "RepeatedFieldEncoding", + "id": 3, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "PACKED" + } + }, + "utf8Validation": { + "type": "Utf8Validation", + "id": 4, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "VERIFY" + } + }, + "messageEncoding": { + "type": "MessageEncoding", + "id": 5, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO2", + "edition_defaults.value": "LENGTH_PREFIXED" + } + }, + "jsonFormat": { + "type": "JsonFormat", + "id": 6, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "ALLOW" + } + } + }, + "extensions": [ + [ + 1000, + 1000 + ], + [ + 1001, + 1001 + ], + [ + 1002, + 1002 + ], + [ + 9990, + 9990 + ], + [ + 9995, + 9999 + ], + [ + 10000, + 10000 + ] + ], + "reserved": [ + [ + 999, + 999 + ] + ], + "nested": { + "FieldPresence": { + "values": { + "FIELD_PRESENCE_UNKNOWN": 0, + "EXPLICIT": 1, + "IMPLICIT": 2, + "LEGACY_REQUIRED": 3 + } + }, + "EnumType": { + "values": { + "ENUM_TYPE_UNKNOWN": 0, + "OPEN": 1, + "CLOSED": 2 + } + }, + "RepeatedFieldEncoding": { + "values": { + "REPEATED_FIELD_ENCODING_UNKNOWN": 0, + "PACKED": 1, + "EXPANDED": 2 + } + }, + "Utf8Validation": { + "values": { + "UTF8_VALIDATION_UNKNOWN": 0, + "VERIFY": 2, + "NONE": 3 + } + }, + "MessageEncoding": { + "values": { + "MESSAGE_ENCODING_UNKNOWN": 0, + "LENGTH_PREFIXED": 1, + "DELIMITED": 2 + } + }, + "JsonFormat": { + "values": { + "JSON_FORMAT_UNKNOWN": 0, + "ALLOW": 1, + "LEGACY_BEST_EFFORT": 2 + } + } + } + }, + "FeatureSetDefaults": { + "edition": "proto2", + "fields": { + "defaults": { + "rule": "repeated", + "type": "FeatureSetEditionDefault", + "id": 1 + }, + "minimumEdition": { + "type": "Edition", + "id": 4 + }, + "maximumEdition": { + "type": "Edition", + "id": 5 + } + }, + "nested": { + "FeatureSetEditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "features": { + "type": "FeatureSet", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "edition": "proto2", + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1, + "options": { + "packed": true + } + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2, + "options": { + "packed": true + } + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "edition": "proto2", + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1, + "options": { + "packed": true + } + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } + } + } + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "DoubleValue": { + "fields": { + "value": { + "type": "double", + "id": 1 + } + } + }, + "FloatValue": { + "fields": { + "value": { + "type": "float", + "id": 1 + } + } + }, + "Int64Value": { + "fields": { + "value": { + "type": "int64", + "id": 1 + } + } + }, + "UInt64Value": { + "fields": { + "value": { + "type": "uint64", + "id": 1 + } + } + }, + "Int32Value": { + "fields": { + "value": { + "type": "int32", + "id": 1 + } + } + }, + "UInt32Value": { + "fields": { + "value": { + "type": "uint32", + "id": 1 + } + } + }, + "BoolValue": { + "fields": { + "value": { + "type": "bool", + "id": 1 + } + } + }, + "StringValue": { + "fields": { + "value": { + "type": "string", + "id": 1 + } + } + }, + "BytesValue": { + "fields": { + "value": { + "type": "bytes", + "id": 1 + } + } + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "cloud.google.com/go/longrunning/autogen/longrunningpb;longrunningpb", + "java_multiple_files": true, + "java_outer_classname": "OperationsProto", + "java_package": "com.google.longrunning", + "php_namespace": "Google\\LongRunning" + }, + "nested": { + "operationInfo": { + "type": "google.longrunning.OperationInfo", + "id": 1049, + "extend": "google.protobuf.MethodOptions" + }, + "Operations": { + "options": { + "(google.api.default_host)": "longrunning.googleapis.com" + }, + "methods": { + "ListOperations": { + "requestType": "ListOperationsRequest", + "responseType": "ListOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{name=operations}", + "(google.api.method_signature)": "name,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations}" + } + }, + { + "(google.api.method_signature)": "name,filter" + } + ] + }, + "GetOperation": { + "requestType": "GetOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).get": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteOperation": { + "requestType": "DeleteOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CancelOperation": { + "requestType": "CancelOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=operations/**}:cancel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=operations/**}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "WaitOperation": { + "requestType": "WaitOperationRequest", + "responseType": "Operation" + } + } + }, + "Operation": { + "oneofs": { + "result": { + "oneof": [ + "error", + "response" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "metadata": { + "type": "google.protobuf.Any", + "id": 2 + }, + "done": { + "type": "bool", + "id": 3 + }, + "error": { + "type": "google.rpc.Status", + "id": 4 + }, + "response": { + "type": "google.protobuf.Any", + "id": 5 + } + } + }, + "GetOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListOperationsRequest": { + "fields": { + "name": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListOperationsResponse": { + "fields": { + "operations": { + "rule": "repeated", + "type": "Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CancelOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DeleteOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "WaitOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "OperationInfo": { + "fields": { + "responseType": { + "type": "string", + "id": 1 + }, + "metadataType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/samples/generated/v1/adaptation.create_custom_class.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/samples/generated/v1/adaptation.create_custom_class.js new file mode 100644 index 00000000000..f7a91e2c9da --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/samples/generated/v1/adaptation.create_custom_class.js @@ -0,0 +1,81 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, customClassId, customClass) { + // [START speech_v1_generated_Adaptation_CreateCustomClass_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource where this custom class will be created. + * Format: + * `projects/{project}/locations/{location}/customClasses` + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * regional endpoint (https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + */ + // const parent = 'abc123' + /** + * Required. The ID to use for the custom class, which will become the final + * component of the custom class' resource name. + * This value should restrict to letters, numbers, and hyphens, with the first + * character a letter, the last a letter or a number, and be 4-63 characters. + */ + // const customClassId = 'abc123' + /** + * Required. The custom class to create. + */ + // const customClass = {} + + // Imports the Speech library + const {AdaptationClient} = require('@google-cloud/speech').v1; + + // Instantiates a client + const speechClient = new AdaptationClient(); + + async function callCreateCustomClass() { + // Construct request + const request = { + parent, + customClassId, + customClass, + }; + + // Run request + const response = await speechClient.createCustomClass(request); + console.log(response); + } + + callCreateCustomClass(); + // [END speech_v1_generated_Adaptation_CreateCustomClass_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/samples/generated/v1/adaptation.create_phrase_set.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/samples/generated/v1/adaptation.create_phrase_set.js new file mode 100644 index 00000000000..ad7724130bc --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/samples/generated/v1/adaptation.create_phrase_set.js @@ -0,0 +1,81 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, phraseSetId, phraseSet) { + // [START speech_v1_generated_Adaptation_CreatePhraseSet_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource where this phrase set will be created. + * Format: + * `projects/{project}/locations/{location}` + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * regional endpoint (https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + */ + // const parent = 'abc123' + /** + * Required. The ID to use for the phrase set, which will become the final + * component of the phrase set's resource name. + * This value should restrict to letters, numbers, and hyphens, with the first + * character a letter, the last a letter or a number, and be 4-63 characters. + */ + // const phraseSetId = 'abc123' + /** + * Required. The phrase set to create. + */ + // const phraseSet = {} + + // Imports the Speech library + const {AdaptationClient} = require('@google-cloud/speech').v1; + + // Instantiates a client + const speechClient = new AdaptationClient(); + + async function callCreatePhraseSet() { + // Construct request + const request = { + parent, + phraseSetId, + phraseSet, + }; + + // Run request + const response = await speechClient.createPhraseSet(request); + console.log(response); + } + + callCreatePhraseSet(); + // [END speech_v1_generated_Adaptation_CreatePhraseSet_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/samples/generated/v1/adaptation.delete_custom_class.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/samples/generated/v1/adaptation.delete_custom_class.js new file mode 100644 index 00000000000..fb804f9fead --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/samples/generated/v1/adaptation.delete_custom_class.js @@ -0,0 +1,67 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START speech_v1_generated_Adaptation_DeleteCustomClass_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the custom class to delete. Format: + * `projects/{project}/locations/{location}/customClasses/{custom_class}` + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * regional endpoint (https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + */ + // const name = 'abc123' + + // Imports the Speech library + const {AdaptationClient} = require('@google-cloud/speech').v1; + + // Instantiates a client + const speechClient = new AdaptationClient(); + + async function callDeleteCustomClass() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await speechClient.deleteCustomClass(request); + console.log(response); + } + + callDeleteCustomClass(); + // [END speech_v1_generated_Adaptation_DeleteCustomClass_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/samples/generated/v1/adaptation.delete_phrase_set.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/samples/generated/v1/adaptation.delete_phrase_set.js new file mode 100644 index 00000000000..d9d6a9c9e2b --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/samples/generated/v1/adaptation.delete_phrase_set.js @@ -0,0 +1,62 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START speech_v1_generated_Adaptation_DeletePhraseSet_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the phrase set to delete. Format: + * `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + */ + // const name = 'abc123' + + // Imports the Speech library + const {AdaptationClient} = require('@google-cloud/speech').v1; + + // Instantiates a client + const speechClient = new AdaptationClient(); + + async function callDeletePhraseSet() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await speechClient.deletePhraseSet(request); + console.log(response); + } + + callDeletePhraseSet(); + // [END speech_v1_generated_Adaptation_DeletePhraseSet_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/samples/generated/v1/adaptation.get_custom_class.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/samples/generated/v1/adaptation.get_custom_class.js new file mode 100644 index 00000000000..0ecc0638127 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/samples/generated/v1/adaptation.get_custom_class.js @@ -0,0 +1,62 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START speech_v1_generated_Adaptation_GetCustomClass_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the custom class to retrieve. Format: + * `projects/{project}/locations/{location}/customClasses/{custom_class}` + */ + // const name = 'abc123' + + // Imports the Speech library + const {AdaptationClient} = require('@google-cloud/speech').v1; + + // Instantiates a client + const speechClient = new AdaptationClient(); + + async function callGetCustomClass() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await speechClient.getCustomClass(request); + console.log(response); + } + + callGetCustomClass(); + // [END speech_v1_generated_Adaptation_GetCustomClass_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/samples/generated/v1/adaptation.get_phrase_set.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/samples/generated/v1/adaptation.get_phrase_set.js new file mode 100644 index 00000000000..cbed15e15a0 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/samples/generated/v1/adaptation.get_phrase_set.js @@ -0,0 +1,67 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START speech_v1_generated_Adaptation_GetPhraseSet_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the phrase set to retrieve. Format: + * `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * regional endpoint (https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + */ + // const name = 'abc123' + + // Imports the Speech library + const {AdaptationClient} = require('@google-cloud/speech').v1; + + // Instantiates a client + const speechClient = new AdaptationClient(); + + async function callGetPhraseSet() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await speechClient.getPhraseSet(request); + console.log(response); + } + + callGetPhraseSet(); + // [END speech_v1_generated_Adaptation_GetPhraseSet_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/samples/generated/v1/adaptation.list_custom_classes.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/samples/generated/v1/adaptation.list_custom_classes.js new file mode 100644 index 00000000000..b0346689174 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/samples/generated/v1/adaptation.list_custom_classes.js @@ -0,0 +1,83 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START speech_v1_generated_Adaptation_ListCustomClasses_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent, which owns this collection of custom classes. Format: + * `projects/{project}/locations/{location}/customClasses` + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * regional endpoint (https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + */ + // const parent = 'abc123' + /** + * The maximum number of custom classes to return. The service may return + * fewer than this value. If unspecified, at most 50 custom classes will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListCustomClass` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListCustomClass` must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Speech library + const {AdaptationClient} = require('@google-cloud/speech').v1; + + // Instantiates a client + const speechClient = new AdaptationClient(); + + async function callListCustomClasses() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = speechClient.listCustomClassesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListCustomClasses(); + // [END speech_v1_generated_Adaptation_ListCustomClasses_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/samples/generated/v1/adaptation.list_phrase_set.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/samples/generated/v1/adaptation.list_phrase_set.js new file mode 100644 index 00000000000..1d26f21ab37 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/samples/generated/v1/adaptation.list_phrase_set.js @@ -0,0 +1,83 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START speech_v1_generated_Adaptation_ListPhraseSet_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent, which owns this collection of phrase set. Format: + * `projects/{project}/locations/{location}` + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * regional endpoint (https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + */ + // const parent = 'abc123' + /** + * The maximum number of phrase sets to return. The service may return + * fewer than this value. If unspecified, at most 50 phrase sets will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListPhraseSet` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListPhraseSet` must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Speech library + const {AdaptationClient} = require('@google-cloud/speech').v1; + + // Instantiates a client + const speechClient = new AdaptationClient(); + + async function callListPhraseSet() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = speechClient.listPhraseSetAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListPhraseSet(); + // [END speech_v1_generated_Adaptation_ListPhraseSet_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/samples/generated/v1/adaptation.update_custom_class.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/samples/generated/v1/adaptation.update_custom_class.js new file mode 100644 index 00000000000..54b2bbbcfa4 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/samples/generated/v1/adaptation.update_custom_class.js @@ -0,0 +1,73 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(customClass) { + // [START speech_v1_generated_Adaptation_UpdateCustomClass_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The custom class to update. + * The custom class's `name` field is used to identify the custom class to be + * updated. Format: + * `projects/{project}/locations/{location}/customClasses/{custom_class}` + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * regional endpoint (https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + */ + // const customClass = {} + /** + * The list of fields to be updated. + */ + // const updateMask = {} + + // Imports the Speech library + const {AdaptationClient} = require('@google-cloud/speech').v1; + + // Instantiates a client + const speechClient = new AdaptationClient(); + + async function callUpdateCustomClass() { + // Construct request + const request = { + customClass, + }; + + // Run request + const response = await speechClient.updateCustomClass(request); + console.log(response); + } + + callUpdateCustomClass(); + // [END speech_v1_generated_Adaptation_UpdateCustomClass_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/samples/generated/v1/adaptation.update_phrase_set.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/samples/generated/v1/adaptation.update_phrase_set.js new file mode 100644 index 00000000000..8bb22ee893f --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/samples/generated/v1/adaptation.update_phrase_set.js @@ -0,0 +1,73 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(phraseSet) { + // [START speech_v1_generated_Adaptation_UpdatePhraseSet_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The phrase set to update. + * The phrase set's `name` field is used to identify the set to be + * updated. Format: + * `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * regional endpoint (https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + */ + // const phraseSet = {} + /** + * The list of fields to be updated. + */ + // const updateMask = {} + + // Imports the Speech library + const {AdaptationClient} = require('@google-cloud/speech').v1; + + // Instantiates a client + const speechClient = new AdaptationClient(); + + async function callUpdatePhraseSet() { + // Construct request + const request = { + phraseSet, + }; + + // Run request + const response = await speechClient.updatePhraseSet(request); + console.log(response); + } + + callUpdatePhraseSet(); + // [END speech_v1_generated_Adaptation_UpdatePhraseSet_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/samples/generated/v1/snippet_metadata_google.cloud.speech.v1.json b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/samples/generated/v1/snippet_metadata_google.cloud.speech.v1.json new file mode 100644 index 00000000000..dee670aa1b6 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/samples/generated/v1/snippet_metadata_google.cloud.speech.v1.json @@ -0,0 +1,591 @@ +{ + "clientLibrary": { + "name": "nodejs-speech", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.speech.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "speech_v1_generated_Adaptation_CreatePhraseSet_async", + "title": "Adaptation createPhraseSet Sample", + "origin": "API_DEFINITION", + "description": " Create a set of phrase hints. Each item in the set can be a single word or a multi-word phrase. The items in the PhraseSet are favored by the recognition model when you send a call that includes the PhraseSet.", + "canonical": true, + "file": "adaptation.create_phrase_set.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreatePhraseSet", + "fullName": "google.cloud.speech.v1.Adaptation.CreatePhraseSet", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "phrase_set_id", + "type": "TYPE_STRING" + }, + { + "name": "phrase_set", + "type": ".google.cloud.speech.v1.PhraseSet" + } + ], + "resultType": ".google.cloud.speech.v1.PhraseSet", + "client": { + "shortName": "AdaptationClient", + "fullName": "google.cloud.speech.v1.AdaptationClient" + }, + "method": { + "shortName": "CreatePhraseSet", + "fullName": "google.cloud.speech.v1.Adaptation.CreatePhraseSet", + "service": { + "shortName": "Adaptation", + "fullName": "google.cloud.speech.v1.Adaptation" + } + } + } + }, + { + "regionTag": "speech_v1_generated_Adaptation_GetPhraseSet_async", + "title": "Adaptation getPhraseSet Sample", + "origin": "API_DEFINITION", + "description": " Get a phrase set.", + "canonical": true, + "file": "adaptation.get_phrase_set.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetPhraseSet", + "fullName": "google.cloud.speech.v1.Adaptation.GetPhraseSet", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.speech.v1.PhraseSet", + "client": { + "shortName": "AdaptationClient", + "fullName": "google.cloud.speech.v1.AdaptationClient" + }, + "method": { + "shortName": "GetPhraseSet", + "fullName": "google.cloud.speech.v1.Adaptation.GetPhraseSet", + "service": { + "shortName": "Adaptation", + "fullName": "google.cloud.speech.v1.Adaptation" + } + } + } + }, + { + "regionTag": "speech_v1_generated_Adaptation_ListPhraseSet_async", + "title": "Adaptation listPhraseSet Sample", + "origin": "API_DEFINITION", + "description": " List phrase sets.", + "canonical": true, + "file": "adaptation.list_phrase_set.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListPhraseSet", + "fullName": "google.cloud.speech.v1.Adaptation.ListPhraseSet", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.speech.v1.ListPhraseSetResponse", + "client": { + "shortName": "AdaptationClient", + "fullName": "google.cloud.speech.v1.AdaptationClient" + }, + "method": { + "shortName": "ListPhraseSet", + "fullName": "google.cloud.speech.v1.Adaptation.ListPhraseSet", + "service": { + "shortName": "Adaptation", + "fullName": "google.cloud.speech.v1.Adaptation" + } + } + } + }, + { + "regionTag": "speech_v1_generated_Adaptation_UpdatePhraseSet_async", + "title": "Adaptation updatePhraseSet Sample", + "origin": "API_DEFINITION", + "description": " Update a phrase set.", + "canonical": true, + "file": "adaptation.update_phrase_set.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdatePhraseSet", + "fullName": "google.cloud.speech.v1.Adaptation.UpdatePhraseSet", + "async": true, + "parameters": [ + { + "name": "phrase_set", + "type": ".google.cloud.speech.v1.PhraseSet" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.speech.v1.PhraseSet", + "client": { + "shortName": "AdaptationClient", + "fullName": "google.cloud.speech.v1.AdaptationClient" + }, + "method": { + "shortName": "UpdatePhraseSet", + "fullName": "google.cloud.speech.v1.Adaptation.UpdatePhraseSet", + "service": { + "shortName": "Adaptation", + "fullName": "google.cloud.speech.v1.Adaptation" + } + } + } + }, + { + "regionTag": "speech_v1_generated_Adaptation_DeletePhraseSet_async", + "title": "Adaptation deletePhraseSet Sample", + "origin": "API_DEFINITION", + "description": " Delete a phrase set.", + "canonical": true, + "file": "adaptation.delete_phrase_set.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeletePhraseSet", + "fullName": "google.cloud.speech.v1.Adaptation.DeletePhraseSet", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AdaptationClient", + "fullName": "google.cloud.speech.v1.AdaptationClient" + }, + "method": { + "shortName": "DeletePhraseSet", + "fullName": "google.cloud.speech.v1.Adaptation.DeletePhraseSet", + "service": { + "shortName": "Adaptation", + "fullName": "google.cloud.speech.v1.Adaptation" + } + } + } + }, + { + "regionTag": "speech_v1_generated_Adaptation_CreateCustomClass_async", + "title": "Adaptation createCustomClass Sample", + "origin": "API_DEFINITION", + "description": " Create a custom class.", + "canonical": true, + "file": "adaptation.create_custom_class.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateCustomClass", + "fullName": "google.cloud.speech.v1.Adaptation.CreateCustomClass", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "custom_class_id", + "type": "TYPE_STRING" + }, + { + "name": "custom_class", + "type": ".google.cloud.speech.v1.CustomClass" + } + ], + "resultType": ".google.cloud.speech.v1.CustomClass", + "client": { + "shortName": "AdaptationClient", + "fullName": "google.cloud.speech.v1.AdaptationClient" + }, + "method": { + "shortName": "CreateCustomClass", + "fullName": "google.cloud.speech.v1.Adaptation.CreateCustomClass", + "service": { + "shortName": "Adaptation", + "fullName": "google.cloud.speech.v1.Adaptation" + } + } + } + }, + { + "regionTag": "speech_v1_generated_Adaptation_GetCustomClass_async", + "title": "Adaptation getCustomClass Sample", + "origin": "API_DEFINITION", + "description": " Get a custom class.", + "canonical": true, + "file": "adaptation.get_custom_class.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetCustomClass", + "fullName": "google.cloud.speech.v1.Adaptation.GetCustomClass", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.speech.v1.CustomClass", + "client": { + "shortName": "AdaptationClient", + "fullName": "google.cloud.speech.v1.AdaptationClient" + }, + "method": { + "shortName": "GetCustomClass", + "fullName": "google.cloud.speech.v1.Adaptation.GetCustomClass", + "service": { + "shortName": "Adaptation", + "fullName": "google.cloud.speech.v1.Adaptation" + } + } + } + }, + { + "regionTag": "speech_v1_generated_Adaptation_ListCustomClasses_async", + "title": "Adaptation listCustomClasses Sample", + "origin": "API_DEFINITION", + "description": " List custom classes.", + "canonical": true, + "file": "adaptation.list_custom_classes.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListCustomClasses", + "fullName": "google.cloud.speech.v1.Adaptation.ListCustomClasses", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.speech.v1.ListCustomClassesResponse", + "client": { + "shortName": "AdaptationClient", + "fullName": "google.cloud.speech.v1.AdaptationClient" + }, + "method": { + "shortName": "ListCustomClasses", + "fullName": "google.cloud.speech.v1.Adaptation.ListCustomClasses", + "service": { + "shortName": "Adaptation", + "fullName": "google.cloud.speech.v1.Adaptation" + } + } + } + }, + { + "regionTag": "speech_v1_generated_Adaptation_UpdateCustomClass_async", + "title": "Adaptation updateCustomClass Sample", + "origin": "API_DEFINITION", + "description": " Update a custom class.", + "canonical": true, + "file": "adaptation.update_custom_class.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateCustomClass", + "fullName": "google.cloud.speech.v1.Adaptation.UpdateCustomClass", + "async": true, + "parameters": [ + { + "name": "custom_class", + "type": ".google.cloud.speech.v1.CustomClass" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.speech.v1.CustomClass", + "client": { + "shortName": "AdaptationClient", + "fullName": "google.cloud.speech.v1.AdaptationClient" + }, + "method": { + "shortName": "UpdateCustomClass", + "fullName": "google.cloud.speech.v1.Adaptation.UpdateCustomClass", + "service": { + "shortName": "Adaptation", + "fullName": "google.cloud.speech.v1.Adaptation" + } + } + } + }, + { + "regionTag": "speech_v1_generated_Adaptation_DeleteCustomClass_async", + "title": "Adaptation deleteCustomClass Sample", + "origin": "API_DEFINITION", + "description": " Delete a custom class.", + "canonical": true, + "file": "adaptation.delete_custom_class.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteCustomClass", + "fullName": "google.cloud.speech.v1.Adaptation.DeleteCustomClass", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AdaptationClient", + "fullName": "google.cloud.speech.v1.AdaptationClient" + }, + "method": { + "shortName": "DeleteCustomClass", + "fullName": "google.cloud.speech.v1.Adaptation.DeleteCustomClass", + "service": { + "shortName": "Adaptation", + "fullName": "google.cloud.speech.v1.Adaptation" + } + } + } + }, + { + "regionTag": "speech_v1_generated_Speech_Recognize_async", + "title": "Adaptation recognize Sample", + "origin": "API_DEFINITION", + "description": " Performs synchronous speech recognition: receive results after all audio has been sent and processed.", + "canonical": true, + "file": "speech.recognize.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "Recognize", + "fullName": "google.cloud.speech.v1.Speech.Recognize", + "async": true, + "parameters": [ + { + "name": "config", + "type": ".google.cloud.speech.v1.RecognitionConfig" + }, + { + "name": "audio", + "type": ".google.cloud.speech.v1.RecognitionAudio" + } + ], + "resultType": ".google.cloud.speech.v1.RecognizeResponse", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v1.SpeechClient" + }, + "method": { + "shortName": "Recognize", + "fullName": "google.cloud.speech.v1.Speech.Recognize", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v1.Speech" + } + } + } + }, + { + "regionTag": "speech_v1_generated_Speech_LongRunningRecognize_async", + "title": "Adaptation longRunningRecognize Sample", + "origin": "API_DEFINITION", + "description": " Performs asynchronous speech recognition: receive results via the google.longrunning.Operations interface. Returns either an `Operation.error` or an `Operation.response` which contains a `LongRunningRecognizeResponse` message. For more information on asynchronous speech recognition, see the [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize).", + "canonical": true, + "file": "speech.long_running_recognize.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "LongRunningRecognize", + "fullName": "google.cloud.speech.v1.Speech.LongRunningRecognize", + "async": true, + "parameters": [ + { + "name": "config", + "type": ".google.cloud.speech.v1.RecognitionConfig" + }, + { + "name": "audio", + "type": ".google.cloud.speech.v1.RecognitionAudio" + }, + { + "name": "output_config", + "type": ".google.cloud.speech.v1.TranscriptOutputConfig" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v1.SpeechClient" + }, + "method": { + "shortName": "LongRunningRecognize", + "fullName": "google.cloud.speech.v1.Speech.LongRunningRecognize", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v1.Speech" + } + } + } + }, + { + "regionTag": "speech_v1_generated_Speech_StreamingRecognize_async", + "title": "Adaptation streamingRecognize Sample", + "origin": "API_DEFINITION", + "description": " Performs bidirectional streaming speech recognition: receive results while sending audio. This method is only available via the gRPC API (not REST).", + "canonical": true, + "file": "speech.streaming_recognize.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "StreamingRecognize", + "fullName": "google.cloud.speech.v1.Speech.StreamingRecognize", + "async": true, + "parameters": [ + { + "name": "streaming_config", + "type": ".google.cloud.speech.v1.StreamingRecognitionConfig" + }, + { + "name": "audio_content", + "type": "TYPE_BYTES" + } + ], + "resultType": ".google.cloud.speech.v1.StreamingRecognizeResponse", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v1.SpeechClient" + }, + "method": { + "shortName": "StreamingRecognize", + "fullName": "google.cloud.speech.v1.Speech.StreamingRecognize", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v1.Speech" + } + } + } + } + ] +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/samples/generated/v1/speech.long_running_recognize.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/samples/generated/v1/speech.long_running_recognize.js new file mode 100644 index 00000000000..f2887a67c53 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/samples/generated/v1/speech.long_running_recognize.js @@ -0,0 +1,72 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(config, audio) { + // [START speech_v1_generated_Speech_LongRunningRecognize_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Provides information to the recognizer that specifies how to + * process the request. + */ + // const config = {} + /** + * Required. The audio data to be recognized. + */ + // const audio = {} + /** + * Optional. Specifies an optional destination for the recognition results. + */ + // const outputConfig = {} + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v1; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callLongRunningRecognize() { + // Construct request + const request = { + config, + audio, + }; + + // Run request + const [operation] = await speechClient.longRunningRecognize(request); + const [response] = await operation.promise(); + console.log(response); + } + + callLongRunningRecognize(); + // [END speech_v1_generated_Speech_LongRunningRecognize_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/samples/generated/v1/speech.recognize.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/samples/generated/v1/speech.recognize.js new file mode 100644 index 00000000000..1fdc0c79122 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/samples/generated/v1/speech.recognize.js @@ -0,0 +1,67 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(config, audio) { + // [START speech_v1_generated_Speech_Recognize_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Provides information to the recognizer that specifies how to + * process the request. + */ + // const config = {} + /** + * Required. The audio data to be recognized. + */ + // const audio = {} + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v1; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callRecognize() { + // Construct request + const request = { + config, + audio, + }; + + // Run request + const response = await speechClient.recognize(request); + console.log(response); + } + + callRecognize(); + // [END speech_v1_generated_Speech_Recognize_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/samples/generated/v1/speech.streaming_recognize.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/samples/generated/v1/speech.streaming_recognize.js new file mode 100644 index 00000000000..7e29fc0819c --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/samples/generated/v1/speech.streaming_recognize.js @@ -0,0 +1,77 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START speech_v1_generated_Speech_StreamingRecognize_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Provides information to the recognizer that specifies how to process the + * request. The first `StreamingRecognizeRequest` message must contain a + * `streaming_config` message. + */ + // const streamingConfig = {} + /** + * The audio data to be recognized. Sequential chunks of audio data are sent + * in sequential `StreamingRecognizeRequest` messages. The first + * `StreamingRecognizeRequest` message must not contain `audio_content` data + * and all subsequent `StreamingRecognizeRequest` messages must contain + * `audio_content` data. The audio bytes must be encoded as specified in + * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a + * pure binary representation (not base64). See + * content limits (https://cloud.google.com/speech-to-text/quotas#content). + */ + // const audioContent = Buffer.from('string') + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v1; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callStreamingRecognize() { + // Construct request + const request = { + }; + + // Run request + const stream = await speechClient.streamingRecognize(); + stream.on('data', (response) => { console.log(response) }); + stream.on('error', (err) => { throw(err) }); + stream.on('end', () => { /* API call completed */ }); + stream.write(request); + stream.end(); + } + + callStreamingRecognize(); + // [END speech_v1_generated_Speech_StreamingRecognize_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/src/index.ts b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/src/index.ts new file mode 100644 index 00000000000..fe67084db43 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/src/index.ts @@ -0,0 +1,27 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as v1 from './v1'; +const AdaptationClient = v1.AdaptationClient; +type AdaptationClient = v1.AdaptationClient; +const SpeechClient = v1.SpeechClient; +type SpeechClient = v1.SpeechClient; +export {v1, AdaptationClient, SpeechClient}; +export default {v1, AdaptationClient, SpeechClient}; +import * as protos from '../protos/protos'; +export {protos} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/src/v1/adaptation_client.ts b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/src/v1/adaptation_client.ts new file mode 100644 index 00000000000..e8f102750e8 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/src/v1/adaptation_client.ts @@ -0,0 +1,1834 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1/adaptation_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './adaptation_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service that implements Google Cloud Speech Adaptation API. + * @class + * @memberof v1 + */ +export class AdaptationClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('speech'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + adaptationStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of AdaptationClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new AdaptationClient({fallback: true}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof AdaptationClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'speech.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + customClassPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/customClasses/{custom_class}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + phraseSetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/phraseSets/{phrase_set}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listPhraseSet: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'phraseSets'), + listCustomClasses: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'customClasses') + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.speech.v1.Adaptation', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.adaptationStub) { + return this.adaptationStub; + } + + // Put together the "service stub" for + // google.cloud.speech.v1.Adaptation. + this.adaptationStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.speech.v1.Adaptation') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.speech.v1.Adaptation, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const adaptationStubMethods = + ['createPhraseSet', 'getPhraseSet', 'listPhraseSet', 'updatePhraseSet', 'deletePhraseSet', 'createCustomClass', 'getCustomClass', 'listCustomClasses', 'updateCustomClass', 'deleteCustomClass']; + for (const methodName of adaptationStubMethods) { + const callPromise = this.adaptationStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.adaptationStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'speech.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'speech.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Create a set of phrase hints. Each item in the set can be a single word or + * a multi-word phrase. The items in the PhraseSet are favored by the + * recognition model when you send a call that includes the PhraseSet. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource where this phrase set will be created. + * Format: + * + * `projects/{project}/locations/{location}` + * + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + * @param {string} request.phraseSetId + * Required. The ID to use for the phrase set, which will become the final + * component of the phrase set's resource name. + * + * This value should restrict to letters, numbers, and hyphens, with the first + * character a letter, the last a letter or a number, and be 4-63 characters. + * @param {google.cloud.speech.v1.PhraseSet} request.phraseSet + * Required. The phrase set to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.speech.v1.PhraseSet|PhraseSet}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/adaptation.create_phrase_set.js + * region_tag:speech_v1_generated_Adaptation_CreatePhraseSet_async + */ + createPhraseSet( + request?: protos.google.cloud.speech.v1.ICreatePhraseSetRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.speech.v1.IPhraseSet, + protos.google.cloud.speech.v1.ICreatePhraseSetRequest|undefined, {}|undefined + ]>; + createPhraseSet( + request: protos.google.cloud.speech.v1.ICreatePhraseSetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.speech.v1.IPhraseSet, + protos.google.cloud.speech.v1.ICreatePhraseSetRequest|null|undefined, + {}|null|undefined>): void; + createPhraseSet( + request: protos.google.cloud.speech.v1.ICreatePhraseSetRequest, + callback: Callback< + protos.google.cloud.speech.v1.IPhraseSet, + protos.google.cloud.speech.v1.ICreatePhraseSetRequest|null|undefined, + {}|null|undefined>): void; + createPhraseSet( + request?: protos.google.cloud.speech.v1.ICreatePhraseSetRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.speech.v1.IPhraseSet, + protos.google.cloud.speech.v1.ICreatePhraseSetRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.speech.v1.IPhraseSet, + protos.google.cloud.speech.v1.ICreatePhraseSetRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.speech.v1.IPhraseSet, + protos.google.cloud.speech.v1.ICreatePhraseSetRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createPhraseSet request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.speech.v1.IPhraseSet, + protos.google.cloud.speech.v1.ICreatePhraseSetRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createPhraseSet response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createPhraseSet(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.speech.v1.IPhraseSet, + protos.google.cloud.speech.v1.ICreatePhraseSetRequest|undefined, + {}|undefined + ]) => { + this._log.info('createPhraseSet response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Get a phrase set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the phrase set to retrieve. Format: + * + * `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + * + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.speech.v1.PhraseSet|PhraseSet}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/adaptation.get_phrase_set.js + * region_tag:speech_v1_generated_Adaptation_GetPhraseSet_async + */ + getPhraseSet( + request?: protos.google.cloud.speech.v1.IGetPhraseSetRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.speech.v1.IPhraseSet, + protos.google.cloud.speech.v1.IGetPhraseSetRequest|undefined, {}|undefined + ]>; + getPhraseSet( + request: protos.google.cloud.speech.v1.IGetPhraseSetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.speech.v1.IPhraseSet, + protos.google.cloud.speech.v1.IGetPhraseSetRequest|null|undefined, + {}|null|undefined>): void; + getPhraseSet( + request: protos.google.cloud.speech.v1.IGetPhraseSetRequest, + callback: Callback< + protos.google.cloud.speech.v1.IPhraseSet, + protos.google.cloud.speech.v1.IGetPhraseSetRequest|null|undefined, + {}|null|undefined>): void; + getPhraseSet( + request?: protos.google.cloud.speech.v1.IGetPhraseSetRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.speech.v1.IPhraseSet, + protos.google.cloud.speech.v1.IGetPhraseSetRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.speech.v1.IPhraseSet, + protos.google.cloud.speech.v1.IGetPhraseSetRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.speech.v1.IPhraseSet, + protos.google.cloud.speech.v1.IGetPhraseSetRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getPhraseSet request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.speech.v1.IPhraseSet, + protos.google.cloud.speech.v1.IGetPhraseSetRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getPhraseSet response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getPhraseSet(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.speech.v1.IPhraseSet, + protos.google.cloud.speech.v1.IGetPhraseSetRequest|undefined, + {}|undefined + ]) => { + this._log.info('getPhraseSet response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Update a phrase set. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.speech.v1.PhraseSet} request.phraseSet + * Required. The phrase set to update. + * + * The phrase set's `name` field is used to identify the set to be + * updated. Format: + * + * `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + * + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + * @param {google.protobuf.FieldMask} request.updateMask + * The list of fields to be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.speech.v1.PhraseSet|PhraseSet}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/adaptation.update_phrase_set.js + * region_tag:speech_v1_generated_Adaptation_UpdatePhraseSet_async + */ + updatePhraseSet( + request?: protos.google.cloud.speech.v1.IUpdatePhraseSetRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.speech.v1.IPhraseSet, + protos.google.cloud.speech.v1.IUpdatePhraseSetRequest|undefined, {}|undefined + ]>; + updatePhraseSet( + request: protos.google.cloud.speech.v1.IUpdatePhraseSetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.speech.v1.IPhraseSet, + protos.google.cloud.speech.v1.IUpdatePhraseSetRequest|null|undefined, + {}|null|undefined>): void; + updatePhraseSet( + request: protos.google.cloud.speech.v1.IUpdatePhraseSetRequest, + callback: Callback< + protos.google.cloud.speech.v1.IPhraseSet, + protos.google.cloud.speech.v1.IUpdatePhraseSetRequest|null|undefined, + {}|null|undefined>): void; + updatePhraseSet( + request?: protos.google.cloud.speech.v1.IUpdatePhraseSetRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.speech.v1.IPhraseSet, + protos.google.cloud.speech.v1.IUpdatePhraseSetRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.speech.v1.IPhraseSet, + protos.google.cloud.speech.v1.IUpdatePhraseSetRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.speech.v1.IPhraseSet, + protos.google.cloud.speech.v1.IUpdatePhraseSetRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'phrase_set.name': request.phraseSet!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updatePhraseSet request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.speech.v1.IPhraseSet, + protos.google.cloud.speech.v1.IUpdatePhraseSetRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updatePhraseSet response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updatePhraseSet(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.speech.v1.IPhraseSet, + protos.google.cloud.speech.v1.IUpdatePhraseSetRequest|undefined, + {}|undefined + ]) => { + this._log.info('updatePhraseSet response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Delete a phrase set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the phrase set to delete. Format: + * + * `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/adaptation.delete_phrase_set.js + * region_tag:speech_v1_generated_Adaptation_DeletePhraseSet_async + */ + deletePhraseSet( + request?: protos.google.cloud.speech.v1.IDeletePhraseSetRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1.IDeletePhraseSetRequest|undefined, {}|undefined + ]>; + deletePhraseSet( + request: protos.google.cloud.speech.v1.IDeletePhraseSetRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1.IDeletePhraseSetRequest|null|undefined, + {}|null|undefined>): void; + deletePhraseSet( + request: protos.google.cloud.speech.v1.IDeletePhraseSetRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1.IDeletePhraseSetRequest|null|undefined, + {}|null|undefined>): void; + deletePhraseSet( + request?: protos.google.cloud.speech.v1.IDeletePhraseSetRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1.IDeletePhraseSetRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1.IDeletePhraseSetRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1.IDeletePhraseSetRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('deletePhraseSet request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1.IDeletePhraseSetRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deletePhraseSet response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deletePhraseSet(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1.IDeletePhraseSetRequest|undefined, + {}|undefined + ]) => { + this._log.info('deletePhraseSet response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Create a custom class. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource where this custom class will be created. + * Format: + * + * `projects/{project}/locations/{location}/customClasses` + * + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + * @param {string} request.customClassId + * Required. The ID to use for the custom class, which will become the final + * component of the custom class' resource name. + * + * This value should restrict to letters, numbers, and hyphens, with the first + * character a letter, the last a letter or a number, and be 4-63 characters. + * @param {google.cloud.speech.v1.CustomClass} request.customClass + * Required. The custom class to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.speech.v1.CustomClass|CustomClass}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/adaptation.create_custom_class.js + * region_tag:speech_v1_generated_Adaptation_CreateCustomClass_async + */ + createCustomClass( + request?: protos.google.cloud.speech.v1.ICreateCustomClassRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.speech.v1.ICustomClass, + protos.google.cloud.speech.v1.ICreateCustomClassRequest|undefined, {}|undefined + ]>; + createCustomClass( + request: protos.google.cloud.speech.v1.ICreateCustomClassRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.speech.v1.ICustomClass, + protos.google.cloud.speech.v1.ICreateCustomClassRequest|null|undefined, + {}|null|undefined>): void; + createCustomClass( + request: protos.google.cloud.speech.v1.ICreateCustomClassRequest, + callback: Callback< + protos.google.cloud.speech.v1.ICustomClass, + protos.google.cloud.speech.v1.ICreateCustomClassRequest|null|undefined, + {}|null|undefined>): void; + createCustomClass( + request?: protos.google.cloud.speech.v1.ICreateCustomClassRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.speech.v1.ICustomClass, + protos.google.cloud.speech.v1.ICreateCustomClassRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.speech.v1.ICustomClass, + protos.google.cloud.speech.v1.ICreateCustomClassRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.speech.v1.ICustomClass, + protos.google.cloud.speech.v1.ICreateCustomClassRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createCustomClass request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.speech.v1.ICustomClass, + protos.google.cloud.speech.v1.ICreateCustomClassRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createCustomClass response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createCustomClass(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.speech.v1.ICustomClass, + protos.google.cloud.speech.v1.ICreateCustomClassRequest|undefined, + {}|undefined + ]) => { + this._log.info('createCustomClass response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Get a custom class. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the custom class to retrieve. Format: + * + * `projects/{project}/locations/{location}/customClasses/{custom_class}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.speech.v1.CustomClass|CustomClass}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/adaptation.get_custom_class.js + * region_tag:speech_v1_generated_Adaptation_GetCustomClass_async + */ + getCustomClass( + request?: protos.google.cloud.speech.v1.IGetCustomClassRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.speech.v1.ICustomClass, + protos.google.cloud.speech.v1.IGetCustomClassRequest|undefined, {}|undefined + ]>; + getCustomClass( + request: protos.google.cloud.speech.v1.IGetCustomClassRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.speech.v1.ICustomClass, + protos.google.cloud.speech.v1.IGetCustomClassRequest|null|undefined, + {}|null|undefined>): void; + getCustomClass( + request: protos.google.cloud.speech.v1.IGetCustomClassRequest, + callback: Callback< + protos.google.cloud.speech.v1.ICustomClass, + protos.google.cloud.speech.v1.IGetCustomClassRequest|null|undefined, + {}|null|undefined>): void; + getCustomClass( + request?: protos.google.cloud.speech.v1.IGetCustomClassRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.speech.v1.ICustomClass, + protos.google.cloud.speech.v1.IGetCustomClassRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.speech.v1.ICustomClass, + protos.google.cloud.speech.v1.IGetCustomClassRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.speech.v1.ICustomClass, + protos.google.cloud.speech.v1.IGetCustomClassRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getCustomClass request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.speech.v1.ICustomClass, + protos.google.cloud.speech.v1.IGetCustomClassRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getCustomClass response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getCustomClass(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.speech.v1.ICustomClass, + protos.google.cloud.speech.v1.IGetCustomClassRequest|undefined, + {}|undefined + ]) => { + this._log.info('getCustomClass response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Update a custom class. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.speech.v1.CustomClass} request.customClass + * Required. The custom class to update. + * + * The custom class's `name` field is used to identify the custom class to be + * updated. Format: + * + * `projects/{project}/locations/{location}/customClasses/{custom_class}` + * + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + * @param {google.protobuf.FieldMask} request.updateMask + * The list of fields to be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.speech.v1.CustomClass|CustomClass}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/adaptation.update_custom_class.js + * region_tag:speech_v1_generated_Adaptation_UpdateCustomClass_async + */ + updateCustomClass( + request?: protos.google.cloud.speech.v1.IUpdateCustomClassRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.speech.v1.ICustomClass, + protos.google.cloud.speech.v1.IUpdateCustomClassRequest|undefined, {}|undefined + ]>; + updateCustomClass( + request: protos.google.cloud.speech.v1.IUpdateCustomClassRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.speech.v1.ICustomClass, + protos.google.cloud.speech.v1.IUpdateCustomClassRequest|null|undefined, + {}|null|undefined>): void; + updateCustomClass( + request: protos.google.cloud.speech.v1.IUpdateCustomClassRequest, + callback: Callback< + protos.google.cloud.speech.v1.ICustomClass, + protos.google.cloud.speech.v1.IUpdateCustomClassRequest|null|undefined, + {}|null|undefined>): void; + updateCustomClass( + request?: protos.google.cloud.speech.v1.IUpdateCustomClassRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.speech.v1.ICustomClass, + protos.google.cloud.speech.v1.IUpdateCustomClassRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.speech.v1.ICustomClass, + protos.google.cloud.speech.v1.IUpdateCustomClassRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.speech.v1.ICustomClass, + protos.google.cloud.speech.v1.IUpdateCustomClassRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'custom_class.name': request.customClass!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateCustomClass request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.speech.v1.ICustomClass, + protos.google.cloud.speech.v1.IUpdateCustomClassRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateCustomClass response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateCustomClass(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.speech.v1.ICustomClass, + protos.google.cloud.speech.v1.IUpdateCustomClassRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateCustomClass response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Delete a custom class. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the custom class to delete. Format: + * + * `projects/{project}/locations/{location}/customClasses/{custom_class}` + * + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/adaptation.delete_custom_class.js + * region_tag:speech_v1_generated_Adaptation_DeleteCustomClass_async + */ + deleteCustomClass( + request?: protos.google.cloud.speech.v1.IDeleteCustomClassRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1.IDeleteCustomClassRequest|undefined, {}|undefined + ]>; + deleteCustomClass( + request: protos.google.cloud.speech.v1.IDeleteCustomClassRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1.IDeleteCustomClassRequest|null|undefined, + {}|null|undefined>): void; + deleteCustomClass( + request: protos.google.cloud.speech.v1.IDeleteCustomClassRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1.IDeleteCustomClassRequest|null|undefined, + {}|null|undefined>): void; + deleteCustomClass( + request?: protos.google.cloud.speech.v1.IDeleteCustomClassRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1.IDeleteCustomClassRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1.IDeleteCustomClassRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1.IDeleteCustomClassRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('deleteCustomClass request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1.IDeleteCustomClassRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteCustomClass response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteCustomClass(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1.IDeleteCustomClassRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteCustomClass response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } + + /** + * List phrase sets. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of phrase set. Format: + * + * `projects/{project}/locations/{location}` + * + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + * @param {number} request.pageSize + * The maximum number of phrase sets to return. The service may return + * fewer than this value. If unspecified, at most 50 phrase sets will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListPhraseSet` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListPhraseSet` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.speech.v1.PhraseSet|PhraseSet}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listPhraseSetAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listPhraseSet( + request?: protos.google.cloud.speech.v1.IListPhraseSetRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.speech.v1.IPhraseSet[], + protos.google.cloud.speech.v1.IListPhraseSetRequest|null, + protos.google.cloud.speech.v1.IListPhraseSetResponse + ]>; + listPhraseSet( + request: protos.google.cloud.speech.v1.IListPhraseSetRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.speech.v1.IListPhraseSetRequest, + protos.google.cloud.speech.v1.IListPhraseSetResponse|null|undefined, + protos.google.cloud.speech.v1.IPhraseSet>): void; + listPhraseSet( + request: protos.google.cloud.speech.v1.IListPhraseSetRequest, + callback: PaginationCallback< + protos.google.cloud.speech.v1.IListPhraseSetRequest, + protos.google.cloud.speech.v1.IListPhraseSetResponse|null|undefined, + protos.google.cloud.speech.v1.IPhraseSet>): void; + listPhraseSet( + request?: protos.google.cloud.speech.v1.IListPhraseSetRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.speech.v1.IListPhraseSetRequest, + protos.google.cloud.speech.v1.IListPhraseSetResponse|null|undefined, + protos.google.cloud.speech.v1.IPhraseSet>, + callback?: PaginationCallback< + protos.google.cloud.speech.v1.IListPhraseSetRequest, + protos.google.cloud.speech.v1.IListPhraseSetResponse|null|undefined, + protos.google.cloud.speech.v1.IPhraseSet>): + Promise<[ + protos.google.cloud.speech.v1.IPhraseSet[], + protos.google.cloud.speech.v1.IListPhraseSetRequest|null, + protos.google.cloud.speech.v1.IListPhraseSetResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.speech.v1.IListPhraseSetRequest, + protos.google.cloud.speech.v1.IListPhraseSetResponse|null|undefined, + protos.google.cloud.speech.v1.IPhraseSet>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listPhraseSet values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listPhraseSet request %j', request); + return this.innerApiCalls + .listPhraseSet(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.speech.v1.IPhraseSet[], + protos.google.cloud.speech.v1.IListPhraseSetRequest|null, + protos.google.cloud.speech.v1.IListPhraseSetResponse + ]) => { + this._log.info('listPhraseSet values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listPhraseSet`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of phrase set. Format: + * + * `projects/{project}/locations/{location}` + * + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + * @param {number} request.pageSize + * The maximum number of phrase sets to return. The service may return + * fewer than this value. If unspecified, at most 50 phrase sets will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListPhraseSet` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListPhraseSet` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.speech.v1.PhraseSet|PhraseSet} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listPhraseSetAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listPhraseSetStream( + request?: protos.google.cloud.speech.v1.IListPhraseSetRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listPhraseSet']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listPhraseSet stream %j', request); + return this.descriptors.page.listPhraseSet.createStream( + this.innerApiCalls.listPhraseSet as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listPhraseSet`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of phrase set. Format: + * + * `projects/{project}/locations/{location}` + * + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + * @param {number} request.pageSize + * The maximum number of phrase sets to return. The service may return + * fewer than this value. If unspecified, at most 50 phrase sets will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListPhraseSet` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListPhraseSet` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.speech.v1.PhraseSet|PhraseSet}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/adaptation.list_phrase_set.js + * region_tag:speech_v1_generated_Adaptation_ListPhraseSet_async + */ + listPhraseSetAsync( + request?: protos.google.cloud.speech.v1.IListPhraseSetRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listPhraseSet']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listPhraseSet iterate %j', request); + return this.descriptors.page.listPhraseSet.asyncIterate( + this.innerApiCalls['listPhraseSet'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * List custom classes. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of custom classes. Format: + * + * `projects/{project}/locations/{location}/customClasses` + * + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + * @param {number} request.pageSize + * The maximum number of custom classes to return. The service may return + * fewer than this value. If unspecified, at most 50 custom classes will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListCustomClass` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListCustomClass` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.speech.v1.CustomClass|CustomClass}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listCustomClassesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listCustomClasses( + request?: protos.google.cloud.speech.v1.IListCustomClassesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.speech.v1.ICustomClass[], + protos.google.cloud.speech.v1.IListCustomClassesRequest|null, + protos.google.cloud.speech.v1.IListCustomClassesResponse + ]>; + listCustomClasses( + request: protos.google.cloud.speech.v1.IListCustomClassesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.speech.v1.IListCustomClassesRequest, + protos.google.cloud.speech.v1.IListCustomClassesResponse|null|undefined, + protos.google.cloud.speech.v1.ICustomClass>): void; + listCustomClasses( + request: protos.google.cloud.speech.v1.IListCustomClassesRequest, + callback: PaginationCallback< + protos.google.cloud.speech.v1.IListCustomClassesRequest, + protos.google.cloud.speech.v1.IListCustomClassesResponse|null|undefined, + protos.google.cloud.speech.v1.ICustomClass>): void; + listCustomClasses( + request?: protos.google.cloud.speech.v1.IListCustomClassesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.speech.v1.IListCustomClassesRequest, + protos.google.cloud.speech.v1.IListCustomClassesResponse|null|undefined, + protos.google.cloud.speech.v1.ICustomClass>, + callback?: PaginationCallback< + protos.google.cloud.speech.v1.IListCustomClassesRequest, + protos.google.cloud.speech.v1.IListCustomClassesResponse|null|undefined, + protos.google.cloud.speech.v1.ICustomClass>): + Promise<[ + protos.google.cloud.speech.v1.ICustomClass[], + protos.google.cloud.speech.v1.IListCustomClassesRequest|null, + protos.google.cloud.speech.v1.IListCustomClassesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.speech.v1.IListCustomClassesRequest, + protos.google.cloud.speech.v1.IListCustomClassesResponse|null|undefined, + protos.google.cloud.speech.v1.ICustomClass>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listCustomClasses values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listCustomClasses request %j', request); + return this.innerApiCalls + .listCustomClasses(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.speech.v1.ICustomClass[], + protos.google.cloud.speech.v1.IListCustomClassesRequest|null, + protos.google.cloud.speech.v1.IListCustomClassesResponse + ]) => { + this._log.info('listCustomClasses values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listCustomClasses`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of custom classes. Format: + * + * `projects/{project}/locations/{location}/customClasses` + * + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + * @param {number} request.pageSize + * The maximum number of custom classes to return. The service may return + * fewer than this value. If unspecified, at most 50 custom classes will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListCustomClass` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListCustomClass` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.speech.v1.CustomClass|CustomClass} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listCustomClassesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listCustomClassesStream( + request?: protos.google.cloud.speech.v1.IListCustomClassesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listCustomClasses']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listCustomClasses stream %j', request); + return this.descriptors.page.listCustomClasses.createStream( + this.innerApiCalls.listCustomClasses as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listCustomClasses`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of custom classes. Format: + * + * `projects/{project}/locations/{location}/customClasses` + * + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + * @param {number} request.pageSize + * The maximum number of custom classes to return. The service may return + * fewer than this value. If unspecified, at most 50 custom classes will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListCustomClass` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListCustomClass` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.speech.v1.CustomClass|CustomClass}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/adaptation.list_custom_classes.js + * region_tag:speech_v1_generated_Adaptation_ListCustomClasses_async + */ + listCustomClassesAsync( + request?: protos.google.cloud.speech.v1.IListCustomClassesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listCustomClasses']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listCustomClasses iterate %j', request); + return this.descriptors.page.listCustomClasses.asyncIterate( + this.innerApiCalls['listCustomClasses'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified customClass resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} custom_class + * @returns {string} Resource name string. + */ + customClassPath(project:string,location:string,customClass:string) { + return this.pathTemplates.customClassPathTemplate.render({ + project: project, + location: location, + custom_class: customClass, + }); + } + + /** + * Parse the project from CustomClass resource. + * + * @param {string} customClassName + * A fully-qualified path representing CustomClass resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCustomClassName(customClassName: string) { + return this.pathTemplates.customClassPathTemplate.match(customClassName).project; + } + + /** + * Parse the location from CustomClass resource. + * + * @param {string} customClassName + * A fully-qualified path representing CustomClass resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCustomClassName(customClassName: string) { + return this.pathTemplates.customClassPathTemplate.match(customClassName).location; + } + + /** + * Parse the custom_class from CustomClass resource. + * + * @param {string} customClassName + * A fully-qualified path representing CustomClass resource. + * @returns {string} A string representing the custom_class. + */ + matchCustomClassFromCustomClassName(customClassName: string) { + return this.pathTemplates.customClassPathTemplate.match(customClassName).custom_class; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified phraseSet resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} phrase_set + * @returns {string} Resource name string. + */ + phraseSetPath(project:string,location:string,phraseSet:string) { + return this.pathTemplates.phraseSetPathTemplate.render({ + project: project, + location: location, + phrase_set: phraseSet, + }); + } + + /** + * Parse the project from PhraseSet resource. + * + * @param {string} phraseSetName + * A fully-qualified path representing PhraseSet resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPhraseSetName(phraseSetName: string) { + return this.pathTemplates.phraseSetPathTemplate.match(phraseSetName).project; + } + + /** + * Parse the location from PhraseSet resource. + * + * @param {string} phraseSetName + * A fully-qualified path representing PhraseSet resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPhraseSetName(phraseSetName: string) { + return this.pathTemplates.phraseSetPathTemplate.match(phraseSetName).location; + } + + /** + * Parse the phrase_set from PhraseSet resource. + * + * @param {string} phraseSetName + * A fully-qualified path representing PhraseSet resource. + * @returns {string} A string representing the phrase_set. + */ + matchPhraseSetFromPhraseSetName(phraseSetName: string) { + return this.pathTemplates.phraseSetPathTemplate.match(phraseSetName).phrase_set; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project:string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.adaptationStub && !this._terminated) { + return this.adaptationStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/src/v1/adaptation_client_config.json b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/src/v1/adaptation_client_config.json new file mode 100644 index 00000000000..029e9b88558 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/src/v1/adaptation_client_config.json @@ -0,0 +1,66 @@ +{ + "interfaces": { + "google.cloud.speech.v1.Adaptation": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreatePhraseSet": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetPhraseSet": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListPhraseSet": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdatePhraseSet": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeletePhraseSet": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateCustomClass": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetCustomClass": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListCustomClasses": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateCustomClass": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteCustomClass": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/src/v1/adaptation_proto_list.json b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/src/v1/adaptation_proto_list.json new file mode 100644 index 00000000000..46afac3f942 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/src/v1/adaptation_proto_list.json @@ -0,0 +1,5 @@ +[ + "../../protos/google/cloud/speech/v1/cloud_speech.proto", + "../../protos/google/cloud/speech/v1/cloud_speech_adaptation.proto", + "../../protos/google/cloud/speech/v1/resource.proto" +] diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/src/v1/gapic_metadata.json b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..96f60b3cd28 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/src/v1/gapic_metadata.json @@ -0,0 +1,170 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.speech.v1", + "libraryPackage": "@google-cloud/speech", + "services": { + "Adaptation": { + "clients": { + "grpc": { + "libraryClient": "AdaptationClient", + "rpcs": { + "CreatePhraseSet": { + "methods": [ + "createPhraseSet" + ] + }, + "GetPhraseSet": { + "methods": [ + "getPhraseSet" + ] + }, + "UpdatePhraseSet": { + "methods": [ + "updatePhraseSet" + ] + }, + "DeletePhraseSet": { + "methods": [ + "deletePhraseSet" + ] + }, + "CreateCustomClass": { + "methods": [ + "createCustomClass" + ] + }, + "GetCustomClass": { + "methods": [ + "getCustomClass" + ] + }, + "UpdateCustomClass": { + "methods": [ + "updateCustomClass" + ] + }, + "DeleteCustomClass": { + "methods": [ + "deleteCustomClass" + ] + }, + "ListPhraseSet": { + "methods": [ + "listPhraseSet", + "listPhraseSetStream", + "listPhraseSetAsync" + ] + }, + "ListCustomClasses": { + "methods": [ + "listCustomClasses", + "listCustomClassesStream", + "listCustomClassesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "AdaptationClient", + "rpcs": { + "CreatePhraseSet": { + "methods": [ + "createPhraseSet" + ] + }, + "GetPhraseSet": { + "methods": [ + "getPhraseSet" + ] + }, + "UpdatePhraseSet": { + "methods": [ + "updatePhraseSet" + ] + }, + "DeletePhraseSet": { + "methods": [ + "deletePhraseSet" + ] + }, + "CreateCustomClass": { + "methods": [ + "createCustomClass" + ] + }, + "GetCustomClass": { + "methods": [ + "getCustomClass" + ] + }, + "UpdateCustomClass": { + "methods": [ + "updateCustomClass" + ] + }, + "DeleteCustomClass": { + "methods": [ + "deleteCustomClass" + ] + }, + "ListPhraseSet": { + "methods": [ + "listPhraseSet", + "listPhraseSetStream", + "listPhraseSetAsync" + ] + }, + "ListCustomClasses": { + "methods": [ + "listCustomClasses", + "listCustomClassesStream", + "listCustomClassesAsync" + ] + } + } + } + } + }, + "Speech": { + "clients": { + "grpc": { + "libraryClient": "SpeechClient", + "rpcs": { + "Recognize": { + "methods": [ + "recognize" + ] + }, + "StreamingRecognize": { + "methods": [ + "streamingRecognize" + ] + }, + "LongRunningRecognize": { + "methods": [ + "longRunningRecognize" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "SpeechClient", + "rpcs": { + "Recognize": { + "methods": [ + "recognize" + ] + }, + "LongRunningRecognize": { + "methods": [ + "longRunningRecognize" + ] + } + } + } + } + } + } +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/src/v1/index.ts b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/src/v1/index.ts new file mode 100644 index 00000000000..4a66bbeb5ff --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/src/v1/index.ts @@ -0,0 +1,20 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {AdaptationClient} from './adaptation_client'; +export {SpeechClient} from './speech_client'; diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/src/v1/speech_client.ts b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/src/v1/speech_client.ts new file mode 100644 index 00000000000..d4610409334 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/src/v1/speech_client.ts @@ -0,0 +1,946 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation} from 'google-gax'; +import {PassThrough} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1/speech_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './speech_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service that implements Google Cloud Speech API. + * @class + * @memberof v1 + */ +export class SpeechClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('speech'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + speechStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of SpeechClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new SpeechClient({fallback: true}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof SpeechClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'speech.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + customClassPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/customClasses/{custom_class}' + ), + phraseSetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/phraseSets/{phrase_set}' + ), + }; + + // Some of the methods on this service provide streaming responses. + // Provide descriptors for these. + this.descriptors.stream = { + streamingRecognize: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.BIDI_STREAMING, !!opts.fallback, !!opts.gaxServerStreamingRetries) + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.longrunning.Operations.GetOperation',get: '/v1/operations/{name=**}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v1/operations',}]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); + const longRunningRecognizeResponse = protoFilesRoot.lookup( + '.google.cloud.speech.v1.LongRunningRecognizeResponse') as gax.protobuf.Type; + const longRunningRecognizeMetadata = protoFilesRoot.lookup( + '.google.cloud.speech.v1.LongRunningRecognizeMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + longRunningRecognize: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + longRunningRecognizeResponse.decode.bind(longRunningRecognizeResponse), + longRunningRecognizeMetadata.decode.bind(longRunningRecognizeMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.speech.v1.Speech', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.speechStub) { + return this.speechStub; + } + + // Put together the "service stub" for + // google.cloud.speech.v1.Speech. + this.speechStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.speech.v1.Speech') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.speech.v1.Speech, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const speechStubMethods = + ['recognize', 'longRunningRecognize', 'streamingRecognize']; + for (const methodName of speechStubMethods) { + const callPromise = this.speechStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + if (methodName in this.descriptors.stream) { + const stream = new PassThrough({objectMode: true}); + setImmediate(() => { + stream.emit('error', new this._gaxModule.GoogleError('The client has already been closed.')); + }); + return stream; + } + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.stream[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.speechStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'speech.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'speech.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Performs synchronous speech recognition: receive results after all audio + * has been sent and processed. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.speech.v1.RecognitionConfig} request.config + * Required. Provides information to the recognizer that specifies how to + * process the request. + * @param {google.cloud.speech.v1.RecognitionAudio} request.audio + * Required. The audio data to be recognized. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.speech.v1.RecognizeResponse|RecognizeResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/speech.recognize.js + * region_tag:speech_v1_generated_Speech_Recognize_async + */ + recognize( + request?: protos.google.cloud.speech.v1.IRecognizeRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.speech.v1.IRecognizeResponse, + protos.google.cloud.speech.v1.IRecognizeRequest|undefined, {}|undefined + ]>; + recognize( + request: protos.google.cloud.speech.v1.IRecognizeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.speech.v1.IRecognizeResponse, + protos.google.cloud.speech.v1.IRecognizeRequest|null|undefined, + {}|null|undefined>): void; + recognize( + request: protos.google.cloud.speech.v1.IRecognizeRequest, + callback: Callback< + protos.google.cloud.speech.v1.IRecognizeResponse, + protos.google.cloud.speech.v1.IRecognizeRequest|null|undefined, + {}|null|undefined>): void; + recognize( + request?: protos.google.cloud.speech.v1.IRecognizeRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.speech.v1.IRecognizeResponse, + protos.google.cloud.speech.v1.IRecognizeRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.speech.v1.IRecognizeResponse, + protos.google.cloud.speech.v1.IRecognizeRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.speech.v1.IRecognizeResponse, + protos.google.cloud.speech.v1.IRecognizeRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + this.initialize().catch(err => {throw err}); + this._log.info('recognize request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.speech.v1.IRecognizeResponse, + protos.google.cloud.speech.v1.IRecognizeRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('recognize response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.recognize(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.speech.v1.IRecognizeResponse, + protos.google.cloud.speech.v1.IRecognizeRequest|undefined, + {}|undefined + ]) => { + this._log.info('recognize response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } + +/** + * Performs bidirectional streaming speech recognition: receive results while + * sending audio. This method is only available via the gRPC API (not REST). + * + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which is both readable and writable. It accepts objects + * representing {@link protos.google.cloud.speech.v1.StreamingRecognizeRequest|StreamingRecognizeRequest} for write() method, and + * will emit objects representing {@link protos.google.cloud.speech.v1.StreamingRecognizeResponse|StreamingRecognizeResponse} on 'data' event asynchronously. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#bi-directional-streaming | documentation } + * for more details and examples. + * @example include:samples/generated/v1/speech.streaming_recognize.js + * region_tag:speech_v1_generated_Speech_StreamingRecognize_async + */ + streamingRecognize( + options?: CallOptions): + gax.CancellableStream { + this.initialize().catch(err => {throw err}); + this._log.info('streamingRecognize stream %j', options); + return this.innerApiCalls.streamingRecognize(null, options); + } + +/** + * Performs asynchronous speech recognition: receive results via the + * google.longrunning.Operations interface. Returns either an + * `Operation.error` or an `Operation.response` which contains + * a `LongRunningRecognizeResponse` message. + * For more information on asynchronous speech recognition, see the + * [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.speech.v1.RecognitionConfig} request.config + * Required. Provides information to the recognizer that specifies how to + * process the request. + * @param {google.cloud.speech.v1.RecognitionAudio} request.audio + * Required. The audio data to be recognized. + * @param {google.cloud.speech.v1.TranscriptOutputConfig} [request.outputConfig] + * Optional. Specifies an optional destination for the recognition results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/speech.long_running_recognize.js + * region_tag:speech_v1_generated_Speech_LongRunningRecognize_async + */ + longRunningRecognize( + request?: protos.google.cloud.speech.v1.ILongRunningRecognizeRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + longRunningRecognize( + request: protos.google.cloud.speech.v1.ILongRunningRecognizeRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + longRunningRecognize( + request: protos.google.cloud.speech.v1.ILongRunningRecognizeRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + longRunningRecognize( + request?: protos.google.cloud.speech.v1.ILongRunningRecognizeRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('longRunningRecognize response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('longRunningRecognize request %j', request); + return this.innerApiCalls.longRunningRecognize(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('longRunningRecognize response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `longRunningRecognize()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/speech.long_running_recognize.js + * region_tag:speech_v1_generated_Speech_LongRunningRecognize_async + */ + async checkLongRunningRecognizeProgress(name: string): Promise>{ + this._log.info('longRunningRecognize long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.longRunningRecognize, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified customClass resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} custom_class + * @returns {string} Resource name string. + */ + customClassPath(project:string,location:string,customClass:string) { + return this.pathTemplates.customClassPathTemplate.render({ + project: project, + location: location, + custom_class: customClass, + }); + } + + /** + * Parse the project from CustomClass resource. + * + * @param {string} customClassName + * A fully-qualified path representing CustomClass resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCustomClassName(customClassName: string) { + return this.pathTemplates.customClassPathTemplate.match(customClassName).project; + } + + /** + * Parse the location from CustomClass resource. + * + * @param {string} customClassName + * A fully-qualified path representing CustomClass resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCustomClassName(customClassName: string) { + return this.pathTemplates.customClassPathTemplate.match(customClassName).location; + } + + /** + * Parse the custom_class from CustomClass resource. + * + * @param {string} customClassName + * A fully-qualified path representing CustomClass resource. + * @returns {string} A string representing the custom_class. + */ + matchCustomClassFromCustomClassName(customClassName: string) { + return this.pathTemplates.customClassPathTemplate.match(customClassName).custom_class; + } + + /** + * Return a fully-qualified phraseSet resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} phrase_set + * @returns {string} Resource name string. + */ + phraseSetPath(project:string,location:string,phraseSet:string) { + return this.pathTemplates.phraseSetPathTemplate.render({ + project: project, + location: location, + phrase_set: phraseSet, + }); + } + + /** + * Parse the project from PhraseSet resource. + * + * @param {string} phraseSetName + * A fully-qualified path representing PhraseSet resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPhraseSetName(phraseSetName: string) { + return this.pathTemplates.phraseSetPathTemplate.match(phraseSetName).project; + } + + /** + * Parse the location from PhraseSet resource. + * + * @param {string} phraseSetName + * A fully-qualified path representing PhraseSet resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPhraseSetName(phraseSetName: string) { + return this.pathTemplates.phraseSetPathTemplate.match(phraseSetName).location; + } + + /** + * Parse the phrase_set from PhraseSet resource. + * + * @param {string} phraseSetName + * A fully-qualified path representing PhraseSet resource. + * @returns {string} A string representing the phrase_set. + */ + matchPhraseSetFromPhraseSetName(phraseSetName: string) { + return this.pathTemplates.phraseSetPathTemplate.match(phraseSetName).phrase_set; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.speechStub && !this._terminated) { + return this.speechStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/src/v1/speech_client_config.json b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/src/v1/speech_client_config.json new file mode 100644 index 00000000000..35b04f64cd2 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/src/v1/speech_client_config.json @@ -0,0 +1,41 @@ +{ + "interfaces": { + "google.cloud.speech.v1.Speech": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "Recognize": { + "timeout_millis": 5000000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "LongRunningRecognize": { + "timeout_millis": 5000000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "StreamingRecognize": { + "timeout_millis": 5000000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/src/v1/speech_proto_list.json b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/src/v1/speech_proto_list.json new file mode 100644 index 00000000000..46afac3f942 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/src/v1/speech_proto_list.json @@ -0,0 +1,5 @@ +[ + "../../protos/google/cloud/speech/v1/cloud_speech.proto", + "../../protos/google/cloud/speech/v1/cloud_speech_adaptation.proto", + "../../protos/google/cloud/speech/v1/resource.proto" +] diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/system-test/fixtures/sample/src/index.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..96a3a1b3b8e --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/system-test/fixtures/sample/src/index.js @@ -0,0 +1,28 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const speech = require('@google-cloud/speech'); + +function main() { + const adaptationClient = new speech.AdaptationClient(); + const speechClient = new speech.SpeechClient(); +} + +main(); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/system-test/fixtures/sample/src/index.ts b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..3f61a9c89c4 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,38 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {AdaptationClient, SpeechClient} from '@google-cloud/speech'; + +// check that the client class type name can be used +function doStuffWithAdaptationClient(client: AdaptationClient) { + client.close(); +} +function doStuffWithSpeechClient(client: SpeechClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const adaptationClient = new AdaptationClient(); + doStuffWithAdaptationClient(adaptationClient); + // check that the client instance can be created + const speechClient = new SpeechClient(); + doStuffWithSpeechClient(speechClient); +} + +main(); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/system-test/install.ts b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/system-test/install.ts new file mode 100644 index 00000000000..2a505d6df0c --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/system-test/install.ts @@ -0,0 +1,49 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + + it('TypeScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() + } + }; + await packNTest(options); + }); + + it('JavaScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() + } + }; + await packNTest(options); + }); + +}); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/test/gapic_adaptation_v1.ts b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/test/gapic_adaptation_v1.ts new file mode 100644 index 00000000000..7283e141bd7 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/test/gapic_adaptation_v1.ts @@ -0,0 +1,1786 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as adaptationModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.AdaptationClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new adaptationModule.v1.AdaptationClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'speech.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new adaptationModule.v1.AdaptationClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = adaptationModule.v1.AdaptationClient.servicePath; + assert.strictEqual(servicePath, 'speech.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = adaptationModule.v1.AdaptationClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'speech.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new adaptationModule.v1.AdaptationClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'speech.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new adaptationModule.v1.AdaptationClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'speech.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new adaptationModule.v1.AdaptationClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'speech.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new adaptationModule.v1.AdaptationClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'speech.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new adaptationModule.v1.AdaptationClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = adaptationModule.v1.AdaptationClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new adaptationModule.v1.AdaptationClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new adaptationModule.v1.AdaptationClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.adaptationStub, undefined); + await client.initialize(); + assert(client.adaptationStub); + }); + + it('has close method for the initialized client', done => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.adaptationStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.adaptationStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('createPhraseSet', () => { + it('invokes createPhraseSet without error', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.CreatePhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.CreatePhraseSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1.PhraseSet() + ); + client.innerApiCalls.createPhraseSet = stubSimpleCall(expectedResponse); + const [response] = await client.createPhraseSet(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createPhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createPhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPhraseSet without error using callback', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.CreatePhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.CreatePhraseSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1.PhraseSet() + ); + client.innerApiCalls.createPhraseSet = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createPhraseSet( + request, + (err?: Error|null, result?: protos.google.cloud.speech.v1.IPhraseSet|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createPhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createPhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPhraseSet with error', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.CreatePhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.CreatePhraseSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createPhraseSet = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createPhraseSet(request), expectedError); + const actualRequest = (client.innerApiCalls.createPhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createPhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPhraseSet with closed client', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.CreatePhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.CreatePhraseSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createPhraseSet(request), expectedError); + }); + }); + + describe('getPhraseSet', () => { + it('invokes getPhraseSet without error', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.GetPhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.GetPhraseSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1.PhraseSet() + ); + client.innerApiCalls.getPhraseSet = stubSimpleCall(expectedResponse); + const [response] = await client.getPhraseSet(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getPhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getPhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPhraseSet without error using callback', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.GetPhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.GetPhraseSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1.PhraseSet() + ); + client.innerApiCalls.getPhraseSet = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getPhraseSet( + request, + (err?: Error|null, result?: protos.google.cloud.speech.v1.IPhraseSet|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getPhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getPhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPhraseSet with error', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.GetPhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.GetPhraseSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getPhraseSet = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getPhraseSet(request), expectedError); + const actualRequest = (client.innerApiCalls.getPhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getPhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPhraseSet with closed client', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.GetPhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.GetPhraseSetRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getPhraseSet(request), expectedError); + }); + }); + + describe('updatePhraseSet', () => { + it('invokes updatePhraseSet without error', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.UpdatePhraseSetRequest() + ); + request.phraseSet ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.UpdatePhraseSetRequest', ['phraseSet', 'name']); + request.phraseSet.name = defaultValue1; + const expectedHeaderRequestParams = `phrase_set.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1.PhraseSet() + ); + client.innerApiCalls.updatePhraseSet = stubSimpleCall(expectedResponse); + const [response] = await client.updatePhraseSet(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updatePhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updatePhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updatePhraseSet without error using callback', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.UpdatePhraseSetRequest() + ); + request.phraseSet ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.UpdatePhraseSetRequest', ['phraseSet', 'name']); + request.phraseSet.name = defaultValue1; + const expectedHeaderRequestParams = `phrase_set.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1.PhraseSet() + ); + client.innerApiCalls.updatePhraseSet = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updatePhraseSet( + request, + (err?: Error|null, result?: protos.google.cloud.speech.v1.IPhraseSet|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updatePhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updatePhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updatePhraseSet with error', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.UpdatePhraseSetRequest() + ); + request.phraseSet ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.UpdatePhraseSetRequest', ['phraseSet', 'name']); + request.phraseSet.name = defaultValue1; + const expectedHeaderRequestParams = `phrase_set.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updatePhraseSet = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updatePhraseSet(request), expectedError); + const actualRequest = (client.innerApiCalls.updatePhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updatePhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updatePhraseSet with closed client', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.UpdatePhraseSetRequest() + ); + request.phraseSet ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.UpdatePhraseSetRequest', ['phraseSet', 'name']); + request.phraseSet.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updatePhraseSet(request), expectedError); + }); + }); + + describe('deletePhraseSet', () => { + it('invokes deletePhraseSet without error', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.DeletePhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.DeletePhraseSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deletePhraseSet = stubSimpleCall(expectedResponse); + const [response] = await client.deletePhraseSet(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deletePhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deletePhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePhraseSet without error using callback', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.DeletePhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.DeletePhraseSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deletePhraseSet = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deletePhraseSet( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deletePhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deletePhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePhraseSet with error', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.DeletePhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.DeletePhraseSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deletePhraseSet = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deletePhraseSet(request), expectedError); + const actualRequest = (client.innerApiCalls.deletePhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deletePhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePhraseSet with closed client', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.DeletePhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.DeletePhraseSetRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deletePhraseSet(request), expectedError); + }); + }); + + describe('createCustomClass', () => { + it('invokes createCustomClass without error', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.CreateCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.CreateCustomClassRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1.CustomClass() + ); + client.innerApiCalls.createCustomClass = stubSimpleCall(expectedResponse); + const [response] = await client.createCustomClass(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCustomClass without error using callback', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.CreateCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.CreateCustomClassRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1.CustomClass() + ); + client.innerApiCalls.createCustomClass = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createCustomClass( + request, + (err?: Error|null, result?: protos.google.cloud.speech.v1.ICustomClass|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCustomClass with error', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.CreateCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.CreateCustomClassRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCustomClass = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createCustomClass(request), expectedError); + const actualRequest = (client.innerApiCalls.createCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCustomClass with closed client', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.CreateCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.CreateCustomClassRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createCustomClass(request), expectedError); + }); + }); + + describe('getCustomClass', () => { + it('invokes getCustomClass without error', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.GetCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.GetCustomClassRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1.CustomClass() + ); + client.innerApiCalls.getCustomClass = stubSimpleCall(expectedResponse); + const [response] = await client.getCustomClass(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCustomClass without error using callback', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.GetCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.GetCustomClassRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1.CustomClass() + ); + client.innerApiCalls.getCustomClass = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getCustomClass( + request, + (err?: Error|null, result?: protos.google.cloud.speech.v1.ICustomClass|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCustomClass with error', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.GetCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.GetCustomClassRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getCustomClass = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getCustomClass(request), expectedError); + const actualRequest = (client.innerApiCalls.getCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCustomClass with closed client', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.GetCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.GetCustomClassRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getCustomClass(request), expectedError); + }); + }); + + describe('updateCustomClass', () => { + it('invokes updateCustomClass without error', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.UpdateCustomClassRequest() + ); + request.customClass ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.UpdateCustomClassRequest', ['customClass', 'name']); + request.customClass.name = defaultValue1; + const expectedHeaderRequestParams = `custom_class.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1.CustomClass() + ); + client.innerApiCalls.updateCustomClass = stubSimpleCall(expectedResponse); + const [response] = await client.updateCustomClass(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCustomClass without error using callback', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.UpdateCustomClassRequest() + ); + request.customClass ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.UpdateCustomClassRequest', ['customClass', 'name']); + request.customClass.name = defaultValue1; + const expectedHeaderRequestParams = `custom_class.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1.CustomClass() + ); + client.innerApiCalls.updateCustomClass = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateCustomClass( + request, + (err?: Error|null, result?: protos.google.cloud.speech.v1.ICustomClass|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCustomClass with error', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.UpdateCustomClassRequest() + ); + request.customClass ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.UpdateCustomClassRequest', ['customClass', 'name']); + request.customClass.name = defaultValue1; + const expectedHeaderRequestParams = `custom_class.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCustomClass = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateCustomClass(request), expectedError); + const actualRequest = (client.innerApiCalls.updateCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCustomClass with closed client', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.UpdateCustomClassRequest() + ); + request.customClass ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.UpdateCustomClassRequest', ['customClass', 'name']); + request.customClass.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateCustomClass(request), expectedError); + }); + }); + + describe('deleteCustomClass', () => { + it('invokes deleteCustomClass without error', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.DeleteCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.DeleteCustomClassRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteCustomClass = stubSimpleCall(expectedResponse); + const [response] = await client.deleteCustomClass(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCustomClass without error using callback', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.DeleteCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.DeleteCustomClassRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteCustomClass = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteCustomClass( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCustomClass with error', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.DeleteCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.DeleteCustomClassRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCustomClass = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteCustomClass(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCustomClass with closed client', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.DeleteCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.DeleteCustomClassRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteCustomClass(request), expectedError); + }); + }); + + describe('listPhraseSet', () => { + it('invokes listPhraseSet without error', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.ListPhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.ListPhraseSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.speech.v1.PhraseSet()), + generateSampleMessage(new protos.google.cloud.speech.v1.PhraseSet()), + generateSampleMessage(new protos.google.cloud.speech.v1.PhraseSet()), + ]; + client.innerApiCalls.listPhraseSet = stubSimpleCall(expectedResponse); + const [response] = await client.listPhraseSet(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listPhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listPhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPhraseSet without error using callback', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.ListPhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.ListPhraseSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.speech.v1.PhraseSet()), + generateSampleMessage(new protos.google.cloud.speech.v1.PhraseSet()), + generateSampleMessage(new protos.google.cloud.speech.v1.PhraseSet()), + ]; + client.innerApiCalls.listPhraseSet = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listPhraseSet( + request, + (err?: Error|null, result?: protos.google.cloud.speech.v1.IPhraseSet[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listPhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listPhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPhraseSet with error', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.ListPhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.ListPhraseSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listPhraseSet = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listPhraseSet(request), expectedError); + const actualRequest = (client.innerApiCalls.listPhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listPhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPhraseSetStream without error', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.ListPhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.ListPhraseSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.speech.v1.PhraseSet()), + generateSampleMessage(new protos.google.cloud.speech.v1.PhraseSet()), + generateSampleMessage(new protos.google.cloud.speech.v1.PhraseSet()), + ]; + client.descriptors.page.listPhraseSet.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listPhraseSetStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.speech.v1.PhraseSet[] = []; + stream.on('data', (response: protos.google.cloud.speech.v1.PhraseSet) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listPhraseSet.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listPhraseSet, request)); + assert( + (client.descriptors.page.listPhraseSet.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listPhraseSetStream with error', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.ListPhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.ListPhraseSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listPhraseSet.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listPhraseSetStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.speech.v1.PhraseSet[] = []; + stream.on('data', (response: protos.google.cloud.speech.v1.PhraseSet) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listPhraseSet.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listPhraseSet, request)); + assert( + (client.descriptors.page.listPhraseSet.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listPhraseSet without error', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.ListPhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.ListPhraseSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.speech.v1.PhraseSet()), + generateSampleMessage(new protos.google.cloud.speech.v1.PhraseSet()), + generateSampleMessage(new protos.google.cloud.speech.v1.PhraseSet()), + ]; + client.descriptors.page.listPhraseSet.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.speech.v1.IPhraseSet[] = []; + const iterable = client.listPhraseSetAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listPhraseSet.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listPhraseSet.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listPhraseSet with error', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.ListPhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.ListPhraseSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listPhraseSet.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listPhraseSetAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.speech.v1.IPhraseSet[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listPhraseSet.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listPhraseSet.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listCustomClasses', () => { + it('invokes listCustomClasses without error', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.ListCustomClassesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.ListCustomClassesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.speech.v1.CustomClass()), + generateSampleMessage(new protos.google.cloud.speech.v1.CustomClass()), + generateSampleMessage(new protos.google.cloud.speech.v1.CustomClass()), + ]; + client.innerApiCalls.listCustomClasses = stubSimpleCall(expectedResponse); + const [response] = await client.listCustomClasses(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listCustomClasses as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listCustomClasses as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCustomClasses without error using callback', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.ListCustomClassesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.ListCustomClassesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.speech.v1.CustomClass()), + generateSampleMessage(new protos.google.cloud.speech.v1.CustomClass()), + generateSampleMessage(new protos.google.cloud.speech.v1.CustomClass()), + ]; + client.innerApiCalls.listCustomClasses = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listCustomClasses( + request, + (err?: Error|null, result?: protos.google.cloud.speech.v1.ICustomClass[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listCustomClasses as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listCustomClasses as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCustomClasses with error', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.ListCustomClassesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.ListCustomClassesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listCustomClasses = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listCustomClasses(request), expectedError); + const actualRequest = (client.innerApiCalls.listCustomClasses as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listCustomClasses as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCustomClassesStream without error', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.ListCustomClassesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.ListCustomClassesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.speech.v1.CustomClass()), + generateSampleMessage(new protos.google.cloud.speech.v1.CustomClass()), + generateSampleMessage(new protos.google.cloud.speech.v1.CustomClass()), + ]; + client.descriptors.page.listCustomClasses.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listCustomClassesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.speech.v1.CustomClass[] = []; + stream.on('data', (response: protos.google.cloud.speech.v1.CustomClass) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listCustomClasses.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listCustomClasses, request)); + assert( + (client.descriptors.page.listCustomClasses.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listCustomClassesStream with error', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.ListCustomClassesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.ListCustomClassesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listCustomClasses.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listCustomClassesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.speech.v1.CustomClass[] = []; + stream.on('data', (response: protos.google.cloud.speech.v1.CustomClass) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listCustomClasses.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listCustomClasses, request)); + assert( + (client.descriptors.page.listCustomClasses.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listCustomClasses without error', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.ListCustomClassesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.ListCustomClassesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.speech.v1.CustomClass()), + generateSampleMessage(new protos.google.cloud.speech.v1.CustomClass()), + generateSampleMessage(new protos.google.cloud.speech.v1.CustomClass()), + ]; + client.descriptors.page.listCustomClasses.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.speech.v1.ICustomClass[] = []; + const iterable = client.listCustomClassesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listCustomClasses.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listCustomClasses.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listCustomClasses with error', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.ListCustomClassesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.ListCustomClassesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listCustomClasses.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listCustomClassesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.speech.v1.ICustomClass[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listCustomClasses.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listCustomClasses.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + + describe('customClass', async () => { + const fakePath = "/rendered/path/customClass"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + custom_class: "customClassValue", + }; + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.customClassPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.customClassPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('customClassPath', () => { + const result = client.customClassPath("projectValue", "locationValue", "customClassValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.customClassPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromCustomClassName', () => { + const result = client.matchProjectFromCustomClassName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.customClassPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromCustomClassName', () => { + const result = client.matchLocationFromCustomClassName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.customClassPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCustomClassFromCustomClassName', () => { + const result = client.matchCustomClassFromCustomClassName(fakePath); + assert.strictEqual(result, "customClassValue"); + assert((client.pathTemplates.customClassPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', async () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('phraseSet', async () => { + const fakePath = "/rendered/path/phraseSet"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + phrase_set: "phraseSetValue", + }; + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.phraseSetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.phraseSetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('phraseSetPath', () => { + const result = client.phraseSetPath("projectValue", "locationValue", "phraseSetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.phraseSetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromPhraseSetName', () => { + const result = client.matchProjectFromPhraseSetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.phraseSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromPhraseSetName', () => { + const result = client.matchLocationFromPhraseSetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.phraseSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPhraseSetFromPhraseSetName', () => { + const result = client.matchPhraseSetFromPhraseSetName(fakePath); + assert.strictEqual(result, "phraseSetValue"); + assert((client.pathTemplates.phraseSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('project', async () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/test/gapic_speech_v1.ts b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/test/gapic_speech_v1.ts new file mode 100644 index 00000000000..5cf13b4a47f --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/test/gapic_speech_v1.ts @@ -0,0 +1,864 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as speechModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubBidiStreamingCall(response?: ResponseType, error?: Error) { + const transformStub = error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + return sinon.stub().returns(mockStream); +} + +function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.SpeechClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new speechModule.v1.SpeechClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'speech.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new speechModule.v1.SpeechClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = speechModule.v1.SpeechClient.servicePath; + assert.strictEqual(servicePath, 'speech.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = speechModule.v1.SpeechClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'speech.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new speechModule.v1.SpeechClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'speech.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new speechModule.v1.SpeechClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'speech.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new speechModule.v1.SpeechClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'speech.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new speechModule.v1.SpeechClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'speech.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new speechModule.v1.SpeechClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = speechModule.v1.SpeechClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new speechModule.v1.SpeechClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new speechModule.v1.SpeechClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.speechStub, undefined); + await client.initialize(); + assert(client.speechStub); + }); + + it('has close method for the initialized client', done => { + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.speechStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.speechStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('recognize', () => { + it('invokes recognize without error', async () => { + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.RecognizeRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1.RecognizeResponse() + ); + client.innerApiCalls.recognize = stubSimpleCall(expectedResponse); + const [response] = await client.recognize(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes recognize without error using callback', async () => { + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.RecognizeRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1.RecognizeResponse() + ); + client.innerApiCalls.recognize = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.recognize( + request, + (err?: Error|null, result?: protos.google.cloud.speech.v1.IRecognizeResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes recognize with error', async () => { + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.RecognizeRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.recognize = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.recognize(request), expectedError); + }); + + it('invokes recognize with closed client', async () => { + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.RecognizeRequest() + ); + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.recognize(request), expectedError); + }); + }); + + describe('longRunningRecognize', () => { + it('invokes longRunningRecognize without error', async () => { + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.LongRunningRecognizeRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.longRunningRecognize = stubLongRunningCall(expectedResponse); + const [operation] = await client.longRunningRecognize(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes longRunningRecognize without error using callback', async () => { + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.LongRunningRecognizeRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.longRunningRecognize = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.longRunningRecognize( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes longRunningRecognize with call error', async () => { + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.LongRunningRecognizeRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.longRunningRecognize = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.longRunningRecognize(request), expectedError); + }); + + it('invokes longRunningRecognize with LRO error', async () => { + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.LongRunningRecognizeRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.longRunningRecognize = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.longRunningRecognize(request); + await assert.rejects(operation.promise(), expectedError); + }); + + it('invokes checkLongRunningRecognizeProgress without error', async () => { + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkLongRunningRecognizeProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkLongRunningRecognizeProgress with error', async () => { + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkLongRunningRecognizeProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('streamingRecognize', () => { + it('invokes streamingRecognize without error', async () => { + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.StreamingRecognizeRequest() + ); + + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1.StreamingRecognizeResponse() + ); + client.innerApiCalls.streamingRecognize = stubBidiStreamingCall(expectedResponse); + const stream = client.streamingRecognize(); + const promise = new Promise((resolve, reject) => { + stream.on('data', (response: protos.google.cloud.speech.v1.StreamingRecognizeResponse) => { + resolve(response); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + stream.write(request); + stream.end(); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.streamingRecognize as SinonStub) + .getCall(0).calledWith(null)); + assert.deepStrictEqual(((stream as unknown as PassThrough) + ._transform as SinonStub).getCall(0).args[0], request); + }); + + it('invokes streamingRecognize with error', async () => { + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.StreamingRecognizeRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.streamingRecognize = stubBidiStreamingCall(undefined, expectedError); + const stream = client.streamingRecognize(); + const promise = new Promise((resolve, reject) => { + stream.on('data', (response: protos.google.cloud.speech.v1.StreamingRecognizeResponse) => { + resolve(response); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + stream.write(request); + stream.end(); + }); + await assert.rejects(promise, expectedError); + assert((client.innerApiCalls.streamingRecognize as SinonStub) + .getCall(0).calledWith(null)); + assert.deepStrictEqual(((stream as unknown as PassThrough) + ._transform as SinonStub).getCall(0).args[0], request); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.IOperation[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.IOperation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + describe('Path templates', () => { + + describe('customClass', async () => { + const fakePath = "/rendered/path/customClass"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + custom_class: "customClassValue", + }; + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.customClassPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.customClassPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('customClassPath', () => { + const result = client.customClassPath("projectValue", "locationValue", "customClassValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.customClassPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromCustomClassName', () => { + const result = client.matchProjectFromCustomClassName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.customClassPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromCustomClassName', () => { + const result = client.matchLocationFromCustomClassName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.customClassPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCustomClassFromCustomClassName', () => { + const result = client.matchCustomClassFromCustomClassName(fakePath); + assert.strictEqual(result, "customClassValue"); + assert((client.pathTemplates.customClassPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('phraseSet', async () => { + const fakePath = "/rendered/path/phraseSet"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + phrase_set: "phraseSetValue", + }; + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.phraseSetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.phraseSetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('phraseSetPath', () => { + const result = client.phraseSetPath("projectValue", "locationValue", "phraseSetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.phraseSetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromPhraseSetName', () => { + const result = client.matchProjectFromPhraseSetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.phraseSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromPhraseSetName', () => { + const result = client.matchLocationFromPhraseSetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.phraseSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPhraseSetFromPhraseSetName', () => { + const result = client.matchPhraseSetFromPhraseSetName(fakePath); + assert.strictEqual(result, "phraseSetValue"); + assert((client.pathTemplates.phraseSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/tsconfig.json b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/tsconfig.json new file mode 100644 index 00000000000..ca73e7bfc82 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/tsconfig.json @@ -0,0 +1,22 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2023", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts", + "src/**/*.json", + "samples/**/*.json", + "protos/protos.json" + ] +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/webpack.config.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/webpack.config.js new file mode 100644 index 00000000000..50273cca41c --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1-nodejs/webpack.config.js @@ -0,0 +1,64 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: 'Adaptation', + filename: './adaptation.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/ + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader' + }, + ], + }, + mode: 'production', +}; diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/.eslintignore b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/.eslintignore new file mode 100644 index 00000000000..cfc348ec4d1 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/.eslintrc.json b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/.gitignore b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/.gitignore new file mode 100644 index 00000000000..d4f03a0df2e --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/.gitignore @@ -0,0 +1,14 @@ +**/*.log +**/node_modules +/.coverage +/coverage +/.nyc_output +/docs/ +/out/ +/build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +package-lock.json +__pycache__ diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/.jsdoc.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/.jsdoc.js new file mode 100644 index 00000000000..51d12943d53 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/.jsdoc.js @@ -0,0 +1,55 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2025 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/speech', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/.mocharc.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/.mocharc.js new file mode 100644 index 00000000000..24e9d15257f --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/.mocharc.js @@ -0,0 +1,33 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/.prettierrc.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/.prettierrc.js new file mode 100644 index 00000000000..d89a632f90b --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/.prettierrc.js @@ -0,0 +1,22 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/README.md b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/README.md new file mode 100644 index 00000000000..061c4f74c8d --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/README.md @@ -0,0 +1,107 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "The comments you see below are used to generate those parts of the template in later states." +Google Cloud Platform logo + +[homepage]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-speech + +# [Speech: Nodejs Client][homepage] + +[//]: # "releaseLevel" + +[![npm version](https://img.shields.io/npm/v/@google-cloud/speech.svg)](https://www.npmjs.org/package/@google-cloud/speech) + +Speech client for Node.js + +[//]: # "partials.introduction" + +A comprehensive list of changes in each version may be found in +[the CHANGELOG]([homepage]/CHANGELOG.md). + +* [Speech Nodejs Client API Reference](https://cloud.google.com/nodejs/docs/reference/speech/latest) + + +Read more about the client libraries for Cloud APIs, including the older +Google APIs Client Libraries, in [Client Libraries Explained][explained]. + +[explained]: https://cloud.google.com/apis/docs/client-libraries-explained + +**Table of contents:** + +* [Quickstart](#quickstart) + * [Before you begin](#before-you-begin) + * [Installing the client library](#installing-the-client-library) + +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) + +## Quickstart +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Speech API][enable_api]. +1. [Set up authentication][auth] so you can access the + API from your local workstation. +### Installing the client library + +```bash +npm install @google-cloud/speech +``` + +[//]: # "partials.body" + +## Samples + +Samples are in the [`samples/`]([homepage]/samples) directory. Each sample's `README.md` has instructions for running its sample. + +[//]: # "samples" + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://github.com/nodejs/release#release-schedule). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. +If you are using an end-of-life version of Node.js, we recommend that you update +as soon as possible to an actively supported LTS version. + +Google's client libraries support legacy versions of Node.js runtimes on a +best-efforts basis with the following warnings: + +* Legacy versions are not tested in continuous integration. +* Some security patches and features cannot be backported. +* Dependencies cannot be kept up-to-date. + +Client libraries targeting some end-of-life versions of Node.js are available, and +can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. +For example, `npm install @google-cloud/speech@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide]([homepage]/CONTRIBUTING.md). + +Please note that this `README.md` +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. + +## License + +Apache Version 2.0 + +See [LICENSE]([homepage]/LICENSE) + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=speech.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local \ No newline at end of file diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/package.json b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/package.json new file mode 100644 index 00000000000..2eb237195cb --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/package.json @@ -0,0 +1,59 @@ +{ + "name": "@google-cloud/speech", + "version": "0.1.0", + "description": "Speech client for Node.js", + "repository": "googleapis/nodejs-speech", + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google speech", + "speech", + "adaptation", + "speech" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test" + }, + "dependencies": { + "google-gax": "^5.1.1-rc.1" + }, + "devDependencies": { + "@types/mocha": "^10.0.10", + "@types/node": "^22.16.2", + "@types/sinon": "^17.0.4", + "c8": "^10.1.3", + "gapic-tools": "^1.0.2", + "gts": "^6.0.2", + "jsdoc": "^4.0.4", + "jsdoc-fresh": "^4.0.0", + "jsdoc-region-tag": "^3.0.0", + "mocha": "^11.7.1", + "pack-n-play": "^3.0.0", + "typescript": "5.8.3", + "sinon": "^21.0.0" + }, + "engines": { + "node": ">=v18" + } +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/protos/google/cloud/speech/v1p1beta1/cloud_speech.proto b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/protos/google/cloud/speech/v1p1beta1/cloud_speech.proto new file mode 100644 index 00000000000..b493d61aa80 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/protos/google/cloud/speech/v1p1beta1/cloud_speech.proto @@ -0,0 +1,1023 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.speech.v1p1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/cloud/speech/v1p1beta1/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; +import "google/rpc/status.proto"; + +option go_package = "cloud.google.com/go/speech/apiv1p1beta1/speechpb;speechpb"; +option java_multiple_files = true; +option java_outer_classname = "SpeechProto"; +option java_package = "com.google.cloud.speech.v1p1beta1"; +option objc_class_prefix = "GCS"; + +// Service that implements Google Cloud Speech API. +service Speech { + option (google.api.default_host) = "speech.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Performs synchronous speech recognition: receive results after all audio + // has been sent and processed. + rpc Recognize(RecognizeRequest) returns (RecognizeResponse) { + option (google.api.http) = { + post: "/v1p1beta1/speech:recognize" + body: "*" + }; + option (google.api.method_signature) = "config,audio"; + } + + // Performs asynchronous speech recognition: receive results via the + // google.longrunning.Operations interface. Returns either an + // `Operation.error` or an `Operation.response` which contains + // a `LongRunningRecognizeResponse` message. + // For more information on asynchronous speech recognition, see the + // [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). + rpc LongRunningRecognize(LongRunningRecognizeRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1p1beta1/speech:longrunningrecognize" + body: "*" + }; + option (google.api.method_signature) = "config,audio"; + option (google.longrunning.operation_info) = { + response_type: "LongRunningRecognizeResponse" + metadata_type: "LongRunningRecognizeMetadata" + }; + } + + // Performs bidirectional streaming speech recognition: receive results while + // sending audio. This method is only available via the gRPC API (not REST). + rpc StreamingRecognize(stream StreamingRecognizeRequest) + returns (stream StreamingRecognizeResponse) {} +} + +// The top-level message sent by the client for the `Recognize` method. +message RecognizeRequest { + // Required. Provides information to the recognizer that specifies how to + // process the request. + RecognitionConfig config = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The audio data to be recognized. + RecognitionAudio audio = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The top-level message sent by the client for the `LongRunningRecognize` +// method. +message LongRunningRecognizeRequest { + // Required. Provides information to the recognizer that specifies how to + // process the request. + RecognitionConfig config = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The audio data to be recognized. + RecognitionAudio audio = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Specifies an optional destination for the recognition results. + TranscriptOutputConfig output_config = 4 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Specifies an optional destination for the recognition results. +message TranscriptOutputConfig { + oneof output_type { + // Specifies a Cloud Storage URI for the recognition results. Must be + // specified in the format: `gs://bucket_name/object_name`, and the bucket + // must already exist. + string gcs_uri = 1; + } +} + +// The top-level message sent by the client for the `StreamingRecognize` method. +// Multiple `StreamingRecognizeRequest` messages are sent. The first message +// must contain a `streaming_config` message and must not contain +// `audio_content`. All subsequent messages must contain `audio_content` and +// must not contain a `streaming_config` message. +message StreamingRecognizeRequest { + // The streaming request, which is either a streaming config or audio content. + oneof streaming_request { + // Provides information to the recognizer that specifies how to process the + // request. The first `StreamingRecognizeRequest` message must contain a + // `streaming_config` message. + StreamingRecognitionConfig streaming_config = 1; + + // The audio data to be recognized. Sequential chunks of audio data are sent + // in sequential `StreamingRecognizeRequest` messages. The first + // `StreamingRecognizeRequest` message must not contain `audio_content` data + // and all subsequent `StreamingRecognizeRequest` messages must contain + // `audio_content` data. The audio bytes must be encoded as specified in + // `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a + // pure binary representation (not base64). See + // [content limits](https://cloud.google.com/speech-to-text/quotas#content). + bytes audio_content = 2; + } +} + +// Provides information to the recognizer that specifies how to process the +// request. +message StreamingRecognitionConfig { + // Events that a timeout can be set on for voice activity. + message VoiceActivityTimeout { + // Duration to timeout the stream if no speech begins. + google.protobuf.Duration speech_start_timeout = 1; + + // Duration to timeout the stream after speech ends. + google.protobuf.Duration speech_end_timeout = 2; + } + + // Required. Provides information to the recognizer that specifies how to + // process the request. + RecognitionConfig config = 1 [(google.api.field_behavior) = REQUIRED]; + + // If `false` or omitted, the recognizer will perform continuous + // recognition (continuing to wait for and process audio even if the user + // pauses speaking) until the client closes the input stream (gRPC API) or + // until the maximum time limit has been reached. May return multiple + // `StreamingRecognitionResult`s with the `is_final` flag set to `true`. + // + // If `true`, the recognizer will detect a single spoken utterance. When it + // detects that the user has paused or stopped speaking, it will return an + // `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no + // more than one `StreamingRecognitionResult` with the `is_final` flag set to + // `true`. + // + // The `single_utterance` field can only be used with specified models, + // otherwise an error is thrown. The `model` field in + // [RecognitionConfig][google.cloud.speech.v1p1beta1.RecognitionConfig] must + // be set to: + // + // * `command_and_search` + // * `phone_call` AND additional field `useEnhanced`=`true` + // * The `model` field is left undefined. In this case the API auto-selects + // a model based on any other parameters that you set in + // `RecognitionConfig`. + bool single_utterance = 2; + + // If `true`, interim results (tentative hypotheses) may be + // returned as they become available (these interim results are indicated with + // the `is_final=false` flag). + // If `false` or omitted, only `is_final=true` result(s) are returned. + bool interim_results = 3; + + // If `true`, responses with voice activity speech events will be returned as + // they are detected. + bool enable_voice_activity_events = 5; + + // If set, the server will automatically close the stream after the specified + // duration has elapsed after the last VOICE_ACTIVITY speech event has been + // sent. The field `voice_activity_events` must also be set to true. + VoiceActivityTimeout voice_activity_timeout = 6; +} + +// Provides information to the recognizer that specifies how to process the +// request. +message RecognitionConfig { + // The encoding of the audio data sent in the request. + // + // All encodings support only 1 channel (mono) audio, unless the + // `audio_channel_count` and `enable_separate_recognition_per_channel` fields + // are set. + // + // For best results, the audio source should be captured and transmitted using + // a lossless encoding (`FLAC` or `LINEAR16`). The accuracy of the speech + // recognition can be reduced if lossy codecs are used to capture or transmit + // audio, particularly if background noise is present. Lossy codecs include + // `MULAW`, `AMR`, `AMR_WB`, `OGG_OPUS`, `SPEEX_WITH_HEADER_BYTE`, `MP3`, + // and `WEBM_OPUS`. + // + // The `FLAC` and `WAV` audio file formats include a header that describes the + // included audio content. You can request recognition for `WAV` files that + // contain either `LINEAR16` or `MULAW` encoded audio. + // If you send `FLAC` or `WAV` audio file format in + // your request, you do not need to specify an `AudioEncoding`; the audio + // encoding format is determined from the file header. If you specify + // an `AudioEncoding` when you send send `FLAC` or `WAV` audio, the + // encoding configuration must match the encoding described in the audio + // header; otherwise the request returns an + // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT] error + // code. + enum AudioEncoding { + // Not specified. + ENCODING_UNSPECIFIED = 0; + + // Uncompressed 16-bit signed little-endian samples (Linear PCM). + LINEAR16 = 1; + + // `FLAC` (Free Lossless Audio + // Codec) is the recommended encoding because it is + // lossless--therefore recognition is not compromised--and + // requires only about half the bandwidth of `LINEAR16`. `FLAC` stream + // encoding supports 16-bit and 24-bit samples, however, not all fields in + // `STREAMINFO` are supported. + FLAC = 2; + + // 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. + MULAW = 3; + + // Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000. + AMR = 4; + + // Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000. + AMR_WB = 5; + + // Opus encoded audio frames in Ogg container + // ([OggOpus](https://wiki.xiph.org/OggOpus)). + // `sample_rate_hertz` must be one of 8000, 12000, 16000, 24000, or 48000. + OGG_OPUS = 6; + + // Although the use of lossy encodings is not recommended, if a very low + // bitrate encoding is required, `OGG_OPUS` is highly preferred over + // Speex encoding. The [Speex](https://speex.org/) encoding supported by + // Cloud Speech API has a header byte in each block, as in MIME type + // `audio/x-speex-with-header-byte`. + // It is a variant of the RTP Speex encoding defined in + // [RFC 5574](https://tools.ietf.org/html/rfc5574). + // The stream is a sequence of blocks, one block per RTP packet. Each block + // starts with a byte containing the length of the block, in bytes, followed + // by one or more frames of Speex data, padded to an integral number of + // bytes (octets) as specified in RFC 5574. In other words, each RTP header + // is replaced with a single byte containing the block length. Only Speex + // wideband is supported. `sample_rate_hertz` must be 16000. + SPEEX_WITH_HEADER_BYTE = 7; + + // MP3 audio. MP3 encoding is a Beta feature and only available in + // v1p1beta1. Support all standard MP3 bitrates (which range from 32-320 + // kbps). When using this encoding, `sample_rate_hertz` has to match the + // sample rate of the file being used. + MP3 = 8; + + // Opus encoded audio frames in WebM container + // ([WebM](https://www.webmproject.org/docs/container/)). + // `sample_rate_hertz` must be one of 8000, 12000, 16000, 24000, or 48000. + WEBM_OPUS = 9; + + // 8-bit samples that compand 13-bit audio samples using G.711 PCMU/a-law. + ALAW = 10; + } + + // Encoding of audio data sent in all `RecognitionAudio` messages. + // This field is optional for `FLAC` and `WAV` audio files and required + // for all other audio formats. For details, see + // [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding]. + AudioEncoding encoding = 1; + + // Sample rate in Hertz of the audio data sent in all + // `RecognitionAudio` messages. Valid values are: 8000-48000. + // 16000 is optimal. For best results, set the sampling rate of the audio + // source to 16000 Hz. If that's not possible, use the native sample rate of + // the audio source (instead of re-sampling). + // This field is optional for FLAC and WAV audio files, but is + // required for all other audio formats. For details, see + // [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding]. + int32 sample_rate_hertz = 2; + + // The number of channels in the input audio data. + // ONLY set this for MULTI-CHANNEL recognition. + // Valid values for LINEAR16, OGG_OPUS and FLAC are `1`-`8`. + // Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`. + // If `0` or omitted, defaults to one channel (mono). + // Note: We only recognize the first channel by default. + // To perform independent recognition on each channel set + // `enable_separate_recognition_per_channel` to 'true'. + int32 audio_channel_count = 7; + + // This needs to be set to `true` explicitly and `audio_channel_count` > 1 + // to get each channel recognized separately. The recognition result will + // contain a `channel_tag` field to state which channel that result belongs + // to. If this is not true, we will only recognize the first channel. The + // request is billed cumulatively for all channels recognized: + // `audio_channel_count` multiplied by the length of the audio. + bool enable_separate_recognition_per_channel = 12; + + // Required. The language of the supplied audio as a + // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. + // Example: "en-US". + // See [Language + // Support](https://cloud.google.com/speech-to-text/docs/languages) for a list + // of the currently supported language codes. + string language_code = 3 [(google.api.field_behavior) = REQUIRED]; + + // A list of up to 3 additional + // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags, + // listing possible alternative languages of the supplied audio. + // See [Language + // Support](https://cloud.google.com/speech-to-text/docs/languages) for a list + // of the currently supported language codes. If alternative languages are + // listed, recognition result will contain recognition in the most likely + // language detected including the main language_code. The recognition result + // will include the language tag of the language detected in the audio. Note: + // This feature is only supported for Voice Command and Voice Search use cases + // and performance may vary for other use cases (e.g., phone call + // transcription). + repeated string alternative_language_codes = 18; + + // Maximum number of recognition hypotheses to be returned. + // Specifically, the maximum number of `SpeechRecognitionAlternative` messages + // within each `SpeechRecognitionResult`. + // The server may return fewer than `max_alternatives`. + // Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of + // one. If omitted, will return a maximum of one. + int32 max_alternatives = 4; + + // If set to `true`, the server will attempt to filter out + // profanities, replacing all but the initial character in each filtered word + // with asterisks, e.g. "f***". If set to `false` or omitted, profanities + // won't be filtered out. + bool profanity_filter = 5; + + // Speech adaptation configuration improves the accuracy of speech + // recognition. For more information, see the [speech + // adaptation](https://cloud.google.com/speech-to-text/docs/adaptation) + // documentation. + // When speech adaptation is set it supersedes the `speech_contexts` field. + SpeechAdaptation adaptation = 20; + + // Optional. Use transcription normalization to automatically replace parts of + // the transcript with phrases of your choosing. For StreamingRecognize, this + // normalization only applies to stable partial transcripts (stability > 0.8) + // and final transcripts. + TranscriptNormalization transcript_normalization = 24 + [(google.api.field_behavior) = OPTIONAL]; + + // Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext]. + // A means to provide context to assist the speech recognition. For more + // information, see + // [speech + // adaptation](https://cloud.google.com/speech-to-text/docs/adaptation). + repeated SpeechContext speech_contexts = 6; + + // If `true`, the top result includes a list of words and + // the start and end time offsets (timestamps) for those words. If + // `false`, no word-level time offset information is returned. The default is + // `false`. + bool enable_word_time_offsets = 8; + + // If `true`, the top result includes a list of words and the + // confidence for those words. If `false`, no word-level confidence + // information is returned. The default is `false`. + bool enable_word_confidence = 15; + + // If 'true', adds punctuation to recognition result hypotheses. + // This feature is only available in select languages. Setting this for + // requests in other languages has no effect at all. + // The default 'false' value does not add punctuation to result hypotheses. + bool enable_automatic_punctuation = 11; + + // The spoken punctuation behavior for the call + // If not set, uses default behavior based on model of choice + // e.g. command_and_search will enable spoken punctuation by default + // If 'true', replaces spoken punctuation with the corresponding symbols in + // the request. For example, "how are you question mark" becomes "how are + // you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation + // for support. If 'false', spoken punctuation is not replaced. + google.protobuf.BoolValue enable_spoken_punctuation = 22; + + // The spoken emoji behavior for the call + // If not set, uses default behavior based on model of choice + // If 'true', adds spoken emoji formatting for the request. This will replace + // spoken emojis with the corresponding Unicode symbols in the final + // transcript. If 'false', spoken emojis are not replaced. + google.protobuf.BoolValue enable_spoken_emojis = 23; + + // If 'true', enables speaker detection for each recognized word in + // the top alternative of the recognition result using a speaker_label + // provided in the WordInfo. + // Note: Use diarization_config instead. + bool enable_speaker_diarization = 16 [deprecated = true]; + + // If set, specifies the estimated number of speakers in the conversation. + // Defaults to '2'. Ignored unless enable_speaker_diarization is set to true. + // Note: Use diarization_config instead. + int32 diarization_speaker_count = 17 [deprecated = true]; + + // Config to enable speaker diarization and set additional + // parameters to make diarization better suited for your application. + // Note: When this is enabled, we send all the words from the beginning of the + // audio for the top alternative in every consecutive STREAMING responses. + // This is done in order to improve our speaker tags as our models learn to + // identify the speakers in the conversation over time. + // For non-streaming requests, the diarization results will be provided only + // in the top alternative of the FINAL SpeechRecognitionResult. + SpeakerDiarizationConfig diarization_config = 19; + + // Metadata regarding this request. + RecognitionMetadata metadata = 9; + + // Which model to select for the given request. Select the model + // best suited to your domain to get best results. If a model is not + // explicitly specified, then we auto-select a model based on the parameters + // in the RecognitionConfig. + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + //
ModelDescription
latest_longBest for long form content like media or conversation.
latest_shortBest for short form content like commands or single shot directed + // speech.
command_and_searchBest for short queries such as voice commands or voice search.
phone_callBest for audio that originated from a phone call (typically + // recorded at an 8khz sampling rate).
videoBest for audio that originated from video or includes multiple + // speakers. Ideally the audio is recorded at a 16khz or greater + // sampling rate. This is a premium model that costs more than the + // standard rate.
defaultBest for audio that is not one of the specific audio models. + // For example, long-form audio. Ideally the audio is high-fidelity, + // recorded at a 16khz or greater sampling rate.
medical_conversationBest for audio that originated from a conversation between a + // medical provider and patient.
medical_dictationBest for audio that originated from dictation notes by a medical + // provider.
+ string model = 13; + + // Set to true to use an enhanced model for speech recognition. + // If `use_enhanced` is set to true and the `model` field is not set, then + // an appropriate enhanced model is chosen if an enhanced model exists for + // the audio. + // + // If `use_enhanced` is true and an enhanced version of the specified model + // does not exist, then the speech is recognized using the standard version + // of the specified model. + bool use_enhanced = 14; +} + +// Config to enable speaker diarization. +message SpeakerDiarizationConfig { + // If 'true', enables speaker detection for each recognized word in + // the top alternative of the recognition result using a speaker_label + // provided in the WordInfo. + bool enable_speaker_diarization = 1; + + // Minimum number of speakers in the conversation. This range gives you more + // flexibility by allowing the system to automatically determine the correct + // number of speakers. If not set, the default value is 2. + int32 min_speaker_count = 2; + + // Maximum number of speakers in the conversation. This range gives you more + // flexibility by allowing the system to automatically determine the correct + // number of speakers. If not set, the default value is 6. + int32 max_speaker_count = 3; + + // Output only. Unused. + int32 speaker_tag = 5 + [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Description of audio data to be recognized. +message RecognitionMetadata { + option deprecated = true; + + // Use case categories that the audio recognition request can be described + // by. + enum InteractionType { + // Use case is either unknown or is something other than one of the other + // values below. + INTERACTION_TYPE_UNSPECIFIED = 0; + + // Multiple people in a conversation or discussion. For example in a + // meeting with two or more people actively participating. Typically + // all the primary people speaking would be in the same room (if not, + // see PHONE_CALL) + DISCUSSION = 1; + + // One or more persons lecturing or presenting to others, mostly + // uninterrupted. + PRESENTATION = 2; + + // A phone-call or video-conference in which two or more people, who are + // not in the same room, are actively participating. + PHONE_CALL = 3; + + // A recorded message intended for another person to listen to. + VOICEMAIL = 4; + + // Professionally produced audio (eg. TV Show, Podcast). + PROFESSIONALLY_PRODUCED = 5; + + // Transcribe spoken questions and queries into text. + VOICE_SEARCH = 6; + + // Transcribe voice commands, such as for controlling a device. + VOICE_COMMAND = 7; + + // Transcribe speech to text to create a written document, such as a + // text-message, email or report. + DICTATION = 8; + } + + // Enumerates the types of capture settings describing an audio file. + enum MicrophoneDistance { + // Audio type is not known. + MICROPHONE_DISTANCE_UNSPECIFIED = 0; + + // The audio was captured from a closely placed microphone. Eg. phone, + // dictaphone, or handheld microphone. Generally if there speaker is within + // 1 meter of the microphone. + NEARFIELD = 1; + + // The speaker if within 3 meters of the microphone. + MIDFIELD = 2; + + // The speaker is more than 3 meters away from the microphone. + FARFIELD = 3; + } + + // The original media the speech was recorded on. + enum OriginalMediaType { + // Unknown original media type. + ORIGINAL_MEDIA_TYPE_UNSPECIFIED = 0; + + // The speech data is an audio recording. + AUDIO = 1; + + // The speech data originally recorded on a video. + VIDEO = 2; + } + + // The type of device the speech was recorded with. + enum RecordingDeviceType { + // The recording device is unknown. + RECORDING_DEVICE_TYPE_UNSPECIFIED = 0; + + // Speech was recorded on a smartphone. + SMARTPHONE = 1; + + // Speech was recorded using a personal computer or tablet. + PC = 2; + + // Speech was recorded over a phone line. + PHONE_LINE = 3; + + // Speech was recorded in a vehicle. + VEHICLE = 4; + + // Speech was recorded outdoors. + OTHER_OUTDOOR_DEVICE = 5; + + // Speech was recorded indoors. + OTHER_INDOOR_DEVICE = 6; + } + + // The use case most closely describing the audio content to be recognized. + InteractionType interaction_type = 1; + + // The industry vertical to which this speech recognition request most + // closely applies. This is most indicative of the topics contained + // in the audio. Use the 6-digit NAICS code to identify the industry + // vertical - see https://www.naics.com/search/. + uint32 industry_naics_code_of_audio = 3; + + // The audio type that most closely describes the audio being recognized. + MicrophoneDistance microphone_distance = 4; + + // The original media the speech was recorded on. + OriginalMediaType original_media_type = 5; + + // The type of device the speech was recorded with. + RecordingDeviceType recording_device_type = 6; + + // The device used to make the recording. Examples 'Nexus 5X' or + // 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or + // 'Cardioid Microphone'. + string recording_device_name = 7; + + // Mime type of the original audio file. For example `audio/m4a`, + // `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`. + // A list of possible audio mime types is maintained at + // http://www.iana.org/assignments/media-types/media-types.xhtml#audio + string original_mime_type = 8; + + // Obfuscated (privacy-protected) ID of the user, to identify number of + // unique users using the service. + int64 obfuscated_id = 9 [deprecated = true]; + + // Description of the content. Eg. "Recordings of federal supreme court + // hearings from 2012". + string audio_topic = 10; +} + +// Provides "hints" to the speech recognizer to favor specific words and phrases +// in the results. +message SpeechContext { + // A list of strings containing words and phrases "hints" so that + // the speech recognition is more likely to recognize them. This can be used + // to improve the accuracy for specific words and phrases, for example, if + // specific commands are typically spoken by the user. This can also be used + // to add additional words to the vocabulary of the recognizer. See + // [usage limits](https://cloud.google.com/speech-to-text/quotas#content). + // + // List items can also be set to classes for groups of words that represent + // common concepts that occur in natural language. For example, rather than + // providing phrase hints for every month of the year, using the $MONTH class + // improves the likelihood of correctly transcribing audio that includes + // months. + repeated string phrases = 1; + + // Hint Boost. Positive value will increase the probability that a specific + // phrase will be recognized over other similar sounding phrases. The higher + // the boost, the higher the chance of false positive recognition as well. + // Negative boost values would correspond to anti-biasing. Anti-biasing is not + // enabled, so negative boost will simply be ignored. Though `boost` can + // accept a wide range of positive values, most use cases are best served with + // values between 0 and 20. We recommend using a binary search approach to + // finding the optimal value for your use case. + float boost = 4; +} + +// Contains audio data in the encoding specified in the `RecognitionConfig`. +// Either `content` or `uri` must be supplied. Supplying both or neither +// returns [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. +// See [content limits](https://cloud.google.com/speech-to-text/quotas#content). +message RecognitionAudio { + // The audio source, which is either inline content or a Google Cloud + // Storage uri. + oneof audio_source { + // The audio data bytes encoded as specified in + // `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a + // pure binary representation, whereas JSON representations use base64. + bytes content = 1; + + // URI that points to a file that contains audio data bytes as specified in + // `RecognitionConfig`. The file must not be compressed (for example, gzip). + // Currently, only Google Cloud Storage URIs are + // supported, which must be specified in the following format: + // `gs://bucket_name/object_name` (other URI formats return + // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). + // For more information, see [Request + // URIs](https://cloud.google.com/storage/docs/reference-uris). + string uri = 2; + } +} + +// The only message returned to the client by the `Recognize` method. It +// contains the result as zero or more sequential `SpeechRecognitionResult` +// messages. +message RecognizeResponse { + // Sequential list of transcription results corresponding to + // sequential portions of audio. + repeated SpeechRecognitionResult results = 2; + + // When available, billed audio seconds for the corresponding request. + google.protobuf.Duration total_billed_time = 3; + + // Provides information on adaptation behavior in response + SpeechAdaptationInfo speech_adaptation_info = 7; + + // The ID associated with the request. This is a unique ID specific only to + // the given request. + int64 request_id = 8; + + // Whether request used legacy asr models (was not automatically migrated to + // use conformer models). + bool using_legacy_models = 9; +} + +// The only message returned to the client by the `LongRunningRecognize` method. +// It contains the result as zero or more sequential `SpeechRecognitionResult` +// messages. It is included in the `result.response` field of the `Operation` +// returned by the `GetOperation` call of the `google::longrunning::Operations` +// service. +message LongRunningRecognizeResponse { + // Sequential list of transcription results corresponding to + // sequential portions of audio. + repeated SpeechRecognitionResult results = 2; + + // When available, billed audio seconds for the corresponding request. + google.protobuf.Duration total_billed_time = 3; + + // Original output config if present in the request. + TranscriptOutputConfig output_config = 6; + + // If the transcript output fails this field contains the relevant error. + google.rpc.Status output_error = 7; + + // Provides information on speech adaptation behavior in response + SpeechAdaptationInfo speech_adaptation_info = 8; + + // The ID associated with the request. This is a unique ID specific only to + // the given request. + int64 request_id = 9; +} + +// Describes the progress of a long-running `LongRunningRecognize` call. It is +// included in the `metadata` field of the `Operation` returned by the +// `GetOperation` call of the `google::longrunning::Operations` service. +message LongRunningRecognizeMetadata { + // Approximate percentage of audio processed thus far. Guaranteed to be 100 + // when the audio is fully processed and the results are available. + int32 progress_percent = 1; + + // Time when the request was received. + google.protobuf.Timestamp start_time = 2; + + // Time of the most recent processing update. + google.protobuf.Timestamp last_update_time = 3; + + // Output only. The URI of the audio file being transcribed. Empty if the + // audio was sent as byte content. + string uri = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A copy of the TranscriptOutputConfig if it was set in the + // request. + TranscriptOutputConfig output_config = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// `StreamingRecognizeResponse` is the only message returned to the client by +// `StreamingRecognize`. A series of zero or more `StreamingRecognizeResponse` +// messages are streamed back to the client. If there is no recognizable +// audio, and `single_utterance` is set to false, then no messages are streamed +// back to the client. +// +// Here's an example of a series of `StreamingRecognizeResponse`s that might be +// returned while processing audio: +// +// 1. results { alternatives { transcript: "tube" } stability: 0.01 } +// +// 2. results { alternatives { transcript: "to be a" } stability: 0.01 } +// +// 3. results { alternatives { transcript: "to be" } stability: 0.9 } +// results { alternatives { transcript: " or not to be" } stability: 0.01 } +// +// 4. results { alternatives { transcript: "to be or not to be" +// confidence: 0.92 } +// alternatives { transcript: "to bee or not to bee" } +// is_final: true } +// +// 5. results { alternatives { transcript: " that's" } stability: 0.01 } +// +// 6. results { alternatives { transcript: " that is" } stability: 0.9 } +// results { alternatives { transcript: " the question" } stability: 0.01 } +// +// 7. results { alternatives { transcript: " that is the question" +// confidence: 0.98 } +// alternatives { transcript: " that was the question" } +// is_final: true } +// +// Notes: +// +// - Only two of the above responses #4 and #7 contain final results; they are +// indicated by `is_final: true`. Concatenating these together generates the +// full transcript: "to be or not to be that is the question". +// +// - The others contain interim `results`. #3 and #6 contain two interim +// `results`: the first portion has a high stability and is less likely to +// change; the second portion has a low stability and is very likely to +// change. A UI designer might choose to show only high stability `results`. +// +// - The specific `stability` and `confidence` values shown above are only for +// illustrative purposes. Actual values may vary. +// +// - In each response, only one of these fields will be set: +// `error`, +// `speech_event_type`, or +// one or more (repeated) `results`. +message StreamingRecognizeResponse { + // Indicates the type of speech event. + enum SpeechEventType { + // No speech event specified. + SPEECH_EVENT_UNSPECIFIED = 0; + + // This event indicates that the server has detected the end of the user's + // speech utterance and expects no additional speech. Therefore, the server + // will not process additional audio (although it may subsequently return + // additional results). The client should stop sending additional audio + // data, half-close the gRPC connection, and wait for any additional results + // until the server closes the gRPC connection. This event is only sent if + // `single_utterance` was set to `true`, and is not used otherwise. + END_OF_SINGLE_UTTERANCE = 1; + + // This event indicates that the server has detected the beginning of human + // voice activity in the stream. This event can be returned multiple times + // if speech starts and stops repeatedly throughout the stream. This event + // is only sent if `voice_activity_events` is set to true. + SPEECH_ACTIVITY_BEGIN = 2; + + // This event indicates that the server has detected the end of human voice + // activity in the stream. This event can be returned multiple times if + // speech starts and stops repeatedly throughout the stream. This event is + // only sent if `voice_activity_events` is set to true. + SPEECH_ACTIVITY_END = 3; + + // This event indicates that the user-set timeout for speech activity begin + // or end has exceeded. Upon receiving this event, the client is expected to + // send a half close. Further audio will not be processed. + SPEECH_ACTIVITY_TIMEOUT = 4; + } + + // If set, returns a [google.rpc.Status][google.rpc.Status] message that + // specifies the error for the operation. + google.rpc.Status error = 1; + + // This repeated list contains zero or more results that + // correspond to consecutive portions of the audio currently being processed. + // It contains zero or one `is_final=true` result (the newly settled portion), + // followed by zero or more `is_final=false` results (the interim results). + repeated StreamingRecognitionResult results = 2; + + // Indicates the type of speech event. + SpeechEventType speech_event_type = 4; + + // Time offset between the beginning of the audio and event emission. + google.protobuf.Duration speech_event_time = 8; + + // When available, billed audio seconds for the stream. + // Set only if this is the last response in the stream. + google.protobuf.Duration total_billed_time = 5; + + // Provides information on adaptation behavior in response + SpeechAdaptationInfo speech_adaptation_info = 9; + + // The ID associated with the request. This is a unique ID specific only to + // the given request. + int64 request_id = 10; +} + +// A streaming speech recognition result corresponding to a portion of the audio +// that is currently being processed. +message StreamingRecognitionResult { + // May contain one or more recognition hypotheses (up to the + // maximum specified in `max_alternatives`). + // These alternatives are ordered in terms of accuracy, with the top (first) + // alternative being the most probable, as ranked by the recognizer. + repeated SpeechRecognitionAlternative alternatives = 1; + + // If `false`, this `StreamingRecognitionResult` represents an + // interim result that may change. If `true`, this is the final time the + // speech service will return this particular `StreamingRecognitionResult`, + // the recognizer will not return any further hypotheses for this portion of + // the transcript and corresponding audio. + bool is_final = 2; + + // An estimate of the likelihood that the recognizer will not + // change its guess about this interim result. Values range from 0.0 + // (completely unstable) to 1.0 (completely stable). + // This field is only provided for interim results (`is_final=false`). + // The default of 0.0 is a sentinel value indicating `stability` was not set. + float stability = 3; + + // Time offset of the end of this result relative to the + // beginning of the audio. + google.protobuf.Duration result_end_time = 4; + + // For multi-channel audio, this is the channel number corresponding to the + // recognized result for the audio from that channel. + // For audio_channel_count = N, its output values can range from '1' to 'N'. + int32 channel_tag = 5; + + // Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + // language tag of the language in this result. This language code was + // detected to have the most likelihood of being spoken in the audio. + string language_code = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A speech recognition result corresponding to a portion of the audio. +message SpeechRecognitionResult { + // May contain one or more recognition hypotheses (up to the + // maximum specified in `max_alternatives`). + // These alternatives are ordered in terms of accuracy, with the top (first) + // alternative being the most probable, as ranked by the recognizer. + repeated SpeechRecognitionAlternative alternatives = 1; + + // For multi-channel audio, this is the channel number corresponding to the + // recognized result for the audio from that channel. + // For audio_channel_count = N, its output values can range from '1' to 'N'. + int32 channel_tag = 2; + + // Time offset of the end of this result relative to the + // beginning of the audio. + google.protobuf.Duration result_end_time = 4; + + // Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + // language tag of the language in this result. This language code was + // detected to have the most likelihood of being spoken in the audio. + string language_code = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Alternative hypotheses (a.k.a. n-best list). +message SpeechRecognitionAlternative { + // Transcript text representing the words that the user spoke. + // In languages that use spaces to separate words, the transcript might have a + // leading space if it isn't the first result. You can concatenate each result + // to obtain the full transcript without using a separator. + string transcript = 1; + + // The confidence estimate between 0.0 and 1.0. A higher number + // indicates an estimated greater likelihood that the recognized words are + // correct. This field is set only for the top alternative of a non-streaming + // result or, of a streaming result where `is_final=true`. + // This field is not guaranteed to be accurate and users should not rely on it + // to be always provided. + // The default of 0.0 is a sentinel value indicating `confidence` was not set. + float confidence = 2; + + // A list of word-specific information for each recognized word. + // Note: When `enable_speaker_diarization` is true, you will see all the words + // from the beginning of the audio. + repeated WordInfo words = 3; +} + +// Word-specific information for recognized words. +message WordInfo { + // Time offset relative to the beginning of the audio, + // and corresponding to the start of the spoken word. + // This field is only set if `enable_word_time_offsets=true` and only + // in the top hypothesis. + // This is an experimental feature and the accuracy of the time offset can + // vary. + google.protobuf.Duration start_time = 1; + + // Time offset relative to the beginning of the audio, + // and corresponding to the end of the spoken word. + // This field is only set if `enable_word_time_offsets=true` and only + // in the top hypothesis. + // This is an experimental feature and the accuracy of the time offset can + // vary. + google.protobuf.Duration end_time = 2; + + // The word corresponding to this set of information. + string word = 3; + + // The confidence estimate between 0.0 and 1.0. A higher number + // indicates an estimated greater likelihood that the recognized words are + // correct. This field is set only for the top alternative of a non-streaming + // result or, of a streaming result where `is_final=true`. + // This field is not guaranteed to be accurate and users should not rely on it + // to be always provided. + // The default of 0.0 is a sentinel value indicating `confidence` was not set. + float confidence = 4; + + // Output only. A distinct integer value is assigned for every speaker within + // the audio. This field specifies which one of those speakers was detected to + // have spoken this word. Value ranges from '1' to diarization_speaker_count. + // speaker_tag is set if enable_speaker_diarization = 'true' and only for the + // top alternative. + // Note: Use speaker_label instead. + int32 speaker_tag = 5 + [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A label value assigned for every unique speaker within the + // audio. This field specifies which speaker was detected to have spoken this + // word. For some models, like medical_conversation this can be actual speaker + // role, for example "patient" or "provider", but generally this would be a + // number identifying a speaker. This field is only set if + // enable_speaker_diarization = 'true' and only for the top alternative. + string speaker_label = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Information on speech adaptation use in results +message SpeechAdaptationInfo { + // Whether there was a timeout when applying speech adaptation. If true, + // adaptation had no effect in the response transcript. + bool adaptation_timeout = 1; + + // If set, returns a message specifying which part of the speech adaptation + // request timed out. + string timeout_message = 4; +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/protos/google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/protos/google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto new file mode 100644 index 00000000000..ad42cf576d2 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/protos/google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto @@ -0,0 +1,375 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.speech.v1p1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/speech/v1p1beta1/resource.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option go_package = "cloud.google.com/go/speech/apiv1p1beta1/speechpb;speechpb"; +option java_multiple_files = true; +option java_outer_classname = "SpeechAdaptationProto"; +option java_package = "com.google.cloud.speech.v1p1beta1"; +option objc_class_prefix = "GCS"; + +// Service that implements Google Cloud Speech Adaptation API. +service Adaptation { + option (google.api.default_host) = "speech.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Create a set of phrase hints. Each item in the set can be a single word or + // a multi-word phrase. The items in the PhraseSet are favored by the + // recognition model when you send a call that includes the PhraseSet. + rpc CreatePhraseSet(CreatePhraseSetRequest) returns (PhraseSet) { + option (google.api.http) = { + post: "/v1p1beta1/{parent=projects/*/locations/*}/phraseSets" + body: "*" + }; + option (google.api.method_signature) = "parent,phrase_set,phrase_set_id"; + } + + // Get a phrase set. + rpc GetPhraseSet(GetPhraseSetRequest) returns (PhraseSet) { + option (google.api.http) = { + get: "/v1p1beta1/{name=projects/*/locations/*/phraseSets/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List phrase sets. + rpc ListPhraseSet(ListPhraseSetRequest) returns (ListPhraseSetResponse) { + option (google.api.http) = { + get: "/v1p1beta1/{parent=projects/*/locations/*}/phraseSets" + }; + option (google.api.method_signature) = "parent"; + } + + // Update a phrase set. + rpc UpdatePhraseSet(UpdatePhraseSetRequest) returns (PhraseSet) { + option (google.api.http) = { + patch: "/v1p1beta1/{phrase_set.name=projects/*/locations/*/phraseSets/*}" + body: "phrase_set" + }; + option (google.api.method_signature) = "phrase_set,update_mask"; + } + + // Delete a phrase set. + rpc DeletePhraseSet(DeletePhraseSetRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1p1beta1/{name=projects/*/locations/*/phraseSets/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Create a custom class. + rpc CreateCustomClass(CreateCustomClassRequest) returns (CustomClass) { + option (google.api.http) = { + post: "/v1p1beta1/{parent=projects/*/locations/*}/customClasses" + body: "*" + }; + option (google.api.method_signature) = + "parent,custom_class,custom_class_id"; + } + + // Get a custom class. + rpc GetCustomClass(GetCustomClassRequest) returns (CustomClass) { + option (google.api.http) = { + get: "/v1p1beta1/{name=projects/*/locations/*/customClasses/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List custom classes. + rpc ListCustomClasses(ListCustomClassesRequest) + returns (ListCustomClassesResponse) { + option (google.api.http) = { + get: "/v1p1beta1/{parent=projects/*/locations/*}/customClasses" + }; + option (google.api.method_signature) = "parent"; + } + + // Update a custom class. + rpc UpdateCustomClass(UpdateCustomClassRequest) returns (CustomClass) { + option (google.api.http) = { + patch: "/v1p1beta1/{custom_class.name=projects/*/locations/*/customClasses/*}" + body: "custom_class" + }; + option (google.api.method_signature) = "custom_class,update_mask"; + } + + // Delete a custom class. + rpc DeleteCustomClass(DeleteCustomClassRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1p1beta1/{name=projects/*/locations/*/customClasses/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// Message sent by the client for the `CreatePhraseSet` method. +message CreatePhraseSetRequest { + // Required. The parent resource where this phrase set will be created. + // Format: + // + // `projects/{project}/locations/{location}` + // + // Speech-to-Text supports three locations: `global`, `us` (US North America), + // and `eu` (Europe). If you are calling the `speech.googleapis.com` + // endpoint, use the `global` location. To specify a region, use a + // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + // with matching `us` or `eu` location value. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "speech.googleapis.com/PhraseSet" + } + ]; + + // Required. The ID to use for the phrase set, which will become the final + // component of the phrase set's resource name. + // + // This value should restrict to letters, numbers, and hyphens, with the first + // character a letter, the last a letter or a number, and be 4-63 characters. + string phrase_set_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The phrase set to create. + PhraseSet phrase_set = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Message sent by the client for the `UpdatePhraseSet` method. +message UpdatePhraseSetRequest { + // Required. The phrase set to update. + // + // The phrase set's `name` field is used to identify the set to be + // updated. Format: + // + // `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + // + // Speech-to-Text supports three locations: `global`, `us` (US North America), + // and `eu` (Europe). If you are calling the `speech.googleapis.com` + // endpoint, use the `global` location. To specify a region, use a + // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + // with matching `us` or `eu` location value. + PhraseSet phrase_set = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Message sent by the client for the `GetPhraseSet` method. +message GetPhraseSetRequest { + // Required. The name of the phrase set to retrieve. Format: + // + // `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + // + // Speech-to-Text supports three locations: `global`, `us` (US North America), + // and `eu` (Europe). If you are calling the `speech.googleapis.com` + // endpoint, use the `global` location. To specify a region, use a + // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + // with matching `us` or `eu` location value. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "speech.googleapis.com/PhraseSet" + } + ]; +} + +// Message sent by the client for the `ListPhraseSet` method. +message ListPhraseSetRequest { + // Required. The parent, which owns this collection of phrase set. Format: + // + // `projects/{project}/locations/{location}` + // + // Speech-to-Text supports three locations: `global`, `us` (US North America), + // and `eu` (Europe). If you are calling the `speech.googleapis.com` + // endpoint, use the `global` location. To specify a region, use a + // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + // with matching `us` or `eu` location value. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "speech.googleapis.com/PhraseSet" + } + ]; + + // The maximum number of phrase sets to return. The service may return + // fewer than this value. If unspecified, at most 50 phrase sets will be + // returned. The maximum value is 1000; values above 1000 will be coerced to + // 1000. + int32 page_size = 2; + + // A page token, received from a previous `ListPhraseSet` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListPhraseSet` must + // match the call that provided the page token. + string page_token = 3; +} + +// Message returned to the client by the `ListPhraseSet` method. +message ListPhraseSetResponse { + // The phrase set. + repeated PhraseSet phrase_sets = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Message sent by the client for the `DeletePhraseSet` method. +message DeletePhraseSetRequest { + // Required. The name of the phrase set to delete. Format: + // + // `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "speech.googleapis.com/PhraseSet" + } + ]; +} + +// Message sent by the client for the `CreateCustomClass` method. +message CreateCustomClassRequest { + // Required. The parent resource where this custom class will be created. + // Format: + // + // `projects/{project}/locations/{location}/customClasses` + // + // Speech-to-Text supports three locations: `global`, `us` (US North America), + // and `eu` (Europe). If you are calling the `speech.googleapis.com` + // endpoint, use the `global` location. To specify a region, use a + // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + // with matching `us` or `eu` location value. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "speech.googleapis.com/CustomClass" + } + ]; + + // Required. The ID to use for the custom class, which will become the final + // component of the custom class' resource name. + // + // This value should restrict to letters, numbers, and hyphens, with the first + // character a letter, the last a letter or a number, and be 4-63 characters. + string custom_class_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The custom class to create. + CustomClass custom_class = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Message sent by the client for the `UpdateCustomClass` method. +message UpdateCustomClassRequest { + // Required. The custom class to update. + // + // The custom class's `name` field is used to identify the custom class to be + // updated. Format: + // + // `projects/{project}/locations/{location}/customClasses/{custom_class}` + // + // Speech-to-Text supports three locations: `global`, `us` (US North America), + // and `eu` (Europe). If you are calling the `speech.googleapis.com` + // endpoint, use the `global` location. To specify a region, use a + // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + // with matching `us` or `eu` location value. + CustomClass custom_class = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Message sent by the client for the `GetCustomClass` method. +message GetCustomClassRequest { + // Required. The name of the custom class to retrieve. Format: + // + // `projects/{project}/locations/{location}/customClasses/{custom_class}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "speech.googleapis.com/CustomClass" + } + ]; +} + +// Message sent by the client for the `ListCustomClasses` method. +message ListCustomClassesRequest { + // Required. The parent, which owns this collection of custom classes. Format: + // + // `projects/{project}/locations/{location}/customClasses` + // + // Speech-to-Text supports three locations: `global`, `us` (US North America), + // and `eu` (Europe). If you are calling the `speech.googleapis.com` + // endpoint, use the `global` location. To specify a region, use a + // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + // with matching `us` or `eu` location value. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "speech.googleapis.com/CustomClass" + } + ]; + + // The maximum number of custom classes to return. The service may return + // fewer than this value. If unspecified, at most 50 custom classes will be + // returned. The maximum value is 1000; values above 1000 will be coerced to + // 1000. + int32 page_size = 2; + + // A page token, received from a previous `ListCustomClass` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListCustomClass` must + // match the call that provided the page token. + string page_token = 3; +} + +// Message returned to the client by the `ListCustomClasses` method. +message ListCustomClassesResponse { + // The custom classes. + repeated CustomClass custom_classes = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Message sent by the client for the `DeleteCustomClass` method. +message DeleteCustomClassRequest { + // Required. The name of the custom class to delete. Format: + // + // `projects/{project}/locations/{location}/customClasses/{custom_class}` + // + // Speech-to-Text supports three locations: `global`, `us` (US North America), + // and `eu` (Europe). If you are calling the `speech.googleapis.com` + // endpoint, use the `global` location. To specify a region, use a + // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + // with matching `us` or `eu` location value. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "speech.googleapis.com/CustomClass" + } + ]; +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/protos/google/cloud/speech/v1p1beta1/resource.proto b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/protos/google/cloud/speech/v1p1beta1/resource.proto new file mode 100644 index 00000000000..bd75f30fcab --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/protos/google/cloud/speech/v1p1beta1/resource.proto @@ -0,0 +1,330 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.speech.v1p1beta1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/speech/apiv1p1beta1/speechpb;speechpb"; +option java_multiple_files = true; +option java_outer_classname = "SpeechResourceProto"; +option java_package = "com.google.cloud.speech.v1p1beta1"; +option objc_class_prefix = "GCS"; +option (google.api.resource_definition) = { + type: "cloudkms.googleapis.com/CryptoKey" + pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}" +}; +option (google.api.resource_definition) = { + type: "cloudkms.googleapis.com/CryptoKeyVersion" + pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}" +}; + +// A set of words or phrases that represents a common concept likely to appear +// in your audio, for example a list of passenger ship names. CustomClass items +// can be substituted into placeholders that you set in PhraseSet phrases. +message CustomClass { + option (google.api.resource) = { + type: "speech.googleapis.com/CustomClass" + pattern: "projects/{project}/locations/{location}/customClasses/{custom_class}" + }; + + // An item of the class. + message ClassItem { + // The class item's value. + string value = 1; + } + + // Set of states that define the lifecycle of a CustomClass. + enum State { + // Unspecified state. This is only used/useful for distinguishing + // unset values. + STATE_UNSPECIFIED = 0; + + // The normal and active state. + ACTIVE = 2; + + // This CustomClass has been deleted. + DELETED = 4; + } + + // The resource name of the custom class. + string name = 1; + + // If this custom class is a resource, the custom_class_id is the resource id + // of the CustomClass. Case sensitive. + string custom_class_id = 2; + + // A collection of class items. + repeated ClassItem items = 3; + + // Output only. The [KMS key + // name](https://cloud.google.com/kms/docs/resource-hierarchy#keys) with which + // the content of the ClassItem is encrypted. The expected format is + // `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`. + string kms_key_name = 6 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + } + ]; + + // Output only. The [KMS key version + // name](https://cloud.google.com/kms/docs/resource-hierarchy#key_versions) + // with which content of the ClassItem is encrypted. The expected format is + // `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}`. + string kms_key_version_name = 7 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKeyVersion" + } + ]; + + // Output only. System-assigned unique identifier for the CustomClass. + // This field is not used. + string uid = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. User-settable, human-readable name for the CustomClass. Must + // be 63 characters or less. This field is not used. + string display_name = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The CustomClass lifecycle state. + // This field is not used. + State state = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which this resource was requested for deletion. + // This field is not used. + google.protobuf.Timestamp delete_time = 11 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which this resource will be purged. + // This field is not used. + google.protobuf.Timestamp expire_time = 12 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Allows users to store small amounts of arbitrary data. + // Both the key and the value must be 63 characters or less each. + // At most 100 annotations. + // This field is not used. + map annotations = 13 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. This checksum is computed by the server based on the value of + // other fields. This may be sent on update, undelete, and delete requests to + // ensure the client has an up-to-date value before proceeding. This field is + // not used. + string etag = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Whether or not this CustomClass is in the process of being + // updated. This field is not used. + bool reconciling = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Provides "hints" to the speech recognizer to favor specific words and phrases +// in the results. +message PhraseSet { + option (google.api.resource) = { + type: "speech.googleapis.com/PhraseSet" + pattern: "projects/{project}/locations/{location}/phraseSets/{phrase_set}" + }; + + // A phrases containing words and phrase "hints" so that + // the speech recognition is more likely to recognize them. This can be used + // to improve the accuracy for specific words and phrases, for example, if + // specific commands are typically spoken by the user. This can also be used + // to add additional words to the vocabulary of the recognizer. See + // [usage limits](https://cloud.google.com/speech-to-text/quotas#content). + // + // List items can also include pre-built or custom classes containing groups + // of words that represent common concepts that occur in natural language. For + // example, rather than providing a phrase hint for every month of the + // year (e.g. "i was born in january", "i was born in febuary", ...), use the + // pre-built `$MONTH` class improves the likelihood of correctly transcribing + // audio that includes months (e.g. "i was born in $month"). + // To refer to pre-built classes, use the class' symbol prepended with `$` + // e.g. `$MONTH`. To refer to custom classes that were defined inline in the + // request, set the class's `custom_class_id` to a string unique to all class + // resources and inline classes. Then use the class' id wrapped in $`{...}` + // e.g. "${my-months}". To refer to custom classes resources, use the class' + // id wrapped in `${}` (e.g. `${my-months}`). + // + // Speech-to-Text supports three locations: `global`, `us` (US North America), + // and `eu` (Europe). If you are calling the `speech.googleapis.com` + // endpoint, use the `global` location. To specify a region, use a + // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + // with matching `us` or `eu` location value. + message Phrase { + // The phrase itself. + string value = 1; + + // Hint Boost. Overrides the boost set at the phrase set level. + // Positive value will increase the probability that a specific phrase will + // be recognized over other similar sounding phrases. The higher the boost, + // the higher the chance of false positive recognition as well. Negative + // boost will simply be ignored. Though `boost` can accept a wide range of + // positive values, most use cases are best served + // with values between 0 and 20. We recommend using a binary search approach + // to finding the optimal value for your use case as well as adding + // phrases both with and without boost to your requests. + float boost = 2; + } + + // Set of states that define the lifecycle of a CustomClass. + enum State { + // Unspecified state. This is only used/useful for distinguishing + // unset values. + STATE_UNSPECIFIED = 0; + + // The normal and active state. + ACTIVE = 2; + + // This CustomClass has been deleted. + DELETED = 4; + } + + // The resource name of the phrase set. + string name = 1; + + // A list of word and phrases. + repeated Phrase phrases = 2; + + // Hint Boost. Positive value will increase the probability that a specific + // phrase will be recognized over other similar sounding phrases. The higher + // the boost, the higher the chance of false positive recognition as well. + // Negative boost values would correspond to anti-biasing. Anti-biasing is not + // enabled, so negative boost will simply be ignored. Though `boost` can + // accept a wide range of positive values, most use cases are best served with + // values between 0 (exclusive) and 20. We recommend using a binary search + // approach to finding the optimal value for your use case as well as adding + // phrases both with and without boost to your requests. + float boost = 4; + + // Output only. The [KMS key + // name](https://cloud.google.com/kms/docs/resource-hierarchy#keys) with which + // the content of the PhraseSet is encrypted. The expected format is + // `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`. + string kms_key_name = 7 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + } + ]; + + // Output only. The [KMS key version + // name](https://cloud.google.com/kms/docs/resource-hierarchy#key_versions) + // with which content of the PhraseSet is encrypted. The expected format is + // `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}`. + string kms_key_version_name = 8 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKeyVersion" + } + ]; + + // Output only. System-assigned unique identifier for the PhraseSet. + // This field is not used. + string uid = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. User-settable, human-readable name for the PhraseSet. Must be + // 63 characters or less. This field is not used. + string display_name = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The CustomClass lifecycle state. + // This field is not used. + State state = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which this resource was requested for deletion. + // This field is not used. + google.protobuf.Timestamp delete_time = 12 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which this resource will be purged. + // This field is not used. + google.protobuf.Timestamp expire_time = 13 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Allows users to store small amounts of arbitrary data. + // Both the key and the value must be 63 characters or less each. + // At most 100 annotations. + // This field is not used. + map annotations = 14 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. This checksum is computed by the server based on the value of + // other fields. This may be sent on update, undelete, and delete requests to + // ensure the client has an up-to-date value before proceeding. This field is + // not used. + string etag = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Whether or not this PhraseSet is in the process of being + // updated. This field is not used. + bool reconciling = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Speech adaptation configuration. +message SpeechAdaptation { + message ABNFGrammar { + // All declarations and rules of an ABNF grammar broken up into multiple + // strings that will end up concatenated. + repeated string abnf_strings = 1; + } + + // A collection of phrase sets. To specify the hints inline, leave the + // phrase set's `name` blank and fill in the rest of its fields. Any + // phrase set can use any custom class. + repeated PhraseSet phrase_sets = 1; + + // A collection of phrase set resource names to use. + repeated string phrase_set_references = 2 [(google.api.resource_reference) = { + type: "speech.googleapis.com/PhraseSet" + }]; + + // A collection of custom classes. To specify the classes inline, leave the + // class' `name` blank and fill in the rest of its fields, giving it a unique + // `custom_class_id`. Refer to the inline defined class in phrase hints by its + // `custom_class_id`. + repeated CustomClass custom_classes = 3; + + // Augmented Backus-Naur form (ABNF) is a standardized grammar notation + // comprised by a set of derivation rules. + // See specifications: https://www.w3.org/TR/speech-grammar + ABNFGrammar abnf_grammar = 4; +} + +// Transcription normalization configuration. Use transcription normalization +// to automatically replace parts of the transcript with phrases of your +// choosing. For StreamingRecognize, this normalization only applies to stable +// partial transcripts (stability > 0.8) and final transcripts. +message TranscriptNormalization { + // A single replacement configuration. + message Entry { + // What to replace. Max length is 100 characters. + string search = 1; + + // What to replace with. Max length is 100 characters. + string replace = 2; + + // Whether the search is case sensitive. + bool case_sensitive = 3; + } + + // A list of replacement entries. We will perform replacement with one entry + // at a time. For example, the second entry in ["cat" => "dog", "mountain cat" + // => "mountain dog"] will never be applied because we will always process the + // first entry before it. At most 100 entries. + repeated Entry entries = 1; +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/protos/protos.d.ts b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/protos/protos.d.ts new file mode 100644 index 00000000000..6be37f8940d --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/protos/protos.d.ts @@ -0,0 +1,13751 @@ +// 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. + +import type {protobuf as $protobuf} from "google-gax"; +import Long = require("long"); +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace speech. */ + namespace speech { + + /** Namespace v1p1beta1. */ + namespace v1p1beta1 { + + /** Represents a Speech */ + class Speech extends $protobuf.rpc.Service { + + /** + * Constructs a new Speech service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Speech service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Speech; + + /** + * Calls Recognize. + * @param request RecognizeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RecognizeResponse + */ + public recognize(request: google.cloud.speech.v1p1beta1.IRecognizeRequest, callback: google.cloud.speech.v1p1beta1.Speech.RecognizeCallback): void; + + /** + * Calls Recognize. + * @param request RecognizeRequest message or plain object + * @returns Promise + */ + public recognize(request: google.cloud.speech.v1p1beta1.IRecognizeRequest): Promise; + + /** + * Calls LongRunningRecognize. + * @param request LongRunningRecognizeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public longRunningRecognize(request: google.cloud.speech.v1p1beta1.ILongRunningRecognizeRequest, callback: google.cloud.speech.v1p1beta1.Speech.LongRunningRecognizeCallback): void; + + /** + * Calls LongRunningRecognize. + * @param request LongRunningRecognizeRequest message or plain object + * @returns Promise + */ + public longRunningRecognize(request: google.cloud.speech.v1p1beta1.ILongRunningRecognizeRequest): Promise; + + /** + * Calls StreamingRecognize. + * @param request StreamingRecognizeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and StreamingRecognizeResponse + */ + public streamingRecognize(request: google.cloud.speech.v1p1beta1.IStreamingRecognizeRequest, callback: google.cloud.speech.v1p1beta1.Speech.StreamingRecognizeCallback): void; + + /** + * Calls StreamingRecognize. + * @param request StreamingRecognizeRequest message or plain object + * @returns Promise + */ + public streamingRecognize(request: google.cloud.speech.v1p1beta1.IStreamingRecognizeRequest): Promise; + } + + namespace Speech { + + /** + * Callback as used by {@link google.cloud.speech.v1p1beta1.Speech|recognize}. + * @param error Error, if any + * @param [response] RecognizeResponse + */ + type RecognizeCallback = (error: (Error|null), response?: google.cloud.speech.v1p1beta1.RecognizeResponse) => void; + + /** + * Callback as used by {@link google.cloud.speech.v1p1beta1.Speech|longRunningRecognize}. + * @param error Error, if any + * @param [response] Operation + */ + type LongRunningRecognizeCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.speech.v1p1beta1.Speech|streamingRecognize}. + * @param error Error, if any + * @param [response] StreamingRecognizeResponse + */ + type StreamingRecognizeCallback = (error: (Error|null), response?: google.cloud.speech.v1p1beta1.StreamingRecognizeResponse) => void; + } + + /** Properties of a RecognizeRequest. */ + interface IRecognizeRequest { + + /** RecognizeRequest config */ + config?: (google.cloud.speech.v1p1beta1.IRecognitionConfig|null); + + /** RecognizeRequest audio */ + audio?: (google.cloud.speech.v1p1beta1.IRecognitionAudio|null); + } + + /** Represents a RecognizeRequest. */ + class RecognizeRequest implements IRecognizeRequest { + + /** + * Constructs a new RecognizeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1p1beta1.IRecognizeRequest); + + /** RecognizeRequest config. */ + public config?: (google.cloud.speech.v1p1beta1.IRecognitionConfig|null); + + /** RecognizeRequest audio. */ + public audio?: (google.cloud.speech.v1p1beta1.IRecognitionAudio|null); + + /** + * Creates a new RecognizeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RecognizeRequest instance + */ + public static create(properties?: google.cloud.speech.v1p1beta1.IRecognizeRequest): google.cloud.speech.v1p1beta1.RecognizeRequest; + + /** + * Encodes the specified RecognizeRequest message. Does not implicitly {@link google.cloud.speech.v1p1beta1.RecognizeRequest.verify|verify} messages. + * @param message RecognizeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1p1beta1.IRecognizeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RecognizeRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.RecognizeRequest.verify|verify} messages. + * @param message RecognizeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1p1beta1.IRecognizeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RecognizeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RecognizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1p1beta1.RecognizeRequest; + + /** + * Decodes a RecognizeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RecognizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1p1beta1.RecognizeRequest; + + /** + * Verifies a RecognizeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RecognizeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RecognizeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1p1beta1.RecognizeRequest; + + /** + * Creates a plain object from a RecognizeRequest message. Also converts values to other types if specified. + * @param message RecognizeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1p1beta1.RecognizeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RecognizeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RecognizeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LongRunningRecognizeRequest. */ + interface ILongRunningRecognizeRequest { + + /** LongRunningRecognizeRequest config */ + config?: (google.cloud.speech.v1p1beta1.IRecognitionConfig|null); + + /** LongRunningRecognizeRequest audio */ + audio?: (google.cloud.speech.v1p1beta1.IRecognitionAudio|null); + + /** LongRunningRecognizeRequest outputConfig */ + outputConfig?: (google.cloud.speech.v1p1beta1.ITranscriptOutputConfig|null); + } + + /** Represents a LongRunningRecognizeRequest. */ + class LongRunningRecognizeRequest implements ILongRunningRecognizeRequest { + + /** + * Constructs a new LongRunningRecognizeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1p1beta1.ILongRunningRecognizeRequest); + + /** LongRunningRecognizeRequest config. */ + public config?: (google.cloud.speech.v1p1beta1.IRecognitionConfig|null); + + /** LongRunningRecognizeRequest audio. */ + public audio?: (google.cloud.speech.v1p1beta1.IRecognitionAudio|null); + + /** LongRunningRecognizeRequest outputConfig. */ + public outputConfig?: (google.cloud.speech.v1p1beta1.ITranscriptOutputConfig|null); + + /** + * Creates a new LongRunningRecognizeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns LongRunningRecognizeRequest instance + */ + public static create(properties?: google.cloud.speech.v1p1beta1.ILongRunningRecognizeRequest): google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest; + + /** + * Encodes the specified LongRunningRecognizeRequest message. Does not implicitly {@link google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest.verify|verify} messages. + * @param message LongRunningRecognizeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1p1beta1.ILongRunningRecognizeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LongRunningRecognizeRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest.verify|verify} messages. + * @param message LongRunningRecognizeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1p1beta1.ILongRunningRecognizeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LongRunningRecognizeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LongRunningRecognizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest; + + /** + * Decodes a LongRunningRecognizeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LongRunningRecognizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest; + + /** + * Verifies a LongRunningRecognizeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LongRunningRecognizeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LongRunningRecognizeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest; + + /** + * Creates a plain object from a LongRunningRecognizeRequest message. Also converts values to other types if specified. + * @param message LongRunningRecognizeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LongRunningRecognizeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LongRunningRecognizeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TranscriptOutputConfig. */ + interface ITranscriptOutputConfig { + + /** TranscriptOutputConfig gcsUri */ + gcsUri?: (string|null); + } + + /** Represents a TranscriptOutputConfig. */ + class TranscriptOutputConfig implements ITranscriptOutputConfig { + + /** + * Constructs a new TranscriptOutputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1p1beta1.ITranscriptOutputConfig); + + /** TranscriptOutputConfig gcsUri. */ + public gcsUri?: (string|null); + + /** TranscriptOutputConfig outputType. */ + public outputType?: "gcsUri"; + + /** + * Creates a new TranscriptOutputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns TranscriptOutputConfig instance + */ + public static create(properties?: google.cloud.speech.v1p1beta1.ITranscriptOutputConfig): google.cloud.speech.v1p1beta1.TranscriptOutputConfig; + + /** + * Encodes the specified TranscriptOutputConfig message. Does not implicitly {@link google.cloud.speech.v1p1beta1.TranscriptOutputConfig.verify|verify} messages. + * @param message TranscriptOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1p1beta1.ITranscriptOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TranscriptOutputConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.TranscriptOutputConfig.verify|verify} messages. + * @param message TranscriptOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1p1beta1.ITranscriptOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TranscriptOutputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TranscriptOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1p1beta1.TranscriptOutputConfig; + + /** + * Decodes a TranscriptOutputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TranscriptOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1p1beta1.TranscriptOutputConfig; + + /** + * Verifies a TranscriptOutputConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TranscriptOutputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TranscriptOutputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1p1beta1.TranscriptOutputConfig; + + /** + * Creates a plain object from a TranscriptOutputConfig message. Also converts values to other types if specified. + * @param message TranscriptOutputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1p1beta1.TranscriptOutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TranscriptOutputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TranscriptOutputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StreamingRecognizeRequest. */ + interface IStreamingRecognizeRequest { + + /** StreamingRecognizeRequest streamingConfig */ + streamingConfig?: (google.cloud.speech.v1p1beta1.IStreamingRecognitionConfig|null); + + /** StreamingRecognizeRequest audioContent */ + audioContent?: (Uint8Array|Buffer|string|null); + } + + /** Represents a StreamingRecognizeRequest. */ + class StreamingRecognizeRequest implements IStreamingRecognizeRequest { + + /** + * Constructs a new StreamingRecognizeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1p1beta1.IStreamingRecognizeRequest); + + /** StreamingRecognizeRequest streamingConfig. */ + public streamingConfig?: (google.cloud.speech.v1p1beta1.IStreamingRecognitionConfig|null); + + /** StreamingRecognizeRequest audioContent. */ + public audioContent?: (Uint8Array|Buffer|string|null); + + /** StreamingRecognizeRequest streamingRequest. */ + public streamingRequest?: ("streamingConfig"|"audioContent"); + + /** + * Creates a new StreamingRecognizeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingRecognizeRequest instance + */ + public static create(properties?: google.cloud.speech.v1p1beta1.IStreamingRecognizeRequest): google.cloud.speech.v1p1beta1.StreamingRecognizeRequest; + + /** + * Encodes the specified StreamingRecognizeRequest message. Does not implicitly {@link google.cloud.speech.v1p1beta1.StreamingRecognizeRequest.verify|verify} messages. + * @param message StreamingRecognizeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1p1beta1.IStreamingRecognizeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamingRecognizeRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.StreamingRecognizeRequest.verify|verify} messages. + * @param message StreamingRecognizeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1p1beta1.IStreamingRecognizeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamingRecognizeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingRecognizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1p1beta1.StreamingRecognizeRequest; + + /** + * Decodes a StreamingRecognizeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingRecognizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1p1beta1.StreamingRecognizeRequest; + + /** + * Verifies a StreamingRecognizeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamingRecognizeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingRecognizeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1p1beta1.StreamingRecognizeRequest; + + /** + * Creates a plain object from a StreamingRecognizeRequest message. Also converts values to other types if specified. + * @param message StreamingRecognizeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1p1beta1.StreamingRecognizeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamingRecognizeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamingRecognizeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StreamingRecognitionConfig. */ + interface IStreamingRecognitionConfig { + + /** StreamingRecognitionConfig config */ + config?: (google.cloud.speech.v1p1beta1.IRecognitionConfig|null); + + /** StreamingRecognitionConfig singleUtterance */ + singleUtterance?: (boolean|null); + + /** StreamingRecognitionConfig interimResults */ + interimResults?: (boolean|null); + + /** StreamingRecognitionConfig enableVoiceActivityEvents */ + enableVoiceActivityEvents?: (boolean|null); + + /** StreamingRecognitionConfig voiceActivityTimeout */ + voiceActivityTimeout?: (google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.IVoiceActivityTimeout|null); + } + + /** Represents a StreamingRecognitionConfig. */ + class StreamingRecognitionConfig implements IStreamingRecognitionConfig { + + /** + * Constructs a new StreamingRecognitionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1p1beta1.IStreamingRecognitionConfig); + + /** StreamingRecognitionConfig config. */ + public config?: (google.cloud.speech.v1p1beta1.IRecognitionConfig|null); + + /** StreamingRecognitionConfig singleUtterance. */ + public singleUtterance: boolean; + + /** StreamingRecognitionConfig interimResults. */ + public interimResults: boolean; + + /** StreamingRecognitionConfig enableVoiceActivityEvents. */ + public enableVoiceActivityEvents: boolean; + + /** StreamingRecognitionConfig voiceActivityTimeout. */ + public voiceActivityTimeout?: (google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.IVoiceActivityTimeout|null); + + /** + * Creates a new StreamingRecognitionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingRecognitionConfig instance + */ + public static create(properties?: google.cloud.speech.v1p1beta1.IStreamingRecognitionConfig): google.cloud.speech.v1p1beta1.StreamingRecognitionConfig; + + /** + * Encodes the specified StreamingRecognitionConfig message. Does not implicitly {@link google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.verify|verify} messages. + * @param message StreamingRecognitionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1p1beta1.IStreamingRecognitionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamingRecognitionConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.verify|verify} messages. + * @param message StreamingRecognitionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1p1beta1.IStreamingRecognitionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamingRecognitionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingRecognitionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1p1beta1.StreamingRecognitionConfig; + + /** + * Decodes a StreamingRecognitionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingRecognitionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1p1beta1.StreamingRecognitionConfig; + + /** + * Verifies a StreamingRecognitionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamingRecognitionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingRecognitionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1p1beta1.StreamingRecognitionConfig; + + /** + * Creates a plain object from a StreamingRecognitionConfig message. Also converts values to other types if specified. + * @param message StreamingRecognitionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1p1beta1.StreamingRecognitionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamingRecognitionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamingRecognitionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace StreamingRecognitionConfig { + + /** Properties of a VoiceActivityTimeout. */ + interface IVoiceActivityTimeout { + + /** VoiceActivityTimeout speechStartTimeout */ + speechStartTimeout?: (google.protobuf.IDuration|null); + + /** VoiceActivityTimeout speechEndTimeout */ + speechEndTimeout?: (google.protobuf.IDuration|null); + } + + /** Represents a VoiceActivityTimeout. */ + class VoiceActivityTimeout implements IVoiceActivityTimeout { + + /** + * Constructs a new VoiceActivityTimeout. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.IVoiceActivityTimeout); + + /** VoiceActivityTimeout speechStartTimeout. */ + public speechStartTimeout?: (google.protobuf.IDuration|null); + + /** VoiceActivityTimeout speechEndTimeout. */ + public speechEndTimeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new VoiceActivityTimeout instance using the specified properties. + * @param [properties] Properties to set + * @returns VoiceActivityTimeout instance + */ + public static create(properties?: google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.IVoiceActivityTimeout): google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.VoiceActivityTimeout; + + /** + * Encodes the specified VoiceActivityTimeout message. Does not implicitly {@link google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.VoiceActivityTimeout.verify|verify} messages. + * @param message VoiceActivityTimeout message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.IVoiceActivityTimeout, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VoiceActivityTimeout message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.VoiceActivityTimeout.verify|verify} messages. + * @param message VoiceActivityTimeout message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.IVoiceActivityTimeout, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VoiceActivityTimeout message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VoiceActivityTimeout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.VoiceActivityTimeout; + + /** + * Decodes a VoiceActivityTimeout message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VoiceActivityTimeout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.VoiceActivityTimeout; + + /** + * Verifies a VoiceActivityTimeout message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VoiceActivityTimeout message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VoiceActivityTimeout + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.VoiceActivityTimeout; + + /** + * Creates a plain object from a VoiceActivityTimeout message. Also converts values to other types if specified. + * @param message VoiceActivityTimeout + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.VoiceActivityTimeout, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VoiceActivityTimeout to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VoiceActivityTimeout + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a RecognitionConfig. */ + interface IRecognitionConfig { + + /** RecognitionConfig encoding */ + encoding?: (google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding|keyof typeof google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding|null); + + /** RecognitionConfig sampleRateHertz */ + sampleRateHertz?: (number|null); + + /** RecognitionConfig audioChannelCount */ + audioChannelCount?: (number|null); + + /** RecognitionConfig enableSeparateRecognitionPerChannel */ + enableSeparateRecognitionPerChannel?: (boolean|null); + + /** RecognitionConfig languageCode */ + languageCode?: (string|null); + + /** RecognitionConfig alternativeLanguageCodes */ + alternativeLanguageCodes?: (string[]|null); + + /** RecognitionConfig maxAlternatives */ + maxAlternatives?: (number|null); + + /** RecognitionConfig profanityFilter */ + profanityFilter?: (boolean|null); + + /** RecognitionConfig adaptation */ + adaptation?: (google.cloud.speech.v1p1beta1.ISpeechAdaptation|null); + + /** RecognitionConfig transcriptNormalization */ + transcriptNormalization?: (google.cloud.speech.v1p1beta1.ITranscriptNormalization|null); + + /** RecognitionConfig speechContexts */ + speechContexts?: (google.cloud.speech.v1p1beta1.ISpeechContext[]|null); + + /** RecognitionConfig enableWordTimeOffsets */ + enableWordTimeOffsets?: (boolean|null); + + /** RecognitionConfig enableWordConfidence */ + enableWordConfidence?: (boolean|null); + + /** RecognitionConfig enableAutomaticPunctuation */ + enableAutomaticPunctuation?: (boolean|null); + + /** RecognitionConfig enableSpokenPunctuation */ + enableSpokenPunctuation?: (google.protobuf.IBoolValue|null); + + /** RecognitionConfig enableSpokenEmojis */ + enableSpokenEmojis?: (google.protobuf.IBoolValue|null); + + /** RecognitionConfig enableSpeakerDiarization */ + enableSpeakerDiarization?: (boolean|null); + + /** RecognitionConfig diarizationSpeakerCount */ + diarizationSpeakerCount?: (number|null); + + /** RecognitionConfig diarizationConfig */ + diarizationConfig?: (google.cloud.speech.v1p1beta1.ISpeakerDiarizationConfig|null); + + /** RecognitionConfig metadata */ + metadata?: (google.cloud.speech.v1p1beta1.IRecognitionMetadata|null); + + /** RecognitionConfig model */ + model?: (string|null); + + /** RecognitionConfig useEnhanced */ + useEnhanced?: (boolean|null); + } + + /** Represents a RecognitionConfig. */ + class RecognitionConfig implements IRecognitionConfig { + + /** + * Constructs a new RecognitionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1p1beta1.IRecognitionConfig); + + /** RecognitionConfig encoding. */ + public encoding: (google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding|keyof typeof google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding); + + /** RecognitionConfig sampleRateHertz. */ + public sampleRateHertz: number; + + /** RecognitionConfig audioChannelCount. */ + public audioChannelCount: number; + + /** RecognitionConfig enableSeparateRecognitionPerChannel. */ + public enableSeparateRecognitionPerChannel: boolean; + + /** RecognitionConfig languageCode. */ + public languageCode: string; + + /** RecognitionConfig alternativeLanguageCodes. */ + public alternativeLanguageCodes: string[]; + + /** RecognitionConfig maxAlternatives. */ + public maxAlternatives: number; + + /** RecognitionConfig profanityFilter. */ + public profanityFilter: boolean; + + /** RecognitionConfig adaptation. */ + public adaptation?: (google.cloud.speech.v1p1beta1.ISpeechAdaptation|null); + + /** RecognitionConfig transcriptNormalization. */ + public transcriptNormalization?: (google.cloud.speech.v1p1beta1.ITranscriptNormalization|null); + + /** RecognitionConfig speechContexts. */ + public speechContexts: google.cloud.speech.v1p1beta1.ISpeechContext[]; + + /** RecognitionConfig enableWordTimeOffsets. */ + public enableWordTimeOffsets: boolean; + + /** RecognitionConfig enableWordConfidence. */ + public enableWordConfidence: boolean; + + /** RecognitionConfig enableAutomaticPunctuation. */ + public enableAutomaticPunctuation: boolean; + + /** RecognitionConfig enableSpokenPunctuation. */ + public enableSpokenPunctuation?: (google.protobuf.IBoolValue|null); + + /** RecognitionConfig enableSpokenEmojis. */ + public enableSpokenEmojis?: (google.protobuf.IBoolValue|null); + + /** RecognitionConfig enableSpeakerDiarization. */ + public enableSpeakerDiarization: boolean; + + /** RecognitionConfig diarizationSpeakerCount. */ + public diarizationSpeakerCount: number; + + /** RecognitionConfig diarizationConfig. */ + public diarizationConfig?: (google.cloud.speech.v1p1beta1.ISpeakerDiarizationConfig|null); + + /** RecognitionConfig metadata. */ + public metadata?: (google.cloud.speech.v1p1beta1.IRecognitionMetadata|null); + + /** RecognitionConfig model. */ + public model: string; + + /** RecognitionConfig useEnhanced. */ + public useEnhanced: boolean; + + /** + * Creates a new RecognitionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns RecognitionConfig instance + */ + public static create(properties?: google.cloud.speech.v1p1beta1.IRecognitionConfig): google.cloud.speech.v1p1beta1.RecognitionConfig; + + /** + * Encodes the specified RecognitionConfig message. Does not implicitly {@link google.cloud.speech.v1p1beta1.RecognitionConfig.verify|verify} messages. + * @param message RecognitionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1p1beta1.IRecognitionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RecognitionConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.RecognitionConfig.verify|verify} messages. + * @param message RecognitionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1p1beta1.IRecognitionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RecognitionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RecognitionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1p1beta1.RecognitionConfig; + + /** + * Decodes a RecognitionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RecognitionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1p1beta1.RecognitionConfig; + + /** + * Verifies a RecognitionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RecognitionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RecognitionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1p1beta1.RecognitionConfig; + + /** + * Creates a plain object from a RecognitionConfig message. Also converts values to other types if specified. + * @param message RecognitionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1p1beta1.RecognitionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RecognitionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RecognitionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RecognitionConfig { + + /** AudioEncoding enum. */ + enum AudioEncoding { + ENCODING_UNSPECIFIED = 0, + LINEAR16 = 1, + FLAC = 2, + MULAW = 3, + AMR = 4, + AMR_WB = 5, + OGG_OPUS = 6, + SPEEX_WITH_HEADER_BYTE = 7, + MP3 = 8, + WEBM_OPUS = 9, + ALAW = 10 + } + } + + /** Properties of a SpeakerDiarizationConfig. */ + interface ISpeakerDiarizationConfig { + + /** SpeakerDiarizationConfig enableSpeakerDiarization */ + enableSpeakerDiarization?: (boolean|null); + + /** SpeakerDiarizationConfig minSpeakerCount */ + minSpeakerCount?: (number|null); + + /** SpeakerDiarizationConfig maxSpeakerCount */ + maxSpeakerCount?: (number|null); + + /** SpeakerDiarizationConfig speakerTag */ + speakerTag?: (number|null); + } + + /** Represents a SpeakerDiarizationConfig. */ + class SpeakerDiarizationConfig implements ISpeakerDiarizationConfig { + + /** + * Constructs a new SpeakerDiarizationConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1p1beta1.ISpeakerDiarizationConfig); + + /** SpeakerDiarizationConfig enableSpeakerDiarization. */ + public enableSpeakerDiarization: boolean; + + /** SpeakerDiarizationConfig minSpeakerCount. */ + public minSpeakerCount: number; + + /** SpeakerDiarizationConfig maxSpeakerCount. */ + public maxSpeakerCount: number; + + /** SpeakerDiarizationConfig speakerTag. */ + public speakerTag: number; + + /** + * Creates a new SpeakerDiarizationConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SpeakerDiarizationConfig instance + */ + public static create(properties?: google.cloud.speech.v1p1beta1.ISpeakerDiarizationConfig): google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig; + + /** + * Encodes the specified SpeakerDiarizationConfig message. Does not implicitly {@link google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.verify|verify} messages. + * @param message SpeakerDiarizationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1p1beta1.ISpeakerDiarizationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpeakerDiarizationConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.verify|verify} messages. + * @param message SpeakerDiarizationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1p1beta1.ISpeakerDiarizationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpeakerDiarizationConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpeakerDiarizationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig; + + /** + * Decodes a SpeakerDiarizationConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpeakerDiarizationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig; + + /** + * Verifies a SpeakerDiarizationConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpeakerDiarizationConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpeakerDiarizationConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig; + + /** + * Creates a plain object from a SpeakerDiarizationConfig message. Also converts values to other types if specified. + * @param message SpeakerDiarizationConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpeakerDiarizationConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpeakerDiarizationConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RecognitionMetadata. */ + interface IRecognitionMetadata { + + /** RecognitionMetadata interactionType */ + interactionType?: (google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType|keyof typeof google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType|null); + + /** RecognitionMetadata industryNaicsCodeOfAudio */ + industryNaicsCodeOfAudio?: (number|null); + + /** RecognitionMetadata microphoneDistance */ + microphoneDistance?: (google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance|keyof typeof google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance|null); + + /** RecognitionMetadata originalMediaType */ + originalMediaType?: (google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType|keyof typeof google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType|null); + + /** RecognitionMetadata recordingDeviceType */ + recordingDeviceType?: (google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType|keyof typeof google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType|null); + + /** RecognitionMetadata recordingDeviceName */ + recordingDeviceName?: (string|null); + + /** RecognitionMetadata originalMimeType */ + originalMimeType?: (string|null); + + /** RecognitionMetadata obfuscatedId */ + obfuscatedId?: (number|Long|string|null); + + /** RecognitionMetadata audioTopic */ + audioTopic?: (string|null); + } + + /** Represents a RecognitionMetadata. */ + class RecognitionMetadata implements IRecognitionMetadata { + + /** + * Constructs a new RecognitionMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1p1beta1.IRecognitionMetadata); + + /** RecognitionMetadata interactionType. */ + public interactionType: (google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType|keyof typeof google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType); + + /** RecognitionMetadata industryNaicsCodeOfAudio. */ + public industryNaicsCodeOfAudio: number; + + /** RecognitionMetadata microphoneDistance. */ + public microphoneDistance: (google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance|keyof typeof google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance); + + /** RecognitionMetadata originalMediaType. */ + public originalMediaType: (google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType|keyof typeof google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType); + + /** RecognitionMetadata recordingDeviceType. */ + public recordingDeviceType: (google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType|keyof typeof google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType); + + /** RecognitionMetadata recordingDeviceName. */ + public recordingDeviceName: string; + + /** RecognitionMetadata originalMimeType. */ + public originalMimeType: string; + + /** RecognitionMetadata obfuscatedId. */ + public obfuscatedId: (number|Long|string); + + /** RecognitionMetadata audioTopic. */ + public audioTopic: string; + + /** + * Creates a new RecognitionMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns RecognitionMetadata instance + */ + public static create(properties?: google.cloud.speech.v1p1beta1.IRecognitionMetadata): google.cloud.speech.v1p1beta1.RecognitionMetadata; + + /** + * Encodes the specified RecognitionMetadata message. Does not implicitly {@link google.cloud.speech.v1p1beta1.RecognitionMetadata.verify|verify} messages. + * @param message RecognitionMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1p1beta1.IRecognitionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RecognitionMetadata message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.RecognitionMetadata.verify|verify} messages. + * @param message RecognitionMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1p1beta1.IRecognitionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RecognitionMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RecognitionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1p1beta1.RecognitionMetadata; + + /** + * Decodes a RecognitionMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RecognitionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1p1beta1.RecognitionMetadata; + + /** + * Verifies a RecognitionMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RecognitionMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RecognitionMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1p1beta1.RecognitionMetadata; + + /** + * Creates a plain object from a RecognitionMetadata message. Also converts values to other types if specified. + * @param message RecognitionMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1p1beta1.RecognitionMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RecognitionMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RecognitionMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RecognitionMetadata { + + /** InteractionType enum. */ + enum InteractionType { + INTERACTION_TYPE_UNSPECIFIED = 0, + DISCUSSION = 1, + PRESENTATION = 2, + PHONE_CALL = 3, + VOICEMAIL = 4, + PROFESSIONALLY_PRODUCED = 5, + VOICE_SEARCH = 6, + VOICE_COMMAND = 7, + DICTATION = 8 + } + + /** MicrophoneDistance enum. */ + enum MicrophoneDistance { + MICROPHONE_DISTANCE_UNSPECIFIED = 0, + NEARFIELD = 1, + MIDFIELD = 2, + FARFIELD = 3 + } + + /** OriginalMediaType enum. */ + enum OriginalMediaType { + ORIGINAL_MEDIA_TYPE_UNSPECIFIED = 0, + AUDIO = 1, + VIDEO = 2 + } + + /** RecordingDeviceType enum. */ + enum RecordingDeviceType { + RECORDING_DEVICE_TYPE_UNSPECIFIED = 0, + SMARTPHONE = 1, + PC = 2, + PHONE_LINE = 3, + VEHICLE = 4, + OTHER_OUTDOOR_DEVICE = 5, + OTHER_INDOOR_DEVICE = 6 + } + } + + /** Properties of a SpeechContext. */ + interface ISpeechContext { + + /** SpeechContext phrases */ + phrases?: (string[]|null); + + /** SpeechContext boost */ + boost?: (number|null); + } + + /** Represents a SpeechContext. */ + class SpeechContext implements ISpeechContext { + + /** + * Constructs a new SpeechContext. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1p1beta1.ISpeechContext); + + /** SpeechContext phrases. */ + public phrases: string[]; + + /** SpeechContext boost. */ + public boost: number; + + /** + * Creates a new SpeechContext instance using the specified properties. + * @param [properties] Properties to set + * @returns SpeechContext instance + */ + public static create(properties?: google.cloud.speech.v1p1beta1.ISpeechContext): google.cloud.speech.v1p1beta1.SpeechContext; + + /** + * Encodes the specified SpeechContext message. Does not implicitly {@link google.cloud.speech.v1p1beta1.SpeechContext.verify|verify} messages. + * @param message SpeechContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1p1beta1.ISpeechContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpeechContext message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.SpeechContext.verify|verify} messages. + * @param message SpeechContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1p1beta1.ISpeechContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpeechContext message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpeechContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1p1beta1.SpeechContext; + + /** + * Decodes a SpeechContext message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpeechContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1p1beta1.SpeechContext; + + /** + * Verifies a SpeechContext message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpeechContext message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpeechContext + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1p1beta1.SpeechContext; + + /** + * Creates a plain object from a SpeechContext message. Also converts values to other types if specified. + * @param message SpeechContext + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1p1beta1.SpeechContext, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpeechContext to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpeechContext + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RecognitionAudio. */ + interface IRecognitionAudio { + + /** RecognitionAudio content */ + content?: (Uint8Array|Buffer|string|null); + + /** RecognitionAudio uri */ + uri?: (string|null); + } + + /** Represents a RecognitionAudio. */ + class RecognitionAudio implements IRecognitionAudio { + + /** + * Constructs a new RecognitionAudio. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1p1beta1.IRecognitionAudio); + + /** RecognitionAudio content. */ + public content?: (Uint8Array|Buffer|string|null); + + /** RecognitionAudio uri. */ + public uri?: (string|null); + + /** RecognitionAudio audioSource. */ + public audioSource?: ("content"|"uri"); + + /** + * Creates a new RecognitionAudio instance using the specified properties. + * @param [properties] Properties to set + * @returns RecognitionAudio instance + */ + public static create(properties?: google.cloud.speech.v1p1beta1.IRecognitionAudio): google.cloud.speech.v1p1beta1.RecognitionAudio; + + /** + * Encodes the specified RecognitionAudio message. Does not implicitly {@link google.cloud.speech.v1p1beta1.RecognitionAudio.verify|verify} messages. + * @param message RecognitionAudio message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1p1beta1.IRecognitionAudio, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RecognitionAudio message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.RecognitionAudio.verify|verify} messages. + * @param message RecognitionAudio message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1p1beta1.IRecognitionAudio, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RecognitionAudio message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RecognitionAudio + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1p1beta1.RecognitionAudio; + + /** + * Decodes a RecognitionAudio message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RecognitionAudio + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1p1beta1.RecognitionAudio; + + /** + * Verifies a RecognitionAudio message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RecognitionAudio message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RecognitionAudio + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1p1beta1.RecognitionAudio; + + /** + * Creates a plain object from a RecognitionAudio message. Also converts values to other types if specified. + * @param message RecognitionAudio + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1p1beta1.RecognitionAudio, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RecognitionAudio to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RecognitionAudio + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RecognizeResponse. */ + interface IRecognizeResponse { + + /** RecognizeResponse results */ + results?: (google.cloud.speech.v1p1beta1.ISpeechRecognitionResult[]|null); + + /** RecognizeResponse totalBilledTime */ + totalBilledTime?: (google.protobuf.IDuration|null); + + /** RecognizeResponse speechAdaptationInfo */ + speechAdaptationInfo?: (google.cloud.speech.v1p1beta1.ISpeechAdaptationInfo|null); + + /** RecognizeResponse requestId */ + requestId?: (number|Long|string|null); + + /** RecognizeResponse usingLegacyModels */ + usingLegacyModels?: (boolean|null); + } + + /** Represents a RecognizeResponse. */ + class RecognizeResponse implements IRecognizeResponse { + + /** + * Constructs a new RecognizeResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1p1beta1.IRecognizeResponse); + + /** RecognizeResponse results. */ + public results: google.cloud.speech.v1p1beta1.ISpeechRecognitionResult[]; + + /** RecognizeResponse totalBilledTime. */ + public totalBilledTime?: (google.protobuf.IDuration|null); + + /** RecognizeResponse speechAdaptationInfo. */ + public speechAdaptationInfo?: (google.cloud.speech.v1p1beta1.ISpeechAdaptationInfo|null); + + /** RecognizeResponse requestId. */ + public requestId: (number|Long|string); + + /** RecognizeResponse usingLegacyModels. */ + public usingLegacyModels: boolean; + + /** + * Creates a new RecognizeResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RecognizeResponse instance + */ + public static create(properties?: google.cloud.speech.v1p1beta1.IRecognizeResponse): google.cloud.speech.v1p1beta1.RecognizeResponse; + + /** + * Encodes the specified RecognizeResponse message. Does not implicitly {@link google.cloud.speech.v1p1beta1.RecognizeResponse.verify|verify} messages. + * @param message RecognizeResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1p1beta1.IRecognizeResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RecognizeResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.RecognizeResponse.verify|verify} messages. + * @param message RecognizeResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1p1beta1.IRecognizeResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RecognizeResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RecognizeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1p1beta1.RecognizeResponse; + + /** + * Decodes a RecognizeResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RecognizeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1p1beta1.RecognizeResponse; + + /** + * Verifies a RecognizeResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RecognizeResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RecognizeResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1p1beta1.RecognizeResponse; + + /** + * Creates a plain object from a RecognizeResponse message. Also converts values to other types if specified. + * @param message RecognizeResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1p1beta1.RecognizeResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RecognizeResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RecognizeResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LongRunningRecognizeResponse. */ + interface ILongRunningRecognizeResponse { + + /** LongRunningRecognizeResponse results */ + results?: (google.cloud.speech.v1p1beta1.ISpeechRecognitionResult[]|null); + + /** LongRunningRecognizeResponse totalBilledTime */ + totalBilledTime?: (google.protobuf.IDuration|null); + + /** LongRunningRecognizeResponse outputConfig */ + outputConfig?: (google.cloud.speech.v1p1beta1.ITranscriptOutputConfig|null); + + /** LongRunningRecognizeResponse outputError */ + outputError?: (google.rpc.IStatus|null); + + /** LongRunningRecognizeResponse speechAdaptationInfo */ + speechAdaptationInfo?: (google.cloud.speech.v1p1beta1.ISpeechAdaptationInfo|null); + + /** LongRunningRecognizeResponse requestId */ + requestId?: (number|Long|string|null); + } + + /** Represents a LongRunningRecognizeResponse. */ + class LongRunningRecognizeResponse implements ILongRunningRecognizeResponse { + + /** + * Constructs a new LongRunningRecognizeResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1p1beta1.ILongRunningRecognizeResponse); + + /** LongRunningRecognizeResponse results. */ + public results: google.cloud.speech.v1p1beta1.ISpeechRecognitionResult[]; + + /** LongRunningRecognizeResponse totalBilledTime. */ + public totalBilledTime?: (google.protobuf.IDuration|null); + + /** LongRunningRecognizeResponse outputConfig. */ + public outputConfig?: (google.cloud.speech.v1p1beta1.ITranscriptOutputConfig|null); + + /** LongRunningRecognizeResponse outputError. */ + public outputError?: (google.rpc.IStatus|null); + + /** LongRunningRecognizeResponse speechAdaptationInfo. */ + public speechAdaptationInfo?: (google.cloud.speech.v1p1beta1.ISpeechAdaptationInfo|null); + + /** LongRunningRecognizeResponse requestId. */ + public requestId: (number|Long|string); + + /** + * Creates a new LongRunningRecognizeResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns LongRunningRecognizeResponse instance + */ + public static create(properties?: google.cloud.speech.v1p1beta1.ILongRunningRecognizeResponse): google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse; + + /** + * Encodes the specified LongRunningRecognizeResponse message. Does not implicitly {@link google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse.verify|verify} messages. + * @param message LongRunningRecognizeResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1p1beta1.ILongRunningRecognizeResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LongRunningRecognizeResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse.verify|verify} messages. + * @param message LongRunningRecognizeResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1p1beta1.ILongRunningRecognizeResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LongRunningRecognizeResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LongRunningRecognizeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse; + + /** + * Decodes a LongRunningRecognizeResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LongRunningRecognizeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse; + + /** + * Verifies a LongRunningRecognizeResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LongRunningRecognizeResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LongRunningRecognizeResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse; + + /** + * Creates a plain object from a LongRunningRecognizeResponse message. Also converts values to other types if specified. + * @param message LongRunningRecognizeResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LongRunningRecognizeResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LongRunningRecognizeResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LongRunningRecognizeMetadata. */ + interface ILongRunningRecognizeMetadata { + + /** LongRunningRecognizeMetadata progressPercent */ + progressPercent?: (number|null); + + /** LongRunningRecognizeMetadata startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** LongRunningRecognizeMetadata lastUpdateTime */ + lastUpdateTime?: (google.protobuf.ITimestamp|null); + + /** LongRunningRecognizeMetadata uri */ + uri?: (string|null); + + /** LongRunningRecognizeMetadata outputConfig */ + outputConfig?: (google.cloud.speech.v1p1beta1.ITranscriptOutputConfig|null); + } + + /** Represents a LongRunningRecognizeMetadata. */ + class LongRunningRecognizeMetadata implements ILongRunningRecognizeMetadata { + + /** + * Constructs a new LongRunningRecognizeMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1p1beta1.ILongRunningRecognizeMetadata); + + /** LongRunningRecognizeMetadata progressPercent. */ + public progressPercent: number; + + /** LongRunningRecognizeMetadata startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** LongRunningRecognizeMetadata lastUpdateTime. */ + public lastUpdateTime?: (google.protobuf.ITimestamp|null); + + /** LongRunningRecognizeMetadata uri. */ + public uri: string; + + /** LongRunningRecognizeMetadata outputConfig. */ + public outputConfig?: (google.cloud.speech.v1p1beta1.ITranscriptOutputConfig|null); + + /** + * Creates a new LongRunningRecognizeMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns LongRunningRecognizeMetadata instance + */ + public static create(properties?: google.cloud.speech.v1p1beta1.ILongRunningRecognizeMetadata): google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata; + + /** + * Encodes the specified LongRunningRecognizeMetadata message. Does not implicitly {@link google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata.verify|verify} messages. + * @param message LongRunningRecognizeMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1p1beta1.ILongRunningRecognizeMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LongRunningRecognizeMetadata message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata.verify|verify} messages. + * @param message LongRunningRecognizeMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1p1beta1.ILongRunningRecognizeMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LongRunningRecognizeMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LongRunningRecognizeMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata; + + /** + * Decodes a LongRunningRecognizeMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LongRunningRecognizeMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata; + + /** + * Verifies a LongRunningRecognizeMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LongRunningRecognizeMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LongRunningRecognizeMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata; + + /** + * Creates a plain object from a LongRunningRecognizeMetadata message. Also converts values to other types if specified. + * @param message LongRunningRecognizeMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LongRunningRecognizeMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LongRunningRecognizeMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StreamingRecognizeResponse. */ + interface IStreamingRecognizeResponse { + + /** StreamingRecognizeResponse error */ + error?: (google.rpc.IStatus|null); + + /** StreamingRecognizeResponse results */ + results?: (google.cloud.speech.v1p1beta1.IStreamingRecognitionResult[]|null); + + /** StreamingRecognizeResponse speechEventType */ + speechEventType?: (google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType|keyof typeof google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType|null); + + /** StreamingRecognizeResponse speechEventTime */ + speechEventTime?: (google.protobuf.IDuration|null); + + /** StreamingRecognizeResponse totalBilledTime */ + totalBilledTime?: (google.protobuf.IDuration|null); + + /** StreamingRecognizeResponse speechAdaptationInfo */ + speechAdaptationInfo?: (google.cloud.speech.v1p1beta1.ISpeechAdaptationInfo|null); + + /** StreamingRecognizeResponse requestId */ + requestId?: (number|Long|string|null); + } + + /** Represents a StreamingRecognizeResponse. */ + class StreamingRecognizeResponse implements IStreamingRecognizeResponse { + + /** + * Constructs a new StreamingRecognizeResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1p1beta1.IStreamingRecognizeResponse); + + /** StreamingRecognizeResponse error. */ + public error?: (google.rpc.IStatus|null); + + /** StreamingRecognizeResponse results. */ + public results: google.cloud.speech.v1p1beta1.IStreamingRecognitionResult[]; + + /** StreamingRecognizeResponse speechEventType. */ + public speechEventType: (google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType|keyof typeof google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType); + + /** StreamingRecognizeResponse speechEventTime. */ + public speechEventTime?: (google.protobuf.IDuration|null); + + /** StreamingRecognizeResponse totalBilledTime. */ + public totalBilledTime?: (google.protobuf.IDuration|null); + + /** StreamingRecognizeResponse speechAdaptationInfo. */ + public speechAdaptationInfo?: (google.cloud.speech.v1p1beta1.ISpeechAdaptationInfo|null); + + /** StreamingRecognizeResponse requestId. */ + public requestId: (number|Long|string); + + /** + * Creates a new StreamingRecognizeResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingRecognizeResponse instance + */ + public static create(properties?: google.cloud.speech.v1p1beta1.IStreamingRecognizeResponse): google.cloud.speech.v1p1beta1.StreamingRecognizeResponse; + + /** + * Encodes the specified StreamingRecognizeResponse message. Does not implicitly {@link google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.verify|verify} messages. + * @param message StreamingRecognizeResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1p1beta1.IStreamingRecognizeResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamingRecognizeResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.verify|verify} messages. + * @param message StreamingRecognizeResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1p1beta1.IStreamingRecognizeResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamingRecognizeResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingRecognizeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1p1beta1.StreamingRecognizeResponse; + + /** + * Decodes a StreamingRecognizeResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingRecognizeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1p1beta1.StreamingRecognizeResponse; + + /** + * Verifies a StreamingRecognizeResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamingRecognizeResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingRecognizeResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1p1beta1.StreamingRecognizeResponse; + + /** + * Creates a plain object from a StreamingRecognizeResponse message. Also converts values to other types if specified. + * @param message StreamingRecognizeResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1p1beta1.StreamingRecognizeResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamingRecognizeResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamingRecognizeResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace StreamingRecognizeResponse { + + /** SpeechEventType enum. */ + enum SpeechEventType { + SPEECH_EVENT_UNSPECIFIED = 0, + END_OF_SINGLE_UTTERANCE = 1, + SPEECH_ACTIVITY_BEGIN = 2, + SPEECH_ACTIVITY_END = 3, + SPEECH_ACTIVITY_TIMEOUT = 4 + } + } + + /** Properties of a StreamingRecognitionResult. */ + interface IStreamingRecognitionResult { + + /** StreamingRecognitionResult alternatives */ + alternatives?: (google.cloud.speech.v1p1beta1.ISpeechRecognitionAlternative[]|null); + + /** StreamingRecognitionResult isFinal */ + isFinal?: (boolean|null); + + /** StreamingRecognitionResult stability */ + stability?: (number|null); + + /** StreamingRecognitionResult resultEndTime */ + resultEndTime?: (google.protobuf.IDuration|null); + + /** StreamingRecognitionResult channelTag */ + channelTag?: (number|null); + + /** StreamingRecognitionResult languageCode */ + languageCode?: (string|null); + } + + /** Represents a StreamingRecognitionResult. */ + class StreamingRecognitionResult implements IStreamingRecognitionResult { + + /** + * Constructs a new StreamingRecognitionResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1p1beta1.IStreamingRecognitionResult); + + /** StreamingRecognitionResult alternatives. */ + public alternatives: google.cloud.speech.v1p1beta1.ISpeechRecognitionAlternative[]; + + /** StreamingRecognitionResult isFinal. */ + public isFinal: boolean; + + /** StreamingRecognitionResult stability. */ + public stability: number; + + /** StreamingRecognitionResult resultEndTime. */ + public resultEndTime?: (google.protobuf.IDuration|null); + + /** StreamingRecognitionResult channelTag. */ + public channelTag: number; + + /** StreamingRecognitionResult languageCode. */ + public languageCode: string; + + /** + * Creates a new StreamingRecognitionResult instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingRecognitionResult instance + */ + public static create(properties?: google.cloud.speech.v1p1beta1.IStreamingRecognitionResult): google.cloud.speech.v1p1beta1.StreamingRecognitionResult; + + /** + * Encodes the specified StreamingRecognitionResult message. Does not implicitly {@link google.cloud.speech.v1p1beta1.StreamingRecognitionResult.verify|verify} messages. + * @param message StreamingRecognitionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1p1beta1.IStreamingRecognitionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamingRecognitionResult message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.StreamingRecognitionResult.verify|verify} messages. + * @param message StreamingRecognitionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1p1beta1.IStreamingRecognitionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamingRecognitionResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingRecognitionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1p1beta1.StreamingRecognitionResult; + + /** + * Decodes a StreamingRecognitionResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingRecognitionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1p1beta1.StreamingRecognitionResult; + + /** + * Verifies a StreamingRecognitionResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamingRecognitionResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingRecognitionResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1p1beta1.StreamingRecognitionResult; + + /** + * Creates a plain object from a StreamingRecognitionResult message. Also converts values to other types if specified. + * @param message StreamingRecognitionResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1p1beta1.StreamingRecognitionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamingRecognitionResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamingRecognitionResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpeechRecognitionResult. */ + interface ISpeechRecognitionResult { + + /** SpeechRecognitionResult alternatives */ + alternatives?: (google.cloud.speech.v1p1beta1.ISpeechRecognitionAlternative[]|null); + + /** SpeechRecognitionResult channelTag */ + channelTag?: (number|null); + + /** SpeechRecognitionResult resultEndTime */ + resultEndTime?: (google.protobuf.IDuration|null); + + /** SpeechRecognitionResult languageCode */ + languageCode?: (string|null); + } + + /** Represents a SpeechRecognitionResult. */ + class SpeechRecognitionResult implements ISpeechRecognitionResult { + + /** + * Constructs a new SpeechRecognitionResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1p1beta1.ISpeechRecognitionResult); + + /** SpeechRecognitionResult alternatives. */ + public alternatives: google.cloud.speech.v1p1beta1.ISpeechRecognitionAlternative[]; + + /** SpeechRecognitionResult channelTag. */ + public channelTag: number; + + /** SpeechRecognitionResult resultEndTime. */ + public resultEndTime?: (google.protobuf.IDuration|null); + + /** SpeechRecognitionResult languageCode. */ + public languageCode: string; + + /** + * Creates a new SpeechRecognitionResult instance using the specified properties. + * @param [properties] Properties to set + * @returns SpeechRecognitionResult instance + */ + public static create(properties?: google.cloud.speech.v1p1beta1.ISpeechRecognitionResult): google.cloud.speech.v1p1beta1.SpeechRecognitionResult; + + /** + * Encodes the specified SpeechRecognitionResult message. Does not implicitly {@link google.cloud.speech.v1p1beta1.SpeechRecognitionResult.verify|verify} messages. + * @param message SpeechRecognitionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1p1beta1.ISpeechRecognitionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpeechRecognitionResult message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.SpeechRecognitionResult.verify|verify} messages. + * @param message SpeechRecognitionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1p1beta1.ISpeechRecognitionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpeechRecognitionResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpeechRecognitionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1p1beta1.SpeechRecognitionResult; + + /** + * Decodes a SpeechRecognitionResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpeechRecognitionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1p1beta1.SpeechRecognitionResult; + + /** + * Verifies a SpeechRecognitionResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpeechRecognitionResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpeechRecognitionResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1p1beta1.SpeechRecognitionResult; + + /** + * Creates a plain object from a SpeechRecognitionResult message. Also converts values to other types if specified. + * @param message SpeechRecognitionResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1p1beta1.SpeechRecognitionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpeechRecognitionResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpeechRecognitionResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpeechRecognitionAlternative. */ + interface ISpeechRecognitionAlternative { + + /** SpeechRecognitionAlternative transcript */ + transcript?: (string|null); + + /** SpeechRecognitionAlternative confidence */ + confidence?: (number|null); + + /** SpeechRecognitionAlternative words */ + words?: (google.cloud.speech.v1p1beta1.IWordInfo[]|null); + } + + /** Represents a SpeechRecognitionAlternative. */ + class SpeechRecognitionAlternative implements ISpeechRecognitionAlternative { + + /** + * Constructs a new SpeechRecognitionAlternative. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1p1beta1.ISpeechRecognitionAlternative); + + /** SpeechRecognitionAlternative transcript. */ + public transcript: string; + + /** SpeechRecognitionAlternative confidence. */ + public confidence: number; + + /** SpeechRecognitionAlternative words. */ + public words: google.cloud.speech.v1p1beta1.IWordInfo[]; + + /** + * Creates a new SpeechRecognitionAlternative instance using the specified properties. + * @param [properties] Properties to set + * @returns SpeechRecognitionAlternative instance + */ + public static create(properties?: google.cloud.speech.v1p1beta1.ISpeechRecognitionAlternative): google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative; + + /** + * Encodes the specified SpeechRecognitionAlternative message. Does not implicitly {@link google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.verify|verify} messages. + * @param message SpeechRecognitionAlternative message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1p1beta1.ISpeechRecognitionAlternative, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpeechRecognitionAlternative message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.verify|verify} messages. + * @param message SpeechRecognitionAlternative message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1p1beta1.ISpeechRecognitionAlternative, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpeechRecognitionAlternative message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpeechRecognitionAlternative + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative; + + /** + * Decodes a SpeechRecognitionAlternative message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpeechRecognitionAlternative + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative; + + /** + * Verifies a SpeechRecognitionAlternative message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpeechRecognitionAlternative message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpeechRecognitionAlternative + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative; + + /** + * Creates a plain object from a SpeechRecognitionAlternative message. Also converts values to other types if specified. + * @param message SpeechRecognitionAlternative + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpeechRecognitionAlternative to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpeechRecognitionAlternative + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WordInfo. */ + interface IWordInfo { + + /** WordInfo startTime */ + startTime?: (google.protobuf.IDuration|null); + + /** WordInfo endTime */ + endTime?: (google.protobuf.IDuration|null); + + /** WordInfo word */ + word?: (string|null); + + /** WordInfo confidence */ + confidence?: (number|null); + + /** WordInfo speakerTag */ + speakerTag?: (number|null); + + /** WordInfo speakerLabel */ + speakerLabel?: (string|null); + } + + /** Represents a WordInfo. */ + class WordInfo implements IWordInfo { + + /** + * Constructs a new WordInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1p1beta1.IWordInfo); + + /** WordInfo startTime. */ + public startTime?: (google.protobuf.IDuration|null); + + /** WordInfo endTime. */ + public endTime?: (google.protobuf.IDuration|null); + + /** WordInfo word. */ + public word: string; + + /** WordInfo confidence. */ + public confidence: number; + + /** WordInfo speakerTag. */ + public speakerTag: number; + + /** WordInfo speakerLabel. */ + public speakerLabel: string; + + /** + * Creates a new WordInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns WordInfo instance + */ + public static create(properties?: google.cloud.speech.v1p1beta1.IWordInfo): google.cloud.speech.v1p1beta1.WordInfo; + + /** + * Encodes the specified WordInfo message. Does not implicitly {@link google.cloud.speech.v1p1beta1.WordInfo.verify|verify} messages. + * @param message WordInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1p1beta1.IWordInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WordInfo message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.WordInfo.verify|verify} messages. + * @param message WordInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1p1beta1.IWordInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WordInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WordInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1p1beta1.WordInfo; + + /** + * Decodes a WordInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WordInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1p1beta1.WordInfo; + + /** + * Verifies a WordInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WordInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WordInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1p1beta1.WordInfo; + + /** + * Creates a plain object from a WordInfo message. Also converts values to other types if specified. + * @param message WordInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1p1beta1.WordInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WordInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WordInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpeechAdaptationInfo. */ + interface ISpeechAdaptationInfo { + + /** SpeechAdaptationInfo adaptationTimeout */ + adaptationTimeout?: (boolean|null); + + /** SpeechAdaptationInfo timeoutMessage */ + timeoutMessage?: (string|null); + } + + /** Represents a SpeechAdaptationInfo. */ + class SpeechAdaptationInfo implements ISpeechAdaptationInfo { + + /** + * Constructs a new SpeechAdaptationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1p1beta1.ISpeechAdaptationInfo); + + /** SpeechAdaptationInfo adaptationTimeout. */ + public adaptationTimeout: boolean; + + /** SpeechAdaptationInfo timeoutMessage. */ + public timeoutMessage: string; + + /** + * Creates a new SpeechAdaptationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SpeechAdaptationInfo instance + */ + public static create(properties?: google.cloud.speech.v1p1beta1.ISpeechAdaptationInfo): google.cloud.speech.v1p1beta1.SpeechAdaptationInfo; + + /** + * Encodes the specified SpeechAdaptationInfo message. Does not implicitly {@link google.cloud.speech.v1p1beta1.SpeechAdaptationInfo.verify|verify} messages. + * @param message SpeechAdaptationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1p1beta1.ISpeechAdaptationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpeechAdaptationInfo message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.SpeechAdaptationInfo.verify|verify} messages. + * @param message SpeechAdaptationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1p1beta1.ISpeechAdaptationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpeechAdaptationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpeechAdaptationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1p1beta1.SpeechAdaptationInfo; + + /** + * Decodes a SpeechAdaptationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpeechAdaptationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1p1beta1.SpeechAdaptationInfo; + + /** + * Verifies a SpeechAdaptationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpeechAdaptationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpeechAdaptationInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1p1beta1.SpeechAdaptationInfo; + + /** + * Creates a plain object from a SpeechAdaptationInfo message. Also converts values to other types if specified. + * @param message SpeechAdaptationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1p1beta1.SpeechAdaptationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpeechAdaptationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpeechAdaptationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomClass. */ + interface ICustomClass { + + /** CustomClass name */ + name?: (string|null); + + /** CustomClass customClassId */ + customClassId?: (string|null); + + /** CustomClass items */ + items?: (google.cloud.speech.v1p1beta1.CustomClass.IClassItem[]|null); + + /** CustomClass kmsKeyName */ + kmsKeyName?: (string|null); + + /** CustomClass kmsKeyVersionName */ + kmsKeyVersionName?: (string|null); + + /** CustomClass uid */ + uid?: (string|null); + + /** CustomClass displayName */ + displayName?: (string|null); + + /** CustomClass state */ + state?: (google.cloud.speech.v1p1beta1.CustomClass.State|keyof typeof google.cloud.speech.v1p1beta1.CustomClass.State|null); + + /** CustomClass deleteTime */ + deleteTime?: (google.protobuf.ITimestamp|null); + + /** CustomClass expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + + /** CustomClass annotations */ + annotations?: ({ [k: string]: string }|null); + + /** CustomClass etag */ + etag?: (string|null); + + /** CustomClass reconciling */ + reconciling?: (boolean|null); + } + + /** Represents a CustomClass. */ + class CustomClass implements ICustomClass { + + /** + * Constructs a new CustomClass. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1p1beta1.ICustomClass); + + /** CustomClass name. */ + public name: string; + + /** CustomClass customClassId. */ + public customClassId: string; + + /** CustomClass items. */ + public items: google.cloud.speech.v1p1beta1.CustomClass.IClassItem[]; + + /** CustomClass kmsKeyName. */ + public kmsKeyName: string; + + /** CustomClass kmsKeyVersionName. */ + public kmsKeyVersionName: string; + + /** CustomClass uid. */ + public uid: string; + + /** CustomClass displayName. */ + public displayName: string; + + /** CustomClass state. */ + public state: (google.cloud.speech.v1p1beta1.CustomClass.State|keyof typeof google.cloud.speech.v1p1beta1.CustomClass.State); + + /** CustomClass deleteTime. */ + public deleteTime?: (google.protobuf.ITimestamp|null); + + /** CustomClass expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** CustomClass annotations. */ + public annotations: { [k: string]: string }; + + /** CustomClass etag. */ + public etag: string; + + /** CustomClass reconciling. */ + public reconciling: boolean; + + /** + * Creates a new CustomClass instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomClass instance + */ + public static create(properties?: google.cloud.speech.v1p1beta1.ICustomClass): google.cloud.speech.v1p1beta1.CustomClass; + + /** + * Encodes the specified CustomClass message. Does not implicitly {@link google.cloud.speech.v1p1beta1.CustomClass.verify|verify} messages. + * @param message CustomClass message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1p1beta1.ICustomClass, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomClass message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.CustomClass.verify|verify} messages. + * @param message CustomClass message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1p1beta1.ICustomClass, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomClass message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomClass + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1p1beta1.CustomClass; + + /** + * Decodes a CustomClass message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomClass + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1p1beta1.CustomClass; + + /** + * Verifies a CustomClass message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomClass message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomClass + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1p1beta1.CustomClass; + + /** + * Creates a plain object from a CustomClass message. Also converts values to other types if specified. + * @param message CustomClass + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1p1beta1.CustomClass, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomClass to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomClass + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CustomClass { + + /** Properties of a ClassItem. */ + interface IClassItem { + + /** ClassItem value */ + value?: (string|null); + } + + /** Represents a ClassItem. */ + class ClassItem implements IClassItem { + + /** + * Constructs a new ClassItem. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1p1beta1.CustomClass.IClassItem); + + /** ClassItem value. */ + public value: string; + + /** + * Creates a new ClassItem instance using the specified properties. + * @param [properties] Properties to set + * @returns ClassItem instance + */ + public static create(properties?: google.cloud.speech.v1p1beta1.CustomClass.IClassItem): google.cloud.speech.v1p1beta1.CustomClass.ClassItem; + + /** + * Encodes the specified ClassItem message. Does not implicitly {@link google.cloud.speech.v1p1beta1.CustomClass.ClassItem.verify|verify} messages. + * @param message ClassItem message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1p1beta1.CustomClass.IClassItem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClassItem message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.CustomClass.ClassItem.verify|verify} messages. + * @param message ClassItem message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1p1beta1.CustomClass.IClassItem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClassItem message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClassItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1p1beta1.CustomClass.ClassItem; + + /** + * Decodes a ClassItem message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClassItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1p1beta1.CustomClass.ClassItem; + + /** + * Verifies a ClassItem message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClassItem message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClassItem + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1p1beta1.CustomClass.ClassItem; + + /** + * Creates a plain object from a ClassItem message. Also converts values to other types if specified. + * @param message ClassItem + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1p1beta1.CustomClass.ClassItem, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClassItem to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClassItem + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 2, + DELETED = 4 + } + } + + /** Properties of a PhraseSet. */ + interface IPhraseSet { + + /** PhraseSet name */ + name?: (string|null); + + /** PhraseSet phrases */ + phrases?: (google.cloud.speech.v1p1beta1.PhraseSet.IPhrase[]|null); + + /** PhraseSet boost */ + boost?: (number|null); + + /** PhraseSet kmsKeyName */ + kmsKeyName?: (string|null); + + /** PhraseSet kmsKeyVersionName */ + kmsKeyVersionName?: (string|null); + + /** PhraseSet uid */ + uid?: (string|null); + + /** PhraseSet displayName */ + displayName?: (string|null); + + /** PhraseSet state */ + state?: (google.cloud.speech.v1p1beta1.PhraseSet.State|keyof typeof google.cloud.speech.v1p1beta1.PhraseSet.State|null); + + /** PhraseSet deleteTime */ + deleteTime?: (google.protobuf.ITimestamp|null); + + /** PhraseSet expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + + /** PhraseSet annotations */ + annotations?: ({ [k: string]: string }|null); + + /** PhraseSet etag */ + etag?: (string|null); + + /** PhraseSet reconciling */ + reconciling?: (boolean|null); + } + + /** Represents a PhraseSet. */ + class PhraseSet implements IPhraseSet { + + /** + * Constructs a new PhraseSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1p1beta1.IPhraseSet); + + /** PhraseSet name. */ + public name: string; + + /** PhraseSet phrases. */ + public phrases: google.cloud.speech.v1p1beta1.PhraseSet.IPhrase[]; + + /** PhraseSet boost. */ + public boost: number; + + /** PhraseSet kmsKeyName. */ + public kmsKeyName: string; + + /** PhraseSet kmsKeyVersionName. */ + public kmsKeyVersionName: string; + + /** PhraseSet uid. */ + public uid: string; + + /** PhraseSet displayName. */ + public displayName: string; + + /** PhraseSet state. */ + public state: (google.cloud.speech.v1p1beta1.PhraseSet.State|keyof typeof google.cloud.speech.v1p1beta1.PhraseSet.State); + + /** PhraseSet deleteTime. */ + public deleteTime?: (google.protobuf.ITimestamp|null); + + /** PhraseSet expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** PhraseSet annotations. */ + public annotations: { [k: string]: string }; + + /** PhraseSet etag. */ + public etag: string; + + /** PhraseSet reconciling. */ + public reconciling: boolean; + + /** + * Creates a new PhraseSet instance using the specified properties. + * @param [properties] Properties to set + * @returns PhraseSet instance + */ + public static create(properties?: google.cloud.speech.v1p1beta1.IPhraseSet): google.cloud.speech.v1p1beta1.PhraseSet; + + /** + * Encodes the specified PhraseSet message. Does not implicitly {@link google.cloud.speech.v1p1beta1.PhraseSet.verify|verify} messages. + * @param message PhraseSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1p1beta1.IPhraseSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PhraseSet message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.PhraseSet.verify|verify} messages. + * @param message PhraseSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1p1beta1.IPhraseSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PhraseSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PhraseSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1p1beta1.PhraseSet; + + /** + * Decodes a PhraseSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PhraseSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1p1beta1.PhraseSet; + + /** + * Verifies a PhraseSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PhraseSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PhraseSet + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1p1beta1.PhraseSet; + + /** + * Creates a plain object from a PhraseSet message. Also converts values to other types if specified. + * @param message PhraseSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1p1beta1.PhraseSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PhraseSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PhraseSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PhraseSet { + + /** Properties of a Phrase. */ + interface IPhrase { + + /** Phrase value */ + value?: (string|null); + + /** Phrase boost */ + boost?: (number|null); + } + + /** Represents a Phrase. */ + class Phrase implements IPhrase { + + /** + * Constructs a new Phrase. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1p1beta1.PhraseSet.IPhrase); + + /** Phrase value. */ + public value: string; + + /** Phrase boost. */ + public boost: number; + + /** + * Creates a new Phrase instance using the specified properties. + * @param [properties] Properties to set + * @returns Phrase instance + */ + public static create(properties?: google.cloud.speech.v1p1beta1.PhraseSet.IPhrase): google.cloud.speech.v1p1beta1.PhraseSet.Phrase; + + /** + * Encodes the specified Phrase message. Does not implicitly {@link google.cloud.speech.v1p1beta1.PhraseSet.Phrase.verify|verify} messages. + * @param message Phrase message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1p1beta1.PhraseSet.IPhrase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Phrase message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.PhraseSet.Phrase.verify|verify} messages. + * @param message Phrase message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1p1beta1.PhraseSet.IPhrase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Phrase message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Phrase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1p1beta1.PhraseSet.Phrase; + + /** + * Decodes a Phrase message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Phrase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1p1beta1.PhraseSet.Phrase; + + /** + * Verifies a Phrase message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Phrase message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Phrase + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1p1beta1.PhraseSet.Phrase; + + /** + * Creates a plain object from a Phrase message. Also converts values to other types if specified. + * @param message Phrase + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1p1beta1.PhraseSet.Phrase, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Phrase to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Phrase + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 2, + DELETED = 4 + } + } + + /** Properties of a SpeechAdaptation. */ + interface ISpeechAdaptation { + + /** SpeechAdaptation phraseSets */ + phraseSets?: (google.cloud.speech.v1p1beta1.IPhraseSet[]|null); + + /** SpeechAdaptation phraseSetReferences */ + phraseSetReferences?: (string[]|null); + + /** SpeechAdaptation customClasses */ + customClasses?: (google.cloud.speech.v1p1beta1.ICustomClass[]|null); + + /** SpeechAdaptation abnfGrammar */ + abnfGrammar?: (google.cloud.speech.v1p1beta1.SpeechAdaptation.IABNFGrammar|null); + } + + /** Represents a SpeechAdaptation. */ + class SpeechAdaptation implements ISpeechAdaptation { + + /** + * Constructs a new SpeechAdaptation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1p1beta1.ISpeechAdaptation); + + /** SpeechAdaptation phraseSets. */ + public phraseSets: google.cloud.speech.v1p1beta1.IPhraseSet[]; + + /** SpeechAdaptation phraseSetReferences. */ + public phraseSetReferences: string[]; + + /** SpeechAdaptation customClasses. */ + public customClasses: google.cloud.speech.v1p1beta1.ICustomClass[]; + + /** SpeechAdaptation abnfGrammar. */ + public abnfGrammar?: (google.cloud.speech.v1p1beta1.SpeechAdaptation.IABNFGrammar|null); + + /** + * Creates a new SpeechAdaptation instance using the specified properties. + * @param [properties] Properties to set + * @returns SpeechAdaptation instance + */ + public static create(properties?: google.cloud.speech.v1p1beta1.ISpeechAdaptation): google.cloud.speech.v1p1beta1.SpeechAdaptation; + + /** + * Encodes the specified SpeechAdaptation message. Does not implicitly {@link google.cloud.speech.v1p1beta1.SpeechAdaptation.verify|verify} messages. + * @param message SpeechAdaptation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1p1beta1.ISpeechAdaptation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpeechAdaptation message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.SpeechAdaptation.verify|verify} messages. + * @param message SpeechAdaptation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1p1beta1.ISpeechAdaptation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpeechAdaptation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpeechAdaptation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1p1beta1.SpeechAdaptation; + + /** + * Decodes a SpeechAdaptation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpeechAdaptation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1p1beta1.SpeechAdaptation; + + /** + * Verifies a SpeechAdaptation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpeechAdaptation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpeechAdaptation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1p1beta1.SpeechAdaptation; + + /** + * Creates a plain object from a SpeechAdaptation message. Also converts values to other types if specified. + * @param message SpeechAdaptation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1p1beta1.SpeechAdaptation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpeechAdaptation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpeechAdaptation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SpeechAdaptation { + + /** Properties of a ABNFGrammar. */ + interface IABNFGrammar { + + /** ABNFGrammar abnfStrings */ + abnfStrings?: (string[]|null); + } + + /** Represents a ABNFGrammar. */ + class ABNFGrammar implements IABNFGrammar { + + /** + * Constructs a new ABNFGrammar. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1p1beta1.SpeechAdaptation.IABNFGrammar); + + /** ABNFGrammar abnfStrings. */ + public abnfStrings: string[]; + + /** + * Creates a new ABNFGrammar instance using the specified properties. + * @param [properties] Properties to set + * @returns ABNFGrammar instance + */ + public static create(properties?: google.cloud.speech.v1p1beta1.SpeechAdaptation.IABNFGrammar): google.cloud.speech.v1p1beta1.SpeechAdaptation.ABNFGrammar; + + /** + * Encodes the specified ABNFGrammar message. Does not implicitly {@link google.cloud.speech.v1p1beta1.SpeechAdaptation.ABNFGrammar.verify|verify} messages. + * @param message ABNFGrammar message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1p1beta1.SpeechAdaptation.IABNFGrammar, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ABNFGrammar message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.SpeechAdaptation.ABNFGrammar.verify|verify} messages. + * @param message ABNFGrammar message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1p1beta1.SpeechAdaptation.IABNFGrammar, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ABNFGrammar message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ABNFGrammar + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1p1beta1.SpeechAdaptation.ABNFGrammar; + + /** + * Decodes a ABNFGrammar message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ABNFGrammar + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1p1beta1.SpeechAdaptation.ABNFGrammar; + + /** + * Verifies a ABNFGrammar message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ABNFGrammar message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ABNFGrammar + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1p1beta1.SpeechAdaptation.ABNFGrammar; + + /** + * Creates a plain object from a ABNFGrammar message. Also converts values to other types if specified. + * @param message ABNFGrammar + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1p1beta1.SpeechAdaptation.ABNFGrammar, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ABNFGrammar to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ABNFGrammar + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a TranscriptNormalization. */ + interface ITranscriptNormalization { + + /** TranscriptNormalization entries */ + entries?: (google.cloud.speech.v1p1beta1.TranscriptNormalization.IEntry[]|null); + } + + /** Represents a TranscriptNormalization. */ + class TranscriptNormalization implements ITranscriptNormalization { + + /** + * Constructs a new TranscriptNormalization. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1p1beta1.ITranscriptNormalization); + + /** TranscriptNormalization entries. */ + public entries: google.cloud.speech.v1p1beta1.TranscriptNormalization.IEntry[]; + + /** + * Creates a new TranscriptNormalization instance using the specified properties. + * @param [properties] Properties to set + * @returns TranscriptNormalization instance + */ + public static create(properties?: google.cloud.speech.v1p1beta1.ITranscriptNormalization): google.cloud.speech.v1p1beta1.TranscriptNormalization; + + /** + * Encodes the specified TranscriptNormalization message. Does not implicitly {@link google.cloud.speech.v1p1beta1.TranscriptNormalization.verify|verify} messages. + * @param message TranscriptNormalization message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1p1beta1.ITranscriptNormalization, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TranscriptNormalization message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.TranscriptNormalization.verify|verify} messages. + * @param message TranscriptNormalization message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1p1beta1.ITranscriptNormalization, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TranscriptNormalization message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TranscriptNormalization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1p1beta1.TranscriptNormalization; + + /** + * Decodes a TranscriptNormalization message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TranscriptNormalization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1p1beta1.TranscriptNormalization; + + /** + * Verifies a TranscriptNormalization message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TranscriptNormalization message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TranscriptNormalization + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1p1beta1.TranscriptNormalization; + + /** + * Creates a plain object from a TranscriptNormalization message. Also converts values to other types if specified. + * @param message TranscriptNormalization + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1p1beta1.TranscriptNormalization, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TranscriptNormalization to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TranscriptNormalization + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TranscriptNormalization { + + /** Properties of an Entry. */ + interface IEntry { + + /** Entry search */ + search?: (string|null); + + /** Entry replace */ + replace?: (string|null); + + /** Entry caseSensitive */ + caseSensitive?: (boolean|null); + } + + /** Represents an Entry. */ + class Entry implements IEntry { + + /** + * Constructs a new Entry. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1p1beta1.TranscriptNormalization.IEntry); + + /** Entry search. */ + public search: string; + + /** Entry replace. */ + public replace: string; + + /** Entry caseSensitive. */ + public caseSensitive: boolean; + + /** + * Creates a new Entry instance using the specified properties. + * @param [properties] Properties to set + * @returns Entry instance + */ + public static create(properties?: google.cloud.speech.v1p1beta1.TranscriptNormalization.IEntry): google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry; + + /** + * Encodes the specified Entry message. Does not implicitly {@link google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry.verify|verify} messages. + * @param message Entry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1p1beta1.TranscriptNormalization.IEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Entry message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry.verify|verify} messages. + * @param message Entry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1p1beta1.TranscriptNormalization.IEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Entry message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Entry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry; + + /** + * Decodes an Entry message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Entry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry; + + /** + * Verifies an Entry message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Entry message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Entry + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry; + + /** + * Creates a plain object from an Entry message. Also converts values to other types if specified. + * @param message Entry + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Entry to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Entry + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Represents an Adaptation */ + class Adaptation extends $protobuf.rpc.Service { + + /** + * Constructs a new Adaptation service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Adaptation service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Adaptation; + + /** + * Calls CreatePhraseSet. + * @param request CreatePhraseSetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PhraseSet + */ + public createPhraseSet(request: google.cloud.speech.v1p1beta1.ICreatePhraseSetRequest, callback: google.cloud.speech.v1p1beta1.Adaptation.CreatePhraseSetCallback): void; + + /** + * Calls CreatePhraseSet. + * @param request CreatePhraseSetRequest message or plain object + * @returns Promise + */ + public createPhraseSet(request: google.cloud.speech.v1p1beta1.ICreatePhraseSetRequest): Promise; + + /** + * Calls GetPhraseSet. + * @param request GetPhraseSetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PhraseSet + */ + public getPhraseSet(request: google.cloud.speech.v1p1beta1.IGetPhraseSetRequest, callback: google.cloud.speech.v1p1beta1.Adaptation.GetPhraseSetCallback): void; + + /** + * Calls GetPhraseSet. + * @param request GetPhraseSetRequest message or plain object + * @returns Promise + */ + public getPhraseSet(request: google.cloud.speech.v1p1beta1.IGetPhraseSetRequest): Promise; + + /** + * Calls ListPhraseSet. + * @param request ListPhraseSetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListPhraseSetResponse + */ + public listPhraseSet(request: google.cloud.speech.v1p1beta1.IListPhraseSetRequest, callback: google.cloud.speech.v1p1beta1.Adaptation.ListPhraseSetCallback): void; + + /** + * Calls ListPhraseSet. + * @param request ListPhraseSetRequest message or plain object + * @returns Promise + */ + public listPhraseSet(request: google.cloud.speech.v1p1beta1.IListPhraseSetRequest): Promise; + + /** + * Calls UpdatePhraseSet. + * @param request UpdatePhraseSetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PhraseSet + */ + public updatePhraseSet(request: google.cloud.speech.v1p1beta1.IUpdatePhraseSetRequest, callback: google.cloud.speech.v1p1beta1.Adaptation.UpdatePhraseSetCallback): void; + + /** + * Calls UpdatePhraseSet. + * @param request UpdatePhraseSetRequest message or plain object + * @returns Promise + */ + public updatePhraseSet(request: google.cloud.speech.v1p1beta1.IUpdatePhraseSetRequest): Promise; + + /** + * Calls DeletePhraseSet. + * @param request DeletePhraseSetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deletePhraseSet(request: google.cloud.speech.v1p1beta1.IDeletePhraseSetRequest, callback: google.cloud.speech.v1p1beta1.Adaptation.DeletePhraseSetCallback): void; + + /** + * Calls DeletePhraseSet. + * @param request DeletePhraseSetRequest message or plain object + * @returns Promise + */ + public deletePhraseSet(request: google.cloud.speech.v1p1beta1.IDeletePhraseSetRequest): Promise; + + /** + * Calls CreateCustomClass. + * @param request CreateCustomClassRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CustomClass + */ + public createCustomClass(request: google.cloud.speech.v1p1beta1.ICreateCustomClassRequest, callback: google.cloud.speech.v1p1beta1.Adaptation.CreateCustomClassCallback): void; + + /** + * Calls CreateCustomClass. + * @param request CreateCustomClassRequest message or plain object + * @returns Promise + */ + public createCustomClass(request: google.cloud.speech.v1p1beta1.ICreateCustomClassRequest): Promise; + + /** + * Calls GetCustomClass. + * @param request GetCustomClassRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CustomClass + */ + public getCustomClass(request: google.cloud.speech.v1p1beta1.IGetCustomClassRequest, callback: google.cloud.speech.v1p1beta1.Adaptation.GetCustomClassCallback): void; + + /** + * Calls GetCustomClass. + * @param request GetCustomClassRequest message or plain object + * @returns Promise + */ + public getCustomClass(request: google.cloud.speech.v1p1beta1.IGetCustomClassRequest): Promise; + + /** + * Calls ListCustomClasses. + * @param request ListCustomClassesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListCustomClassesResponse + */ + public listCustomClasses(request: google.cloud.speech.v1p1beta1.IListCustomClassesRequest, callback: google.cloud.speech.v1p1beta1.Adaptation.ListCustomClassesCallback): void; + + /** + * Calls ListCustomClasses. + * @param request ListCustomClassesRequest message or plain object + * @returns Promise + */ + public listCustomClasses(request: google.cloud.speech.v1p1beta1.IListCustomClassesRequest): Promise; + + /** + * Calls UpdateCustomClass. + * @param request UpdateCustomClassRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CustomClass + */ + public updateCustomClass(request: google.cloud.speech.v1p1beta1.IUpdateCustomClassRequest, callback: google.cloud.speech.v1p1beta1.Adaptation.UpdateCustomClassCallback): void; + + /** + * Calls UpdateCustomClass. + * @param request UpdateCustomClassRequest message or plain object + * @returns Promise + */ + public updateCustomClass(request: google.cloud.speech.v1p1beta1.IUpdateCustomClassRequest): Promise; + + /** + * Calls DeleteCustomClass. + * @param request DeleteCustomClassRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteCustomClass(request: google.cloud.speech.v1p1beta1.IDeleteCustomClassRequest, callback: google.cloud.speech.v1p1beta1.Adaptation.DeleteCustomClassCallback): void; + + /** + * Calls DeleteCustomClass. + * @param request DeleteCustomClassRequest message or plain object + * @returns Promise + */ + public deleteCustomClass(request: google.cloud.speech.v1p1beta1.IDeleteCustomClassRequest): Promise; + } + + namespace Adaptation { + + /** + * Callback as used by {@link google.cloud.speech.v1p1beta1.Adaptation|createPhraseSet}. + * @param error Error, if any + * @param [response] PhraseSet + */ + type CreatePhraseSetCallback = (error: (Error|null), response?: google.cloud.speech.v1p1beta1.PhraseSet) => void; + + /** + * Callback as used by {@link google.cloud.speech.v1p1beta1.Adaptation|getPhraseSet}. + * @param error Error, if any + * @param [response] PhraseSet + */ + type GetPhraseSetCallback = (error: (Error|null), response?: google.cloud.speech.v1p1beta1.PhraseSet) => void; + + /** + * Callback as used by {@link google.cloud.speech.v1p1beta1.Adaptation|listPhraseSet}. + * @param error Error, if any + * @param [response] ListPhraseSetResponse + */ + type ListPhraseSetCallback = (error: (Error|null), response?: google.cloud.speech.v1p1beta1.ListPhraseSetResponse) => void; + + /** + * Callback as used by {@link google.cloud.speech.v1p1beta1.Adaptation|updatePhraseSet}. + * @param error Error, if any + * @param [response] PhraseSet + */ + type UpdatePhraseSetCallback = (error: (Error|null), response?: google.cloud.speech.v1p1beta1.PhraseSet) => void; + + /** + * Callback as used by {@link google.cloud.speech.v1p1beta1.Adaptation|deletePhraseSet}. + * @param error Error, if any + * @param [response] Empty + */ + type DeletePhraseSetCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.speech.v1p1beta1.Adaptation|createCustomClass}. + * @param error Error, if any + * @param [response] CustomClass + */ + type CreateCustomClassCallback = (error: (Error|null), response?: google.cloud.speech.v1p1beta1.CustomClass) => void; + + /** + * Callback as used by {@link google.cloud.speech.v1p1beta1.Adaptation|getCustomClass}. + * @param error Error, if any + * @param [response] CustomClass + */ + type GetCustomClassCallback = (error: (Error|null), response?: google.cloud.speech.v1p1beta1.CustomClass) => void; + + /** + * Callback as used by {@link google.cloud.speech.v1p1beta1.Adaptation|listCustomClasses}. + * @param error Error, if any + * @param [response] ListCustomClassesResponse + */ + type ListCustomClassesCallback = (error: (Error|null), response?: google.cloud.speech.v1p1beta1.ListCustomClassesResponse) => void; + + /** + * Callback as used by {@link google.cloud.speech.v1p1beta1.Adaptation|updateCustomClass}. + * @param error Error, if any + * @param [response] CustomClass + */ + type UpdateCustomClassCallback = (error: (Error|null), response?: google.cloud.speech.v1p1beta1.CustomClass) => void; + + /** + * Callback as used by {@link google.cloud.speech.v1p1beta1.Adaptation|deleteCustomClass}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteCustomClassCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of a CreatePhraseSetRequest. */ + interface ICreatePhraseSetRequest { + + /** CreatePhraseSetRequest parent */ + parent?: (string|null); + + /** CreatePhraseSetRequest phraseSetId */ + phraseSetId?: (string|null); + + /** CreatePhraseSetRequest phraseSet */ + phraseSet?: (google.cloud.speech.v1p1beta1.IPhraseSet|null); + } + + /** Represents a CreatePhraseSetRequest. */ + class CreatePhraseSetRequest implements ICreatePhraseSetRequest { + + /** + * Constructs a new CreatePhraseSetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1p1beta1.ICreatePhraseSetRequest); + + /** CreatePhraseSetRequest parent. */ + public parent: string; + + /** CreatePhraseSetRequest phraseSetId. */ + public phraseSetId: string; + + /** CreatePhraseSetRequest phraseSet. */ + public phraseSet?: (google.cloud.speech.v1p1beta1.IPhraseSet|null); + + /** + * Creates a new CreatePhraseSetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreatePhraseSetRequest instance + */ + public static create(properties?: google.cloud.speech.v1p1beta1.ICreatePhraseSetRequest): google.cloud.speech.v1p1beta1.CreatePhraseSetRequest; + + /** + * Encodes the specified CreatePhraseSetRequest message. Does not implicitly {@link google.cloud.speech.v1p1beta1.CreatePhraseSetRequest.verify|verify} messages. + * @param message CreatePhraseSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1p1beta1.ICreatePhraseSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreatePhraseSetRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.CreatePhraseSetRequest.verify|verify} messages. + * @param message CreatePhraseSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1p1beta1.ICreatePhraseSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreatePhraseSetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreatePhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1p1beta1.CreatePhraseSetRequest; + + /** + * Decodes a CreatePhraseSetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreatePhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1p1beta1.CreatePhraseSetRequest; + + /** + * Verifies a CreatePhraseSetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreatePhraseSetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreatePhraseSetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1p1beta1.CreatePhraseSetRequest; + + /** + * Creates a plain object from a CreatePhraseSetRequest message. Also converts values to other types if specified. + * @param message CreatePhraseSetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1p1beta1.CreatePhraseSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreatePhraseSetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreatePhraseSetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdatePhraseSetRequest. */ + interface IUpdatePhraseSetRequest { + + /** UpdatePhraseSetRequest phraseSet */ + phraseSet?: (google.cloud.speech.v1p1beta1.IPhraseSet|null); + + /** UpdatePhraseSetRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdatePhraseSetRequest. */ + class UpdatePhraseSetRequest implements IUpdatePhraseSetRequest { + + /** + * Constructs a new UpdatePhraseSetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1p1beta1.IUpdatePhraseSetRequest); + + /** UpdatePhraseSetRequest phraseSet. */ + public phraseSet?: (google.cloud.speech.v1p1beta1.IPhraseSet|null); + + /** UpdatePhraseSetRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdatePhraseSetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdatePhraseSetRequest instance + */ + public static create(properties?: google.cloud.speech.v1p1beta1.IUpdatePhraseSetRequest): google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest; + + /** + * Encodes the specified UpdatePhraseSetRequest message. Does not implicitly {@link google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest.verify|verify} messages. + * @param message UpdatePhraseSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1p1beta1.IUpdatePhraseSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdatePhraseSetRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest.verify|verify} messages. + * @param message UpdatePhraseSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1p1beta1.IUpdatePhraseSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdatePhraseSetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdatePhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest; + + /** + * Decodes an UpdatePhraseSetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdatePhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest; + + /** + * Verifies an UpdatePhraseSetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdatePhraseSetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdatePhraseSetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest; + + /** + * Creates a plain object from an UpdatePhraseSetRequest message. Also converts values to other types if specified. + * @param message UpdatePhraseSetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdatePhraseSetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdatePhraseSetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetPhraseSetRequest. */ + interface IGetPhraseSetRequest { + + /** GetPhraseSetRequest name */ + name?: (string|null); + } + + /** Represents a GetPhraseSetRequest. */ + class GetPhraseSetRequest implements IGetPhraseSetRequest { + + /** + * Constructs a new GetPhraseSetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1p1beta1.IGetPhraseSetRequest); + + /** GetPhraseSetRequest name. */ + public name: string; + + /** + * Creates a new GetPhraseSetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetPhraseSetRequest instance + */ + public static create(properties?: google.cloud.speech.v1p1beta1.IGetPhraseSetRequest): google.cloud.speech.v1p1beta1.GetPhraseSetRequest; + + /** + * Encodes the specified GetPhraseSetRequest message. Does not implicitly {@link google.cloud.speech.v1p1beta1.GetPhraseSetRequest.verify|verify} messages. + * @param message GetPhraseSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1p1beta1.IGetPhraseSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetPhraseSetRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.GetPhraseSetRequest.verify|verify} messages. + * @param message GetPhraseSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1p1beta1.IGetPhraseSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetPhraseSetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetPhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1p1beta1.GetPhraseSetRequest; + + /** + * Decodes a GetPhraseSetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetPhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1p1beta1.GetPhraseSetRequest; + + /** + * Verifies a GetPhraseSetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetPhraseSetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetPhraseSetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1p1beta1.GetPhraseSetRequest; + + /** + * Creates a plain object from a GetPhraseSetRequest message. Also converts values to other types if specified. + * @param message GetPhraseSetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1p1beta1.GetPhraseSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetPhraseSetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetPhraseSetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListPhraseSetRequest. */ + interface IListPhraseSetRequest { + + /** ListPhraseSetRequest parent */ + parent?: (string|null); + + /** ListPhraseSetRequest pageSize */ + pageSize?: (number|null); + + /** ListPhraseSetRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListPhraseSetRequest. */ + class ListPhraseSetRequest implements IListPhraseSetRequest { + + /** + * Constructs a new ListPhraseSetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1p1beta1.IListPhraseSetRequest); + + /** ListPhraseSetRequest parent. */ + public parent: string; + + /** ListPhraseSetRequest pageSize. */ + public pageSize: number; + + /** ListPhraseSetRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListPhraseSetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPhraseSetRequest instance + */ + public static create(properties?: google.cloud.speech.v1p1beta1.IListPhraseSetRequest): google.cloud.speech.v1p1beta1.ListPhraseSetRequest; + + /** + * Encodes the specified ListPhraseSetRequest message. Does not implicitly {@link google.cloud.speech.v1p1beta1.ListPhraseSetRequest.verify|verify} messages. + * @param message ListPhraseSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1p1beta1.IListPhraseSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPhraseSetRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.ListPhraseSetRequest.verify|verify} messages. + * @param message ListPhraseSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1p1beta1.IListPhraseSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPhraseSetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1p1beta1.ListPhraseSetRequest; + + /** + * Decodes a ListPhraseSetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1p1beta1.ListPhraseSetRequest; + + /** + * Verifies a ListPhraseSetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListPhraseSetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPhraseSetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1p1beta1.ListPhraseSetRequest; + + /** + * Creates a plain object from a ListPhraseSetRequest message. Also converts values to other types if specified. + * @param message ListPhraseSetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1p1beta1.ListPhraseSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPhraseSetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListPhraseSetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListPhraseSetResponse. */ + interface IListPhraseSetResponse { + + /** ListPhraseSetResponse phraseSets */ + phraseSets?: (google.cloud.speech.v1p1beta1.IPhraseSet[]|null); + + /** ListPhraseSetResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListPhraseSetResponse. */ + class ListPhraseSetResponse implements IListPhraseSetResponse { + + /** + * Constructs a new ListPhraseSetResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1p1beta1.IListPhraseSetResponse); + + /** ListPhraseSetResponse phraseSets. */ + public phraseSets: google.cloud.speech.v1p1beta1.IPhraseSet[]; + + /** ListPhraseSetResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListPhraseSetResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPhraseSetResponse instance + */ + public static create(properties?: google.cloud.speech.v1p1beta1.IListPhraseSetResponse): google.cloud.speech.v1p1beta1.ListPhraseSetResponse; + + /** + * Encodes the specified ListPhraseSetResponse message. Does not implicitly {@link google.cloud.speech.v1p1beta1.ListPhraseSetResponse.verify|verify} messages. + * @param message ListPhraseSetResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1p1beta1.IListPhraseSetResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPhraseSetResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.ListPhraseSetResponse.verify|verify} messages. + * @param message ListPhraseSetResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1p1beta1.IListPhraseSetResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPhraseSetResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPhraseSetResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1p1beta1.ListPhraseSetResponse; + + /** + * Decodes a ListPhraseSetResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPhraseSetResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1p1beta1.ListPhraseSetResponse; + + /** + * Verifies a ListPhraseSetResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListPhraseSetResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPhraseSetResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1p1beta1.ListPhraseSetResponse; + + /** + * Creates a plain object from a ListPhraseSetResponse message. Also converts values to other types if specified. + * @param message ListPhraseSetResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1p1beta1.ListPhraseSetResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPhraseSetResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListPhraseSetResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeletePhraseSetRequest. */ + interface IDeletePhraseSetRequest { + + /** DeletePhraseSetRequest name */ + name?: (string|null); + } + + /** Represents a DeletePhraseSetRequest. */ + class DeletePhraseSetRequest implements IDeletePhraseSetRequest { + + /** + * Constructs a new DeletePhraseSetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1p1beta1.IDeletePhraseSetRequest); + + /** DeletePhraseSetRequest name. */ + public name: string; + + /** + * Creates a new DeletePhraseSetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeletePhraseSetRequest instance + */ + public static create(properties?: google.cloud.speech.v1p1beta1.IDeletePhraseSetRequest): google.cloud.speech.v1p1beta1.DeletePhraseSetRequest; + + /** + * Encodes the specified DeletePhraseSetRequest message. Does not implicitly {@link google.cloud.speech.v1p1beta1.DeletePhraseSetRequest.verify|verify} messages. + * @param message DeletePhraseSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1p1beta1.IDeletePhraseSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeletePhraseSetRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.DeletePhraseSetRequest.verify|verify} messages. + * @param message DeletePhraseSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1p1beta1.IDeletePhraseSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeletePhraseSetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeletePhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1p1beta1.DeletePhraseSetRequest; + + /** + * Decodes a DeletePhraseSetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeletePhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1p1beta1.DeletePhraseSetRequest; + + /** + * Verifies a DeletePhraseSetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeletePhraseSetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeletePhraseSetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1p1beta1.DeletePhraseSetRequest; + + /** + * Creates a plain object from a DeletePhraseSetRequest message. Also converts values to other types if specified. + * @param message DeletePhraseSetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1p1beta1.DeletePhraseSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeletePhraseSetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeletePhraseSetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateCustomClassRequest. */ + interface ICreateCustomClassRequest { + + /** CreateCustomClassRequest parent */ + parent?: (string|null); + + /** CreateCustomClassRequest customClassId */ + customClassId?: (string|null); + + /** CreateCustomClassRequest customClass */ + customClass?: (google.cloud.speech.v1p1beta1.ICustomClass|null); + } + + /** Represents a CreateCustomClassRequest. */ + class CreateCustomClassRequest implements ICreateCustomClassRequest { + + /** + * Constructs a new CreateCustomClassRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1p1beta1.ICreateCustomClassRequest); + + /** CreateCustomClassRequest parent. */ + public parent: string; + + /** CreateCustomClassRequest customClassId. */ + public customClassId: string; + + /** CreateCustomClassRequest customClass. */ + public customClass?: (google.cloud.speech.v1p1beta1.ICustomClass|null); + + /** + * Creates a new CreateCustomClassRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateCustomClassRequest instance + */ + public static create(properties?: google.cloud.speech.v1p1beta1.ICreateCustomClassRequest): google.cloud.speech.v1p1beta1.CreateCustomClassRequest; + + /** + * Encodes the specified CreateCustomClassRequest message. Does not implicitly {@link google.cloud.speech.v1p1beta1.CreateCustomClassRequest.verify|verify} messages. + * @param message CreateCustomClassRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1p1beta1.ICreateCustomClassRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateCustomClassRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.CreateCustomClassRequest.verify|verify} messages. + * @param message CreateCustomClassRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1p1beta1.ICreateCustomClassRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateCustomClassRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1p1beta1.CreateCustomClassRequest; + + /** + * Decodes a CreateCustomClassRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1p1beta1.CreateCustomClassRequest; + + /** + * Verifies a CreateCustomClassRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateCustomClassRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateCustomClassRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1p1beta1.CreateCustomClassRequest; + + /** + * Creates a plain object from a CreateCustomClassRequest message. Also converts values to other types if specified. + * @param message CreateCustomClassRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1p1beta1.CreateCustomClassRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateCustomClassRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateCustomClassRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateCustomClassRequest. */ + interface IUpdateCustomClassRequest { + + /** UpdateCustomClassRequest customClass */ + customClass?: (google.cloud.speech.v1p1beta1.ICustomClass|null); + + /** UpdateCustomClassRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateCustomClassRequest. */ + class UpdateCustomClassRequest implements IUpdateCustomClassRequest { + + /** + * Constructs a new UpdateCustomClassRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1p1beta1.IUpdateCustomClassRequest); + + /** UpdateCustomClassRequest customClass. */ + public customClass?: (google.cloud.speech.v1p1beta1.ICustomClass|null); + + /** UpdateCustomClassRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateCustomClassRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateCustomClassRequest instance + */ + public static create(properties?: google.cloud.speech.v1p1beta1.IUpdateCustomClassRequest): google.cloud.speech.v1p1beta1.UpdateCustomClassRequest; + + /** + * Encodes the specified UpdateCustomClassRequest message. Does not implicitly {@link google.cloud.speech.v1p1beta1.UpdateCustomClassRequest.verify|verify} messages. + * @param message UpdateCustomClassRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1p1beta1.IUpdateCustomClassRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateCustomClassRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.UpdateCustomClassRequest.verify|verify} messages. + * @param message UpdateCustomClassRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1p1beta1.IUpdateCustomClassRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateCustomClassRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1p1beta1.UpdateCustomClassRequest; + + /** + * Decodes an UpdateCustomClassRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1p1beta1.UpdateCustomClassRequest; + + /** + * Verifies an UpdateCustomClassRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateCustomClassRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateCustomClassRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1p1beta1.UpdateCustomClassRequest; + + /** + * Creates a plain object from an UpdateCustomClassRequest message. Also converts values to other types if specified. + * @param message UpdateCustomClassRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1p1beta1.UpdateCustomClassRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateCustomClassRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateCustomClassRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetCustomClassRequest. */ + interface IGetCustomClassRequest { + + /** GetCustomClassRequest name */ + name?: (string|null); + } + + /** Represents a GetCustomClassRequest. */ + class GetCustomClassRequest implements IGetCustomClassRequest { + + /** + * Constructs a new GetCustomClassRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1p1beta1.IGetCustomClassRequest); + + /** GetCustomClassRequest name. */ + public name: string; + + /** + * Creates a new GetCustomClassRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetCustomClassRequest instance + */ + public static create(properties?: google.cloud.speech.v1p1beta1.IGetCustomClassRequest): google.cloud.speech.v1p1beta1.GetCustomClassRequest; + + /** + * Encodes the specified GetCustomClassRequest message. Does not implicitly {@link google.cloud.speech.v1p1beta1.GetCustomClassRequest.verify|verify} messages. + * @param message GetCustomClassRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1p1beta1.IGetCustomClassRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetCustomClassRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.GetCustomClassRequest.verify|verify} messages. + * @param message GetCustomClassRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1p1beta1.IGetCustomClassRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetCustomClassRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1p1beta1.GetCustomClassRequest; + + /** + * Decodes a GetCustomClassRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1p1beta1.GetCustomClassRequest; + + /** + * Verifies a GetCustomClassRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetCustomClassRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetCustomClassRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1p1beta1.GetCustomClassRequest; + + /** + * Creates a plain object from a GetCustomClassRequest message. Also converts values to other types if specified. + * @param message GetCustomClassRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1p1beta1.GetCustomClassRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetCustomClassRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetCustomClassRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCustomClassesRequest. */ + interface IListCustomClassesRequest { + + /** ListCustomClassesRequest parent */ + parent?: (string|null); + + /** ListCustomClassesRequest pageSize */ + pageSize?: (number|null); + + /** ListCustomClassesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListCustomClassesRequest. */ + class ListCustomClassesRequest implements IListCustomClassesRequest { + + /** + * Constructs a new ListCustomClassesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1p1beta1.IListCustomClassesRequest); + + /** ListCustomClassesRequest parent. */ + public parent: string; + + /** ListCustomClassesRequest pageSize. */ + public pageSize: number; + + /** ListCustomClassesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListCustomClassesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCustomClassesRequest instance + */ + public static create(properties?: google.cloud.speech.v1p1beta1.IListCustomClassesRequest): google.cloud.speech.v1p1beta1.ListCustomClassesRequest; + + /** + * Encodes the specified ListCustomClassesRequest message. Does not implicitly {@link google.cloud.speech.v1p1beta1.ListCustomClassesRequest.verify|verify} messages. + * @param message ListCustomClassesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1p1beta1.IListCustomClassesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCustomClassesRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.ListCustomClassesRequest.verify|verify} messages. + * @param message ListCustomClassesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1p1beta1.IListCustomClassesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCustomClassesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCustomClassesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1p1beta1.ListCustomClassesRequest; + + /** + * Decodes a ListCustomClassesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCustomClassesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1p1beta1.ListCustomClassesRequest; + + /** + * Verifies a ListCustomClassesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCustomClassesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCustomClassesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1p1beta1.ListCustomClassesRequest; + + /** + * Creates a plain object from a ListCustomClassesRequest message. Also converts values to other types if specified. + * @param message ListCustomClassesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1p1beta1.ListCustomClassesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCustomClassesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCustomClassesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCustomClassesResponse. */ + interface IListCustomClassesResponse { + + /** ListCustomClassesResponse customClasses */ + customClasses?: (google.cloud.speech.v1p1beta1.ICustomClass[]|null); + + /** ListCustomClassesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListCustomClassesResponse. */ + class ListCustomClassesResponse implements IListCustomClassesResponse { + + /** + * Constructs a new ListCustomClassesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1p1beta1.IListCustomClassesResponse); + + /** ListCustomClassesResponse customClasses. */ + public customClasses: google.cloud.speech.v1p1beta1.ICustomClass[]; + + /** ListCustomClassesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListCustomClassesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCustomClassesResponse instance + */ + public static create(properties?: google.cloud.speech.v1p1beta1.IListCustomClassesResponse): google.cloud.speech.v1p1beta1.ListCustomClassesResponse; + + /** + * Encodes the specified ListCustomClassesResponse message. Does not implicitly {@link google.cloud.speech.v1p1beta1.ListCustomClassesResponse.verify|verify} messages. + * @param message ListCustomClassesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1p1beta1.IListCustomClassesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCustomClassesResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.ListCustomClassesResponse.verify|verify} messages. + * @param message ListCustomClassesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1p1beta1.IListCustomClassesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCustomClassesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCustomClassesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1p1beta1.ListCustomClassesResponse; + + /** + * Decodes a ListCustomClassesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCustomClassesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1p1beta1.ListCustomClassesResponse; + + /** + * Verifies a ListCustomClassesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCustomClassesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCustomClassesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1p1beta1.ListCustomClassesResponse; + + /** + * Creates a plain object from a ListCustomClassesResponse message. Also converts values to other types if specified. + * @param message ListCustomClassesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1p1beta1.ListCustomClassesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCustomClassesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCustomClassesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteCustomClassRequest. */ + interface IDeleteCustomClassRequest { + + /** DeleteCustomClassRequest name */ + name?: (string|null); + } + + /** Represents a DeleteCustomClassRequest. */ + class DeleteCustomClassRequest implements IDeleteCustomClassRequest { + + /** + * Constructs a new DeleteCustomClassRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1p1beta1.IDeleteCustomClassRequest); + + /** DeleteCustomClassRequest name. */ + public name: string; + + /** + * Creates a new DeleteCustomClassRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteCustomClassRequest instance + */ + public static create(properties?: google.cloud.speech.v1p1beta1.IDeleteCustomClassRequest): google.cloud.speech.v1p1beta1.DeleteCustomClassRequest; + + /** + * Encodes the specified DeleteCustomClassRequest message. Does not implicitly {@link google.cloud.speech.v1p1beta1.DeleteCustomClassRequest.verify|verify} messages. + * @param message DeleteCustomClassRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1p1beta1.IDeleteCustomClassRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteCustomClassRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.DeleteCustomClassRequest.verify|verify} messages. + * @param message DeleteCustomClassRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1p1beta1.IDeleteCustomClassRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteCustomClassRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1p1beta1.DeleteCustomClassRequest; + + /** + * Decodes a DeleteCustomClassRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1p1beta1.DeleteCustomClassRequest; + + /** + * Verifies a DeleteCustomClassRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteCustomClassRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteCustomClassRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1p1beta1.DeleteCustomClassRequest; + + /** + * Creates a plain object from a DeleteCustomClassRequest message. Also converts values to other types if specified. + * @param message DeleteCustomClassRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1p1beta1.DeleteCustomClassRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteCustomClassRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteCustomClassRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Http message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + + /** + * Verifies a Http message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Http + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HttpRule. */ + interface IHttpRule { + + /** HttpRule selector */ + selector?: (string|null); + + /** HttpRule get */ + get?: (string|null); + + /** HttpRule put */ + put?: (string|null); + + /** HttpRule post */ + post?: (string|null); + + /** HttpRule delete */ + "delete"?: (string|null); + + /** HttpRule patch */ + patch?: (string|null); + + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body */ + body?: (string|null); + + /** HttpRule responseBody */ + responseBody?: (string|null); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } + + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { + + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); + + /** HttpRule selector. */ + public selector: string; + + /** HttpRule get. */ + public get?: (string|null); + + /** HttpRule put. */ + public put?: (string|null); + + /** HttpRule post. */ + public post?: (string|null); + + /** HttpRule delete. */ + public delete?: (string|null); + + /** HttpRule patch. */ + public patch?: (string|null); + + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body. */ + public body: string; + + /** HttpRule responseBody. */ + public responseBody: string; + + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; + + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + + /** + * Creates a new HttpRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRule instance + */ + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; + + /** + * Verifies a HttpRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRule + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @param message HttpRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { + + /** CustomHttpPattern kind */ + kind?: (string|null); + + /** CustomHttpPattern path */ + path?: (string|null); + } + + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { + + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); + + /** CustomHttpPattern kind. */ + public kind: string; + + /** CustomHttpPattern path. */ + public path: string; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHttpPattern instance + */ + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; + + /** + * Verifies a CustomHttpPattern message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomHttpPattern + */ + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @param message CustomHttpPattern + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomHttpPattern + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CommonLanguageSettings. */ + interface ICommonLanguageSettings { + + /** CommonLanguageSettings referenceDocsUri */ + referenceDocsUri?: (string|null); + + /** CommonLanguageSettings destinations */ + destinations?: (google.api.ClientLibraryDestination[]|null); + } + + /** Represents a CommonLanguageSettings. */ + class CommonLanguageSettings implements ICommonLanguageSettings { + + /** + * Constructs a new CommonLanguageSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICommonLanguageSettings); + + /** CommonLanguageSettings referenceDocsUri. */ + public referenceDocsUri: string; + + /** CommonLanguageSettings destinations. */ + public destinations: google.api.ClientLibraryDestination[]; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CommonLanguageSettings instance + */ + public static create(properties?: google.api.ICommonLanguageSettings): google.api.CommonLanguageSettings; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CommonLanguageSettings; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CommonLanguageSettings; + + /** + * Verifies a CommonLanguageSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommonLanguageSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CommonLanguageSettings; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @param message CommonLanguageSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CommonLanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CommonLanguageSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClientLibrarySettings. */ + interface IClientLibrarySettings { + + /** ClientLibrarySettings version */ + version?: (string|null); + + /** ClientLibrarySettings launchStage */ + launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); + + /** ClientLibrarySettings restNumericEnums */ + restNumericEnums?: (boolean|null); + + /** ClientLibrarySettings javaSettings */ + javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings */ + cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings */ + phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings */ + pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings */ + nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings */ + dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings */ + rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings */ + goSettings?: (google.api.IGoSettings|null); + } + + /** Represents a ClientLibrarySettings. */ + class ClientLibrarySettings implements IClientLibrarySettings { + + /** + * Constructs a new ClientLibrarySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IClientLibrarySettings); + + /** ClientLibrarySettings version. */ + public version: string; + + /** ClientLibrarySettings launchStage. */ + public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); + + /** ClientLibrarySettings restNumericEnums. */ + public restNumericEnums: boolean; + + /** ClientLibrarySettings javaSettings. */ + public javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings. */ + public cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings. */ + public phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings. */ + public pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings. */ + public nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings. */ + public dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings. */ + public rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings. */ + public goSettings?: (google.api.IGoSettings|null); + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientLibrarySettings instance + */ + public static create(properties?: google.api.IClientLibrarySettings): google.api.ClientLibrarySettings; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ClientLibrarySettings; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ClientLibrarySettings; + + /** + * Verifies a ClientLibrarySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClientLibrarySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.ClientLibrarySettings; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @param message ClientLibrarySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ClientLibrarySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClientLibrarySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Publishing. */ + interface IPublishing { + + /** Publishing methodSettings */ + methodSettings?: (google.api.IMethodSettings[]|null); + + /** Publishing newIssueUri */ + newIssueUri?: (string|null); + + /** Publishing documentationUri */ + documentationUri?: (string|null); + + /** Publishing apiShortName */ + apiShortName?: (string|null); + + /** Publishing githubLabel */ + githubLabel?: (string|null); + + /** Publishing codeownerGithubTeams */ + codeownerGithubTeams?: (string[]|null); + + /** Publishing docTagPrefix */ + docTagPrefix?: (string|null); + + /** Publishing organization */ + organization?: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization|null); + + /** Publishing librarySettings */ + librarySettings?: (google.api.IClientLibrarySettings[]|null); + + /** Publishing protoReferenceDocumentationUri */ + protoReferenceDocumentationUri?: (string|null); + + /** Publishing restReferenceDocumentationUri */ + restReferenceDocumentationUri?: (string|null); + } + + /** Represents a Publishing. */ + class Publishing implements IPublishing { + + /** + * Constructs a new Publishing. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPublishing); + + /** Publishing methodSettings. */ + public methodSettings: google.api.IMethodSettings[]; + + /** Publishing newIssueUri. */ + public newIssueUri: string; + + /** Publishing documentationUri. */ + public documentationUri: string; + + /** Publishing apiShortName. */ + public apiShortName: string; + + /** Publishing githubLabel. */ + public githubLabel: string; + + /** Publishing codeownerGithubTeams. */ + public codeownerGithubTeams: string[]; + + /** Publishing docTagPrefix. */ + public docTagPrefix: string; + + /** Publishing organization. */ + public organization: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization); + + /** Publishing librarySettings. */ + public librarySettings: google.api.IClientLibrarySettings[]; + + /** Publishing protoReferenceDocumentationUri. */ + public protoReferenceDocumentationUri: string; + + /** Publishing restReferenceDocumentationUri. */ + public restReferenceDocumentationUri: string; + + /** + * Creates a new Publishing instance using the specified properties. + * @param [properties] Properties to set + * @returns Publishing instance + */ + public static create(properties?: google.api.IPublishing): google.api.Publishing; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Publishing; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Publishing; + + /** + * Verifies a Publishing message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Publishing + */ + public static fromObject(object: { [k: string]: any }): google.api.Publishing; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @param message Publishing + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Publishing, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Publishing to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Publishing + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JavaSettings. */ + interface IJavaSettings { + + /** JavaSettings libraryPackage */ + libraryPackage?: (string|null); + + /** JavaSettings serviceClassNames */ + serviceClassNames?: ({ [k: string]: string }|null); + + /** JavaSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a JavaSettings. */ + class JavaSettings implements IJavaSettings { + + /** + * Constructs a new JavaSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IJavaSettings); + + /** JavaSettings libraryPackage. */ + public libraryPackage: string; + + /** JavaSettings serviceClassNames. */ + public serviceClassNames: { [k: string]: string }; + + /** JavaSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new JavaSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns JavaSettings instance + */ + public static create(properties?: google.api.IJavaSettings): google.api.JavaSettings; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.JavaSettings; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.JavaSettings; + + /** + * Verifies a JavaSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JavaSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.JavaSettings; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @param message JavaSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.JavaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JavaSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JavaSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CppSettings. */ + interface ICppSettings { + + /** CppSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a CppSettings. */ + class CppSettings implements ICppSettings { + + /** + * Constructs a new CppSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICppSettings); + + /** CppSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new CppSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CppSettings instance + */ + public static create(properties?: google.api.ICppSettings): google.api.CppSettings; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CppSettings; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CppSettings; + + /** + * Verifies a CppSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CppSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CppSettings; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @param message CppSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CppSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CppSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CppSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PhpSettings. */ + interface IPhpSettings { + + /** PhpSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PhpSettings. */ + class PhpSettings implements IPhpSettings { + + /** + * Constructs a new PhpSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPhpSettings); + + /** PhpSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PhpSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PhpSettings instance + */ + public static create(properties?: google.api.IPhpSettings): google.api.PhpSettings; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PhpSettings; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PhpSettings; + + /** + * Verifies a PhpSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PhpSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PhpSettings; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @param message PhpSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PhpSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PhpSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PhpSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PythonSettings. */ + interface IPythonSettings { + + /** PythonSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PythonSettings. */ + class PythonSettings implements IPythonSettings { + + /** + * Constructs a new PythonSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPythonSettings); + + /** PythonSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PythonSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PythonSettings instance + */ + public static create(properties?: google.api.IPythonSettings): google.api.PythonSettings; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings; + + /** + * Verifies a PythonSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PythonSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @param message PythonSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PythonSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PythonSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeSettings. */ + interface INodeSettings { + + /** NodeSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a NodeSettings. */ + class NodeSettings implements INodeSettings { + + /** + * Constructs a new NodeSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.INodeSettings); + + /** NodeSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new NodeSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeSettings instance + */ + public static create(properties?: google.api.INodeSettings): google.api.NodeSettings; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.NodeSettings; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.NodeSettings; + + /** + * Verifies a NodeSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.NodeSettings; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @param message NodeSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.NodeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodeSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DotnetSettings. */ + interface IDotnetSettings { + + /** DotnetSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|null); + + /** DotnetSettings renamedResources */ + renamedResources?: ({ [k: string]: string }|null); + + /** DotnetSettings ignoredResources */ + ignoredResources?: (string[]|null); + + /** DotnetSettings forcedNamespaceAliases */ + forcedNamespaceAliases?: (string[]|null); + + /** DotnetSettings handwrittenSignatures */ + handwrittenSignatures?: (string[]|null); + } + + /** Represents a DotnetSettings. */ + class DotnetSettings implements IDotnetSettings { + + /** + * Constructs a new DotnetSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IDotnetSettings); + + /** DotnetSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + + /** DotnetSettings renamedResources. */ + public renamedResources: { [k: string]: string }; + + /** DotnetSettings ignoredResources. */ + public ignoredResources: string[]; + + /** DotnetSettings forcedNamespaceAliases. */ + public forcedNamespaceAliases: string[]; + + /** DotnetSettings handwrittenSignatures. */ + public handwrittenSignatures: string[]; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns DotnetSettings instance + */ + public static create(properties?: google.api.IDotnetSettings): google.api.DotnetSettings; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.DotnetSettings; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.DotnetSettings; + + /** + * Verifies a DotnetSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DotnetSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @param message DotnetSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DotnetSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DotnetSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RubySettings. */ + interface IRubySettings { + + /** RubySettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a RubySettings. */ + class RubySettings implements IRubySettings { + + /** + * Constructs a new RubySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IRubySettings); + + /** RubySettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new RubySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns RubySettings instance + */ + public static create(properties?: google.api.IRubySettings): google.api.RubySettings; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.RubySettings; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.RubySettings; + + /** + * Verifies a RubySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RubySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.RubySettings; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @param message RubySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.RubySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RubySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RubySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GoSettings. */ + interface IGoSettings { + + /** GoSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a GoSettings. */ + class GoSettings implements IGoSettings { + + /** + * Constructs a new GoSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IGoSettings); + + /** GoSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new GoSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns GoSettings instance + */ + public static create(properties?: google.api.IGoSettings): google.api.GoSettings; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.GoSettings; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.GoSettings; + + /** + * Verifies a GoSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.GoSettings; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @param message GoSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodSettings. */ + interface IMethodSettings { + + /** MethodSettings selector */ + selector?: (string|null); + + /** MethodSettings longRunning */ + longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields */ + autoPopulatedFields?: (string[]|null); + } + + /** Represents a MethodSettings. */ + class MethodSettings implements IMethodSettings { + + /** + * Constructs a new MethodSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IMethodSettings); + + /** MethodSettings selector. */ + public selector: string; + + /** MethodSettings longRunning. */ + public longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields. */ + public autoPopulatedFields: string[]; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodSettings instance + */ + public static create(properties?: google.api.IMethodSettings): google.api.MethodSettings; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings; + + /** + * Verifies a MethodSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @param message MethodSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodSettings { + + /** Properties of a LongRunning. */ + interface ILongRunning { + + /** LongRunning initialPollDelay */ + initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier */ + pollDelayMultiplier?: (number|null); + + /** LongRunning maxPollDelay */ + maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout */ + totalPollTimeout?: (google.protobuf.IDuration|null); + } + + /** Represents a LongRunning. */ + class LongRunning implements ILongRunning { + + /** + * Constructs a new LongRunning. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.MethodSettings.ILongRunning); + + /** LongRunning initialPollDelay. */ + public initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier. */ + public pollDelayMultiplier: number; + + /** LongRunning maxPollDelay. */ + public maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout. */ + public totalPollTimeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new LongRunning instance using the specified properties. + * @param [properties] Properties to set + * @returns LongRunning instance + */ + public static create(properties?: google.api.MethodSettings.ILongRunning): google.api.MethodSettings.LongRunning; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings.LongRunning; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings.LongRunning; + + /** + * Verifies a LongRunning message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LongRunning + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings.LongRunning; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @param message LongRunning + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings.LongRunning, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LongRunning to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LongRunning + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** ClientLibraryOrganization enum. */ + enum ClientLibraryOrganization { + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, + CLOUD = 1, + ADS = 2, + PHOTOS = 3, + STREET_VIEW = 4, + SHOPPING = 5, + GEO = 6, + GENERATIVE_AI = 7 + } + + /** ClientLibraryDestination enum. */ + enum ClientLibraryDestination { + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, + GITHUB = 10, + PACKAGE_MANAGER = 20 + } + + /** LaunchStage enum. */ + enum LaunchStage { + LAUNCH_STAGE_UNSPECIFIED = 0, + UNIMPLEMENTED = 6, + PRELAUNCH = 7, + EARLY_ACCESS = 1, + ALPHA = 2, + BETA = 3, + GA = 4, + DEPRECATED = 5 + } + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7, + IDENTIFIER = 8 + } + + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { + + /** ResourceDescriptor type */ + type?: (string|null); + + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); + } + + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { + + /** + * Constructs a new ResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceDescriptor); + + /** ResourceDescriptor type. */ + public type: string; + + /** ResourceDescriptor pattern. */ + public pattern: string[]; + + /** ResourceDescriptor nameField. */ + public nameField: string; + + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceDescriptor instance + */ + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; + + /** + * Verifies a ResourceDescriptor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @param message ResourceDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } + } + + /** Properties of a ResourceReference. */ + interface IResourceReference { + + /** ResourceReference type */ + type?: (string|null); + + /** ResourceReference childType */ + childType?: (string|null); + } + + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { + + /** + * Constructs a new ResourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceReference); + + /** ResourceReference type. */ + public type: string; + + /** ResourceReference childType. */ + public childType: string; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceReference instance + */ + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; + + /** + * Verifies a ResourceReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceReference + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @param message ResourceReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { + + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } + + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { + + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); + + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorSet instance + */ + public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; + + /** + * Verifies a FileDescriptorSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @param message FileDescriptorSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Edition enum. */ + enum Edition { + EDITION_UNKNOWN = 0, + EDITION_PROTO2 = 998, + EDITION_PROTO3 = 999, + EDITION_2023 = 1000, + EDITION_2024 = 1001, + EDITION_1_TEST_ONLY = 1, + EDITION_2_TEST_ONLY = 2, + EDITION_99997_TEST_ONLY = 99997, + EDITION_99998_TEST_ONLY = 99998, + EDITION_99999_TEST_ONLY = 99999, + EDITION_MAX = 2147483647 + } + + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { + + /** FileDescriptorProto name */ + name?: (string|null); + + /** FileDescriptorProto package */ + "package"?: (string|null); + + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); + + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); + + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); + + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); + + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); + + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax */ + syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { + + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); + + /** FileDescriptorProto name. */ + public name: string; + + /** FileDescriptorProto package. */ + public package: string; + + /** FileDescriptorProto dependency. */ + public dependency: string[]; + + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; + + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; + + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; + + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; + + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax. */ + public syntax: string; + + /** FileDescriptorProto edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; + + /** + * Verifies a FileDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @param message FileDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { + + /** DescriptorProto name */ + name?: (string|null); + + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); + + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { + + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); + + /** DescriptorProto name. */ + public name: string; + + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; + + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + + /** DescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DescriptorProto instance + */ + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; + + /** + * Verifies a DescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @param message DescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DescriptorProto { + + /** Properties of an ExtensionRange. */ + interface IExtensionRange { + + /** ExtensionRange start */ + start?: (number|null); + + /** ExtensionRange end */ + end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } + + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { + + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + + /** ExtensionRange start. */ + public start: number; + + /** ExtensionRange end. */ + public end: number; + + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Verifies an ExtensionRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @param message ExtensionRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReservedRange. */ + interface IReservedRange { + + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); + } + + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { + + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + + /** ReservedRange start. */ + public start: number; + + /** ReservedRange end. */ + public end: number; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservedRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Verifies a ReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @param message ReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ExtensionRangeOptions declaration */ + declaration?: (google.protobuf.ExtensionRangeOptions.IDeclaration[]|null); + + /** ExtensionRangeOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification */ + verification?: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState|null); + } + + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { + + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); + + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** ExtensionRangeOptions declaration. */ + public declaration: google.protobuf.ExtensionRangeOptions.IDeclaration[]; + + /** ExtensionRangeOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification. */ + public verification: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState); + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRangeOptions instance + */ + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; + + /** + * Verifies an ExtensionRangeOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRangeOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @param message ExtensionRangeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExtensionRangeOptions { + + /** Properties of a Declaration. */ + interface IDeclaration { + + /** Declaration number */ + number?: (number|null); + + /** Declaration fullName */ + fullName?: (string|null); + + /** Declaration type */ + type?: (string|null); + + /** Declaration reserved */ + reserved?: (boolean|null); + + /** Declaration repeated */ + repeated?: (boolean|null); + } + + /** Represents a Declaration. */ + class Declaration implements IDeclaration { + + /** + * Constructs a new Declaration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration); + + /** Declaration number. */ + public number: number; + + /** Declaration fullName. */ + public fullName: string; + + /** Declaration type. */ + public type: string; + + /** Declaration reserved. */ + public reserved: boolean; + + /** Declaration repeated. */ + public repeated: boolean; + + /** + * Creates a new Declaration instance using the specified properties. + * @param [properties] Properties to set + * @returns Declaration instance + */ + public static create(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Verifies a Declaration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Declaration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @param message Declaration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions.Declaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Declaration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Declaration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** VerificationState enum. */ + enum VerificationState { + DECLARATION = 0, + UNVERIFIED = 1 + } + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldDescriptorProto { + + /** Type enum. */ + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } + + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REPEATED = 3, + LABEL_REQUIRED = 2 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Verifies an EnumReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; + + /** + * Verifies an EnumValueDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; + + /** + * Verifies a ServiceDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; + + /** + * Verifies a MethodDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions deprecated */ + deprecated?: (boolean|null); + + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); + + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); + + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); + + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); + + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); + + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); + + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); + + /** FileOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); + } + + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { + + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); + + /** FileOptions javaPackage. */ + public javaPackage: string; + + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; + + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; + + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions deprecated. */ + public deprecated: boolean; + + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; + + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; + + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; + + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; + + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; + + /** FileOptions phpNamespace. */ + public phpNamespace: string; + + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; + + /** FileOptions rubyPackage. */ + public rubyPackage: string; + + /** FileOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FileOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOptions instance + */ + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; + + /** + * Verifies a FileOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @param message FileOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FileOptions { + + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } + + /** Properties of a MessageOptions. */ + interface IMessageOptions { + + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); + + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); + + /** MessageOptions deprecated */ + deprecated?: (boolean|null); + + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); + + /** MessageOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** MessageOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); + } + + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { + + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); + + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** MessageOptions mapEntry. */ + public mapEntry: boolean; + + /** MessageOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** MessageOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageOptions instance + */ + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; + + /** + * Verifies a MessageOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @param message MessageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MessageOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldOptions. */ + interface IFieldOptions { + + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + + /** FieldOptions lazy */ + lazy?: (boolean|null); + + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions debugRedact */ + debugRedact?: (boolean|null); + + /** FieldOptions retention */ + retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); + + /** FieldOptions targets */ + targets?: (google.protobuf.FieldOptions.OptionTargetType[]|null); + + /** FieldOptions editionDefaults */ + editionDefaults?: (google.protobuf.FieldOptions.IEditionDefault[]|null); + + /** FieldOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions debugRedact. */ + public debugRedact: boolean; + + /** FieldOptions retention. */ + public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); + + /** FieldOptions targets. */ + public targets: google.protobuf.FieldOptions.OptionTargetType[]; + + /** FieldOptions editionDefaults. */ + public editionDefaults: google.protobuf.FieldOptions.IEditionDefault[]; + + /** FieldOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldOptions instance + */ + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; + + /** + * Verifies a FieldOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @param message FieldOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + + /** OptionRetention enum. */ + enum OptionRetention { + RETENTION_UNKNOWN = 0, + RETENTION_RUNTIME = 1, + RETENTION_SOURCE = 2 + } + + /** OptionTargetType enum. */ + enum OptionTargetType { + TARGET_TYPE_UNKNOWN = 0, + TARGET_TYPE_FILE = 1, + TARGET_TYPE_EXTENSION_RANGE = 2, + TARGET_TYPE_MESSAGE = 3, + TARGET_TYPE_FIELD = 4, + TARGET_TYPE_ONEOF = 5, + TARGET_TYPE_ENUM = 6, + TARGET_TYPE_ENUM_ENTRY = 7, + TARGET_TYPE_SERVICE = 8, + TARGET_TYPE_METHOD = 9 + } + + /** Properties of an EditionDefault. */ + interface IEditionDefault { + + /** EditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** EditionDefault value */ + value?: (string|null); + } + + /** Represents an EditionDefault. */ + class EditionDefault implements IEditionDefault { + + /** + * Constructs a new EditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IEditionDefault); + + /** EditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** EditionDefault value. */ + public value: string; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns EditionDefault instance + */ + public static create(properties?: google.protobuf.FieldOptions.IEditionDefault): google.protobuf.FieldOptions.EditionDefault; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.EditionDefault; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.EditionDefault; + + /** + * Verifies an EditionDefault message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.EditionDefault; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @param message EditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.EditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { + + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); + + /** OneofOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofOptions instance + */ + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; + + /** + * Verifies an OneofOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @param message OneofOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** EnumOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { + + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); + + /** EnumOptions allowAlias. */ + public allowAlias: boolean; + + /** EnumOptions deprecated. */ + public deprecated: boolean; + + /** EnumOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** EnumOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; + + /** + * Verifies an EnumOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact */ + debugRedact?: (boolean|null); + + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { + + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); + + /** EnumValueOptions deprecated. */ + public deprecated: boolean; + + /** EnumValueOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact. */ + public debugRedact: boolean; + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; + + /** + * Verifies an EnumValueOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + + /** ServiceOptions .google.api.apiVersion */ + ".google.api.apiVersion"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|Buffer|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|Buffer|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a FeatureSet. */ + interface IFeatureSet { + + /** FeatureSet fieldPresence */ + fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); + + /** FeatureSet enumType */ + enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); + + /** FeatureSet repeatedFieldEncoding */ + repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); + + /** FeatureSet utf8Validation */ + utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); + + /** FeatureSet messageEncoding */ + messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); + + /** FeatureSet jsonFormat */ + jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); + } + + /** Represents a FeatureSet. */ + class FeatureSet implements IFeatureSet { + + /** + * Constructs a new FeatureSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSet); + + /** FeatureSet fieldPresence. */ + public fieldPresence: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence); + + /** FeatureSet enumType. */ + public enumType: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType); + + /** FeatureSet repeatedFieldEncoding. */ + public repeatedFieldEncoding: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding); + + /** FeatureSet utf8Validation. */ + public utf8Validation: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation); + + /** FeatureSet messageEncoding. */ + public messageEncoding: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding); + + /** FeatureSet jsonFormat. */ + public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); + + /** + * Creates a new FeatureSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSet instance + */ + public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet; + + /** + * Verifies a FeatureSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @param message FeatureSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSet { + + /** FieldPresence enum. */ + enum FieldPresence { + FIELD_PRESENCE_UNKNOWN = 0, + EXPLICIT = 1, + IMPLICIT = 2, + LEGACY_REQUIRED = 3 + } + + /** EnumType enum. */ + enum EnumType { + ENUM_TYPE_UNKNOWN = 0, + OPEN = 1, + CLOSED = 2 + } + + /** RepeatedFieldEncoding enum. */ + enum RepeatedFieldEncoding { + REPEATED_FIELD_ENCODING_UNKNOWN = 0, + PACKED = 1, + EXPANDED = 2 + } + + /** Utf8Validation enum. */ + enum Utf8Validation { + UTF8_VALIDATION_UNKNOWN = 0, + VERIFY = 2, + NONE = 3 + } + + /** MessageEncoding enum. */ + enum MessageEncoding { + MESSAGE_ENCODING_UNKNOWN = 0, + LENGTH_PREFIXED = 1, + DELIMITED = 2 + } + + /** JsonFormat enum. */ + enum JsonFormat { + JSON_FORMAT_UNKNOWN = 0, + ALLOW = 1, + LEGACY_BEST_EFFORT = 2 + } + } + + /** Properties of a FeatureSetDefaults. */ + interface IFeatureSetDefaults { + + /** FeatureSetDefaults defaults */ + defaults?: (google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]|null); + + /** FeatureSetDefaults minimumEdition */ + minimumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetDefaults maximumEdition */ + maximumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSetDefaults. */ + class FeatureSetDefaults implements IFeatureSetDefaults { + + /** + * Constructs a new FeatureSetDefaults. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSetDefaults); + + /** FeatureSetDefaults defaults. */ + public defaults: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]; + + /** FeatureSetDefaults minimumEdition. */ + public minimumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetDefaults maximumEdition. */ + public maximumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetDefaults instance + */ + public static create(properties?: google.protobuf.IFeatureSetDefaults): google.protobuf.FeatureSetDefaults; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults; + + /** + * Verifies a FeatureSetDefaults message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetDefaults + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @param message FeatureSetDefaults + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetDefaults + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSetDefaults { + + /** Properties of a FeatureSetEditionDefault. */ + interface IFeatureSetEditionDefault { + + /** FeatureSetEditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetEditionDefault features */ + features?: (google.protobuf.IFeatureSet|null); + } + + /** Represents a FeatureSetEditionDefault. */ + class FeatureSetEditionDefault implements IFeatureSetEditionDefault { + + /** + * Constructs a new FeatureSetEditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault); + + /** FeatureSetEditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetEditionDefault features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetEditionDefault instance + */ + public static create(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Verifies a FeatureSetEditionDefault message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetEditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @param message FeatureSetEditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } + } + } + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long|string); + + /** Duration nanos. */ + public nanos: number; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; + + /** + * Verifies a Duration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Duration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|Buffer|string|null); + } + + /** Represents an Any. */ + class Any implements IAny { + + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); + + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: (Uint8Array|Buffer|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; + + /** + * Verifies an Any message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); + + /** + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance + */ + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; + + /** + * Verifies an Empty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Empty + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Empty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** DoubleValue value */ + value?: (number|null); + } + + /** Represents a DoubleValue. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDoubleValue); + + /** DoubleValue value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param message DoubleValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param message DoubleValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DoubleValue; + + /** + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DoubleValue; + + /** + * Verifies a DoubleValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DoubleValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DoubleValue; + + /** + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @param message DoubleValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DoubleValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DoubleValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** FloatValue value */ + value?: (number|null); + } + + /** Represents a FloatValue. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFloatValue); + + /** FloatValue value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param message FloatValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param message FloatValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FloatValue; + + /** + * Decodes a FloatValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FloatValue; + + /** + * Verifies a FloatValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FloatValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FloatValue; + + /** + * Creates a plain object from a FloatValue message. Also converts values to other types if specified. + * @param message FloatValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FloatValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FloatValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** Int64Value value */ + value?: (number|Long|string|null); + } + + /** Represents an Int64Value. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IInt64Value); + + /** Int64Value value. */ + public value: (number|Long|string); + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param message Int64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param message Int64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int64Value; + + /** + * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int64Value; + + /** + * Verifies an Int64Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Int64Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Int64Value; + + /** + * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * @param message Int64Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Int64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Int64Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** UInt64Value value */ + value?: (number|Long|string|null); + } + + /** Represents a UInt64Value. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUInt64Value); + + /** UInt64Value value. */ + public value: (number|Long|string); + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param message UInt64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param message UInt64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt64Value; + + /** + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt64Value; + + /** + * Verifies a UInt64Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UInt64Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UInt64Value; + + /** + * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. + * @param message UInt64Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UInt64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UInt64Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** Int32Value value */ + value?: (number|null); + } + + /** Represents an Int32Value. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IInt32Value); + + /** Int32Value value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param message Int32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param message Int32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int32Value; + + /** + * Decodes an Int32Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int32Value; + + /** + * Verifies an Int32Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Int32Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Int32Value; + + /** + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. + * @param message Int32Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Int32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Int32Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** UInt32Value value */ + value?: (number|null); + } + + /** Represents a UInt32Value. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUInt32Value); + + /** UInt32Value value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param message UInt32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param message UInt32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt32Value; + + /** + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt32Value; + + /** + * Verifies a UInt32Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UInt32Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UInt32Value; + + /** + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. + * @param message UInt32Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UInt32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UInt32Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** BoolValue value */ + value?: (boolean|null); + } + + /** Represents a BoolValue. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IBoolValue); + + /** BoolValue value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param message BoolValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param message BoolValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BoolValue; + + /** + * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BoolValue; + + /** + * Verifies a BoolValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoolValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.BoolValue; + + /** + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * @param message BoolValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.BoolValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoolValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** StringValue value */ + value?: (string|null); + } + + /** Represents a StringValue. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IStringValue); + + /** StringValue value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param message StringValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param message StringValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.StringValue; + + /** + * Decodes a StringValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.StringValue; + + /** + * Verifies a StringValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StringValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StringValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.StringValue; + + /** + * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * @param message StringValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.StringValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StringValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** BytesValue value */ + value?: (Uint8Array|Buffer|string|null); + } + + /** Represents a BytesValue. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IBytesValue); + + /** BytesValue value. */ + public value: (Uint8Array|Buffer|string); + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param message BytesValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param message BytesValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BytesValue; + + /** + * Decodes a BytesValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BytesValue; + + /** + * Verifies a BytesValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BytesValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.BytesValue; + + /** + * Creates a plain object from a BytesValue message. Also converts values to other types if specified. + * @param message BytesValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.BytesValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BytesValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldMask. */ + interface IFieldMask { + + /** FieldMask paths */ + paths?: (string[]|null); + } + + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { + + /** + * Constructs a new FieldMask. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldMask); + + /** FieldMask paths. */ + public paths: string[]; + + /** + * Creates a new FieldMask instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldMask instance + */ + public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; + + /** + * Verifies a FieldMask message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldMask + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @param message FieldMask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldMask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldMask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace longrunning. */ + namespace longrunning { + + /** Represents an Operations */ + class Operations extends $protobuf.rpc.Service { + + /** + * Constructs a new Operations service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Operations service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Operations; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOperationsResponse + */ + public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @returns Promise + */ + public listOperations(request: google.longrunning.IListOperationsRequest): Promise; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @returns Promise + */ + public getOperation(request: google.longrunning.IGetOperationRequest): Promise; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @returns Promise + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @returns Promise + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @returns Promise + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; + } + + namespace Operations { + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @param error Error, if any + * @param [response] ListOperationsResponse + */ + type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Operation. */ + interface IOperation { + + /** Operation name */ + name?: (string|null); + + /** Operation metadata */ + metadata?: (google.protobuf.IAny|null); + + /** Operation done */ + done?: (boolean|null); + + /** Operation error */ + error?: (google.rpc.IStatus|null); + + /** Operation response */ + response?: (google.protobuf.IAny|null); + } + + /** Represents an Operation. */ + class Operation implements IOperation { + + /** + * Constructs a new Operation. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperation); + + /** Operation name. */ + public name: string; + + /** Operation metadata. */ + public metadata?: (google.protobuf.IAny|null); + + /** Operation done. */ + public done: boolean; + + /** Operation error. */ + public error?: (google.rpc.IStatus|null); + + /** Operation response. */ + public response?: (google.protobuf.IAny|null); + + /** Operation result. */ + public result?: ("error"|"response"); + + /** + * Creates a new Operation instance using the specified properties. + * @param [properties] Properties to set + * @returns Operation instance + */ + public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.Operation; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.Operation; + + /** + * Verifies an Operation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Operation + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @param message Operation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Operation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Operation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetOperationRequest. */ + interface IGetOperationRequest { + + /** GetOperationRequest name */ + name?: (string|null); + } + + /** Represents a GetOperationRequest. */ + class GetOperationRequest implements IGetOperationRequest { + + /** + * Constructs a new GetOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IGetOperationRequest); + + /** GetOperationRequest name. */ + public name: string; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOperationRequest instance + */ + public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.GetOperationRequest; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.GetOperationRequest; + + /** + * Verifies a GetOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @param message GetOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsRequest. */ + interface IListOperationsRequest { + + /** ListOperationsRequest name */ + name?: (string|null); + + /** ListOperationsRequest filter */ + filter?: (string|null); + + /** ListOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOperationsRequest. */ + class ListOperationsRequest implements IListOperationsRequest { + + /** + * Constructs a new ListOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsRequest); + + /** ListOperationsRequest name. */ + public name: string; + + /** ListOperationsRequest filter. */ + public filter: string; + + /** ListOperationsRequest pageSize. */ + public pageSize: number; + + /** ListOperationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsRequest instance + */ + public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsRequest; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsRequest; + + /** + * Verifies a ListOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @param message ListOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsResponse. */ + interface IListOperationsResponse { + + /** ListOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOperationsResponse. */ + class ListOperationsResponse implements IListOperationsResponse { + + /** + * Constructs a new ListOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsResponse); + + /** ListOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsResponse instance + */ + public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsResponse; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsResponse; + + /** + * Verifies a ListOperationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @param message ListOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelOperationRequest. */ + interface ICancelOperationRequest { + + /** CancelOperationRequest name */ + name?: (string|null); + } + + /** Represents a CancelOperationRequest. */ + class CancelOperationRequest implements ICancelOperationRequest { + + /** + * Constructs a new CancelOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.ICancelOperationRequest); + + /** CancelOperationRequest name. */ + public name: string; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelOperationRequest instance + */ + public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.CancelOperationRequest; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.CancelOperationRequest; + + /** + * Verifies a CancelOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @param message CancelOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteOperationRequest. */ + interface IDeleteOperationRequest { + + /** DeleteOperationRequest name */ + name?: (string|null); + } + + /** Represents a DeleteOperationRequest. */ + class DeleteOperationRequest implements IDeleteOperationRequest { + + /** + * Constructs a new DeleteOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IDeleteOperationRequest); + + /** DeleteOperationRequest name. */ + public name: string; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOperationRequest instance + */ + public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.DeleteOperationRequest; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.DeleteOperationRequest; + + /** + * Verifies a DeleteOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @param message DeleteOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WaitOperationRequest. */ + interface IWaitOperationRequest { + + /** WaitOperationRequest name */ + name?: (string|null); + + /** WaitOperationRequest timeout */ + timeout?: (google.protobuf.IDuration|null); + } + + /** Represents a WaitOperationRequest. */ + class WaitOperationRequest implements IWaitOperationRequest { + + /** + * Constructs a new WaitOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IWaitOperationRequest); + + /** WaitOperationRequest name. */ + public name: string; + + /** WaitOperationRequest timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WaitOperationRequest instance + */ + public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.WaitOperationRequest; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.WaitOperationRequest; + + /** + * Verifies a WaitOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WaitOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @param message WaitOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WaitOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WaitOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationInfo. */ + interface IOperationInfo { + + /** OperationInfo responseType */ + responseType?: (string|null); + + /** OperationInfo metadataType */ + metadataType?: (string|null); + } + + /** Represents an OperationInfo. */ + class OperationInfo implements IOperationInfo { + + /** + * Constructs a new OperationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperationInfo); + + /** OperationInfo responseType. */ + public responseType: string; + + /** OperationInfo metadataType. */ + public metadataType: string; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationInfo instance + */ + public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.OperationInfo; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.OperationInfo; + + /** + * Verifies an OperationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationInfo + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @param message OperationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; + + /** + * Verifies a Status message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/protos/protos.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/protos/protos.js new file mode 100644 index 00000000000..6bfd7550d81 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/protos/protos.js @@ -0,0 +1,36060 @@ +// 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. + +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +(function(global, factory) { /* global define, require, module */ + + /* AMD */ if (typeof define === 'function' && define.amd) + define(["protobufjs/minimal"], factory); + + /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) + module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal); + +})(this, function($protobuf) { + "use strict"; + + // Common aliases + var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + + // Exported root namespace + var $root = $protobuf.roots._google_cloud_speech_protos || ($protobuf.roots._google_cloud_speech_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.speech = (function() { + + /** + * Namespace speech. + * @memberof google.cloud + * @namespace + */ + var speech = {}; + + speech.v1p1beta1 = (function() { + + /** + * Namespace v1p1beta1. + * @memberof google.cloud.speech + * @namespace + */ + var v1p1beta1 = {}; + + v1p1beta1.Speech = (function() { + + /** + * Constructs a new Speech service. + * @memberof google.cloud.speech.v1p1beta1 + * @classdesc Represents a Speech + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Speech(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Speech.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Speech; + + /** + * Creates new Speech service using the specified rpc implementation. + * @function create + * @memberof google.cloud.speech.v1p1beta1.Speech + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Speech} RPC service. Useful where requests and/or responses are streamed. + */ + Speech.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.speech.v1p1beta1.Speech|recognize}. + * @memberof google.cloud.speech.v1p1beta1.Speech + * @typedef RecognizeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.speech.v1p1beta1.RecognizeResponse} [response] RecognizeResponse + */ + + /** + * Calls Recognize. + * @function recognize + * @memberof google.cloud.speech.v1p1beta1.Speech + * @instance + * @param {google.cloud.speech.v1p1beta1.IRecognizeRequest} request RecognizeRequest message or plain object + * @param {google.cloud.speech.v1p1beta1.Speech.RecognizeCallback} callback Node-style callback called with the error, if any, and RecognizeResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Speech.prototype.recognize = function recognize(request, callback) { + return this.rpcCall(recognize, $root.google.cloud.speech.v1p1beta1.RecognizeRequest, $root.google.cloud.speech.v1p1beta1.RecognizeResponse, request, callback); + }, "name", { value: "Recognize" }); + + /** + * Calls Recognize. + * @function recognize + * @memberof google.cloud.speech.v1p1beta1.Speech + * @instance + * @param {google.cloud.speech.v1p1beta1.IRecognizeRequest} request RecognizeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.speech.v1p1beta1.Speech|longRunningRecognize}. + * @memberof google.cloud.speech.v1p1beta1.Speech + * @typedef LongRunningRecognizeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls LongRunningRecognize. + * @function longRunningRecognize + * @memberof google.cloud.speech.v1p1beta1.Speech + * @instance + * @param {google.cloud.speech.v1p1beta1.ILongRunningRecognizeRequest} request LongRunningRecognizeRequest message or plain object + * @param {google.cloud.speech.v1p1beta1.Speech.LongRunningRecognizeCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Speech.prototype.longRunningRecognize = function longRunningRecognize(request, callback) { + return this.rpcCall(longRunningRecognize, $root.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "LongRunningRecognize" }); + + /** + * Calls LongRunningRecognize. + * @function longRunningRecognize + * @memberof google.cloud.speech.v1p1beta1.Speech + * @instance + * @param {google.cloud.speech.v1p1beta1.ILongRunningRecognizeRequest} request LongRunningRecognizeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.speech.v1p1beta1.Speech|streamingRecognize}. + * @memberof google.cloud.speech.v1p1beta1.Speech + * @typedef StreamingRecognizeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.speech.v1p1beta1.StreamingRecognizeResponse} [response] StreamingRecognizeResponse + */ + + /** + * Calls StreamingRecognize. + * @function streamingRecognize + * @memberof google.cloud.speech.v1p1beta1.Speech + * @instance + * @param {google.cloud.speech.v1p1beta1.IStreamingRecognizeRequest} request StreamingRecognizeRequest message or plain object + * @param {google.cloud.speech.v1p1beta1.Speech.StreamingRecognizeCallback} callback Node-style callback called with the error, if any, and StreamingRecognizeResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Speech.prototype.streamingRecognize = function streamingRecognize(request, callback) { + return this.rpcCall(streamingRecognize, $root.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest, $root.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse, request, callback); + }, "name", { value: "StreamingRecognize" }); + + /** + * Calls StreamingRecognize. + * @function streamingRecognize + * @memberof google.cloud.speech.v1p1beta1.Speech + * @instance + * @param {google.cloud.speech.v1p1beta1.IStreamingRecognizeRequest} request StreamingRecognizeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Speech; + })(); + + v1p1beta1.RecognizeRequest = (function() { + + /** + * Properties of a RecognizeRequest. + * @memberof google.cloud.speech.v1p1beta1 + * @interface IRecognizeRequest + * @property {google.cloud.speech.v1p1beta1.IRecognitionConfig|null} [config] RecognizeRequest config + * @property {google.cloud.speech.v1p1beta1.IRecognitionAudio|null} [audio] RecognizeRequest audio + */ + + /** + * Constructs a new RecognizeRequest. + * @memberof google.cloud.speech.v1p1beta1 + * @classdesc Represents a RecognizeRequest. + * @implements IRecognizeRequest + * @constructor + * @param {google.cloud.speech.v1p1beta1.IRecognizeRequest=} [properties] Properties to set + */ + function RecognizeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RecognizeRequest config. + * @member {google.cloud.speech.v1p1beta1.IRecognitionConfig|null|undefined} config + * @memberof google.cloud.speech.v1p1beta1.RecognizeRequest + * @instance + */ + RecognizeRequest.prototype.config = null; + + /** + * RecognizeRequest audio. + * @member {google.cloud.speech.v1p1beta1.IRecognitionAudio|null|undefined} audio + * @memberof google.cloud.speech.v1p1beta1.RecognizeRequest + * @instance + */ + RecognizeRequest.prototype.audio = null; + + /** + * Creates a new RecognizeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1p1beta1.RecognizeRequest + * @static + * @param {google.cloud.speech.v1p1beta1.IRecognizeRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v1p1beta1.RecognizeRequest} RecognizeRequest instance + */ + RecognizeRequest.create = function create(properties) { + return new RecognizeRequest(properties); + }; + + /** + * Encodes the specified RecognizeRequest message. Does not implicitly {@link google.cloud.speech.v1p1beta1.RecognizeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1p1beta1.RecognizeRequest + * @static + * @param {google.cloud.speech.v1p1beta1.IRecognizeRequest} message RecognizeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecognizeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.cloud.speech.v1p1beta1.RecognitionConfig.encode(message.config, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.audio != null && Object.hasOwnProperty.call(message, "audio")) + $root.google.cloud.speech.v1p1beta1.RecognitionAudio.encode(message.audio, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RecognizeRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.RecognizeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1p1beta1.RecognizeRequest + * @static + * @param {google.cloud.speech.v1p1beta1.IRecognizeRequest} message RecognizeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecognizeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RecognizeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1p1beta1.RecognizeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1p1beta1.RecognizeRequest} RecognizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecognizeRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.RecognizeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.config = $root.google.cloud.speech.v1p1beta1.RecognitionConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.audio = $root.google.cloud.speech.v1p1beta1.RecognitionAudio.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RecognizeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1p1beta1.RecognizeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1p1beta1.RecognizeRequest} RecognizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecognizeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RecognizeRequest message. + * @function verify + * @memberof google.cloud.speech.v1p1beta1.RecognizeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RecognizeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.config != null && message.hasOwnProperty("config")) { + var error = $root.google.cloud.speech.v1p1beta1.RecognitionConfig.verify(message.config); + if (error) + return "config." + error; + } + if (message.audio != null && message.hasOwnProperty("audio")) { + var error = $root.google.cloud.speech.v1p1beta1.RecognitionAudio.verify(message.audio); + if (error) + return "audio." + error; + } + return null; + }; + + /** + * Creates a RecognizeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1p1beta1.RecognizeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1p1beta1.RecognizeRequest} RecognizeRequest + */ + RecognizeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1p1beta1.RecognizeRequest) + return object; + var message = new $root.google.cloud.speech.v1p1beta1.RecognizeRequest(); + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.RecognizeRequest.config: object expected"); + message.config = $root.google.cloud.speech.v1p1beta1.RecognitionConfig.fromObject(object.config); + } + if (object.audio != null) { + if (typeof object.audio !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.RecognizeRequest.audio: object expected"); + message.audio = $root.google.cloud.speech.v1p1beta1.RecognitionAudio.fromObject(object.audio); + } + return message; + }; + + /** + * Creates a plain object from a RecognizeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1p1beta1.RecognizeRequest + * @static + * @param {google.cloud.speech.v1p1beta1.RecognizeRequest} message RecognizeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RecognizeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.config = null; + object.audio = null; + } + if (message.config != null && message.hasOwnProperty("config")) + object.config = $root.google.cloud.speech.v1p1beta1.RecognitionConfig.toObject(message.config, options); + if (message.audio != null && message.hasOwnProperty("audio")) + object.audio = $root.google.cloud.speech.v1p1beta1.RecognitionAudio.toObject(message.audio, options); + return object; + }; + + /** + * Converts this RecognizeRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1p1beta1.RecognizeRequest + * @instance + * @returns {Object.} JSON object + */ + RecognizeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RecognizeRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v1p1beta1.RecognizeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RecognizeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1p1beta1.RecognizeRequest"; + }; + + return RecognizeRequest; + })(); + + v1p1beta1.LongRunningRecognizeRequest = (function() { + + /** + * Properties of a LongRunningRecognizeRequest. + * @memberof google.cloud.speech.v1p1beta1 + * @interface ILongRunningRecognizeRequest + * @property {google.cloud.speech.v1p1beta1.IRecognitionConfig|null} [config] LongRunningRecognizeRequest config + * @property {google.cloud.speech.v1p1beta1.IRecognitionAudio|null} [audio] LongRunningRecognizeRequest audio + * @property {google.cloud.speech.v1p1beta1.ITranscriptOutputConfig|null} [outputConfig] LongRunningRecognizeRequest outputConfig + */ + + /** + * Constructs a new LongRunningRecognizeRequest. + * @memberof google.cloud.speech.v1p1beta1 + * @classdesc Represents a LongRunningRecognizeRequest. + * @implements ILongRunningRecognizeRequest + * @constructor + * @param {google.cloud.speech.v1p1beta1.ILongRunningRecognizeRequest=} [properties] Properties to set + */ + function LongRunningRecognizeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LongRunningRecognizeRequest config. + * @member {google.cloud.speech.v1p1beta1.IRecognitionConfig|null|undefined} config + * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest + * @instance + */ + LongRunningRecognizeRequest.prototype.config = null; + + /** + * LongRunningRecognizeRequest audio. + * @member {google.cloud.speech.v1p1beta1.IRecognitionAudio|null|undefined} audio + * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest + * @instance + */ + LongRunningRecognizeRequest.prototype.audio = null; + + /** + * LongRunningRecognizeRequest outputConfig. + * @member {google.cloud.speech.v1p1beta1.ITranscriptOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest + * @instance + */ + LongRunningRecognizeRequest.prototype.outputConfig = null; + + /** + * Creates a new LongRunningRecognizeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest + * @static + * @param {google.cloud.speech.v1p1beta1.ILongRunningRecognizeRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest} LongRunningRecognizeRequest instance + */ + LongRunningRecognizeRequest.create = function create(properties) { + return new LongRunningRecognizeRequest(properties); + }; + + /** + * Encodes the specified LongRunningRecognizeRequest message. Does not implicitly {@link google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest + * @static + * @param {google.cloud.speech.v1p1beta1.ILongRunningRecognizeRequest} message LongRunningRecognizeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunningRecognizeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.cloud.speech.v1p1beta1.RecognitionConfig.encode(message.config, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.audio != null && Object.hasOwnProperty.call(message, "audio")) + $root.google.cloud.speech.v1p1beta1.RecognitionAudio.encode(message.audio, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) + $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.encode(message.outputConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LongRunningRecognizeRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest + * @static + * @param {google.cloud.speech.v1p1beta1.ILongRunningRecognizeRequest} message LongRunningRecognizeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunningRecognizeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LongRunningRecognizeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest} LongRunningRecognizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunningRecognizeRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.config = $root.google.cloud.speech.v1p1beta1.RecognitionConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.audio = $root.google.cloud.speech.v1p1beta1.RecognitionAudio.decode(reader, reader.uint32()); + break; + } + case 4: { + message.outputConfig = $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LongRunningRecognizeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest} LongRunningRecognizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunningRecognizeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LongRunningRecognizeRequest message. + * @function verify + * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LongRunningRecognizeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.config != null && message.hasOwnProperty("config")) { + var error = $root.google.cloud.speech.v1p1beta1.RecognitionConfig.verify(message.config); + if (error) + return "config." + error; + } + if (message.audio != null && message.hasOwnProperty("audio")) { + var error = $root.google.cloud.speech.v1p1beta1.RecognitionAudio.verify(message.audio); + if (error) + return "audio." + error; + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + return null; + }; + + /** + * Creates a LongRunningRecognizeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest} LongRunningRecognizeRequest + */ + LongRunningRecognizeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest) + return object; + var message = new $root.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest(); + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest.config: object expected"); + message.config = $root.google.cloud.speech.v1p1beta1.RecognitionConfig.fromObject(object.config); + } + if (object.audio != null) { + if (typeof object.audio !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest.audio: object expected"); + message.audio = $root.google.cloud.speech.v1p1beta1.RecognitionAudio.fromObject(object.audio); + } + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.fromObject(object.outputConfig); + } + return message; + }; + + /** + * Creates a plain object from a LongRunningRecognizeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest + * @static + * @param {google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest} message LongRunningRecognizeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LongRunningRecognizeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.config = null; + object.audio = null; + object.outputConfig = null; + } + if (message.config != null && message.hasOwnProperty("config")) + object.config = $root.google.cloud.speech.v1p1beta1.RecognitionConfig.toObject(message.config, options); + if (message.audio != null && message.hasOwnProperty("audio")) + object.audio = $root.google.cloud.speech.v1p1beta1.RecognitionAudio.toObject(message.audio, options); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.toObject(message.outputConfig, options); + return object; + }; + + /** + * Converts this LongRunningRecognizeRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest + * @instance + * @returns {Object.} JSON object + */ + LongRunningRecognizeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LongRunningRecognizeRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LongRunningRecognizeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest"; + }; + + return LongRunningRecognizeRequest; + })(); + + v1p1beta1.TranscriptOutputConfig = (function() { + + /** + * Properties of a TranscriptOutputConfig. + * @memberof google.cloud.speech.v1p1beta1 + * @interface ITranscriptOutputConfig + * @property {string|null} [gcsUri] TranscriptOutputConfig gcsUri + */ + + /** + * Constructs a new TranscriptOutputConfig. + * @memberof google.cloud.speech.v1p1beta1 + * @classdesc Represents a TranscriptOutputConfig. + * @implements ITranscriptOutputConfig + * @constructor + * @param {google.cloud.speech.v1p1beta1.ITranscriptOutputConfig=} [properties] Properties to set + */ + function TranscriptOutputConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TranscriptOutputConfig gcsUri. + * @member {string|null|undefined} gcsUri + * @memberof google.cloud.speech.v1p1beta1.TranscriptOutputConfig + * @instance + */ + TranscriptOutputConfig.prototype.gcsUri = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TranscriptOutputConfig outputType. + * @member {"gcsUri"|undefined} outputType + * @memberof google.cloud.speech.v1p1beta1.TranscriptOutputConfig + * @instance + */ + Object.defineProperty(TranscriptOutputConfig.prototype, "outputType", { + get: $util.oneOfGetter($oneOfFields = ["gcsUri"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TranscriptOutputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1p1beta1.TranscriptOutputConfig + * @static + * @param {google.cloud.speech.v1p1beta1.ITranscriptOutputConfig=} [properties] Properties to set + * @returns {google.cloud.speech.v1p1beta1.TranscriptOutputConfig} TranscriptOutputConfig instance + */ + TranscriptOutputConfig.create = function create(properties) { + return new TranscriptOutputConfig(properties); + }; + + /** + * Encodes the specified TranscriptOutputConfig message. Does not implicitly {@link google.cloud.speech.v1p1beta1.TranscriptOutputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1p1beta1.TranscriptOutputConfig + * @static + * @param {google.cloud.speech.v1p1beta1.ITranscriptOutputConfig} message TranscriptOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranscriptOutputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsUri != null && Object.hasOwnProperty.call(message, "gcsUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsUri); + return writer; + }; + + /** + * Encodes the specified TranscriptOutputConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.TranscriptOutputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1p1beta1.TranscriptOutputConfig + * @static + * @param {google.cloud.speech.v1p1beta1.ITranscriptOutputConfig} message TranscriptOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranscriptOutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TranscriptOutputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1p1beta1.TranscriptOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1p1beta1.TranscriptOutputConfig} TranscriptOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranscriptOutputConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.gcsUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TranscriptOutputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1p1beta1.TranscriptOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1p1beta1.TranscriptOutputConfig} TranscriptOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranscriptOutputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TranscriptOutputConfig message. + * @function verify + * @memberof google.cloud.speech.v1p1beta1.TranscriptOutputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TranscriptOutputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) { + properties.outputType = 1; + if (!$util.isString(message.gcsUri)) + return "gcsUri: string expected"; + } + return null; + }; + + /** + * Creates a TranscriptOutputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1p1beta1.TranscriptOutputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1p1beta1.TranscriptOutputConfig} TranscriptOutputConfig + */ + TranscriptOutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig) + return object; + var message = new $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig(); + if (object.gcsUri != null) + message.gcsUri = String(object.gcsUri); + return message; + }; + + /** + * Creates a plain object from a TranscriptOutputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1p1beta1.TranscriptOutputConfig + * @static + * @param {google.cloud.speech.v1p1beta1.TranscriptOutputConfig} message TranscriptOutputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TranscriptOutputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) { + object.gcsUri = message.gcsUri; + if (options.oneofs) + object.outputType = "gcsUri"; + } + return object; + }; + + /** + * Converts this TranscriptOutputConfig to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1p1beta1.TranscriptOutputConfig + * @instance + * @returns {Object.} JSON object + */ + TranscriptOutputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TranscriptOutputConfig + * @function getTypeUrl + * @memberof google.cloud.speech.v1p1beta1.TranscriptOutputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TranscriptOutputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1p1beta1.TranscriptOutputConfig"; + }; + + return TranscriptOutputConfig; + })(); + + v1p1beta1.StreamingRecognizeRequest = (function() { + + /** + * Properties of a StreamingRecognizeRequest. + * @memberof google.cloud.speech.v1p1beta1 + * @interface IStreamingRecognizeRequest + * @property {google.cloud.speech.v1p1beta1.IStreamingRecognitionConfig|null} [streamingConfig] StreamingRecognizeRequest streamingConfig + * @property {Uint8Array|null} [audioContent] StreamingRecognizeRequest audioContent + */ + + /** + * Constructs a new StreamingRecognizeRequest. + * @memberof google.cloud.speech.v1p1beta1 + * @classdesc Represents a StreamingRecognizeRequest. + * @implements IStreamingRecognizeRequest + * @constructor + * @param {google.cloud.speech.v1p1beta1.IStreamingRecognizeRequest=} [properties] Properties to set + */ + function StreamingRecognizeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamingRecognizeRequest streamingConfig. + * @member {google.cloud.speech.v1p1beta1.IStreamingRecognitionConfig|null|undefined} streamingConfig + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeRequest + * @instance + */ + StreamingRecognizeRequest.prototype.streamingConfig = null; + + /** + * StreamingRecognizeRequest audioContent. + * @member {Uint8Array|null|undefined} audioContent + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeRequest + * @instance + */ + StreamingRecognizeRequest.prototype.audioContent = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * StreamingRecognizeRequest streamingRequest. + * @member {"streamingConfig"|"audioContent"|undefined} streamingRequest + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeRequest + * @instance + */ + Object.defineProperty(StreamingRecognizeRequest.prototype, "streamingRequest", { + get: $util.oneOfGetter($oneOfFields = ["streamingConfig", "audioContent"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StreamingRecognizeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeRequest + * @static + * @param {google.cloud.speech.v1p1beta1.IStreamingRecognizeRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v1p1beta1.StreamingRecognizeRequest} StreamingRecognizeRequest instance + */ + StreamingRecognizeRequest.create = function create(properties) { + return new StreamingRecognizeRequest(properties); + }; + + /** + * Encodes the specified StreamingRecognizeRequest message. Does not implicitly {@link google.cloud.speech.v1p1beta1.StreamingRecognizeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeRequest + * @static + * @param {google.cloud.speech.v1p1beta1.IStreamingRecognizeRequest} message StreamingRecognizeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingRecognizeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.streamingConfig != null && Object.hasOwnProperty.call(message, "streamingConfig")) + $root.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.encode(message.streamingConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.audioContent != null && Object.hasOwnProperty.call(message, "audioContent")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.audioContent); + return writer; + }; + + /** + * Encodes the specified StreamingRecognizeRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.StreamingRecognizeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeRequest + * @static + * @param {google.cloud.speech.v1p1beta1.IStreamingRecognizeRequest} message StreamingRecognizeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingRecognizeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamingRecognizeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1p1beta1.StreamingRecognizeRequest} StreamingRecognizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingRecognizeRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.streamingConfig = $root.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.audioContent = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamingRecognizeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1p1beta1.StreamingRecognizeRequest} StreamingRecognizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingRecognizeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamingRecognizeRequest message. + * @function verify + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingRecognizeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.streamingConfig != null && message.hasOwnProperty("streamingConfig")) { + properties.streamingRequest = 1; + { + var error = $root.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.verify(message.streamingConfig); + if (error) + return "streamingConfig." + error; + } + } + if (message.audioContent != null && message.hasOwnProperty("audioContent")) { + if (properties.streamingRequest === 1) + return "streamingRequest: multiple values"; + properties.streamingRequest = 1; + if (!(message.audioContent && typeof message.audioContent.length === "number" || $util.isString(message.audioContent))) + return "audioContent: buffer expected"; + } + return null; + }; + + /** + * Creates a StreamingRecognizeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1p1beta1.StreamingRecognizeRequest} StreamingRecognizeRequest + */ + StreamingRecognizeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest) + return object; + var message = new $root.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest(); + if (object.streamingConfig != null) { + if (typeof object.streamingConfig !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.StreamingRecognizeRequest.streamingConfig: object expected"); + message.streamingConfig = $root.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.fromObject(object.streamingConfig); + } + if (object.audioContent != null) + if (typeof object.audioContent === "string") + $util.base64.decode(object.audioContent, message.audioContent = $util.newBuffer($util.base64.length(object.audioContent)), 0); + else if (object.audioContent.length >= 0) + message.audioContent = object.audioContent; + return message; + }; + + /** + * Creates a plain object from a StreamingRecognizeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeRequest + * @static + * @param {google.cloud.speech.v1p1beta1.StreamingRecognizeRequest} message StreamingRecognizeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingRecognizeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.streamingConfig != null && message.hasOwnProperty("streamingConfig")) { + object.streamingConfig = $root.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.toObject(message.streamingConfig, options); + if (options.oneofs) + object.streamingRequest = "streamingConfig"; + } + if (message.audioContent != null && message.hasOwnProperty("audioContent")) { + object.audioContent = options.bytes === String ? $util.base64.encode(message.audioContent, 0, message.audioContent.length) : options.bytes === Array ? Array.prototype.slice.call(message.audioContent) : message.audioContent; + if (options.oneofs) + object.streamingRequest = "audioContent"; + } + return object; + }; + + /** + * Converts this StreamingRecognizeRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeRequest + * @instance + * @returns {Object.} JSON object + */ + StreamingRecognizeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamingRecognizeRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamingRecognizeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1p1beta1.StreamingRecognizeRequest"; + }; + + return StreamingRecognizeRequest; + })(); + + v1p1beta1.StreamingRecognitionConfig = (function() { + + /** + * Properties of a StreamingRecognitionConfig. + * @memberof google.cloud.speech.v1p1beta1 + * @interface IStreamingRecognitionConfig + * @property {google.cloud.speech.v1p1beta1.IRecognitionConfig|null} [config] StreamingRecognitionConfig config + * @property {boolean|null} [singleUtterance] StreamingRecognitionConfig singleUtterance + * @property {boolean|null} [interimResults] StreamingRecognitionConfig interimResults + * @property {boolean|null} [enableVoiceActivityEvents] StreamingRecognitionConfig enableVoiceActivityEvents + * @property {google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.IVoiceActivityTimeout|null} [voiceActivityTimeout] StreamingRecognitionConfig voiceActivityTimeout + */ + + /** + * Constructs a new StreamingRecognitionConfig. + * @memberof google.cloud.speech.v1p1beta1 + * @classdesc Represents a StreamingRecognitionConfig. + * @implements IStreamingRecognitionConfig + * @constructor + * @param {google.cloud.speech.v1p1beta1.IStreamingRecognitionConfig=} [properties] Properties to set + */ + function StreamingRecognitionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamingRecognitionConfig config. + * @member {google.cloud.speech.v1p1beta1.IRecognitionConfig|null|undefined} config + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionConfig + * @instance + */ + StreamingRecognitionConfig.prototype.config = null; + + /** + * StreamingRecognitionConfig singleUtterance. + * @member {boolean} singleUtterance + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionConfig + * @instance + */ + StreamingRecognitionConfig.prototype.singleUtterance = false; + + /** + * StreamingRecognitionConfig interimResults. + * @member {boolean} interimResults + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionConfig + * @instance + */ + StreamingRecognitionConfig.prototype.interimResults = false; + + /** + * StreamingRecognitionConfig enableVoiceActivityEvents. + * @member {boolean} enableVoiceActivityEvents + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionConfig + * @instance + */ + StreamingRecognitionConfig.prototype.enableVoiceActivityEvents = false; + + /** + * StreamingRecognitionConfig voiceActivityTimeout. + * @member {google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.IVoiceActivityTimeout|null|undefined} voiceActivityTimeout + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionConfig + * @instance + */ + StreamingRecognitionConfig.prototype.voiceActivityTimeout = null; + + /** + * Creates a new StreamingRecognitionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionConfig + * @static + * @param {google.cloud.speech.v1p1beta1.IStreamingRecognitionConfig=} [properties] Properties to set + * @returns {google.cloud.speech.v1p1beta1.StreamingRecognitionConfig} StreamingRecognitionConfig instance + */ + StreamingRecognitionConfig.create = function create(properties) { + return new StreamingRecognitionConfig(properties); + }; + + /** + * Encodes the specified StreamingRecognitionConfig message. Does not implicitly {@link google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionConfig + * @static + * @param {google.cloud.speech.v1p1beta1.IStreamingRecognitionConfig} message StreamingRecognitionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingRecognitionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.cloud.speech.v1p1beta1.RecognitionConfig.encode(message.config, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.singleUtterance != null && Object.hasOwnProperty.call(message, "singleUtterance")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.singleUtterance); + if (message.interimResults != null && Object.hasOwnProperty.call(message, "interimResults")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.interimResults); + if (message.enableVoiceActivityEvents != null && Object.hasOwnProperty.call(message, "enableVoiceActivityEvents")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.enableVoiceActivityEvents); + if (message.voiceActivityTimeout != null && Object.hasOwnProperty.call(message, "voiceActivityTimeout")) + $root.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.VoiceActivityTimeout.encode(message.voiceActivityTimeout, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StreamingRecognitionConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionConfig + * @static + * @param {google.cloud.speech.v1p1beta1.IStreamingRecognitionConfig} message StreamingRecognitionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingRecognitionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamingRecognitionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1p1beta1.StreamingRecognitionConfig} StreamingRecognitionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingRecognitionConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.config = $root.google.cloud.speech.v1p1beta1.RecognitionConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.singleUtterance = reader.bool(); + break; + } + case 3: { + message.interimResults = reader.bool(); + break; + } + case 5: { + message.enableVoiceActivityEvents = reader.bool(); + break; + } + case 6: { + message.voiceActivityTimeout = $root.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.VoiceActivityTimeout.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamingRecognitionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1p1beta1.StreamingRecognitionConfig} StreamingRecognitionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingRecognitionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamingRecognitionConfig message. + * @function verify + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingRecognitionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.config != null && message.hasOwnProperty("config")) { + var error = $root.google.cloud.speech.v1p1beta1.RecognitionConfig.verify(message.config); + if (error) + return "config." + error; + } + if (message.singleUtterance != null && message.hasOwnProperty("singleUtterance")) + if (typeof message.singleUtterance !== "boolean") + return "singleUtterance: boolean expected"; + if (message.interimResults != null && message.hasOwnProperty("interimResults")) + if (typeof message.interimResults !== "boolean") + return "interimResults: boolean expected"; + if (message.enableVoiceActivityEvents != null && message.hasOwnProperty("enableVoiceActivityEvents")) + if (typeof message.enableVoiceActivityEvents !== "boolean") + return "enableVoiceActivityEvents: boolean expected"; + if (message.voiceActivityTimeout != null && message.hasOwnProperty("voiceActivityTimeout")) { + var error = $root.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.VoiceActivityTimeout.verify(message.voiceActivityTimeout); + if (error) + return "voiceActivityTimeout." + error; + } + return null; + }; + + /** + * Creates a StreamingRecognitionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1p1beta1.StreamingRecognitionConfig} StreamingRecognitionConfig + */ + StreamingRecognitionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig) + return object; + var message = new $root.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig(); + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.config: object expected"); + message.config = $root.google.cloud.speech.v1p1beta1.RecognitionConfig.fromObject(object.config); + } + if (object.singleUtterance != null) + message.singleUtterance = Boolean(object.singleUtterance); + if (object.interimResults != null) + message.interimResults = Boolean(object.interimResults); + if (object.enableVoiceActivityEvents != null) + message.enableVoiceActivityEvents = Boolean(object.enableVoiceActivityEvents); + if (object.voiceActivityTimeout != null) { + if (typeof object.voiceActivityTimeout !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.voiceActivityTimeout: object expected"); + message.voiceActivityTimeout = $root.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.VoiceActivityTimeout.fromObject(object.voiceActivityTimeout); + } + return message; + }; + + /** + * Creates a plain object from a StreamingRecognitionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionConfig + * @static + * @param {google.cloud.speech.v1p1beta1.StreamingRecognitionConfig} message StreamingRecognitionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingRecognitionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.config = null; + object.singleUtterance = false; + object.interimResults = false; + object.enableVoiceActivityEvents = false; + object.voiceActivityTimeout = null; + } + if (message.config != null && message.hasOwnProperty("config")) + object.config = $root.google.cloud.speech.v1p1beta1.RecognitionConfig.toObject(message.config, options); + if (message.singleUtterance != null && message.hasOwnProperty("singleUtterance")) + object.singleUtterance = message.singleUtterance; + if (message.interimResults != null && message.hasOwnProperty("interimResults")) + object.interimResults = message.interimResults; + if (message.enableVoiceActivityEvents != null && message.hasOwnProperty("enableVoiceActivityEvents")) + object.enableVoiceActivityEvents = message.enableVoiceActivityEvents; + if (message.voiceActivityTimeout != null && message.hasOwnProperty("voiceActivityTimeout")) + object.voiceActivityTimeout = $root.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.VoiceActivityTimeout.toObject(message.voiceActivityTimeout, options); + return object; + }; + + /** + * Converts this StreamingRecognitionConfig to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionConfig + * @instance + * @returns {Object.} JSON object + */ + StreamingRecognitionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamingRecognitionConfig + * @function getTypeUrl + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamingRecognitionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1p1beta1.StreamingRecognitionConfig"; + }; + + StreamingRecognitionConfig.VoiceActivityTimeout = (function() { + + /** + * Properties of a VoiceActivityTimeout. + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionConfig + * @interface IVoiceActivityTimeout + * @property {google.protobuf.IDuration|null} [speechStartTimeout] VoiceActivityTimeout speechStartTimeout + * @property {google.protobuf.IDuration|null} [speechEndTimeout] VoiceActivityTimeout speechEndTimeout + */ + + /** + * Constructs a new VoiceActivityTimeout. + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionConfig + * @classdesc Represents a VoiceActivityTimeout. + * @implements IVoiceActivityTimeout + * @constructor + * @param {google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.IVoiceActivityTimeout=} [properties] Properties to set + */ + function VoiceActivityTimeout(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VoiceActivityTimeout speechStartTimeout. + * @member {google.protobuf.IDuration|null|undefined} speechStartTimeout + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.VoiceActivityTimeout + * @instance + */ + VoiceActivityTimeout.prototype.speechStartTimeout = null; + + /** + * VoiceActivityTimeout speechEndTimeout. + * @member {google.protobuf.IDuration|null|undefined} speechEndTimeout + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.VoiceActivityTimeout + * @instance + */ + VoiceActivityTimeout.prototype.speechEndTimeout = null; + + /** + * Creates a new VoiceActivityTimeout instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.VoiceActivityTimeout + * @static + * @param {google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.IVoiceActivityTimeout=} [properties] Properties to set + * @returns {google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.VoiceActivityTimeout} VoiceActivityTimeout instance + */ + VoiceActivityTimeout.create = function create(properties) { + return new VoiceActivityTimeout(properties); + }; + + /** + * Encodes the specified VoiceActivityTimeout message. Does not implicitly {@link google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.VoiceActivityTimeout.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.VoiceActivityTimeout + * @static + * @param {google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.IVoiceActivityTimeout} message VoiceActivityTimeout message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VoiceActivityTimeout.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.speechStartTimeout != null && Object.hasOwnProperty.call(message, "speechStartTimeout")) + $root.google.protobuf.Duration.encode(message.speechStartTimeout, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.speechEndTimeout != null && Object.hasOwnProperty.call(message, "speechEndTimeout")) + $root.google.protobuf.Duration.encode(message.speechEndTimeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VoiceActivityTimeout message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.VoiceActivityTimeout.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.VoiceActivityTimeout + * @static + * @param {google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.IVoiceActivityTimeout} message VoiceActivityTimeout message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VoiceActivityTimeout.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VoiceActivityTimeout message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.VoiceActivityTimeout + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.VoiceActivityTimeout} VoiceActivityTimeout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VoiceActivityTimeout.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.VoiceActivityTimeout(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.speechStartTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.speechEndTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VoiceActivityTimeout message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.VoiceActivityTimeout + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.VoiceActivityTimeout} VoiceActivityTimeout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VoiceActivityTimeout.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VoiceActivityTimeout message. + * @function verify + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.VoiceActivityTimeout + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VoiceActivityTimeout.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.speechStartTimeout != null && message.hasOwnProperty("speechStartTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.speechStartTimeout); + if (error) + return "speechStartTimeout." + error; + } + if (message.speechEndTimeout != null && message.hasOwnProperty("speechEndTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.speechEndTimeout); + if (error) + return "speechEndTimeout." + error; + } + return null; + }; + + /** + * Creates a VoiceActivityTimeout message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.VoiceActivityTimeout + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.VoiceActivityTimeout} VoiceActivityTimeout + */ + VoiceActivityTimeout.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.VoiceActivityTimeout) + return object; + var message = new $root.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.VoiceActivityTimeout(); + if (object.speechStartTimeout != null) { + if (typeof object.speechStartTimeout !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.VoiceActivityTimeout.speechStartTimeout: object expected"); + message.speechStartTimeout = $root.google.protobuf.Duration.fromObject(object.speechStartTimeout); + } + if (object.speechEndTimeout != null) { + if (typeof object.speechEndTimeout !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.VoiceActivityTimeout.speechEndTimeout: object expected"); + message.speechEndTimeout = $root.google.protobuf.Duration.fromObject(object.speechEndTimeout); + } + return message; + }; + + /** + * Creates a plain object from a VoiceActivityTimeout message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.VoiceActivityTimeout + * @static + * @param {google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.VoiceActivityTimeout} message VoiceActivityTimeout + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VoiceActivityTimeout.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.speechStartTimeout = null; + object.speechEndTimeout = null; + } + if (message.speechStartTimeout != null && message.hasOwnProperty("speechStartTimeout")) + object.speechStartTimeout = $root.google.protobuf.Duration.toObject(message.speechStartTimeout, options); + if (message.speechEndTimeout != null && message.hasOwnProperty("speechEndTimeout")) + object.speechEndTimeout = $root.google.protobuf.Duration.toObject(message.speechEndTimeout, options); + return object; + }; + + /** + * Converts this VoiceActivityTimeout to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.VoiceActivityTimeout + * @instance + * @returns {Object.} JSON object + */ + VoiceActivityTimeout.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VoiceActivityTimeout + * @function getTypeUrl + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.VoiceActivityTimeout + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VoiceActivityTimeout.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.VoiceActivityTimeout"; + }; + + return VoiceActivityTimeout; + })(); + + return StreamingRecognitionConfig; + })(); + + v1p1beta1.RecognitionConfig = (function() { + + /** + * Properties of a RecognitionConfig. + * @memberof google.cloud.speech.v1p1beta1 + * @interface IRecognitionConfig + * @property {google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding|null} [encoding] RecognitionConfig encoding + * @property {number|null} [sampleRateHertz] RecognitionConfig sampleRateHertz + * @property {number|null} [audioChannelCount] RecognitionConfig audioChannelCount + * @property {boolean|null} [enableSeparateRecognitionPerChannel] RecognitionConfig enableSeparateRecognitionPerChannel + * @property {string|null} [languageCode] RecognitionConfig languageCode + * @property {Array.|null} [alternativeLanguageCodes] RecognitionConfig alternativeLanguageCodes + * @property {number|null} [maxAlternatives] RecognitionConfig maxAlternatives + * @property {boolean|null} [profanityFilter] RecognitionConfig profanityFilter + * @property {google.cloud.speech.v1p1beta1.ISpeechAdaptation|null} [adaptation] RecognitionConfig adaptation + * @property {google.cloud.speech.v1p1beta1.ITranscriptNormalization|null} [transcriptNormalization] RecognitionConfig transcriptNormalization + * @property {Array.|null} [speechContexts] RecognitionConfig speechContexts + * @property {boolean|null} [enableWordTimeOffsets] RecognitionConfig enableWordTimeOffsets + * @property {boolean|null} [enableWordConfidence] RecognitionConfig enableWordConfidence + * @property {boolean|null} [enableAutomaticPunctuation] RecognitionConfig enableAutomaticPunctuation + * @property {google.protobuf.IBoolValue|null} [enableSpokenPunctuation] RecognitionConfig enableSpokenPunctuation + * @property {google.protobuf.IBoolValue|null} [enableSpokenEmojis] RecognitionConfig enableSpokenEmojis + * @property {boolean|null} [enableSpeakerDiarization] RecognitionConfig enableSpeakerDiarization + * @property {number|null} [diarizationSpeakerCount] RecognitionConfig diarizationSpeakerCount + * @property {google.cloud.speech.v1p1beta1.ISpeakerDiarizationConfig|null} [diarizationConfig] RecognitionConfig diarizationConfig + * @property {google.cloud.speech.v1p1beta1.IRecognitionMetadata|null} [metadata] RecognitionConfig metadata + * @property {string|null} [model] RecognitionConfig model + * @property {boolean|null} [useEnhanced] RecognitionConfig useEnhanced + */ + + /** + * Constructs a new RecognitionConfig. + * @memberof google.cloud.speech.v1p1beta1 + * @classdesc Represents a RecognitionConfig. + * @implements IRecognitionConfig + * @constructor + * @param {google.cloud.speech.v1p1beta1.IRecognitionConfig=} [properties] Properties to set + */ + function RecognitionConfig(properties) { + this.alternativeLanguageCodes = []; + this.speechContexts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RecognitionConfig encoding. + * @member {google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding} encoding + * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.encoding = 0; + + /** + * RecognitionConfig sampleRateHertz. + * @member {number} sampleRateHertz + * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.sampleRateHertz = 0; + + /** + * RecognitionConfig audioChannelCount. + * @member {number} audioChannelCount + * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.audioChannelCount = 0; + + /** + * RecognitionConfig enableSeparateRecognitionPerChannel. + * @member {boolean} enableSeparateRecognitionPerChannel + * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.enableSeparateRecognitionPerChannel = false; + + /** + * RecognitionConfig languageCode. + * @member {string} languageCode + * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.languageCode = ""; + + /** + * RecognitionConfig alternativeLanguageCodes. + * @member {Array.} alternativeLanguageCodes + * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.alternativeLanguageCodes = $util.emptyArray; + + /** + * RecognitionConfig maxAlternatives. + * @member {number} maxAlternatives + * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.maxAlternatives = 0; + + /** + * RecognitionConfig profanityFilter. + * @member {boolean} profanityFilter + * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.profanityFilter = false; + + /** + * RecognitionConfig adaptation. + * @member {google.cloud.speech.v1p1beta1.ISpeechAdaptation|null|undefined} adaptation + * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.adaptation = null; + + /** + * RecognitionConfig transcriptNormalization. + * @member {google.cloud.speech.v1p1beta1.ITranscriptNormalization|null|undefined} transcriptNormalization + * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.transcriptNormalization = null; + + /** + * RecognitionConfig speechContexts. + * @member {Array.} speechContexts + * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.speechContexts = $util.emptyArray; + + /** + * RecognitionConfig enableWordTimeOffsets. + * @member {boolean} enableWordTimeOffsets + * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.enableWordTimeOffsets = false; + + /** + * RecognitionConfig enableWordConfidence. + * @member {boolean} enableWordConfidence + * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.enableWordConfidence = false; + + /** + * RecognitionConfig enableAutomaticPunctuation. + * @member {boolean} enableAutomaticPunctuation + * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.enableAutomaticPunctuation = false; + + /** + * RecognitionConfig enableSpokenPunctuation. + * @member {google.protobuf.IBoolValue|null|undefined} enableSpokenPunctuation + * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.enableSpokenPunctuation = null; + + /** + * RecognitionConfig enableSpokenEmojis. + * @member {google.protobuf.IBoolValue|null|undefined} enableSpokenEmojis + * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.enableSpokenEmojis = null; + + /** + * RecognitionConfig enableSpeakerDiarization. + * @member {boolean} enableSpeakerDiarization + * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.enableSpeakerDiarization = false; + + /** + * RecognitionConfig diarizationSpeakerCount. + * @member {number} diarizationSpeakerCount + * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.diarizationSpeakerCount = 0; + + /** + * RecognitionConfig diarizationConfig. + * @member {google.cloud.speech.v1p1beta1.ISpeakerDiarizationConfig|null|undefined} diarizationConfig + * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.diarizationConfig = null; + + /** + * RecognitionConfig metadata. + * @member {google.cloud.speech.v1p1beta1.IRecognitionMetadata|null|undefined} metadata + * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.metadata = null; + + /** + * RecognitionConfig model. + * @member {string} model + * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.model = ""; + + /** + * RecognitionConfig useEnhanced. + * @member {boolean} useEnhanced + * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.useEnhanced = false; + + /** + * Creates a new RecognitionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig + * @static + * @param {google.cloud.speech.v1p1beta1.IRecognitionConfig=} [properties] Properties to set + * @returns {google.cloud.speech.v1p1beta1.RecognitionConfig} RecognitionConfig instance + */ + RecognitionConfig.create = function create(properties) { + return new RecognitionConfig(properties); + }; + + /** + * Encodes the specified RecognitionConfig message. Does not implicitly {@link google.cloud.speech.v1p1beta1.RecognitionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig + * @static + * @param {google.cloud.speech.v1p1beta1.IRecognitionConfig} message RecognitionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecognitionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.encoding); + if (message.sampleRateHertz != null && Object.hasOwnProperty.call(message, "sampleRateHertz")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.sampleRateHertz); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); + if (message.maxAlternatives != null && Object.hasOwnProperty.call(message, "maxAlternatives")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.maxAlternatives); + if (message.profanityFilter != null && Object.hasOwnProperty.call(message, "profanityFilter")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.profanityFilter); + if (message.speechContexts != null && message.speechContexts.length) + for (var i = 0; i < message.speechContexts.length; ++i) + $root.google.cloud.speech.v1p1beta1.SpeechContext.encode(message.speechContexts[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.audioChannelCount != null && Object.hasOwnProperty.call(message, "audioChannelCount")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.audioChannelCount); + if (message.enableWordTimeOffsets != null && Object.hasOwnProperty.call(message, "enableWordTimeOffsets")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.enableWordTimeOffsets); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.cloud.speech.v1p1beta1.RecognitionMetadata.encode(message.metadata, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.enableAutomaticPunctuation != null && Object.hasOwnProperty.call(message, "enableAutomaticPunctuation")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.enableAutomaticPunctuation); + if (message.enableSeparateRecognitionPerChannel != null && Object.hasOwnProperty.call(message, "enableSeparateRecognitionPerChannel")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.enableSeparateRecognitionPerChannel); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.model); + if (message.useEnhanced != null && Object.hasOwnProperty.call(message, "useEnhanced")) + writer.uint32(/* id 14, wireType 0 =*/112).bool(message.useEnhanced); + if (message.enableWordConfidence != null && Object.hasOwnProperty.call(message, "enableWordConfidence")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.enableWordConfidence); + if (message.enableSpeakerDiarization != null && Object.hasOwnProperty.call(message, "enableSpeakerDiarization")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.enableSpeakerDiarization); + if (message.diarizationSpeakerCount != null && Object.hasOwnProperty.call(message, "diarizationSpeakerCount")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.diarizationSpeakerCount); + if (message.alternativeLanguageCodes != null && message.alternativeLanguageCodes.length) + for (var i = 0; i < message.alternativeLanguageCodes.length; ++i) + writer.uint32(/* id 18, wireType 2 =*/146).string(message.alternativeLanguageCodes[i]); + if (message.diarizationConfig != null && Object.hasOwnProperty.call(message, "diarizationConfig")) + $root.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.encode(message.diarizationConfig, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.adaptation != null && Object.hasOwnProperty.call(message, "adaptation")) + $root.google.cloud.speech.v1p1beta1.SpeechAdaptation.encode(message.adaptation, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.enableSpokenPunctuation != null && Object.hasOwnProperty.call(message, "enableSpokenPunctuation")) + $root.google.protobuf.BoolValue.encode(message.enableSpokenPunctuation, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.enableSpokenEmojis != null && Object.hasOwnProperty.call(message, "enableSpokenEmojis")) + $root.google.protobuf.BoolValue.encode(message.enableSpokenEmojis, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.transcriptNormalization != null && Object.hasOwnProperty.call(message, "transcriptNormalization")) + $root.google.cloud.speech.v1p1beta1.TranscriptNormalization.encode(message.transcriptNormalization, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RecognitionConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.RecognitionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig + * @static + * @param {google.cloud.speech.v1p1beta1.IRecognitionConfig} message RecognitionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecognitionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RecognitionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1p1beta1.RecognitionConfig} RecognitionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecognitionConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.RecognitionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.encoding = reader.int32(); + break; + } + case 2: { + message.sampleRateHertz = reader.int32(); + break; + } + case 7: { + message.audioChannelCount = reader.int32(); + break; + } + case 12: { + message.enableSeparateRecognitionPerChannel = reader.bool(); + break; + } + case 3: { + message.languageCode = reader.string(); + break; + } + case 18: { + if (!(message.alternativeLanguageCodes && message.alternativeLanguageCodes.length)) + message.alternativeLanguageCodes = []; + message.alternativeLanguageCodes.push(reader.string()); + break; + } + case 4: { + message.maxAlternatives = reader.int32(); + break; + } + case 5: { + message.profanityFilter = reader.bool(); + break; + } + case 20: { + message.adaptation = $root.google.cloud.speech.v1p1beta1.SpeechAdaptation.decode(reader, reader.uint32()); + break; + } + case 24: { + message.transcriptNormalization = $root.google.cloud.speech.v1p1beta1.TranscriptNormalization.decode(reader, reader.uint32()); + break; + } + case 6: { + if (!(message.speechContexts && message.speechContexts.length)) + message.speechContexts = []; + message.speechContexts.push($root.google.cloud.speech.v1p1beta1.SpeechContext.decode(reader, reader.uint32())); + break; + } + case 8: { + message.enableWordTimeOffsets = reader.bool(); + break; + } + case 15: { + message.enableWordConfidence = reader.bool(); + break; + } + case 11: { + message.enableAutomaticPunctuation = reader.bool(); + break; + } + case 22: { + message.enableSpokenPunctuation = $root.google.protobuf.BoolValue.decode(reader, reader.uint32()); + break; + } + case 23: { + message.enableSpokenEmojis = $root.google.protobuf.BoolValue.decode(reader, reader.uint32()); + break; + } + case 16: { + message.enableSpeakerDiarization = reader.bool(); + break; + } + case 17: { + message.diarizationSpeakerCount = reader.int32(); + break; + } + case 19: { + message.diarizationConfig = $root.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.decode(reader, reader.uint32()); + break; + } + case 9: { + message.metadata = $root.google.cloud.speech.v1p1beta1.RecognitionMetadata.decode(reader, reader.uint32()); + break; + } + case 13: { + message.model = reader.string(); + break; + } + case 14: { + message.useEnhanced = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RecognitionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1p1beta1.RecognitionConfig} RecognitionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecognitionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RecognitionConfig message. + * @function verify + * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RecognitionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.encoding != null && message.hasOwnProperty("encoding")) + switch (message.encoding) { + default: + return "encoding: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + break; + } + if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) + if (!$util.isInteger(message.sampleRateHertz)) + return "sampleRateHertz: integer expected"; + if (message.audioChannelCount != null && message.hasOwnProperty("audioChannelCount")) + if (!$util.isInteger(message.audioChannelCount)) + return "audioChannelCount: integer expected"; + if (message.enableSeparateRecognitionPerChannel != null && message.hasOwnProperty("enableSeparateRecognitionPerChannel")) + if (typeof message.enableSeparateRecognitionPerChannel !== "boolean") + return "enableSeparateRecognitionPerChannel: boolean expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.alternativeLanguageCodes != null && message.hasOwnProperty("alternativeLanguageCodes")) { + if (!Array.isArray(message.alternativeLanguageCodes)) + return "alternativeLanguageCodes: array expected"; + for (var i = 0; i < message.alternativeLanguageCodes.length; ++i) + if (!$util.isString(message.alternativeLanguageCodes[i])) + return "alternativeLanguageCodes: string[] expected"; + } + if (message.maxAlternatives != null && message.hasOwnProperty("maxAlternatives")) + if (!$util.isInteger(message.maxAlternatives)) + return "maxAlternatives: integer expected"; + if (message.profanityFilter != null && message.hasOwnProperty("profanityFilter")) + if (typeof message.profanityFilter !== "boolean") + return "profanityFilter: boolean expected"; + if (message.adaptation != null && message.hasOwnProperty("adaptation")) { + var error = $root.google.cloud.speech.v1p1beta1.SpeechAdaptation.verify(message.adaptation); + if (error) + return "adaptation." + error; + } + if (message.transcriptNormalization != null && message.hasOwnProperty("transcriptNormalization")) { + var error = $root.google.cloud.speech.v1p1beta1.TranscriptNormalization.verify(message.transcriptNormalization); + if (error) + return "transcriptNormalization." + error; + } + if (message.speechContexts != null && message.hasOwnProperty("speechContexts")) { + if (!Array.isArray(message.speechContexts)) + return "speechContexts: array expected"; + for (var i = 0; i < message.speechContexts.length; ++i) { + var error = $root.google.cloud.speech.v1p1beta1.SpeechContext.verify(message.speechContexts[i]); + if (error) + return "speechContexts." + error; + } + } + if (message.enableWordTimeOffsets != null && message.hasOwnProperty("enableWordTimeOffsets")) + if (typeof message.enableWordTimeOffsets !== "boolean") + return "enableWordTimeOffsets: boolean expected"; + if (message.enableWordConfidence != null && message.hasOwnProperty("enableWordConfidence")) + if (typeof message.enableWordConfidence !== "boolean") + return "enableWordConfidence: boolean expected"; + if (message.enableAutomaticPunctuation != null && message.hasOwnProperty("enableAutomaticPunctuation")) + if (typeof message.enableAutomaticPunctuation !== "boolean") + return "enableAutomaticPunctuation: boolean expected"; + if (message.enableSpokenPunctuation != null && message.hasOwnProperty("enableSpokenPunctuation")) { + var error = $root.google.protobuf.BoolValue.verify(message.enableSpokenPunctuation); + if (error) + return "enableSpokenPunctuation." + error; + } + if (message.enableSpokenEmojis != null && message.hasOwnProperty("enableSpokenEmojis")) { + var error = $root.google.protobuf.BoolValue.verify(message.enableSpokenEmojis); + if (error) + return "enableSpokenEmojis." + error; + } + if (message.enableSpeakerDiarization != null && message.hasOwnProperty("enableSpeakerDiarization")) + if (typeof message.enableSpeakerDiarization !== "boolean") + return "enableSpeakerDiarization: boolean expected"; + if (message.diarizationSpeakerCount != null && message.hasOwnProperty("diarizationSpeakerCount")) + if (!$util.isInteger(message.diarizationSpeakerCount)) + return "diarizationSpeakerCount: integer expected"; + if (message.diarizationConfig != null && message.hasOwnProperty("diarizationConfig")) { + var error = $root.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.verify(message.diarizationConfig); + if (error) + return "diarizationConfig." + error; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.cloud.speech.v1p1beta1.RecognitionMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.useEnhanced != null && message.hasOwnProperty("useEnhanced")) + if (typeof message.useEnhanced !== "boolean") + return "useEnhanced: boolean expected"; + return null; + }; + + /** + * Creates a RecognitionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1p1beta1.RecognitionConfig} RecognitionConfig + */ + RecognitionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1p1beta1.RecognitionConfig) + return object; + var message = new $root.google.cloud.speech.v1p1beta1.RecognitionConfig(); + switch (object.encoding) { + default: + if (typeof object.encoding === "number") { + message.encoding = object.encoding; + break; + } + break; + case "ENCODING_UNSPECIFIED": + case 0: + message.encoding = 0; + break; + case "LINEAR16": + case 1: + message.encoding = 1; + break; + case "FLAC": + case 2: + message.encoding = 2; + break; + case "MULAW": + case 3: + message.encoding = 3; + break; + case "AMR": + case 4: + message.encoding = 4; + break; + case "AMR_WB": + case 5: + message.encoding = 5; + break; + case "OGG_OPUS": + case 6: + message.encoding = 6; + break; + case "SPEEX_WITH_HEADER_BYTE": + case 7: + message.encoding = 7; + break; + case "MP3": + case 8: + message.encoding = 8; + break; + case "WEBM_OPUS": + case 9: + message.encoding = 9; + break; + case "ALAW": + case 10: + message.encoding = 10; + break; + } + if (object.sampleRateHertz != null) + message.sampleRateHertz = object.sampleRateHertz | 0; + if (object.audioChannelCount != null) + message.audioChannelCount = object.audioChannelCount | 0; + if (object.enableSeparateRecognitionPerChannel != null) + message.enableSeparateRecognitionPerChannel = Boolean(object.enableSeparateRecognitionPerChannel); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.alternativeLanguageCodes) { + if (!Array.isArray(object.alternativeLanguageCodes)) + throw TypeError(".google.cloud.speech.v1p1beta1.RecognitionConfig.alternativeLanguageCodes: array expected"); + message.alternativeLanguageCodes = []; + for (var i = 0; i < object.alternativeLanguageCodes.length; ++i) + message.alternativeLanguageCodes[i] = String(object.alternativeLanguageCodes[i]); + } + if (object.maxAlternatives != null) + message.maxAlternatives = object.maxAlternatives | 0; + if (object.profanityFilter != null) + message.profanityFilter = Boolean(object.profanityFilter); + if (object.adaptation != null) { + if (typeof object.adaptation !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.RecognitionConfig.adaptation: object expected"); + message.adaptation = $root.google.cloud.speech.v1p1beta1.SpeechAdaptation.fromObject(object.adaptation); + } + if (object.transcriptNormalization != null) { + if (typeof object.transcriptNormalization !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.RecognitionConfig.transcriptNormalization: object expected"); + message.transcriptNormalization = $root.google.cloud.speech.v1p1beta1.TranscriptNormalization.fromObject(object.transcriptNormalization); + } + if (object.speechContexts) { + if (!Array.isArray(object.speechContexts)) + throw TypeError(".google.cloud.speech.v1p1beta1.RecognitionConfig.speechContexts: array expected"); + message.speechContexts = []; + for (var i = 0; i < object.speechContexts.length; ++i) { + if (typeof object.speechContexts[i] !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.RecognitionConfig.speechContexts: object expected"); + message.speechContexts[i] = $root.google.cloud.speech.v1p1beta1.SpeechContext.fromObject(object.speechContexts[i]); + } + } + if (object.enableWordTimeOffsets != null) + message.enableWordTimeOffsets = Boolean(object.enableWordTimeOffsets); + if (object.enableWordConfidence != null) + message.enableWordConfidence = Boolean(object.enableWordConfidence); + if (object.enableAutomaticPunctuation != null) + message.enableAutomaticPunctuation = Boolean(object.enableAutomaticPunctuation); + if (object.enableSpokenPunctuation != null) { + if (typeof object.enableSpokenPunctuation !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.RecognitionConfig.enableSpokenPunctuation: object expected"); + message.enableSpokenPunctuation = $root.google.protobuf.BoolValue.fromObject(object.enableSpokenPunctuation); + } + if (object.enableSpokenEmojis != null) { + if (typeof object.enableSpokenEmojis !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.RecognitionConfig.enableSpokenEmojis: object expected"); + message.enableSpokenEmojis = $root.google.protobuf.BoolValue.fromObject(object.enableSpokenEmojis); + } + if (object.enableSpeakerDiarization != null) + message.enableSpeakerDiarization = Boolean(object.enableSpeakerDiarization); + if (object.diarizationSpeakerCount != null) + message.diarizationSpeakerCount = object.diarizationSpeakerCount | 0; + if (object.diarizationConfig != null) { + if (typeof object.diarizationConfig !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.RecognitionConfig.diarizationConfig: object expected"); + message.diarizationConfig = $root.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.fromObject(object.diarizationConfig); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.RecognitionConfig.metadata: object expected"); + message.metadata = $root.google.cloud.speech.v1p1beta1.RecognitionMetadata.fromObject(object.metadata); + } + if (object.model != null) + message.model = String(object.model); + if (object.useEnhanced != null) + message.useEnhanced = Boolean(object.useEnhanced); + return message; + }; + + /** + * Creates a plain object from a RecognitionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig + * @static + * @param {google.cloud.speech.v1p1beta1.RecognitionConfig} message RecognitionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RecognitionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.speechContexts = []; + object.alternativeLanguageCodes = []; + } + if (options.defaults) { + object.encoding = options.enums === String ? "ENCODING_UNSPECIFIED" : 0; + object.sampleRateHertz = 0; + object.languageCode = ""; + object.maxAlternatives = 0; + object.profanityFilter = false; + object.audioChannelCount = 0; + object.enableWordTimeOffsets = false; + object.metadata = null; + object.enableAutomaticPunctuation = false; + object.enableSeparateRecognitionPerChannel = false; + object.model = ""; + object.useEnhanced = false; + object.enableWordConfidence = false; + object.enableSpeakerDiarization = false; + object.diarizationSpeakerCount = 0; + object.diarizationConfig = null; + object.adaptation = null; + object.enableSpokenPunctuation = null; + object.enableSpokenEmojis = null; + object.transcriptNormalization = null; + } + if (message.encoding != null && message.hasOwnProperty("encoding")) + object.encoding = options.enums === String ? $root.google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding[message.encoding] === undefined ? message.encoding : $root.google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding[message.encoding] : message.encoding; + if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) + object.sampleRateHertz = message.sampleRateHertz; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.maxAlternatives != null && message.hasOwnProperty("maxAlternatives")) + object.maxAlternatives = message.maxAlternatives; + if (message.profanityFilter != null && message.hasOwnProperty("profanityFilter")) + object.profanityFilter = message.profanityFilter; + if (message.speechContexts && message.speechContexts.length) { + object.speechContexts = []; + for (var j = 0; j < message.speechContexts.length; ++j) + object.speechContexts[j] = $root.google.cloud.speech.v1p1beta1.SpeechContext.toObject(message.speechContexts[j], options); + } + if (message.audioChannelCount != null && message.hasOwnProperty("audioChannelCount")) + object.audioChannelCount = message.audioChannelCount; + if (message.enableWordTimeOffsets != null && message.hasOwnProperty("enableWordTimeOffsets")) + object.enableWordTimeOffsets = message.enableWordTimeOffsets; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.cloud.speech.v1p1beta1.RecognitionMetadata.toObject(message.metadata, options); + if (message.enableAutomaticPunctuation != null && message.hasOwnProperty("enableAutomaticPunctuation")) + object.enableAutomaticPunctuation = message.enableAutomaticPunctuation; + if (message.enableSeparateRecognitionPerChannel != null && message.hasOwnProperty("enableSeparateRecognitionPerChannel")) + object.enableSeparateRecognitionPerChannel = message.enableSeparateRecognitionPerChannel; + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.useEnhanced != null && message.hasOwnProperty("useEnhanced")) + object.useEnhanced = message.useEnhanced; + if (message.enableWordConfidence != null && message.hasOwnProperty("enableWordConfidence")) + object.enableWordConfidence = message.enableWordConfidence; + if (message.enableSpeakerDiarization != null && message.hasOwnProperty("enableSpeakerDiarization")) + object.enableSpeakerDiarization = message.enableSpeakerDiarization; + if (message.diarizationSpeakerCount != null && message.hasOwnProperty("diarizationSpeakerCount")) + object.diarizationSpeakerCount = message.diarizationSpeakerCount; + if (message.alternativeLanguageCodes && message.alternativeLanguageCodes.length) { + object.alternativeLanguageCodes = []; + for (var j = 0; j < message.alternativeLanguageCodes.length; ++j) + object.alternativeLanguageCodes[j] = message.alternativeLanguageCodes[j]; + } + if (message.diarizationConfig != null && message.hasOwnProperty("diarizationConfig")) + object.diarizationConfig = $root.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.toObject(message.diarizationConfig, options); + if (message.adaptation != null && message.hasOwnProperty("adaptation")) + object.adaptation = $root.google.cloud.speech.v1p1beta1.SpeechAdaptation.toObject(message.adaptation, options); + if (message.enableSpokenPunctuation != null && message.hasOwnProperty("enableSpokenPunctuation")) + object.enableSpokenPunctuation = $root.google.protobuf.BoolValue.toObject(message.enableSpokenPunctuation, options); + if (message.enableSpokenEmojis != null && message.hasOwnProperty("enableSpokenEmojis")) + object.enableSpokenEmojis = $root.google.protobuf.BoolValue.toObject(message.enableSpokenEmojis, options); + if (message.transcriptNormalization != null && message.hasOwnProperty("transcriptNormalization")) + object.transcriptNormalization = $root.google.cloud.speech.v1p1beta1.TranscriptNormalization.toObject(message.transcriptNormalization, options); + return object; + }; + + /** + * Converts this RecognitionConfig to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig + * @instance + * @returns {Object.} JSON object + */ + RecognitionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RecognitionConfig + * @function getTypeUrl + * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RecognitionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1p1beta1.RecognitionConfig"; + }; + + /** + * AudioEncoding enum. + * @name google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding + * @enum {number} + * @property {number} ENCODING_UNSPECIFIED=0 ENCODING_UNSPECIFIED value + * @property {number} LINEAR16=1 LINEAR16 value + * @property {number} FLAC=2 FLAC value + * @property {number} MULAW=3 MULAW value + * @property {number} AMR=4 AMR value + * @property {number} AMR_WB=5 AMR_WB value + * @property {number} OGG_OPUS=6 OGG_OPUS value + * @property {number} SPEEX_WITH_HEADER_BYTE=7 SPEEX_WITH_HEADER_BYTE value + * @property {number} MP3=8 MP3 value + * @property {number} WEBM_OPUS=9 WEBM_OPUS value + * @property {number} ALAW=10 ALAW value + */ + RecognitionConfig.AudioEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENCODING_UNSPECIFIED"] = 0; + values[valuesById[1] = "LINEAR16"] = 1; + values[valuesById[2] = "FLAC"] = 2; + values[valuesById[3] = "MULAW"] = 3; + values[valuesById[4] = "AMR"] = 4; + values[valuesById[5] = "AMR_WB"] = 5; + values[valuesById[6] = "OGG_OPUS"] = 6; + values[valuesById[7] = "SPEEX_WITH_HEADER_BYTE"] = 7; + values[valuesById[8] = "MP3"] = 8; + values[valuesById[9] = "WEBM_OPUS"] = 9; + values[valuesById[10] = "ALAW"] = 10; + return values; + })(); + + return RecognitionConfig; + })(); + + v1p1beta1.SpeakerDiarizationConfig = (function() { + + /** + * Properties of a SpeakerDiarizationConfig. + * @memberof google.cloud.speech.v1p1beta1 + * @interface ISpeakerDiarizationConfig + * @property {boolean|null} [enableSpeakerDiarization] SpeakerDiarizationConfig enableSpeakerDiarization + * @property {number|null} [minSpeakerCount] SpeakerDiarizationConfig minSpeakerCount + * @property {number|null} [maxSpeakerCount] SpeakerDiarizationConfig maxSpeakerCount + * @property {number|null} [speakerTag] SpeakerDiarizationConfig speakerTag + */ + + /** + * Constructs a new SpeakerDiarizationConfig. + * @memberof google.cloud.speech.v1p1beta1 + * @classdesc Represents a SpeakerDiarizationConfig. + * @implements ISpeakerDiarizationConfig + * @constructor + * @param {google.cloud.speech.v1p1beta1.ISpeakerDiarizationConfig=} [properties] Properties to set + */ + function SpeakerDiarizationConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpeakerDiarizationConfig enableSpeakerDiarization. + * @member {boolean} enableSpeakerDiarization + * @memberof google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig + * @instance + */ + SpeakerDiarizationConfig.prototype.enableSpeakerDiarization = false; + + /** + * SpeakerDiarizationConfig minSpeakerCount. + * @member {number} minSpeakerCount + * @memberof google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig + * @instance + */ + SpeakerDiarizationConfig.prototype.minSpeakerCount = 0; + + /** + * SpeakerDiarizationConfig maxSpeakerCount. + * @member {number} maxSpeakerCount + * @memberof google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig + * @instance + */ + SpeakerDiarizationConfig.prototype.maxSpeakerCount = 0; + + /** + * SpeakerDiarizationConfig speakerTag. + * @member {number} speakerTag + * @memberof google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig + * @instance + */ + SpeakerDiarizationConfig.prototype.speakerTag = 0; + + /** + * Creates a new SpeakerDiarizationConfig instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig + * @static + * @param {google.cloud.speech.v1p1beta1.ISpeakerDiarizationConfig=} [properties] Properties to set + * @returns {google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig} SpeakerDiarizationConfig instance + */ + SpeakerDiarizationConfig.create = function create(properties) { + return new SpeakerDiarizationConfig(properties); + }; + + /** + * Encodes the specified SpeakerDiarizationConfig message. Does not implicitly {@link google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig + * @static + * @param {google.cloud.speech.v1p1beta1.ISpeakerDiarizationConfig} message SpeakerDiarizationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeakerDiarizationConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableSpeakerDiarization != null && Object.hasOwnProperty.call(message, "enableSpeakerDiarization")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableSpeakerDiarization); + if (message.minSpeakerCount != null && Object.hasOwnProperty.call(message, "minSpeakerCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.minSpeakerCount); + if (message.maxSpeakerCount != null && Object.hasOwnProperty.call(message, "maxSpeakerCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.maxSpeakerCount); + if (message.speakerTag != null && Object.hasOwnProperty.call(message, "speakerTag")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.speakerTag); + return writer; + }; + + /** + * Encodes the specified SpeakerDiarizationConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig + * @static + * @param {google.cloud.speech.v1p1beta1.ISpeakerDiarizationConfig} message SpeakerDiarizationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeakerDiarizationConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpeakerDiarizationConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig} SpeakerDiarizationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeakerDiarizationConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enableSpeakerDiarization = reader.bool(); + break; + } + case 2: { + message.minSpeakerCount = reader.int32(); + break; + } + case 3: { + message.maxSpeakerCount = reader.int32(); + break; + } + case 5: { + message.speakerTag = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpeakerDiarizationConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig} SpeakerDiarizationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeakerDiarizationConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpeakerDiarizationConfig message. + * @function verify + * @memberof google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpeakerDiarizationConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enableSpeakerDiarization != null && message.hasOwnProperty("enableSpeakerDiarization")) + if (typeof message.enableSpeakerDiarization !== "boolean") + return "enableSpeakerDiarization: boolean expected"; + if (message.minSpeakerCount != null && message.hasOwnProperty("minSpeakerCount")) + if (!$util.isInteger(message.minSpeakerCount)) + return "minSpeakerCount: integer expected"; + if (message.maxSpeakerCount != null && message.hasOwnProperty("maxSpeakerCount")) + if (!$util.isInteger(message.maxSpeakerCount)) + return "maxSpeakerCount: integer expected"; + if (message.speakerTag != null && message.hasOwnProperty("speakerTag")) + if (!$util.isInteger(message.speakerTag)) + return "speakerTag: integer expected"; + return null; + }; + + /** + * Creates a SpeakerDiarizationConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig} SpeakerDiarizationConfig + */ + SpeakerDiarizationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig) + return object; + var message = new $root.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig(); + if (object.enableSpeakerDiarization != null) + message.enableSpeakerDiarization = Boolean(object.enableSpeakerDiarization); + if (object.minSpeakerCount != null) + message.minSpeakerCount = object.minSpeakerCount | 0; + if (object.maxSpeakerCount != null) + message.maxSpeakerCount = object.maxSpeakerCount | 0; + if (object.speakerTag != null) + message.speakerTag = object.speakerTag | 0; + return message; + }; + + /** + * Creates a plain object from a SpeakerDiarizationConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig + * @static + * @param {google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig} message SpeakerDiarizationConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpeakerDiarizationConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.enableSpeakerDiarization = false; + object.minSpeakerCount = 0; + object.maxSpeakerCount = 0; + object.speakerTag = 0; + } + if (message.enableSpeakerDiarization != null && message.hasOwnProperty("enableSpeakerDiarization")) + object.enableSpeakerDiarization = message.enableSpeakerDiarization; + if (message.minSpeakerCount != null && message.hasOwnProperty("minSpeakerCount")) + object.minSpeakerCount = message.minSpeakerCount; + if (message.maxSpeakerCount != null && message.hasOwnProperty("maxSpeakerCount")) + object.maxSpeakerCount = message.maxSpeakerCount; + if (message.speakerTag != null && message.hasOwnProperty("speakerTag")) + object.speakerTag = message.speakerTag; + return object; + }; + + /** + * Converts this SpeakerDiarizationConfig to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig + * @instance + * @returns {Object.} JSON object + */ + SpeakerDiarizationConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpeakerDiarizationConfig + * @function getTypeUrl + * @memberof google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpeakerDiarizationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig"; + }; + + return SpeakerDiarizationConfig; + })(); + + v1p1beta1.RecognitionMetadata = (function() { + + /** + * Properties of a RecognitionMetadata. + * @memberof google.cloud.speech.v1p1beta1 + * @interface IRecognitionMetadata + * @property {google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType|null} [interactionType] RecognitionMetadata interactionType + * @property {number|null} [industryNaicsCodeOfAudio] RecognitionMetadata industryNaicsCodeOfAudio + * @property {google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance|null} [microphoneDistance] RecognitionMetadata microphoneDistance + * @property {google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType|null} [originalMediaType] RecognitionMetadata originalMediaType + * @property {google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType|null} [recordingDeviceType] RecognitionMetadata recordingDeviceType + * @property {string|null} [recordingDeviceName] RecognitionMetadata recordingDeviceName + * @property {string|null} [originalMimeType] RecognitionMetadata originalMimeType + * @property {number|Long|null} [obfuscatedId] RecognitionMetadata obfuscatedId + * @property {string|null} [audioTopic] RecognitionMetadata audioTopic + */ + + /** + * Constructs a new RecognitionMetadata. + * @memberof google.cloud.speech.v1p1beta1 + * @classdesc Represents a RecognitionMetadata. + * @implements IRecognitionMetadata + * @constructor + * @param {google.cloud.speech.v1p1beta1.IRecognitionMetadata=} [properties] Properties to set + */ + function RecognitionMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RecognitionMetadata interactionType. + * @member {google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType} interactionType + * @memberof google.cloud.speech.v1p1beta1.RecognitionMetadata + * @instance + */ + RecognitionMetadata.prototype.interactionType = 0; + + /** + * RecognitionMetadata industryNaicsCodeOfAudio. + * @member {number} industryNaicsCodeOfAudio + * @memberof google.cloud.speech.v1p1beta1.RecognitionMetadata + * @instance + */ + RecognitionMetadata.prototype.industryNaicsCodeOfAudio = 0; + + /** + * RecognitionMetadata microphoneDistance. + * @member {google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance} microphoneDistance + * @memberof google.cloud.speech.v1p1beta1.RecognitionMetadata + * @instance + */ + RecognitionMetadata.prototype.microphoneDistance = 0; + + /** + * RecognitionMetadata originalMediaType. + * @member {google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType} originalMediaType + * @memberof google.cloud.speech.v1p1beta1.RecognitionMetadata + * @instance + */ + RecognitionMetadata.prototype.originalMediaType = 0; + + /** + * RecognitionMetadata recordingDeviceType. + * @member {google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType} recordingDeviceType + * @memberof google.cloud.speech.v1p1beta1.RecognitionMetadata + * @instance + */ + RecognitionMetadata.prototype.recordingDeviceType = 0; + + /** + * RecognitionMetadata recordingDeviceName. + * @member {string} recordingDeviceName + * @memberof google.cloud.speech.v1p1beta1.RecognitionMetadata + * @instance + */ + RecognitionMetadata.prototype.recordingDeviceName = ""; + + /** + * RecognitionMetadata originalMimeType. + * @member {string} originalMimeType + * @memberof google.cloud.speech.v1p1beta1.RecognitionMetadata + * @instance + */ + RecognitionMetadata.prototype.originalMimeType = ""; + + /** + * RecognitionMetadata obfuscatedId. + * @member {number|Long} obfuscatedId + * @memberof google.cloud.speech.v1p1beta1.RecognitionMetadata + * @instance + */ + RecognitionMetadata.prototype.obfuscatedId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * RecognitionMetadata audioTopic. + * @member {string} audioTopic + * @memberof google.cloud.speech.v1p1beta1.RecognitionMetadata + * @instance + */ + RecognitionMetadata.prototype.audioTopic = ""; + + /** + * Creates a new RecognitionMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1p1beta1.RecognitionMetadata + * @static + * @param {google.cloud.speech.v1p1beta1.IRecognitionMetadata=} [properties] Properties to set + * @returns {google.cloud.speech.v1p1beta1.RecognitionMetadata} RecognitionMetadata instance + */ + RecognitionMetadata.create = function create(properties) { + return new RecognitionMetadata(properties); + }; + + /** + * Encodes the specified RecognitionMetadata message. Does not implicitly {@link google.cloud.speech.v1p1beta1.RecognitionMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1p1beta1.RecognitionMetadata + * @static + * @param {google.cloud.speech.v1p1beta1.IRecognitionMetadata} message RecognitionMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecognitionMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.interactionType != null && Object.hasOwnProperty.call(message, "interactionType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.interactionType); + if (message.industryNaicsCodeOfAudio != null && Object.hasOwnProperty.call(message, "industryNaicsCodeOfAudio")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.industryNaicsCodeOfAudio); + if (message.microphoneDistance != null && Object.hasOwnProperty.call(message, "microphoneDistance")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.microphoneDistance); + if (message.originalMediaType != null && Object.hasOwnProperty.call(message, "originalMediaType")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.originalMediaType); + if (message.recordingDeviceType != null && Object.hasOwnProperty.call(message, "recordingDeviceType")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.recordingDeviceType); + if (message.recordingDeviceName != null && Object.hasOwnProperty.call(message, "recordingDeviceName")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.recordingDeviceName); + if (message.originalMimeType != null && Object.hasOwnProperty.call(message, "originalMimeType")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.originalMimeType); + if (message.obfuscatedId != null && Object.hasOwnProperty.call(message, "obfuscatedId")) + writer.uint32(/* id 9, wireType 0 =*/72).int64(message.obfuscatedId); + if (message.audioTopic != null && Object.hasOwnProperty.call(message, "audioTopic")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.audioTopic); + return writer; + }; + + /** + * Encodes the specified RecognitionMetadata message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.RecognitionMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1p1beta1.RecognitionMetadata + * @static + * @param {google.cloud.speech.v1p1beta1.IRecognitionMetadata} message RecognitionMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecognitionMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RecognitionMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1p1beta1.RecognitionMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1p1beta1.RecognitionMetadata} RecognitionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecognitionMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.RecognitionMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.interactionType = reader.int32(); + break; + } + case 3: { + message.industryNaicsCodeOfAudio = reader.uint32(); + break; + } + case 4: { + message.microphoneDistance = reader.int32(); + break; + } + case 5: { + message.originalMediaType = reader.int32(); + break; + } + case 6: { + message.recordingDeviceType = reader.int32(); + break; + } + case 7: { + message.recordingDeviceName = reader.string(); + break; + } + case 8: { + message.originalMimeType = reader.string(); + break; + } + case 9: { + message.obfuscatedId = reader.int64(); + break; + } + case 10: { + message.audioTopic = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RecognitionMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1p1beta1.RecognitionMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1p1beta1.RecognitionMetadata} RecognitionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecognitionMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RecognitionMetadata message. + * @function verify + * @memberof google.cloud.speech.v1p1beta1.RecognitionMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RecognitionMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.interactionType != null && message.hasOwnProperty("interactionType")) + switch (message.interactionType) { + default: + return "interactionType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + if (message.industryNaicsCodeOfAudio != null && message.hasOwnProperty("industryNaicsCodeOfAudio")) + if (!$util.isInteger(message.industryNaicsCodeOfAudio)) + return "industryNaicsCodeOfAudio: integer expected"; + if (message.microphoneDistance != null && message.hasOwnProperty("microphoneDistance")) + switch (message.microphoneDistance) { + default: + return "microphoneDistance: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.originalMediaType != null && message.hasOwnProperty("originalMediaType")) + switch (message.originalMediaType) { + default: + return "originalMediaType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.recordingDeviceType != null && message.hasOwnProperty("recordingDeviceType")) + switch (message.recordingDeviceType) { + default: + return "recordingDeviceType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.recordingDeviceName != null && message.hasOwnProperty("recordingDeviceName")) + if (!$util.isString(message.recordingDeviceName)) + return "recordingDeviceName: string expected"; + if (message.originalMimeType != null && message.hasOwnProperty("originalMimeType")) + if (!$util.isString(message.originalMimeType)) + return "originalMimeType: string expected"; + if (message.obfuscatedId != null && message.hasOwnProperty("obfuscatedId")) + if (!$util.isInteger(message.obfuscatedId) && !(message.obfuscatedId && $util.isInteger(message.obfuscatedId.low) && $util.isInteger(message.obfuscatedId.high))) + return "obfuscatedId: integer|Long expected"; + if (message.audioTopic != null && message.hasOwnProperty("audioTopic")) + if (!$util.isString(message.audioTopic)) + return "audioTopic: string expected"; + return null; + }; + + /** + * Creates a RecognitionMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1p1beta1.RecognitionMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1p1beta1.RecognitionMetadata} RecognitionMetadata + */ + RecognitionMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1p1beta1.RecognitionMetadata) + return object; + var message = new $root.google.cloud.speech.v1p1beta1.RecognitionMetadata(); + switch (object.interactionType) { + default: + if (typeof object.interactionType === "number") { + message.interactionType = object.interactionType; + break; + } + break; + case "INTERACTION_TYPE_UNSPECIFIED": + case 0: + message.interactionType = 0; + break; + case "DISCUSSION": + case 1: + message.interactionType = 1; + break; + case "PRESENTATION": + case 2: + message.interactionType = 2; + break; + case "PHONE_CALL": + case 3: + message.interactionType = 3; + break; + case "VOICEMAIL": + case 4: + message.interactionType = 4; + break; + case "PROFESSIONALLY_PRODUCED": + case 5: + message.interactionType = 5; + break; + case "VOICE_SEARCH": + case 6: + message.interactionType = 6; + break; + case "VOICE_COMMAND": + case 7: + message.interactionType = 7; + break; + case "DICTATION": + case 8: + message.interactionType = 8; + break; + } + if (object.industryNaicsCodeOfAudio != null) + message.industryNaicsCodeOfAudio = object.industryNaicsCodeOfAudio >>> 0; + switch (object.microphoneDistance) { + default: + if (typeof object.microphoneDistance === "number") { + message.microphoneDistance = object.microphoneDistance; + break; + } + break; + case "MICROPHONE_DISTANCE_UNSPECIFIED": + case 0: + message.microphoneDistance = 0; + break; + case "NEARFIELD": + case 1: + message.microphoneDistance = 1; + break; + case "MIDFIELD": + case 2: + message.microphoneDistance = 2; + break; + case "FARFIELD": + case 3: + message.microphoneDistance = 3; + break; + } + switch (object.originalMediaType) { + default: + if (typeof object.originalMediaType === "number") { + message.originalMediaType = object.originalMediaType; + break; + } + break; + case "ORIGINAL_MEDIA_TYPE_UNSPECIFIED": + case 0: + message.originalMediaType = 0; + break; + case "AUDIO": + case 1: + message.originalMediaType = 1; + break; + case "VIDEO": + case 2: + message.originalMediaType = 2; + break; + } + switch (object.recordingDeviceType) { + default: + if (typeof object.recordingDeviceType === "number") { + message.recordingDeviceType = object.recordingDeviceType; + break; + } + break; + case "RECORDING_DEVICE_TYPE_UNSPECIFIED": + case 0: + message.recordingDeviceType = 0; + break; + case "SMARTPHONE": + case 1: + message.recordingDeviceType = 1; + break; + case "PC": + case 2: + message.recordingDeviceType = 2; + break; + case "PHONE_LINE": + case 3: + message.recordingDeviceType = 3; + break; + case "VEHICLE": + case 4: + message.recordingDeviceType = 4; + break; + case "OTHER_OUTDOOR_DEVICE": + case 5: + message.recordingDeviceType = 5; + break; + case "OTHER_INDOOR_DEVICE": + case 6: + message.recordingDeviceType = 6; + break; + } + if (object.recordingDeviceName != null) + message.recordingDeviceName = String(object.recordingDeviceName); + if (object.originalMimeType != null) + message.originalMimeType = String(object.originalMimeType); + if (object.obfuscatedId != null) + if ($util.Long) + (message.obfuscatedId = $util.Long.fromValue(object.obfuscatedId)).unsigned = false; + else if (typeof object.obfuscatedId === "string") + message.obfuscatedId = parseInt(object.obfuscatedId, 10); + else if (typeof object.obfuscatedId === "number") + message.obfuscatedId = object.obfuscatedId; + else if (typeof object.obfuscatedId === "object") + message.obfuscatedId = new $util.LongBits(object.obfuscatedId.low >>> 0, object.obfuscatedId.high >>> 0).toNumber(); + if (object.audioTopic != null) + message.audioTopic = String(object.audioTopic); + return message; + }; + + /** + * Creates a plain object from a RecognitionMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1p1beta1.RecognitionMetadata + * @static + * @param {google.cloud.speech.v1p1beta1.RecognitionMetadata} message RecognitionMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RecognitionMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.interactionType = options.enums === String ? "INTERACTION_TYPE_UNSPECIFIED" : 0; + object.industryNaicsCodeOfAudio = 0; + object.microphoneDistance = options.enums === String ? "MICROPHONE_DISTANCE_UNSPECIFIED" : 0; + object.originalMediaType = options.enums === String ? "ORIGINAL_MEDIA_TYPE_UNSPECIFIED" : 0; + object.recordingDeviceType = options.enums === String ? "RECORDING_DEVICE_TYPE_UNSPECIFIED" : 0; + object.recordingDeviceName = ""; + object.originalMimeType = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.obfuscatedId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.obfuscatedId = options.longs === String ? "0" : 0; + object.audioTopic = ""; + } + if (message.interactionType != null && message.hasOwnProperty("interactionType")) + object.interactionType = options.enums === String ? $root.google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType[message.interactionType] === undefined ? message.interactionType : $root.google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType[message.interactionType] : message.interactionType; + if (message.industryNaicsCodeOfAudio != null && message.hasOwnProperty("industryNaicsCodeOfAudio")) + object.industryNaicsCodeOfAudio = message.industryNaicsCodeOfAudio; + if (message.microphoneDistance != null && message.hasOwnProperty("microphoneDistance")) + object.microphoneDistance = options.enums === String ? $root.google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance[message.microphoneDistance] === undefined ? message.microphoneDistance : $root.google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance[message.microphoneDistance] : message.microphoneDistance; + if (message.originalMediaType != null && message.hasOwnProperty("originalMediaType")) + object.originalMediaType = options.enums === String ? $root.google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType[message.originalMediaType] === undefined ? message.originalMediaType : $root.google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType[message.originalMediaType] : message.originalMediaType; + if (message.recordingDeviceType != null && message.hasOwnProperty("recordingDeviceType")) + object.recordingDeviceType = options.enums === String ? $root.google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType[message.recordingDeviceType] === undefined ? message.recordingDeviceType : $root.google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType[message.recordingDeviceType] : message.recordingDeviceType; + if (message.recordingDeviceName != null && message.hasOwnProperty("recordingDeviceName")) + object.recordingDeviceName = message.recordingDeviceName; + if (message.originalMimeType != null && message.hasOwnProperty("originalMimeType")) + object.originalMimeType = message.originalMimeType; + if (message.obfuscatedId != null && message.hasOwnProperty("obfuscatedId")) + if (typeof message.obfuscatedId === "number") + object.obfuscatedId = options.longs === String ? String(message.obfuscatedId) : message.obfuscatedId; + else + object.obfuscatedId = options.longs === String ? $util.Long.prototype.toString.call(message.obfuscatedId) : options.longs === Number ? new $util.LongBits(message.obfuscatedId.low >>> 0, message.obfuscatedId.high >>> 0).toNumber() : message.obfuscatedId; + if (message.audioTopic != null && message.hasOwnProperty("audioTopic")) + object.audioTopic = message.audioTopic; + return object; + }; + + /** + * Converts this RecognitionMetadata to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1p1beta1.RecognitionMetadata + * @instance + * @returns {Object.} JSON object + */ + RecognitionMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RecognitionMetadata + * @function getTypeUrl + * @memberof google.cloud.speech.v1p1beta1.RecognitionMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RecognitionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1p1beta1.RecognitionMetadata"; + }; + + /** + * InteractionType enum. + * @name google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType + * @enum {number} + * @property {number} INTERACTION_TYPE_UNSPECIFIED=0 INTERACTION_TYPE_UNSPECIFIED value + * @property {number} DISCUSSION=1 DISCUSSION value + * @property {number} PRESENTATION=2 PRESENTATION value + * @property {number} PHONE_CALL=3 PHONE_CALL value + * @property {number} VOICEMAIL=4 VOICEMAIL value + * @property {number} PROFESSIONALLY_PRODUCED=5 PROFESSIONALLY_PRODUCED value + * @property {number} VOICE_SEARCH=6 VOICE_SEARCH value + * @property {number} VOICE_COMMAND=7 VOICE_COMMAND value + * @property {number} DICTATION=8 DICTATION value + */ + RecognitionMetadata.InteractionType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INTERACTION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DISCUSSION"] = 1; + values[valuesById[2] = "PRESENTATION"] = 2; + values[valuesById[3] = "PHONE_CALL"] = 3; + values[valuesById[4] = "VOICEMAIL"] = 4; + values[valuesById[5] = "PROFESSIONALLY_PRODUCED"] = 5; + values[valuesById[6] = "VOICE_SEARCH"] = 6; + values[valuesById[7] = "VOICE_COMMAND"] = 7; + values[valuesById[8] = "DICTATION"] = 8; + return values; + })(); + + /** + * MicrophoneDistance enum. + * @name google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance + * @enum {number} + * @property {number} MICROPHONE_DISTANCE_UNSPECIFIED=0 MICROPHONE_DISTANCE_UNSPECIFIED value + * @property {number} NEARFIELD=1 NEARFIELD value + * @property {number} MIDFIELD=2 MIDFIELD value + * @property {number} FARFIELD=3 FARFIELD value + */ + RecognitionMetadata.MicrophoneDistance = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MICROPHONE_DISTANCE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NEARFIELD"] = 1; + values[valuesById[2] = "MIDFIELD"] = 2; + values[valuesById[3] = "FARFIELD"] = 3; + return values; + })(); + + /** + * OriginalMediaType enum. + * @name google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType + * @enum {number} + * @property {number} ORIGINAL_MEDIA_TYPE_UNSPECIFIED=0 ORIGINAL_MEDIA_TYPE_UNSPECIFIED value + * @property {number} AUDIO=1 AUDIO value + * @property {number} VIDEO=2 VIDEO value + */ + RecognitionMetadata.OriginalMediaType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ORIGINAL_MEDIA_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "AUDIO"] = 1; + values[valuesById[2] = "VIDEO"] = 2; + return values; + })(); + + /** + * RecordingDeviceType enum. + * @name google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType + * @enum {number} + * @property {number} RECORDING_DEVICE_TYPE_UNSPECIFIED=0 RECORDING_DEVICE_TYPE_UNSPECIFIED value + * @property {number} SMARTPHONE=1 SMARTPHONE value + * @property {number} PC=2 PC value + * @property {number} PHONE_LINE=3 PHONE_LINE value + * @property {number} VEHICLE=4 VEHICLE value + * @property {number} OTHER_OUTDOOR_DEVICE=5 OTHER_OUTDOOR_DEVICE value + * @property {number} OTHER_INDOOR_DEVICE=6 OTHER_INDOOR_DEVICE value + */ + RecognitionMetadata.RecordingDeviceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RECORDING_DEVICE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SMARTPHONE"] = 1; + values[valuesById[2] = "PC"] = 2; + values[valuesById[3] = "PHONE_LINE"] = 3; + values[valuesById[4] = "VEHICLE"] = 4; + values[valuesById[5] = "OTHER_OUTDOOR_DEVICE"] = 5; + values[valuesById[6] = "OTHER_INDOOR_DEVICE"] = 6; + return values; + })(); + + return RecognitionMetadata; + })(); + + v1p1beta1.SpeechContext = (function() { + + /** + * Properties of a SpeechContext. + * @memberof google.cloud.speech.v1p1beta1 + * @interface ISpeechContext + * @property {Array.|null} [phrases] SpeechContext phrases + * @property {number|null} [boost] SpeechContext boost + */ + + /** + * Constructs a new SpeechContext. + * @memberof google.cloud.speech.v1p1beta1 + * @classdesc Represents a SpeechContext. + * @implements ISpeechContext + * @constructor + * @param {google.cloud.speech.v1p1beta1.ISpeechContext=} [properties] Properties to set + */ + function SpeechContext(properties) { + this.phrases = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpeechContext phrases. + * @member {Array.} phrases + * @memberof google.cloud.speech.v1p1beta1.SpeechContext + * @instance + */ + SpeechContext.prototype.phrases = $util.emptyArray; + + /** + * SpeechContext boost. + * @member {number} boost + * @memberof google.cloud.speech.v1p1beta1.SpeechContext + * @instance + */ + SpeechContext.prototype.boost = 0; + + /** + * Creates a new SpeechContext instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1p1beta1.SpeechContext + * @static + * @param {google.cloud.speech.v1p1beta1.ISpeechContext=} [properties] Properties to set + * @returns {google.cloud.speech.v1p1beta1.SpeechContext} SpeechContext instance + */ + SpeechContext.create = function create(properties) { + return new SpeechContext(properties); + }; + + /** + * Encodes the specified SpeechContext message. Does not implicitly {@link google.cloud.speech.v1p1beta1.SpeechContext.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1p1beta1.SpeechContext + * @static + * @param {google.cloud.speech.v1p1beta1.ISpeechContext} message SpeechContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechContext.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.phrases != null && message.phrases.length) + for (var i = 0; i < message.phrases.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.phrases[i]); + if (message.boost != null && Object.hasOwnProperty.call(message, "boost")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.boost); + return writer; + }; + + /** + * Encodes the specified SpeechContext message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.SpeechContext.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1p1beta1.SpeechContext + * @static + * @param {google.cloud.speech.v1p1beta1.ISpeechContext} message SpeechContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechContext.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpeechContext message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1p1beta1.SpeechContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1p1beta1.SpeechContext} SpeechContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechContext.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.SpeechContext(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.phrases && message.phrases.length)) + message.phrases = []; + message.phrases.push(reader.string()); + break; + } + case 4: { + message.boost = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpeechContext message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1p1beta1.SpeechContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1p1beta1.SpeechContext} SpeechContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechContext.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpeechContext message. + * @function verify + * @memberof google.cloud.speech.v1p1beta1.SpeechContext + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpeechContext.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.phrases != null && message.hasOwnProperty("phrases")) { + if (!Array.isArray(message.phrases)) + return "phrases: array expected"; + for (var i = 0; i < message.phrases.length; ++i) + if (!$util.isString(message.phrases[i])) + return "phrases: string[] expected"; + } + if (message.boost != null && message.hasOwnProperty("boost")) + if (typeof message.boost !== "number") + return "boost: number expected"; + return null; + }; + + /** + * Creates a SpeechContext message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1p1beta1.SpeechContext + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1p1beta1.SpeechContext} SpeechContext + */ + SpeechContext.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1p1beta1.SpeechContext) + return object; + var message = new $root.google.cloud.speech.v1p1beta1.SpeechContext(); + if (object.phrases) { + if (!Array.isArray(object.phrases)) + throw TypeError(".google.cloud.speech.v1p1beta1.SpeechContext.phrases: array expected"); + message.phrases = []; + for (var i = 0; i < object.phrases.length; ++i) + message.phrases[i] = String(object.phrases[i]); + } + if (object.boost != null) + message.boost = Number(object.boost); + return message; + }; + + /** + * Creates a plain object from a SpeechContext message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1p1beta1.SpeechContext + * @static + * @param {google.cloud.speech.v1p1beta1.SpeechContext} message SpeechContext + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpeechContext.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.phrases = []; + if (options.defaults) + object.boost = 0; + if (message.phrases && message.phrases.length) { + object.phrases = []; + for (var j = 0; j < message.phrases.length; ++j) + object.phrases[j] = message.phrases[j]; + } + if (message.boost != null && message.hasOwnProperty("boost")) + object.boost = options.json && !isFinite(message.boost) ? String(message.boost) : message.boost; + return object; + }; + + /** + * Converts this SpeechContext to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1p1beta1.SpeechContext + * @instance + * @returns {Object.} JSON object + */ + SpeechContext.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpeechContext + * @function getTypeUrl + * @memberof google.cloud.speech.v1p1beta1.SpeechContext + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpeechContext.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1p1beta1.SpeechContext"; + }; + + return SpeechContext; + })(); + + v1p1beta1.RecognitionAudio = (function() { + + /** + * Properties of a RecognitionAudio. + * @memberof google.cloud.speech.v1p1beta1 + * @interface IRecognitionAudio + * @property {Uint8Array|null} [content] RecognitionAudio content + * @property {string|null} [uri] RecognitionAudio uri + */ + + /** + * Constructs a new RecognitionAudio. + * @memberof google.cloud.speech.v1p1beta1 + * @classdesc Represents a RecognitionAudio. + * @implements IRecognitionAudio + * @constructor + * @param {google.cloud.speech.v1p1beta1.IRecognitionAudio=} [properties] Properties to set + */ + function RecognitionAudio(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RecognitionAudio content. + * @member {Uint8Array|null|undefined} content + * @memberof google.cloud.speech.v1p1beta1.RecognitionAudio + * @instance + */ + RecognitionAudio.prototype.content = null; + + /** + * RecognitionAudio uri. + * @member {string|null|undefined} uri + * @memberof google.cloud.speech.v1p1beta1.RecognitionAudio + * @instance + */ + RecognitionAudio.prototype.uri = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RecognitionAudio audioSource. + * @member {"content"|"uri"|undefined} audioSource + * @memberof google.cloud.speech.v1p1beta1.RecognitionAudio + * @instance + */ + Object.defineProperty(RecognitionAudio.prototype, "audioSource", { + get: $util.oneOfGetter($oneOfFields = ["content", "uri"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RecognitionAudio instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1p1beta1.RecognitionAudio + * @static + * @param {google.cloud.speech.v1p1beta1.IRecognitionAudio=} [properties] Properties to set + * @returns {google.cloud.speech.v1p1beta1.RecognitionAudio} RecognitionAudio instance + */ + RecognitionAudio.create = function create(properties) { + return new RecognitionAudio(properties); + }; + + /** + * Encodes the specified RecognitionAudio message. Does not implicitly {@link google.cloud.speech.v1p1beta1.RecognitionAudio.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1p1beta1.RecognitionAudio + * @static + * @param {google.cloud.speech.v1p1beta1.IRecognitionAudio} message RecognitionAudio message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecognitionAudio.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.content); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uri); + return writer; + }; + + /** + * Encodes the specified RecognitionAudio message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.RecognitionAudio.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1p1beta1.RecognitionAudio + * @static + * @param {google.cloud.speech.v1p1beta1.IRecognitionAudio} message RecognitionAudio message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecognitionAudio.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RecognitionAudio message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1p1beta1.RecognitionAudio + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1p1beta1.RecognitionAudio} RecognitionAudio + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecognitionAudio.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.RecognitionAudio(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.content = reader.bytes(); + break; + } + case 2: { + message.uri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RecognitionAudio message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1p1beta1.RecognitionAudio + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1p1beta1.RecognitionAudio} RecognitionAudio + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecognitionAudio.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RecognitionAudio message. + * @function verify + * @memberof google.cloud.speech.v1p1beta1.RecognitionAudio + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RecognitionAudio.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.content != null && message.hasOwnProperty("content")) { + properties.audioSource = 1; + if (!(message.content && typeof message.content.length === "number" || $util.isString(message.content))) + return "content: buffer expected"; + } + if (message.uri != null && message.hasOwnProperty("uri")) { + if (properties.audioSource === 1) + return "audioSource: multiple values"; + properties.audioSource = 1; + if (!$util.isString(message.uri)) + return "uri: string expected"; + } + return null; + }; + + /** + * Creates a RecognitionAudio message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1p1beta1.RecognitionAudio + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1p1beta1.RecognitionAudio} RecognitionAudio + */ + RecognitionAudio.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1p1beta1.RecognitionAudio) + return object; + var message = new $root.google.cloud.speech.v1p1beta1.RecognitionAudio(); + if (object.content != null) + if (typeof object.content === "string") + $util.base64.decode(object.content, message.content = $util.newBuffer($util.base64.length(object.content)), 0); + else if (object.content.length >= 0) + message.content = object.content; + if (object.uri != null) + message.uri = String(object.uri); + return message; + }; + + /** + * Creates a plain object from a RecognitionAudio message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1p1beta1.RecognitionAudio + * @static + * @param {google.cloud.speech.v1p1beta1.RecognitionAudio} message RecognitionAudio + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RecognitionAudio.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.content != null && message.hasOwnProperty("content")) { + object.content = options.bytes === String ? $util.base64.encode(message.content, 0, message.content.length) : options.bytes === Array ? Array.prototype.slice.call(message.content) : message.content; + if (options.oneofs) + object.audioSource = "content"; + } + if (message.uri != null && message.hasOwnProperty("uri")) { + object.uri = message.uri; + if (options.oneofs) + object.audioSource = "uri"; + } + return object; + }; + + /** + * Converts this RecognitionAudio to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1p1beta1.RecognitionAudio + * @instance + * @returns {Object.} JSON object + */ + RecognitionAudio.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RecognitionAudio + * @function getTypeUrl + * @memberof google.cloud.speech.v1p1beta1.RecognitionAudio + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RecognitionAudio.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1p1beta1.RecognitionAudio"; + }; + + return RecognitionAudio; + })(); + + v1p1beta1.RecognizeResponse = (function() { + + /** + * Properties of a RecognizeResponse. + * @memberof google.cloud.speech.v1p1beta1 + * @interface IRecognizeResponse + * @property {Array.|null} [results] RecognizeResponse results + * @property {google.protobuf.IDuration|null} [totalBilledTime] RecognizeResponse totalBilledTime + * @property {google.cloud.speech.v1p1beta1.ISpeechAdaptationInfo|null} [speechAdaptationInfo] RecognizeResponse speechAdaptationInfo + * @property {number|Long|null} [requestId] RecognizeResponse requestId + * @property {boolean|null} [usingLegacyModels] RecognizeResponse usingLegacyModels + */ + + /** + * Constructs a new RecognizeResponse. + * @memberof google.cloud.speech.v1p1beta1 + * @classdesc Represents a RecognizeResponse. + * @implements IRecognizeResponse + * @constructor + * @param {google.cloud.speech.v1p1beta1.IRecognizeResponse=} [properties] Properties to set + */ + function RecognizeResponse(properties) { + this.results = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RecognizeResponse results. + * @member {Array.} results + * @memberof google.cloud.speech.v1p1beta1.RecognizeResponse + * @instance + */ + RecognizeResponse.prototype.results = $util.emptyArray; + + /** + * RecognizeResponse totalBilledTime. + * @member {google.protobuf.IDuration|null|undefined} totalBilledTime + * @memberof google.cloud.speech.v1p1beta1.RecognizeResponse + * @instance + */ + RecognizeResponse.prototype.totalBilledTime = null; + + /** + * RecognizeResponse speechAdaptationInfo. + * @member {google.cloud.speech.v1p1beta1.ISpeechAdaptationInfo|null|undefined} speechAdaptationInfo + * @memberof google.cloud.speech.v1p1beta1.RecognizeResponse + * @instance + */ + RecognizeResponse.prototype.speechAdaptationInfo = null; + + /** + * RecognizeResponse requestId. + * @member {number|Long} requestId + * @memberof google.cloud.speech.v1p1beta1.RecognizeResponse + * @instance + */ + RecognizeResponse.prototype.requestId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * RecognizeResponse usingLegacyModels. + * @member {boolean} usingLegacyModels + * @memberof google.cloud.speech.v1p1beta1.RecognizeResponse + * @instance + */ + RecognizeResponse.prototype.usingLegacyModels = false; + + /** + * Creates a new RecognizeResponse instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1p1beta1.RecognizeResponse + * @static + * @param {google.cloud.speech.v1p1beta1.IRecognizeResponse=} [properties] Properties to set + * @returns {google.cloud.speech.v1p1beta1.RecognizeResponse} RecognizeResponse instance + */ + RecognizeResponse.create = function create(properties) { + return new RecognizeResponse(properties); + }; + + /** + * Encodes the specified RecognizeResponse message. Does not implicitly {@link google.cloud.speech.v1p1beta1.RecognizeResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1p1beta1.RecognizeResponse + * @static + * @param {google.cloud.speech.v1p1beta1.IRecognizeResponse} message RecognizeResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecognizeResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.results != null && message.results.length) + for (var i = 0; i < message.results.length; ++i) + $root.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.encode(message.results[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.totalBilledTime != null && Object.hasOwnProperty.call(message, "totalBilledTime")) + $root.google.protobuf.Duration.encode(message.totalBilledTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.speechAdaptationInfo != null && Object.hasOwnProperty.call(message, "speechAdaptationInfo")) + $root.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo.encode(message.speechAdaptationInfo, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 8, wireType 0 =*/64).int64(message.requestId); + if (message.usingLegacyModels != null && Object.hasOwnProperty.call(message, "usingLegacyModels")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.usingLegacyModels); + return writer; + }; + + /** + * Encodes the specified RecognizeResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.RecognizeResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1p1beta1.RecognizeResponse + * @static + * @param {google.cloud.speech.v1p1beta1.IRecognizeResponse} message RecognizeResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecognizeResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RecognizeResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1p1beta1.RecognizeResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1p1beta1.RecognizeResponse} RecognizeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecognizeResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.RecognizeResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.results && message.results.length)) + message.results = []; + message.results.push($root.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.decode(reader, reader.uint32())); + break; + } + case 3: { + message.totalBilledTime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 7: { + message.speechAdaptationInfo = $root.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo.decode(reader, reader.uint32()); + break; + } + case 8: { + message.requestId = reader.int64(); + break; + } + case 9: { + message.usingLegacyModels = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RecognizeResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1p1beta1.RecognizeResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1p1beta1.RecognizeResponse} RecognizeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecognizeResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RecognizeResponse message. + * @function verify + * @memberof google.cloud.speech.v1p1beta1.RecognizeResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RecognizeResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.results != null && message.hasOwnProperty("results")) { + if (!Array.isArray(message.results)) + return "results: array expected"; + for (var i = 0; i < message.results.length; ++i) { + var error = $root.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.verify(message.results[i]); + if (error) + return "results." + error; + } + } + if (message.totalBilledTime != null && message.hasOwnProperty("totalBilledTime")) { + var error = $root.google.protobuf.Duration.verify(message.totalBilledTime); + if (error) + return "totalBilledTime." + error; + } + if (message.speechAdaptationInfo != null && message.hasOwnProperty("speechAdaptationInfo")) { + var error = $root.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo.verify(message.speechAdaptationInfo); + if (error) + return "speechAdaptationInfo." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isInteger(message.requestId) && !(message.requestId && $util.isInteger(message.requestId.low) && $util.isInteger(message.requestId.high))) + return "requestId: integer|Long expected"; + if (message.usingLegacyModels != null && message.hasOwnProperty("usingLegacyModels")) + if (typeof message.usingLegacyModels !== "boolean") + return "usingLegacyModels: boolean expected"; + return null; + }; + + /** + * Creates a RecognizeResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1p1beta1.RecognizeResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1p1beta1.RecognizeResponse} RecognizeResponse + */ + RecognizeResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1p1beta1.RecognizeResponse) + return object; + var message = new $root.google.cloud.speech.v1p1beta1.RecognizeResponse(); + if (object.results) { + if (!Array.isArray(object.results)) + throw TypeError(".google.cloud.speech.v1p1beta1.RecognizeResponse.results: array expected"); + message.results = []; + for (var i = 0; i < object.results.length; ++i) { + if (typeof object.results[i] !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.RecognizeResponse.results: object expected"); + message.results[i] = $root.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.fromObject(object.results[i]); + } + } + if (object.totalBilledTime != null) { + if (typeof object.totalBilledTime !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.RecognizeResponse.totalBilledTime: object expected"); + message.totalBilledTime = $root.google.protobuf.Duration.fromObject(object.totalBilledTime); + } + if (object.speechAdaptationInfo != null) { + if (typeof object.speechAdaptationInfo !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.RecognizeResponse.speechAdaptationInfo: object expected"); + message.speechAdaptationInfo = $root.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo.fromObject(object.speechAdaptationInfo); + } + if (object.requestId != null) + if ($util.Long) + (message.requestId = $util.Long.fromValue(object.requestId)).unsigned = false; + else if (typeof object.requestId === "string") + message.requestId = parseInt(object.requestId, 10); + else if (typeof object.requestId === "number") + message.requestId = object.requestId; + else if (typeof object.requestId === "object") + message.requestId = new $util.LongBits(object.requestId.low >>> 0, object.requestId.high >>> 0).toNumber(); + if (object.usingLegacyModels != null) + message.usingLegacyModels = Boolean(object.usingLegacyModels); + return message; + }; + + /** + * Creates a plain object from a RecognizeResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1p1beta1.RecognizeResponse + * @static + * @param {google.cloud.speech.v1p1beta1.RecognizeResponse} message RecognizeResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RecognizeResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.results = []; + if (options.defaults) { + object.totalBilledTime = null; + object.speechAdaptationInfo = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.requestId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.requestId = options.longs === String ? "0" : 0; + object.usingLegacyModels = false; + } + if (message.results && message.results.length) { + object.results = []; + for (var j = 0; j < message.results.length; ++j) + object.results[j] = $root.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.toObject(message.results[j], options); + } + if (message.totalBilledTime != null && message.hasOwnProperty("totalBilledTime")) + object.totalBilledTime = $root.google.protobuf.Duration.toObject(message.totalBilledTime, options); + if (message.speechAdaptationInfo != null && message.hasOwnProperty("speechAdaptationInfo")) + object.speechAdaptationInfo = $root.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo.toObject(message.speechAdaptationInfo, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (typeof message.requestId === "number") + object.requestId = options.longs === String ? String(message.requestId) : message.requestId; + else + object.requestId = options.longs === String ? $util.Long.prototype.toString.call(message.requestId) : options.longs === Number ? new $util.LongBits(message.requestId.low >>> 0, message.requestId.high >>> 0).toNumber() : message.requestId; + if (message.usingLegacyModels != null && message.hasOwnProperty("usingLegacyModels")) + object.usingLegacyModels = message.usingLegacyModels; + return object; + }; + + /** + * Converts this RecognizeResponse to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1p1beta1.RecognizeResponse + * @instance + * @returns {Object.} JSON object + */ + RecognizeResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RecognizeResponse + * @function getTypeUrl + * @memberof google.cloud.speech.v1p1beta1.RecognizeResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RecognizeResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1p1beta1.RecognizeResponse"; + }; + + return RecognizeResponse; + })(); + + v1p1beta1.LongRunningRecognizeResponse = (function() { + + /** + * Properties of a LongRunningRecognizeResponse. + * @memberof google.cloud.speech.v1p1beta1 + * @interface ILongRunningRecognizeResponse + * @property {Array.|null} [results] LongRunningRecognizeResponse results + * @property {google.protobuf.IDuration|null} [totalBilledTime] LongRunningRecognizeResponse totalBilledTime + * @property {google.cloud.speech.v1p1beta1.ITranscriptOutputConfig|null} [outputConfig] LongRunningRecognizeResponse outputConfig + * @property {google.rpc.IStatus|null} [outputError] LongRunningRecognizeResponse outputError + * @property {google.cloud.speech.v1p1beta1.ISpeechAdaptationInfo|null} [speechAdaptationInfo] LongRunningRecognizeResponse speechAdaptationInfo + * @property {number|Long|null} [requestId] LongRunningRecognizeResponse requestId + */ + + /** + * Constructs a new LongRunningRecognizeResponse. + * @memberof google.cloud.speech.v1p1beta1 + * @classdesc Represents a LongRunningRecognizeResponse. + * @implements ILongRunningRecognizeResponse + * @constructor + * @param {google.cloud.speech.v1p1beta1.ILongRunningRecognizeResponse=} [properties] Properties to set + */ + function LongRunningRecognizeResponse(properties) { + this.results = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LongRunningRecognizeResponse results. + * @member {Array.} results + * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse + * @instance + */ + LongRunningRecognizeResponse.prototype.results = $util.emptyArray; + + /** + * LongRunningRecognizeResponse totalBilledTime. + * @member {google.protobuf.IDuration|null|undefined} totalBilledTime + * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse + * @instance + */ + LongRunningRecognizeResponse.prototype.totalBilledTime = null; + + /** + * LongRunningRecognizeResponse outputConfig. + * @member {google.cloud.speech.v1p1beta1.ITranscriptOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse + * @instance + */ + LongRunningRecognizeResponse.prototype.outputConfig = null; + + /** + * LongRunningRecognizeResponse outputError. + * @member {google.rpc.IStatus|null|undefined} outputError + * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse + * @instance + */ + LongRunningRecognizeResponse.prototype.outputError = null; + + /** + * LongRunningRecognizeResponse speechAdaptationInfo. + * @member {google.cloud.speech.v1p1beta1.ISpeechAdaptationInfo|null|undefined} speechAdaptationInfo + * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse + * @instance + */ + LongRunningRecognizeResponse.prototype.speechAdaptationInfo = null; + + /** + * LongRunningRecognizeResponse requestId. + * @member {number|Long} requestId + * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse + * @instance + */ + LongRunningRecognizeResponse.prototype.requestId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new LongRunningRecognizeResponse instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse + * @static + * @param {google.cloud.speech.v1p1beta1.ILongRunningRecognizeResponse=} [properties] Properties to set + * @returns {google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse} LongRunningRecognizeResponse instance + */ + LongRunningRecognizeResponse.create = function create(properties) { + return new LongRunningRecognizeResponse(properties); + }; + + /** + * Encodes the specified LongRunningRecognizeResponse message. Does not implicitly {@link google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse + * @static + * @param {google.cloud.speech.v1p1beta1.ILongRunningRecognizeResponse} message LongRunningRecognizeResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunningRecognizeResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.results != null && message.results.length) + for (var i = 0; i < message.results.length; ++i) + $root.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.encode(message.results[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.totalBilledTime != null && Object.hasOwnProperty.call(message, "totalBilledTime")) + $root.google.protobuf.Duration.encode(message.totalBilledTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) + $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.encode(message.outputConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.outputError != null && Object.hasOwnProperty.call(message, "outputError")) + $root.google.rpc.Status.encode(message.outputError, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.speechAdaptationInfo != null && Object.hasOwnProperty.call(message, "speechAdaptationInfo")) + $root.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo.encode(message.speechAdaptationInfo, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 9, wireType 0 =*/72).int64(message.requestId); + return writer; + }; + + /** + * Encodes the specified LongRunningRecognizeResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse + * @static + * @param {google.cloud.speech.v1p1beta1.ILongRunningRecognizeResponse} message LongRunningRecognizeResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunningRecognizeResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LongRunningRecognizeResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse} LongRunningRecognizeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunningRecognizeResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.results && message.results.length)) + message.results = []; + message.results.push($root.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.decode(reader, reader.uint32())); + break; + } + case 3: { + message.totalBilledTime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 6: { + message.outputConfig = $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.decode(reader, reader.uint32()); + break; + } + case 7: { + message.outputError = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 8: { + message.speechAdaptationInfo = $root.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo.decode(reader, reader.uint32()); + break; + } + case 9: { + message.requestId = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LongRunningRecognizeResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse} LongRunningRecognizeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunningRecognizeResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LongRunningRecognizeResponse message. + * @function verify + * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LongRunningRecognizeResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.results != null && message.hasOwnProperty("results")) { + if (!Array.isArray(message.results)) + return "results: array expected"; + for (var i = 0; i < message.results.length; ++i) { + var error = $root.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.verify(message.results[i]); + if (error) + return "results." + error; + } + } + if (message.totalBilledTime != null && message.hasOwnProperty("totalBilledTime")) { + var error = $root.google.protobuf.Duration.verify(message.totalBilledTime); + if (error) + return "totalBilledTime." + error; + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + if (message.outputError != null && message.hasOwnProperty("outputError")) { + var error = $root.google.rpc.Status.verify(message.outputError); + if (error) + return "outputError." + error; + } + if (message.speechAdaptationInfo != null && message.hasOwnProperty("speechAdaptationInfo")) { + var error = $root.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo.verify(message.speechAdaptationInfo); + if (error) + return "speechAdaptationInfo." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isInteger(message.requestId) && !(message.requestId && $util.isInteger(message.requestId.low) && $util.isInteger(message.requestId.high))) + return "requestId: integer|Long expected"; + return null; + }; + + /** + * Creates a LongRunningRecognizeResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse} LongRunningRecognizeResponse + */ + LongRunningRecognizeResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse) + return object; + var message = new $root.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse(); + if (object.results) { + if (!Array.isArray(object.results)) + throw TypeError(".google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse.results: array expected"); + message.results = []; + for (var i = 0; i < object.results.length; ++i) { + if (typeof object.results[i] !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse.results: object expected"); + message.results[i] = $root.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.fromObject(object.results[i]); + } + } + if (object.totalBilledTime != null) { + if (typeof object.totalBilledTime !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse.totalBilledTime: object expected"); + message.totalBilledTime = $root.google.protobuf.Duration.fromObject(object.totalBilledTime); + } + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.fromObject(object.outputConfig); + } + if (object.outputError != null) { + if (typeof object.outputError !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse.outputError: object expected"); + message.outputError = $root.google.rpc.Status.fromObject(object.outputError); + } + if (object.speechAdaptationInfo != null) { + if (typeof object.speechAdaptationInfo !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse.speechAdaptationInfo: object expected"); + message.speechAdaptationInfo = $root.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo.fromObject(object.speechAdaptationInfo); + } + if (object.requestId != null) + if ($util.Long) + (message.requestId = $util.Long.fromValue(object.requestId)).unsigned = false; + else if (typeof object.requestId === "string") + message.requestId = parseInt(object.requestId, 10); + else if (typeof object.requestId === "number") + message.requestId = object.requestId; + else if (typeof object.requestId === "object") + message.requestId = new $util.LongBits(object.requestId.low >>> 0, object.requestId.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a LongRunningRecognizeResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse + * @static + * @param {google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse} message LongRunningRecognizeResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LongRunningRecognizeResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.results = []; + if (options.defaults) { + object.totalBilledTime = null; + object.outputConfig = null; + object.outputError = null; + object.speechAdaptationInfo = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.requestId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.requestId = options.longs === String ? "0" : 0; + } + if (message.results && message.results.length) { + object.results = []; + for (var j = 0; j < message.results.length; ++j) + object.results[j] = $root.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.toObject(message.results[j], options); + } + if (message.totalBilledTime != null && message.hasOwnProperty("totalBilledTime")) + object.totalBilledTime = $root.google.protobuf.Duration.toObject(message.totalBilledTime, options); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.toObject(message.outputConfig, options); + if (message.outputError != null && message.hasOwnProperty("outputError")) + object.outputError = $root.google.rpc.Status.toObject(message.outputError, options); + if (message.speechAdaptationInfo != null && message.hasOwnProperty("speechAdaptationInfo")) + object.speechAdaptationInfo = $root.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo.toObject(message.speechAdaptationInfo, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (typeof message.requestId === "number") + object.requestId = options.longs === String ? String(message.requestId) : message.requestId; + else + object.requestId = options.longs === String ? $util.Long.prototype.toString.call(message.requestId) : options.longs === Number ? new $util.LongBits(message.requestId.low >>> 0, message.requestId.high >>> 0).toNumber() : message.requestId; + return object; + }; + + /** + * Converts this LongRunningRecognizeResponse to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse + * @instance + * @returns {Object.} JSON object + */ + LongRunningRecognizeResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LongRunningRecognizeResponse + * @function getTypeUrl + * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LongRunningRecognizeResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse"; + }; + + return LongRunningRecognizeResponse; + })(); + + v1p1beta1.LongRunningRecognizeMetadata = (function() { + + /** + * Properties of a LongRunningRecognizeMetadata. + * @memberof google.cloud.speech.v1p1beta1 + * @interface ILongRunningRecognizeMetadata + * @property {number|null} [progressPercent] LongRunningRecognizeMetadata progressPercent + * @property {google.protobuf.ITimestamp|null} [startTime] LongRunningRecognizeMetadata startTime + * @property {google.protobuf.ITimestamp|null} [lastUpdateTime] LongRunningRecognizeMetadata lastUpdateTime + * @property {string|null} [uri] LongRunningRecognizeMetadata uri + * @property {google.cloud.speech.v1p1beta1.ITranscriptOutputConfig|null} [outputConfig] LongRunningRecognizeMetadata outputConfig + */ + + /** + * Constructs a new LongRunningRecognizeMetadata. + * @memberof google.cloud.speech.v1p1beta1 + * @classdesc Represents a LongRunningRecognizeMetadata. + * @implements ILongRunningRecognizeMetadata + * @constructor + * @param {google.cloud.speech.v1p1beta1.ILongRunningRecognizeMetadata=} [properties] Properties to set + */ + function LongRunningRecognizeMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LongRunningRecognizeMetadata progressPercent. + * @member {number} progressPercent + * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata + * @instance + */ + LongRunningRecognizeMetadata.prototype.progressPercent = 0; + + /** + * LongRunningRecognizeMetadata startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata + * @instance + */ + LongRunningRecognizeMetadata.prototype.startTime = null; + + /** + * LongRunningRecognizeMetadata lastUpdateTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastUpdateTime + * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata + * @instance + */ + LongRunningRecognizeMetadata.prototype.lastUpdateTime = null; + + /** + * LongRunningRecognizeMetadata uri. + * @member {string} uri + * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata + * @instance + */ + LongRunningRecognizeMetadata.prototype.uri = ""; + + /** + * LongRunningRecognizeMetadata outputConfig. + * @member {google.cloud.speech.v1p1beta1.ITranscriptOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata + * @instance + */ + LongRunningRecognizeMetadata.prototype.outputConfig = null; + + /** + * Creates a new LongRunningRecognizeMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata + * @static + * @param {google.cloud.speech.v1p1beta1.ILongRunningRecognizeMetadata=} [properties] Properties to set + * @returns {google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata} LongRunningRecognizeMetadata instance + */ + LongRunningRecognizeMetadata.create = function create(properties) { + return new LongRunningRecognizeMetadata(properties); + }; + + /** + * Encodes the specified LongRunningRecognizeMetadata message. Does not implicitly {@link google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata + * @static + * @param {google.cloud.speech.v1p1beta1.ILongRunningRecognizeMetadata} message LongRunningRecognizeMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunningRecognizeMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.progressPercent != null && Object.hasOwnProperty.call(message, "progressPercent")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.progressPercent); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.lastUpdateTime != null && Object.hasOwnProperty.call(message, "lastUpdateTime")) + $root.google.protobuf.Timestamp.encode(message.lastUpdateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.uri); + if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) + $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.encode(message.outputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LongRunningRecognizeMetadata message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata + * @static + * @param {google.cloud.speech.v1p1beta1.ILongRunningRecognizeMetadata} message LongRunningRecognizeMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunningRecognizeMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LongRunningRecognizeMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata} LongRunningRecognizeMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunningRecognizeMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.progressPercent = reader.int32(); + break; + } + case 2: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.lastUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.uri = reader.string(); + break; + } + case 5: { + message.outputConfig = $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LongRunningRecognizeMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata} LongRunningRecognizeMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunningRecognizeMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LongRunningRecognizeMetadata message. + * @function verify + * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LongRunningRecognizeMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + if (!$util.isInteger(message.progressPercent)) + return "progressPercent: integer expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.lastUpdateTime != null && message.hasOwnProperty("lastUpdateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastUpdateTime); + if (error) + return "lastUpdateTime." + error; + } + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + return null; + }; + + /** + * Creates a LongRunningRecognizeMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata} LongRunningRecognizeMetadata + */ + LongRunningRecognizeMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata) + return object; + var message = new $root.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata(); + if (object.progressPercent != null) + message.progressPercent = object.progressPercent | 0; + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.lastUpdateTime != null) { + if (typeof object.lastUpdateTime !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata.lastUpdateTime: object expected"); + message.lastUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.lastUpdateTime); + } + if (object.uri != null) + message.uri = String(object.uri); + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.fromObject(object.outputConfig); + } + return message; + }; + + /** + * Creates a plain object from a LongRunningRecognizeMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata + * @static + * @param {google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata} message LongRunningRecognizeMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LongRunningRecognizeMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.progressPercent = 0; + object.startTime = null; + object.lastUpdateTime = null; + object.uri = ""; + object.outputConfig = null; + } + if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + object.progressPercent = message.progressPercent; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.lastUpdateTime != null && message.hasOwnProperty("lastUpdateTime")) + object.lastUpdateTime = $root.google.protobuf.Timestamp.toObject(message.lastUpdateTime, options); + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.toObject(message.outputConfig, options); + return object; + }; + + /** + * Converts this LongRunningRecognizeMetadata to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata + * @instance + * @returns {Object.} JSON object + */ + LongRunningRecognizeMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LongRunningRecognizeMetadata + * @function getTypeUrl + * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LongRunningRecognizeMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata"; + }; + + return LongRunningRecognizeMetadata; + })(); + + v1p1beta1.StreamingRecognizeResponse = (function() { + + /** + * Properties of a StreamingRecognizeResponse. + * @memberof google.cloud.speech.v1p1beta1 + * @interface IStreamingRecognizeResponse + * @property {google.rpc.IStatus|null} [error] StreamingRecognizeResponse error + * @property {Array.|null} [results] StreamingRecognizeResponse results + * @property {google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType|null} [speechEventType] StreamingRecognizeResponse speechEventType + * @property {google.protobuf.IDuration|null} [speechEventTime] StreamingRecognizeResponse speechEventTime + * @property {google.protobuf.IDuration|null} [totalBilledTime] StreamingRecognizeResponse totalBilledTime + * @property {google.cloud.speech.v1p1beta1.ISpeechAdaptationInfo|null} [speechAdaptationInfo] StreamingRecognizeResponse speechAdaptationInfo + * @property {number|Long|null} [requestId] StreamingRecognizeResponse requestId + */ + + /** + * Constructs a new StreamingRecognizeResponse. + * @memberof google.cloud.speech.v1p1beta1 + * @classdesc Represents a StreamingRecognizeResponse. + * @implements IStreamingRecognizeResponse + * @constructor + * @param {google.cloud.speech.v1p1beta1.IStreamingRecognizeResponse=} [properties] Properties to set + */ + function StreamingRecognizeResponse(properties) { + this.results = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamingRecognizeResponse error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeResponse + * @instance + */ + StreamingRecognizeResponse.prototype.error = null; + + /** + * StreamingRecognizeResponse results. + * @member {Array.} results + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeResponse + * @instance + */ + StreamingRecognizeResponse.prototype.results = $util.emptyArray; + + /** + * StreamingRecognizeResponse speechEventType. + * @member {google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType} speechEventType + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeResponse + * @instance + */ + StreamingRecognizeResponse.prototype.speechEventType = 0; + + /** + * StreamingRecognizeResponse speechEventTime. + * @member {google.protobuf.IDuration|null|undefined} speechEventTime + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeResponse + * @instance + */ + StreamingRecognizeResponse.prototype.speechEventTime = null; + + /** + * StreamingRecognizeResponse totalBilledTime. + * @member {google.protobuf.IDuration|null|undefined} totalBilledTime + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeResponse + * @instance + */ + StreamingRecognizeResponse.prototype.totalBilledTime = null; + + /** + * StreamingRecognizeResponse speechAdaptationInfo. + * @member {google.cloud.speech.v1p1beta1.ISpeechAdaptationInfo|null|undefined} speechAdaptationInfo + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeResponse + * @instance + */ + StreamingRecognizeResponse.prototype.speechAdaptationInfo = null; + + /** + * StreamingRecognizeResponse requestId. + * @member {number|Long} requestId + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeResponse + * @instance + */ + StreamingRecognizeResponse.prototype.requestId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new StreamingRecognizeResponse instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeResponse + * @static + * @param {google.cloud.speech.v1p1beta1.IStreamingRecognizeResponse=} [properties] Properties to set + * @returns {google.cloud.speech.v1p1beta1.StreamingRecognizeResponse} StreamingRecognizeResponse instance + */ + StreamingRecognizeResponse.create = function create(properties) { + return new StreamingRecognizeResponse(properties); + }; + + /** + * Encodes the specified StreamingRecognizeResponse message. Does not implicitly {@link google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeResponse + * @static + * @param {google.cloud.speech.v1p1beta1.IStreamingRecognizeResponse} message StreamingRecognizeResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingRecognizeResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.results != null && message.results.length) + for (var i = 0; i < message.results.length; ++i) + $root.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.encode(message.results[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.speechEventType != null && Object.hasOwnProperty.call(message, "speechEventType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.speechEventType); + if (message.totalBilledTime != null && Object.hasOwnProperty.call(message, "totalBilledTime")) + $root.google.protobuf.Duration.encode(message.totalBilledTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.speechEventTime != null && Object.hasOwnProperty.call(message, "speechEventTime")) + $root.google.protobuf.Duration.encode(message.speechEventTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.speechAdaptationInfo != null && Object.hasOwnProperty.call(message, "speechAdaptationInfo")) + $root.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo.encode(message.speechAdaptationInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 10, wireType 0 =*/80).int64(message.requestId); + return writer; + }; + + /** + * Encodes the specified StreamingRecognizeResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeResponse + * @static + * @param {google.cloud.speech.v1p1beta1.IStreamingRecognizeResponse} message StreamingRecognizeResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingRecognizeResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamingRecognizeResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1p1beta1.StreamingRecognizeResponse} StreamingRecognizeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingRecognizeResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.results && message.results.length)) + message.results = []; + message.results.push($root.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.decode(reader, reader.uint32())); + break; + } + case 4: { + message.speechEventType = reader.int32(); + break; + } + case 8: { + message.speechEventTime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 5: { + message.totalBilledTime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 9: { + message.speechAdaptationInfo = $root.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo.decode(reader, reader.uint32()); + break; + } + case 10: { + message.requestId = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamingRecognizeResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1p1beta1.StreamingRecognizeResponse} StreamingRecognizeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingRecognizeResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamingRecognizeResponse message. + * @function verify + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingRecognizeResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.error != null && message.hasOwnProperty("error")) { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + if (message.results != null && message.hasOwnProperty("results")) { + if (!Array.isArray(message.results)) + return "results: array expected"; + for (var i = 0; i < message.results.length; ++i) { + var error = $root.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.verify(message.results[i]); + if (error) + return "results." + error; + } + } + if (message.speechEventType != null && message.hasOwnProperty("speechEventType")) + switch (message.speechEventType) { + default: + return "speechEventType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.speechEventTime != null && message.hasOwnProperty("speechEventTime")) { + var error = $root.google.protobuf.Duration.verify(message.speechEventTime); + if (error) + return "speechEventTime." + error; + } + if (message.totalBilledTime != null && message.hasOwnProperty("totalBilledTime")) { + var error = $root.google.protobuf.Duration.verify(message.totalBilledTime); + if (error) + return "totalBilledTime." + error; + } + if (message.speechAdaptationInfo != null && message.hasOwnProperty("speechAdaptationInfo")) { + var error = $root.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo.verify(message.speechAdaptationInfo); + if (error) + return "speechAdaptationInfo." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isInteger(message.requestId) && !(message.requestId && $util.isInteger(message.requestId.low) && $util.isInteger(message.requestId.high))) + return "requestId: integer|Long expected"; + return null; + }; + + /** + * Creates a StreamingRecognizeResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1p1beta1.StreamingRecognizeResponse} StreamingRecognizeResponse + */ + StreamingRecognizeResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse) + return object; + var message = new $root.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse(); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.results) { + if (!Array.isArray(object.results)) + throw TypeError(".google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.results: array expected"); + message.results = []; + for (var i = 0; i < object.results.length; ++i) { + if (typeof object.results[i] !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.results: object expected"); + message.results[i] = $root.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.fromObject(object.results[i]); + } + } + switch (object.speechEventType) { + default: + if (typeof object.speechEventType === "number") { + message.speechEventType = object.speechEventType; + break; + } + break; + case "SPEECH_EVENT_UNSPECIFIED": + case 0: + message.speechEventType = 0; + break; + case "END_OF_SINGLE_UTTERANCE": + case 1: + message.speechEventType = 1; + break; + case "SPEECH_ACTIVITY_BEGIN": + case 2: + message.speechEventType = 2; + break; + case "SPEECH_ACTIVITY_END": + case 3: + message.speechEventType = 3; + break; + case "SPEECH_ACTIVITY_TIMEOUT": + case 4: + message.speechEventType = 4; + break; + } + if (object.speechEventTime != null) { + if (typeof object.speechEventTime !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.speechEventTime: object expected"); + message.speechEventTime = $root.google.protobuf.Duration.fromObject(object.speechEventTime); + } + if (object.totalBilledTime != null) { + if (typeof object.totalBilledTime !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.totalBilledTime: object expected"); + message.totalBilledTime = $root.google.protobuf.Duration.fromObject(object.totalBilledTime); + } + if (object.speechAdaptationInfo != null) { + if (typeof object.speechAdaptationInfo !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.speechAdaptationInfo: object expected"); + message.speechAdaptationInfo = $root.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo.fromObject(object.speechAdaptationInfo); + } + if (object.requestId != null) + if ($util.Long) + (message.requestId = $util.Long.fromValue(object.requestId)).unsigned = false; + else if (typeof object.requestId === "string") + message.requestId = parseInt(object.requestId, 10); + else if (typeof object.requestId === "number") + message.requestId = object.requestId; + else if (typeof object.requestId === "object") + message.requestId = new $util.LongBits(object.requestId.low >>> 0, object.requestId.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a StreamingRecognizeResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeResponse + * @static + * @param {google.cloud.speech.v1p1beta1.StreamingRecognizeResponse} message StreamingRecognizeResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingRecognizeResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.results = []; + if (options.defaults) { + object.error = null; + object.speechEventType = options.enums === String ? "SPEECH_EVENT_UNSPECIFIED" : 0; + object.totalBilledTime = null; + object.speechEventTime = null; + object.speechAdaptationInfo = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.requestId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.requestId = options.longs === String ? "0" : 0; + } + if (message.error != null && message.hasOwnProperty("error")) + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (message.results && message.results.length) { + object.results = []; + for (var j = 0; j < message.results.length; ++j) + object.results[j] = $root.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.toObject(message.results[j], options); + } + if (message.speechEventType != null && message.hasOwnProperty("speechEventType")) + object.speechEventType = options.enums === String ? $root.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType[message.speechEventType] === undefined ? message.speechEventType : $root.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType[message.speechEventType] : message.speechEventType; + if (message.totalBilledTime != null && message.hasOwnProperty("totalBilledTime")) + object.totalBilledTime = $root.google.protobuf.Duration.toObject(message.totalBilledTime, options); + if (message.speechEventTime != null && message.hasOwnProperty("speechEventTime")) + object.speechEventTime = $root.google.protobuf.Duration.toObject(message.speechEventTime, options); + if (message.speechAdaptationInfo != null && message.hasOwnProperty("speechAdaptationInfo")) + object.speechAdaptationInfo = $root.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo.toObject(message.speechAdaptationInfo, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (typeof message.requestId === "number") + object.requestId = options.longs === String ? String(message.requestId) : message.requestId; + else + object.requestId = options.longs === String ? $util.Long.prototype.toString.call(message.requestId) : options.longs === Number ? new $util.LongBits(message.requestId.low >>> 0, message.requestId.high >>> 0).toNumber() : message.requestId; + return object; + }; + + /** + * Converts this StreamingRecognizeResponse to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeResponse + * @instance + * @returns {Object.} JSON object + */ + StreamingRecognizeResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamingRecognizeResponse + * @function getTypeUrl + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamingRecognizeResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1p1beta1.StreamingRecognizeResponse"; + }; + + /** + * SpeechEventType enum. + * @name google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType + * @enum {number} + * @property {number} SPEECH_EVENT_UNSPECIFIED=0 SPEECH_EVENT_UNSPECIFIED value + * @property {number} END_OF_SINGLE_UTTERANCE=1 END_OF_SINGLE_UTTERANCE value + * @property {number} SPEECH_ACTIVITY_BEGIN=2 SPEECH_ACTIVITY_BEGIN value + * @property {number} SPEECH_ACTIVITY_END=3 SPEECH_ACTIVITY_END value + * @property {number} SPEECH_ACTIVITY_TIMEOUT=4 SPEECH_ACTIVITY_TIMEOUT value + */ + StreamingRecognizeResponse.SpeechEventType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SPEECH_EVENT_UNSPECIFIED"] = 0; + values[valuesById[1] = "END_OF_SINGLE_UTTERANCE"] = 1; + values[valuesById[2] = "SPEECH_ACTIVITY_BEGIN"] = 2; + values[valuesById[3] = "SPEECH_ACTIVITY_END"] = 3; + values[valuesById[4] = "SPEECH_ACTIVITY_TIMEOUT"] = 4; + return values; + })(); + + return StreamingRecognizeResponse; + })(); + + v1p1beta1.StreamingRecognitionResult = (function() { + + /** + * Properties of a StreamingRecognitionResult. + * @memberof google.cloud.speech.v1p1beta1 + * @interface IStreamingRecognitionResult + * @property {Array.|null} [alternatives] StreamingRecognitionResult alternatives + * @property {boolean|null} [isFinal] StreamingRecognitionResult isFinal + * @property {number|null} [stability] StreamingRecognitionResult stability + * @property {google.protobuf.IDuration|null} [resultEndTime] StreamingRecognitionResult resultEndTime + * @property {number|null} [channelTag] StreamingRecognitionResult channelTag + * @property {string|null} [languageCode] StreamingRecognitionResult languageCode + */ + + /** + * Constructs a new StreamingRecognitionResult. + * @memberof google.cloud.speech.v1p1beta1 + * @classdesc Represents a StreamingRecognitionResult. + * @implements IStreamingRecognitionResult + * @constructor + * @param {google.cloud.speech.v1p1beta1.IStreamingRecognitionResult=} [properties] Properties to set + */ + function StreamingRecognitionResult(properties) { + this.alternatives = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamingRecognitionResult alternatives. + * @member {Array.} alternatives + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionResult + * @instance + */ + StreamingRecognitionResult.prototype.alternatives = $util.emptyArray; + + /** + * StreamingRecognitionResult isFinal. + * @member {boolean} isFinal + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionResult + * @instance + */ + StreamingRecognitionResult.prototype.isFinal = false; + + /** + * StreamingRecognitionResult stability. + * @member {number} stability + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionResult + * @instance + */ + StreamingRecognitionResult.prototype.stability = 0; + + /** + * StreamingRecognitionResult resultEndTime. + * @member {google.protobuf.IDuration|null|undefined} resultEndTime + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionResult + * @instance + */ + StreamingRecognitionResult.prototype.resultEndTime = null; + + /** + * StreamingRecognitionResult channelTag. + * @member {number} channelTag + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionResult + * @instance + */ + StreamingRecognitionResult.prototype.channelTag = 0; + + /** + * StreamingRecognitionResult languageCode. + * @member {string} languageCode + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionResult + * @instance + */ + StreamingRecognitionResult.prototype.languageCode = ""; + + /** + * Creates a new StreamingRecognitionResult instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionResult + * @static + * @param {google.cloud.speech.v1p1beta1.IStreamingRecognitionResult=} [properties] Properties to set + * @returns {google.cloud.speech.v1p1beta1.StreamingRecognitionResult} StreamingRecognitionResult instance + */ + StreamingRecognitionResult.create = function create(properties) { + return new StreamingRecognitionResult(properties); + }; + + /** + * Encodes the specified StreamingRecognitionResult message. Does not implicitly {@link google.cloud.speech.v1p1beta1.StreamingRecognitionResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionResult + * @static + * @param {google.cloud.speech.v1p1beta1.IStreamingRecognitionResult} message StreamingRecognitionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingRecognitionResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.alternatives != null && message.alternatives.length) + for (var i = 0; i < message.alternatives.length; ++i) + $root.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.encode(message.alternatives[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.isFinal != null && Object.hasOwnProperty.call(message, "isFinal")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isFinal); + if (message.stability != null && Object.hasOwnProperty.call(message, "stability")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.stability); + if (message.resultEndTime != null && Object.hasOwnProperty.call(message, "resultEndTime")) + $root.google.protobuf.Duration.encode(message.resultEndTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.channelTag != null && Object.hasOwnProperty.call(message, "channelTag")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.channelTag); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified StreamingRecognitionResult message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.StreamingRecognitionResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionResult + * @static + * @param {google.cloud.speech.v1p1beta1.IStreamingRecognitionResult} message StreamingRecognitionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingRecognitionResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamingRecognitionResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1p1beta1.StreamingRecognitionResult} StreamingRecognitionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingRecognitionResult.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.StreamingRecognitionResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.alternatives && message.alternatives.length)) + message.alternatives = []; + message.alternatives.push($root.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.decode(reader, reader.uint32())); + break; + } + case 2: { + message.isFinal = reader.bool(); + break; + } + case 3: { + message.stability = reader.float(); + break; + } + case 4: { + message.resultEndTime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 5: { + message.channelTag = reader.int32(); + break; + } + case 6: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamingRecognitionResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1p1beta1.StreamingRecognitionResult} StreamingRecognitionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingRecognitionResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamingRecognitionResult message. + * @function verify + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingRecognitionResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.alternatives != null && message.hasOwnProperty("alternatives")) { + if (!Array.isArray(message.alternatives)) + return "alternatives: array expected"; + for (var i = 0; i < message.alternatives.length; ++i) { + var error = $root.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.verify(message.alternatives[i]); + if (error) + return "alternatives." + error; + } + } + if (message.isFinal != null && message.hasOwnProperty("isFinal")) + if (typeof message.isFinal !== "boolean") + return "isFinal: boolean expected"; + if (message.stability != null && message.hasOwnProperty("stability")) + if (typeof message.stability !== "number") + return "stability: number expected"; + if (message.resultEndTime != null && message.hasOwnProperty("resultEndTime")) { + var error = $root.google.protobuf.Duration.verify(message.resultEndTime); + if (error) + return "resultEndTime." + error; + } + if (message.channelTag != null && message.hasOwnProperty("channelTag")) + if (!$util.isInteger(message.channelTag)) + return "channelTag: integer expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a StreamingRecognitionResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1p1beta1.StreamingRecognitionResult} StreamingRecognitionResult + */ + StreamingRecognitionResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1p1beta1.StreamingRecognitionResult) + return object; + var message = new $root.google.cloud.speech.v1p1beta1.StreamingRecognitionResult(); + if (object.alternatives) { + if (!Array.isArray(object.alternatives)) + throw TypeError(".google.cloud.speech.v1p1beta1.StreamingRecognitionResult.alternatives: array expected"); + message.alternatives = []; + for (var i = 0; i < object.alternatives.length; ++i) { + if (typeof object.alternatives[i] !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.StreamingRecognitionResult.alternatives: object expected"); + message.alternatives[i] = $root.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.fromObject(object.alternatives[i]); + } + } + if (object.isFinal != null) + message.isFinal = Boolean(object.isFinal); + if (object.stability != null) + message.stability = Number(object.stability); + if (object.resultEndTime != null) { + if (typeof object.resultEndTime !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.StreamingRecognitionResult.resultEndTime: object expected"); + message.resultEndTime = $root.google.protobuf.Duration.fromObject(object.resultEndTime); + } + if (object.channelTag != null) + message.channelTag = object.channelTag | 0; + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a StreamingRecognitionResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionResult + * @static + * @param {google.cloud.speech.v1p1beta1.StreamingRecognitionResult} message StreamingRecognitionResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingRecognitionResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.alternatives = []; + if (options.defaults) { + object.isFinal = false; + object.stability = 0; + object.resultEndTime = null; + object.channelTag = 0; + object.languageCode = ""; + } + if (message.alternatives && message.alternatives.length) { + object.alternatives = []; + for (var j = 0; j < message.alternatives.length; ++j) + object.alternatives[j] = $root.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.toObject(message.alternatives[j], options); + } + if (message.isFinal != null && message.hasOwnProperty("isFinal")) + object.isFinal = message.isFinal; + if (message.stability != null && message.hasOwnProperty("stability")) + object.stability = options.json && !isFinite(message.stability) ? String(message.stability) : message.stability; + if (message.resultEndTime != null && message.hasOwnProperty("resultEndTime")) + object.resultEndTime = $root.google.protobuf.Duration.toObject(message.resultEndTime, options); + if (message.channelTag != null && message.hasOwnProperty("channelTag")) + object.channelTag = message.channelTag; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this StreamingRecognitionResult to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionResult + * @instance + * @returns {Object.} JSON object + */ + StreamingRecognitionResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamingRecognitionResult + * @function getTypeUrl + * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamingRecognitionResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1p1beta1.StreamingRecognitionResult"; + }; + + return StreamingRecognitionResult; + })(); + + v1p1beta1.SpeechRecognitionResult = (function() { + + /** + * Properties of a SpeechRecognitionResult. + * @memberof google.cloud.speech.v1p1beta1 + * @interface ISpeechRecognitionResult + * @property {Array.|null} [alternatives] SpeechRecognitionResult alternatives + * @property {number|null} [channelTag] SpeechRecognitionResult channelTag + * @property {google.protobuf.IDuration|null} [resultEndTime] SpeechRecognitionResult resultEndTime + * @property {string|null} [languageCode] SpeechRecognitionResult languageCode + */ + + /** + * Constructs a new SpeechRecognitionResult. + * @memberof google.cloud.speech.v1p1beta1 + * @classdesc Represents a SpeechRecognitionResult. + * @implements ISpeechRecognitionResult + * @constructor + * @param {google.cloud.speech.v1p1beta1.ISpeechRecognitionResult=} [properties] Properties to set + */ + function SpeechRecognitionResult(properties) { + this.alternatives = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpeechRecognitionResult alternatives. + * @member {Array.} alternatives + * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionResult + * @instance + */ + SpeechRecognitionResult.prototype.alternatives = $util.emptyArray; + + /** + * SpeechRecognitionResult channelTag. + * @member {number} channelTag + * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionResult + * @instance + */ + SpeechRecognitionResult.prototype.channelTag = 0; + + /** + * SpeechRecognitionResult resultEndTime. + * @member {google.protobuf.IDuration|null|undefined} resultEndTime + * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionResult + * @instance + */ + SpeechRecognitionResult.prototype.resultEndTime = null; + + /** + * SpeechRecognitionResult languageCode. + * @member {string} languageCode + * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionResult + * @instance + */ + SpeechRecognitionResult.prototype.languageCode = ""; + + /** + * Creates a new SpeechRecognitionResult instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionResult + * @static + * @param {google.cloud.speech.v1p1beta1.ISpeechRecognitionResult=} [properties] Properties to set + * @returns {google.cloud.speech.v1p1beta1.SpeechRecognitionResult} SpeechRecognitionResult instance + */ + SpeechRecognitionResult.create = function create(properties) { + return new SpeechRecognitionResult(properties); + }; + + /** + * Encodes the specified SpeechRecognitionResult message. Does not implicitly {@link google.cloud.speech.v1p1beta1.SpeechRecognitionResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionResult + * @static + * @param {google.cloud.speech.v1p1beta1.ISpeechRecognitionResult} message SpeechRecognitionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechRecognitionResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.alternatives != null && message.alternatives.length) + for (var i = 0; i < message.alternatives.length; ++i) + $root.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.encode(message.alternatives[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.channelTag != null && Object.hasOwnProperty.call(message, "channelTag")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.channelTag); + if (message.resultEndTime != null && Object.hasOwnProperty.call(message, "resultEndTime")) + $root.google.protobuf.Duration.encode(message.resultEndTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified SpeechRecognitionResult message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.SpeechRecognitionResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionResult + * @static + * @param {google.cloud.speech.v1p1beta1.ISpeechRecognitionResult} message SpeechRecognitionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechRecognitionResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpeechRecognitionResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1p1beta1.SpeechRecognitionResult} SpeechRecognitionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechRecognitionResult.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.SpeechRecognitionResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.alternatives && message.alternatives.length)) + message.alternatives = []; + message.alternatives.push($root.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.decode(reader, reader.uint32())); + break; + } + case 2: { + message.channelTag = reader.int32(); + break; + } + case 4: { + message.resultEndTime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 5: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpeechRecognitionResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1p1beta1.SpeechRecognitionResult} SpeechRecognitionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechRecognitionResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpeechRecognitionResult message. + * @function verify + * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpeechRecognitionResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.alternatives != null && message.hasOwnProperty("alternatives")) { + if (!Array.isArray(message.alternatives)) + return "alternatives: array expected"; + for (var i = 0; i < message.alternatives.length; ++i) { + var error = $root.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.verify(message.alternatives[i]); + if (error) + return "alternatives." + error; + } + } + if (message.channelTag != null && message.hasOwnProperty("channelTag")) + if (!$util.isInteger(message.channelTag)) + return "channelTag: integer expected"; + if (message.resultEndTime != null && message.hasOwnProperty("resultEndTime")) { + var error = $root.google.protobuf.Duration.verify(message.resultEndTime); + if (error) + return "resultEndTime." + error; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a SpeechRecognitionResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1p1beta1.SpeechRecognitionResult} SpeechRecognitionResult + */ + SpeechRecognitionResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1p1beta1.SpeechRecognitionResult) + return object; + var message = new $root.google.cloud.speech.v1p1beta1.SpeechRecognitionResult(); + if (object.alternatives) { + if (!Array.isArray(object.alternatives)) + throw TypeError(".google.cloud.speech.v1p1beta1.SpeechRecognitionResult.alternatives: array expected"); + message.alternatives = []; + for (var i = 0; i < object.alternatives.length; ++i) { + if (typeof object.alternatives[i] !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.SpeechRecognitionResult.alternatives: object expected"); + message.alternatives[i] = $root.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.fromObject(object.alternatives[i]); + } + } + if (object.channelTag != null) + message.channelTag = object.channelTag | 0; + if (object.resultEndTime != null) { + if (typeof object.resultEndTime !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.SpeechRecognitionResult.resultEndTime: object expected"); + message.resultEndTime = $root.google.protobuf.Duration.fromObject(object.resultEndTime); + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a SpeechRecognitionResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionResult + * @static + * @param {google.cloud.speech.v1p1beta1.SpeechRecognitionResult} message SpeechRecognitionResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpeechRecognitionResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.alternatives = []; + if (options.defaults) { + object.channelTag = 0; + object.resultEndTime = null; + object.languageCode = ""; + } + if (message.alternatives && message.alternatives.length) { + object.alternatives = []; + for (var j = 0; j < message.alternatives.length; ++j) + object.alternatives[j] = $root.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.toObject(message.alternatives[j], options); + } + if (message.channelTag != null && message.hasOwnProperty("channelTag")) + object.channelTag = message.channelTag; + if (message.resultEndTime != null && message.hasOwnProperty("resultEndTime")) + object.resultEndTime = $root.google.protobuf.Duration.toObject(message.resultEndTime, options); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this SpeechRecognitionResult to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionResult + * @instance + * @returns {Object.} JSON object + */ + SpeechRecognitionResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpeechRecognitionResult + * @function getTypeUrl + * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpeechRecognitionResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1p1beta1.SpeechRecognitionResult"; + }; + + return SpeechRecognitionResult; + })(); + + v1p1beta1.SpeechRecognitionAlternative = (function() { + + /** + * Properties of a SpeechRecognitionAlternative. + * @memberof google.cloud.speech.v1p1beta1 + * @interface ISpeechRecognitionAlternative + * @property {string|null} [transcript] SpeechRecognitionAlternative transcript + * @property {number|null} [confidence] SpeechRecognitionAlternative confidence + * @property {Array.|null} [words] SpeechRecognitionAlternative words + */ + + /** + * Constructs a new SpeechRecognitionAlternative. + * @memberof google.cloud.speech.v1p1beta1 + * @classdesc Represents a SpeechRecognitionAlternative. + * @implements ISpeechRecognitionAlternative + * @constructor + * @param {google.cloud.speech.v1p1beta1.ISpeechRecognitionAlternative=} [properties] Properties to set + */ + function SpeechRecognitionAlternative(properties) { + this.words = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpeechRecognitionAlternative transcript. + * @member {string} transcript + * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative + * @instance + */ + SpeechRecognitionAlternative.prototype.transcript = ""; + + /** + * SpeechRecognitionAlternative confidence. + * @member {number} confidence + * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative + * @instance + */ + SpeechRecognitionAlternative.prototype.confidence = 0; + + /** + * SpeechRecognitionAlternative words. + * @member {Array.} words + * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative + * @instance + */ + SpeechRecognitionAlternative.prototype.words = $util.emptyArray; + + /** + * Creates a new SpeechRecognitionAlternative instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative + * @static + * @param {google.cloud.speech.v1p1beta1.ISpeechRecognitionAlternative=} [properties] Properties to set + * @returns {google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative} SpeechRecognitionAlternative instance + */ + SpeechRecognitionAlternative.create = function create(properties) { + return new SpeechRecognitionAlternative(properties); + }; + + /** + * Encodes the specified SpeechRecognitionAlternative message. Does not implicitly {@link google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative + * @static + * @param {google.cloud.speech.v1p1beta1.ISpeechRecognitionAlternative} message SpeechRecognitionAlternative message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechRecognitionAlternative.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.transcript != null && Object.hasOwnProperty.call(message, "transcript")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.transcript); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence); + if (message.words != null && message.words.length) + for (var i = 0; i < message.words.length; ++i) + $root.google.cloud.speech.v1p1beta1.WordInfo.encode(message.words[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SpeechRecognitionAlternative message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative + * @static + * @param {google.cloud.speech.v1p1beta1.ISpeechRecognitionAlternative} message SpeechRecognitionAlternative message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechRecognitionAlternative.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpeechRecognitionAlternative message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative} SpeechRecognitionAlternative + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechRecognitionAlternative.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.transcript = reader.string(); + break; + } + case 2: { + message.confidence = reader.float(); + break; + } + case 3: { + if (!(message.words && message.words.length)) + message.words = []; + message.words.push($root.google.cloud.speech.v1p1beta1.WordInfo.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpeechRecognitionAlternative message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative} SpeechRecognitionAlternative + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechRecognitionAlternative.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpeechRecognitionAlternative message. + * @function verify + * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpeechRecognitionAlternative.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.transcript != null && message.hasOwnProperty("transcript")) + if (!$util.isString(message.transcript)) + return "transcript: string expected"; + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + if (message.words != null && message.hasOwnProperty("words")) { + if (!Array.isArray(message.words)) + return "words: array expected"; + for (var i = 0; i < message.words.length; ++i) { + var error = $root.google.cloud.speech.v1p1beta1.WordInfo.verify(message.words[i]); + if (error) + return "words." + error; + } + } + return null; + }; + + /** + * Creates a SpeechRecognitionAlternative message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative} SpeechRecognitionAlternative + */ + SpeechRecognitionAlternative.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative) + return object; + var message = new $root.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative(); + if (object.transcript != null) + message.transcript = String(object.transcript); + if (object.confidence != null) + message.confidence = Number(object.confidence); + if (object.words) { + if (!Array.isArray(object.words)) + throw TypeError(".google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.words: array expected"); + message.words = []; + for (var i = 0; i < object.words.length; ++i) { + if (typeof object.words[i] !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.words: object expected"); + message.words[i] = $root.google.cloud.speech.v1p1beta1.WordInfo.fromObject(object.words[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SpeechRecognitionAlternative message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative + * @static + * @param {google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative} message SpeechRecognitionAlternative + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpeechRecognitionAlternative.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.words = []; + if (options.defaults) { + object.transcript = ""; + object.confidence = 0; + } + if (message.transcript != null && message.hasOwnProperty("transcript")) + object.transcript = message.transcript; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + if (message.words && message.words.length) { + object.words = []; + for (var j = 0; j < message.words.length; ++j) + object.words[j] = $root.google.cloud.speech.v1p1beta1.WordInfo.toObject(message.words[j], options); + } + return object; + }; + + /** + * Converts this SpeechRecognitionAlternative to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative + * @instance + * @returns {Object.} JSON object + */ + SpeechRecognitionAlternative.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpeechRecognitionAlternative + * @function getTypeUrl + * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpeechRecognitionAlternative.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative"; + }; + + return SpeechRecognitionAlternative; + })(); + + v1p1beta1.WordInfo = (function() { + + /** + * Properties of a WordInfo. + * @memberof google.cloud.speech.v1p1beta1 + * @interface IWordInfo + * @property {google.protobuf.IDuration|null} [startTime] WordInfo startTime + * @property {google.protobuf.IDuration|null} [endTime] WordInfo endTime + * @property {string|null} [word] WordInfo word + * @property {number|null} [confidence] WordInfo confidence + * @property {number|null} [speakerTag] WordInfo speakerTag + * @property {string|null} [speakerLabel] WordInfo speakerLabel + */ + + /** + * Constructs a new WordInfo. + * @memberof google.cloud.speech.v1p1beta1 + * @classdesc Represents a WordInfo. + * @implements IWordInfo + * @constructor + * @param {google.cloud.speech.v1p1beta1.IWordInfo=} [properties] Properties to set + */ + function WordInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WordInfo startTime. + * @member {google.protobuf.IDuration|null|undefined} startTime + * @memberof google.cloud.speech.v1p1beta1.WordInfo + * @instance + */ + WordInfo.prototype.startTime = null; + + /** + * WordInfo endTime. + * @member {google.protobuf.IDuration|null|undefined} endTime + * @memberof google.cloud.speech.v1p1beta1.WordInfo + * @instance + */ + WordInfo.prototype.endTime = null; + + /** + * WordInfo word. + * @member {string} word + * @memberof google.cloud.speech.v1p1beta1.WordInfo + * @instance + */ + WordInfo.prototype.word = ""; + + /** + * WordInfo confidence. + * @member {number} confidence + * @memberof google.cloud.speech.v1p1beta1.WordInfo + * @instance + */ + WordInfo.prototype.confidence = 0; + + /** + * WordInfo speakerTag. + * @member {number} speakerTag + * @memberof google.cloud.speech.v1p1beta1.WordInfo + * @instance + */ + WordInfo.prototype.speakerTag = 0; + + /** + * WordInfo speakerLabel. + * @member {string} speakerLabel + * @memberof google.cloud.speech.v1p1beta1.WordInfo + * @instance + */ + WordInfo.prototype.speakerLabel = ""; + + /** + * Creates a new WordInfo instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1p1beta1.WordInfo + * @static + * @param {google.cloud.speech.v1p1beta1.IWordInfo=} [properties] Properties to set + * @returns {google.cloud.speech.v1p1beta1.WordInfo} WordInfo instance + */ + WordInfo.create = function create(properties) { + return new WordInfo(properties); + }; + + /** + * Encodes the specified WordInfo message. Does not implicitly {@link google.cloud.speech.v1p1beta1.WordInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1p1beta1.WordInfo + * @static + * @param {google.cloud.speech.v1p1beta1.IWordInfo} message WordInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WordInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Duration.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Duration.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.word != null && Object.hasOwnProperty.call(message, "word")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.word); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.confidence); + if (message.speakerTag != null && Object.hasOwnProperty.call(message, "speakerTag")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.speakerTag); + if (message.speakerLabel != null && Object.hasOwnProperty.call(message, "speakerLabel")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.speakerLabel); + return writer; + }; + + /** + * Encodes the specified WordInfo message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.WordInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1p1beta1.WordInfo + * @static + * @param {google.cloud.speech.v1p1beta1.IWordInfo} message WordInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WordInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WordInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1p1beta1.WordInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1p1beta1.WordInfo} WordInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WordInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.WordInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.startTime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 3: { + message.word = reader.string(); + break; + } + case 4: { + message.confidence = reader.float(); + break; + } + case 5: { + message.speakerTag = reader.int32(); + break; + } + case 6: { + message.speakerLabel = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WordInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1p1beta1.WordInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1p1beta1.WordInfo} WordInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WordInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WordInfo message. + * @function verify + * @memberof google.cloud.speech.v1p1beta1.WordInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WordInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Duration.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Duration.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.word != null && message.hasOwnProperty("word")) + if (!$util.isString(message.word)) + return "word: string expected"; + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + if (message.speakerTag != null && message.hasOwnProperty("speakerTag")) + if (!$util.isInteger(message.speakerTag)) + return "speakerTag: integer expected"; + if (message.speakerLabel != null && message.hasOwnProperty("speakerLabel")) + if (!$util.isString(message.speakerLabel)) + return "speakerLabel: string expected"; + return null; + }; + + /** + * Creates a WordInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1p1beta1.WordInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1p1beta1.WordInfo} WordInfo + */ + WordInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1p1beta1.WordInfo) + return object; + var message = new $root.google.cloud.speech.v1p1beta1.WordInfo(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.WordInfo.startTime: object expected"); + message.startTime = $root.google.protobuf.Duration.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.WordInfo.endTime: object expected"); + message.endTime = $root.google.protobuf.Duration.fromObject(object.endTime); + } + if (object.word != null) + message.word = String(object.word); + if (object.confidence != null) + message.confidence = Number(object.confidence); + if (object.speakerTag != null) + message.speakerTag = object.speakerTag | 0; + if (object.speakerLabel != null) + message.speakerLabel = String(object.speakerLabel); + return message; + }; + + /** + * Creates a plain object from a WordInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1p1beta1.WordInfo + * @static + * @param {google.cloud.speech.v1p1beta1.WordInfo} message WordInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WordInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startTime = null; + object.endTime = null; + object.word = ""; + object.confidence = 0; + object.speakerTag = 0; + object.speakerLabel = ""; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Duration.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Duration.toObject(message.endTime, options); + if (message.word != null && message.hasOwnProperty("word")) + object.word = message.word; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + if (message.speakerTag != null && message.hasOwnProperty("speakerTag")) + object.speakerTag = message.speakerTag; + if (message.speakerLabel != null && message.hasOwnProperty("speakerLabel")) + object.speakerLabel = message.speakerLabel; + return object; + }; + + /** + * Converts this WordInfo to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1p1beta1.WordInfo + * @instance + * @returns {Object.} JSON object + */ + WordInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WordInfo + * @function getTypeUrl + * @memberof google.cloud.speech.v1p1beta1.WordInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WordInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1p1beta1.WordInfo"; + }; + + return WordInfo; + })(); + + v1p1beta1.SpeechAdaptationInfo = (function() { + + /** + * Properties of a SpeechAdaptationInfo. + * @memberof google.cloud.speech.v1p1beta1 + * @interface ISpeechAdaptationInfo + * @property {boolean|null} [adaptationTimeout] SpeechAdaptationInfo adaptationTimeout + * @property {string|null} [timeoutMessage] SpeechAdaptationInfo timeoutMessage + */ + + /** + * Constructs a new SpeechAdaptationInfo. + * @memberof google.cloud.speech.v1p1beta1 + * @classdesc Represents a SpeechAdaptationInfo. + * @implements ISpeechAdaptationInfo + * @constructor + * @param {google.cloud.speech.v1p1beta1.ISpeechAdaptationInfo=} [properties] Properties to set + */ + function SpeechAdaptationInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpeechAdaptationInfo adaptationTimeout. + * @member {boolean} adaptationTimeout + * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptationInfo + * @instance + */ + SpeechAdaptationInfo.prototype.adaptationTimeout = false; + + /** + * SpeechAdaptationInfo timeoutMessage. + * @member {string} timeoutMessage + * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptationInfo + * @instance + */ + SpeechAdaptationInfo.prototype.timeoutMessage = ""; + + /** + * Creates a new SpeechAdaptationInfo instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptationInfo + * @static + * @param {google.cloud.speech.v1p1beta1.ISpeechAdaptationInfo=} [properties] Properties to set + * @returns {google.cloud.speech.v1p1beta1.SpeechAdaptationInfo} SpeechAdaptationInfo instance + */ + SpeechAdaptationInfo.create = function create(properties) { + return new SpeechAdaptationInfo(properties); + }; + + /** + * Encodes the specified SpeechAdaptationInfo message. Does not implicitly {@link google.cloud.speech.v1p1beta1.SpeechAdaptationInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptationInfo + * @static + * @param {google.cloud.speech.v1p1beta1.ISpeechAdaptationInfo} message SpeechAdaptationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechAdaptationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.adaptationTimeout != null && Object.hasOwnProperty.call(message, "adaptationTimeout")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.adaptationTimeout); + if (message.timeoutMessage != null && Object.hasOwnProperty.call(message, "timeoutMessage")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.timeoutMessage); + return writer; + }; + + /** + * Encodes the specified SpeechAdaptationInfo message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.SpeechAdaptationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptationInfo + * @static + * @param {google.cloud.speech.v1p1beta1.ISpeechAdaptationInfo} message SpeechAdaptationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechAdaptationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpeechAdaptationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1p1beta1.SpeechAdaptationInfo} SpeechAdaptationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechAdaptationInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.adaptationTimeout = reader.bool(); + break; + } + case 4: { + message.timeoutMessage = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpeechAdaptationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1p1beta1.SpeechAdaptationInfo} SpeechAdaptationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechAdaptationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpeechAdaptationInfo message. + * @function verify + * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpeechAdaptationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.adaptationTimeout != null && message.hasOwnProperty("adaptationTimeout")) + if (typeof message.adaptationTimeout !== "boolean") + return "adaptationTimeout: boolean expected"; + if (message.timeoutMessage != null && message.hasOwnProperty("timeoutMessage")) + if (!$util.isString(message.timeoutMessage)) + return "timeoutMessage: string expected"; + return null; + }; + + /** + * Creates a SpeechAdaptationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1p1beta1.SpeechAdaptationInfo} SpeechAdaptationInfo + */ + SpeechAdaptationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo) + return object; + var message = new $root.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo(); + if (object.adaptationTimeout != null) + message.adaptationTimeout = Boolean(object.adaptationTimeout); + if (object.timeoutMessage != null) + message.timeoutMessage = String(object.timeoutMessage); + return message; + }; + + /** + * Creates a plain object from a SpeechAdaptationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptationInfo + * @static + * @param {google.cloud.speech.v1p1beta1.SpeechAdaptationInfo} message SpeechAdaptationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpeechAdaptationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.adaptationTimeout = false; + object.timeoutMessage = ""; + } + if (message.adaptationTimeout != null && message.hasOwnProperty("adaptationTimeout")) + object.adaptationTimeout = message.adaptationTimeout; + if (message.timeoutMessage != null && message.hasOwnProperty("timeoutMessage")) + object.timeoutMessage = message.timeoutMessage; + return object; + }; + + /** + * Converts this SpeechAdaptationInfo to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptationInfo + * @instance + * @returns {Object.} JSON object + */ + SpeechAdaptationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpeechAdaptationInfo + * @function getTypeUrl + * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpeechAdaptationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1p1beta1.SpeechAdaptationInfo"; + }; + + return SpeechAdaptationInfo; + })(); + + v1p1beta1.CustomClass = (function() { + + /** + * Properties of a CustomClass. + * @memberof google.cloud.speech.v1p1beta1 + * @interface ICustomClass + * @property {string|null} [name] CustomClass name + * @property {string|null} [customClassId] CustomClass customClassId + * @property {Array.|null} [items] CustomClass items + * @property {string|null} [kmsKeyName] CustomClass kmsKeyName + * @property {string|null} [kmsKeyVersionName] CustomClass kmsKeyVersionName + * @property {string|null} [uid] CustomClass uid + * @property {string|null} [displayName] CustomClass displayName + * @property {google.cloud.speech.v1p1beta1.CustomClass.State|null} [state] CustomClass state + * @property {google.protobuf.ITimestamp|null} [deleteTime] CustomClass deleteTime + * @property {google.protobuf.ITimestamp|null} [expireTime] CustomClass expireTime + * @property {Object.|null} [annotations] CustomClass annotations + * @property {string|null} [etag] CustomClass etag + * @property {boolean|null} [reconciling] CustomClass reconciling + */ + + /** + * Constructs a new CustomClass. + * @memberof google.cloud.speech.v1p1beta1 + * @classdesc Represents a CustomClass. + * @implements ICustomClass + * @constructor + * @param {google.cloud.speech.v1p1beta1.ICustomClass=} [properties] Properties to set + */ + function CustomClass(properties) { + this.items = []; + this.annotations = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomClass name. + * @member {string} name + * @memberof google.cloud.speech.v1p1beta1.CustomClass + * @instance + */ + CustomClass.prototype.name = ""; + + /** + * CustomClass customClassId. + * @member {string} customClassId + * @memberof google.cloud.speech.v1p1beta1.CustomClass + * @instance + */ + CustomClass.prototype.customClassId = ""; + + /** + * CustomClass items. + * @member {Array.} items + * @memberof google.cloud.speech.v1p1beta1.CustomClass + * @instance + */ + CustomClass.prototype.items = $util.emptyArray; + + /** + * CustomClass kmsKeyName. + * @member {string} kmsKeyName + * @memberof google.cloud.speech.v1p1beta1.CustomClass + * @instance + */ + CustomClass.prototype.kmsKeyName = ""; + + /** + * CustomClass kmsKeyVersionName. + * @member {string} kmsKeyVersionName + * @memberof google.cloud.speech.v1p1beta1.CustomClass + * @instance + */ + CustomClass.prototype.kmsKeyVersionName = ""; + + /** + * CustomClass uid. + * @member {string} uid + * @memberof google.cloud.speech.v1p1beta1.CustomClass + * @instance + */ + CustomClass.prototype.uid = ""; + + /** + * CustomClass displayName. + * @member {string} displayName + * @memberof google.cloud.speech.v1p1beta1.CustomClass + * @instance + */ + CustomClass.prototype.displayName = ""; + + /** + * CustomClass state. + * @member {google.cloud.speech.v1p1beta1.CustomClass.State} state + * @memberof google.cloud.speech.v1p1beta1.CustomClass + * @instance + */ + CustomClass.prototype.state = 0; + + /** + * CustomClass deleteTime. + * @member {google.protobuf.ITimestamp|null|undefined} deleteTime + * @memberof google.cloud.speech.v1p1beta1.CustomClass + * @instance + */ + CustomClass.prototype.deleteTime = null; + + /** + * CustomClass expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.cloud.speech.v1p1beta1.CustomClass + * @instance + */ + CustomClass.prototype.expireTime = null; + + /** + * CustomClass annotations. + * @member {Object.} annotations + * @memberof google.cloud.speech.v1p1beta1.CustomClass + * @instance + */ + CustomClass.prototype.annotations = $util.emptyObject; + + /** + * CustomClass etag. + * @member {string} etag + * @memberof google.cloud.speech.v1p1beta1.CustomClass + * @instance + */ + CustomClass.prototype.etag = ""; + + /** + * CustomClass reconciling. + * @member {boolean} reconciling + * @memberof google.cloud.speech.v1p1beta1.CustomClass + * @instance + */ + CustomClass.prototype.reconciling = false; + + /** + * Creates a new CustomClass instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1p1beta1.CustomClass + * @static + * @param {google.cloud.speech.v1p1beta1.ICustomClass=} [properties] Properties to set + * @returns {google.cloud.speech.v1p1beta1.CustomClass} CustomClass instance + */ + CustomClass.create = function create(properties) { + return new CustomClass(properties); + }; + + /** + * Encodes the specified CustomClass message. Does not implicitly {@link google.cloud.speech.v1p1beta1.CustomClass.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1p1beta1.CustomClass + * @static + * @param {google.cloud.speech.v1p1beta1.ICustomClass} message CustomClass message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomClass.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.customClassId != null && Object.hasOwnProperty.call(message, "customClassId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.customClassId); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.encode(message.items[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.kmsKeyName); + if (message.kmsKeyVersionName != null && Object.hasOwnProperty.call(message, "kmsKeyVersionName")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.kmsKeyVersionName); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.uid); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.displayName); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.state); + if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) + $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i) + writer.uint32(/* id 13, wireType 2 =*/106).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.etag); + if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.reconciling); + return writer; + }; + + /** + * Encodes the specified CustomClass message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.CustomClass.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1p1beta1.CustomClass + * @static + * @param {google.cloud.speech.v1p1beta1.ICustomClass} message CustomClass message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomClass.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomClass message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1p1beta1.CustomClass + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1p1beta1.CustomClass} CustomClass + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomClass.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.CustomClass(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.customClassId = reader.string(); + break; + } + case 3: { + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.decode(reader, reader.uint32())); + break; + } + case 6: { + message.kmsKeyName = reader.string(); + break; + } + case 7: { + message.kmsKeyVersionName = reader.string(); + break; + } + case 8: { + message.uid = reader.string(); + break; + } + case 9: { + message.displayName = reader.string(); + break; + } + case 10: { + message.state = reader.int32(); + break; + } + case 11: { + message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 12: { + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 13: { + if (message.annotations === $util.emptyObject) + message.annotations = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.annotations[key] = value; + break; + } + case 14: { + message.etag = reader.string(); + break; + } + case 15: { + message.reconciling = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomClass message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1p1beta1.CustomClass + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1p1beta1.CustomClass} CustomClass + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomClass.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomClass message. + * @function verify + * @memberof google.cloud.speech.v1p1beta1.CustomClass + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomClass.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.customClassId != null && message.hasOwnProperty("customClassId")) + if (!$util.isString(message.customClassId)) + return "customClassId: string expected"; + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (!$util.isString(message.kmsKeyName)) + return "kmsKeyName: string expected"; + if (message.kmsKeyVersionName != null && message.hasOwnProperty("kmsKeyVersionName")) + if (!$util.isString(message.kmsKeyVersionName)) + return "kmsKeyVersionName: string expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 2: + case 4: + break; + } + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); + if (error) + return "deleteTime." + error; + } + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + error; + } + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!$util.isObject(message.annotations)) + return "annotations: object expected"; + var key = Object.keys(message.annotations); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.annotations[key[i]])) + return "annotations: string{k:string} expected"; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + if (typeof message.reconciling !== "boolean") + return "reconciling: boolean expected"; + return null; + }; + + /** + * Creates a CustomClass message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1p1beta1.CustomClass + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1p1beta1.CustomClass} CustomClass + */ + CustomClass.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1p1beta1.CustomClass) + return object; + var message = new $root.google.cloud.speech.v1p1beta1.CustomClass(); + if (object.name != null) + message.name = String(object.name); + if (object.customClassId != null) + message.customClassId = String(object.customClassId); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.speech.v1p1beta1.CustomClass.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.CustomClass.items: object expected"); + message.items[i] = $root.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.fromObject(object.items[i]); + } + } + if (object.kmsKeyName != null) + message.kmsKeyName = String(object.kmsKeyName); + if (object.kmsKeyVersionName != null) + message.kmsKeyVersionName = String(object.kmsKeyVersionName); + if (object.uid != null) + message.uid = String(object.uid); + if (object.displayName != null) + message.displayName = String(object.displayName); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 2: + message.state = 2; + break; + case "DELETED": + case 4: + message.state = 4; + break; + } + if (object.deleteTime != null) { + if (typeof object.deleteTime !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.CustomClass.deleteTime: object expected"); + message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); + } + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.CustomClass.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + if (object.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.CustomClass.annotations: object expected"); + message.annotations = {}; + for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) + message.annotations[keys[i]] = String(object.annotations[keys[i]]); + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.reconciling != null) + message.reconciling = Boolean(object.reconciling); + return message; + }; + + /** + * Creates a plain object from a CustomClass message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1p1beta1.CustomClass + * @static + * @param {google.cloud.speech.v1p1beta1.CustomClass} message CustomClass + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomClass.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (options.objects || options.defaults) + object.annotations = {}; + if (options.defaults) { + object.name = ""; + object.customClassId = ""; + object.kmsKeyName = ""; + object.kmsKeyVersionName = ""; + object.uid = ""; + object.displayName = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.deleteTime = null; + object.expireTime = null; + object.etag = ""; + object.reconciling = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.customClassId != null && message.hasOwnProperty("customClassId")) + object.customClassId = message.customClassId; + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.toObject(message.items[j], options); + } + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + object.kmsKeyName = message.kmsKeyName; + if (message.kmsKeyVersionName != null && message.hasOwnProperty("kmsKeyVersionName")) + object.kmsKeyVersionName = message.kmsKeyVersionName; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.speech.v1p1beta1.CustomClass.State[message.state] === undefined ? message.state : $root.google.cloud.speech.v1p1beta1.CustomClass.State[message.state] : message.state; + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) + object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + var keys2; + if (message.annotations && (keys2 = Object.keys(message.annotations)).length) { + object.annotations = {}; + for (var j = 0; j < keys2.length; ++j) + object.annotations[keys2[j]] = message.annotations[keys2[j]]; + } + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + object.reconciling = message.reconciling; + return object; + }; + + /** + * Converts this CustomClass to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1p1beta1.CustomClass + * @instance + * @returns {Object.} JSON object + */ + CustomClass.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomClass + * @function getTypeUrl + * @memberof google.cloud.speech.v1p1beta1.CustomClass + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomClass.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1p1beta1.CustomClass"; + }; + + CustomClass.ClassItem = (function() { + + /** + * Properties of a ClassItem. + * @memberof google.cloud.speech.v1p1beta1.CustomClass + * @interface IClassItem + * @property {string|null} [value] ClassItem value + */ + + /** + * Constructs a new ClassItem. + * @memberof google.cloud.speech.v1p1beta1.CustomClass + * @classdesc Represents a ClassItem. + * @implements IClassItem + * @constructor + * @param {google.cloud.speech.v1p1beta1.CustomClass.IClassItem=} [properties] Properties to set + */ + function ClassItem(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClassItem value. + * @member {string} value + * @memberof google.cloud.speech.v1p1beta1.CustomClass.ClassItem + * @instance + */ + ClassItem.prototype.value = ""; + + /** + * Creates a new ClassItem instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1p1beta1.CustomClass.ClassItem + * @static + * @param {google.cloud.speech.v1p1beta1.CustomClass.IClassItem=} [properties] Properties to set + * @returns {google.cloud.speech.v1p1beta1.CustomClass.ClassItem} ClassItem instance + */ + ClassItem.create = function create(properties) { + return new ClassItem(properties); + }; + + /** + * Encodes the specified ClassItem message. Does not implicitly {@link google.cloud.speech.v1p1beta1.CustomClass.ClassItem.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1p1beta1.CustomClass.ClassItem + * @static + * @param {google.cloud.speech.v1p1beta1.CustomClass.IClassItem} message ClassItem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClassItem.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + return writer; + }; + + /** + * Encodes the specified ClassItem message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.CustomClass.ClassItem.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1p1beta1.CustomClass.ClassItem + * @static + * @param {google.cloud.speech.v1p1beta1.CustomClass.IClassItem} message ClassItem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClassItem.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClassItem message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1p1beta1.CustomClass.ClassItem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1p1beta1.CustomClass.ClassItem} ClassItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClassItem.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.CustomClass.ClassItem(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClassItem message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1p1beta1.CustomClass.ClassItem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1p1beta1.CustomClass.ClassItem} ClassItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClassItem.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClassItem message. + * @function verify + * @memberof google.cloud.speech.v1p1beta1.CustomClass.ClassItem + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClassItem.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates a ClassItem message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1p1beta1.CustomClass.ClassItem + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1p1beta1.CustomClass.ClassItem} ClassItem + */ + ClassItem.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1p1beta1.CustomClass.ClassItem) + return object; + var message = new $root.google.cloud.speech.v1p1beta1.CustomClass.ClassItem(); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a ClassItem message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1p1beta1.CustomClass.ClassItem + * @static + * @param {google.cloud.speech.v1p1beta1.CustomClass.ClassItem} message ClassItem + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClassItem.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = ""; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this ClassItem to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1p1beta1.CustomClass.ClassItem + * @instance + * @returns {Object.} JSON object + */ + ClassItem.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClassItem + * @function getTypeUrl + * @memberof google.cloud.speech.v1p1beta1.CustomClass.ClassItem + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClassItem.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1p1beta1.CustomClass.ClassItem"; + }; + + return ClassItem; + })(); + + /** + * State enum. + * @name google.cloud.speech.v1p1beta1.CustomClass.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=2 ACTIVE value + * @property {number} DELETED=4 DELETED value + */ + CustomClass.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[2] = "ACTIVE"] = 2; + values[valuesById[4] = "DELETED"] = 4; + return values; + })(); + + return CustomClass; + })(); + + v1p1beta1.PhraseSet = (function() { + + /** + * Properties of a PhraseSet. + * @memberof google.cloud.speech.v1p1beta1 + * @interface IPhraseSet + * @property {string|null} [name] PhraseSet name + * @property {Array.|null} [phrases] PhraseSet phrases + * @property {number|null} [boost] PhraseSet boost + * @property {string|null} [kmsKeyName] PhraseSet kmsKeyName + * @property {string|null} [kmsKeyVersionName] PhraseSet kmsKeyVersionName + * @property {string|null} [uid] PhraseSet uid + * @property {string|null} [displayName] PhraseSet displayName + * @property {google.cloud.speech.v1p1beta1.PhraseSet.State|null} [state] PhraseSet state + * @property {google.protobuf.ITimestamp|null} [deleteTime] PhraseSet deleteTime + * @property {google.protobuf.ITimestamp|null} [expireTime] PhraseSet expireTime + * @property {Object.|null} [annotations] PhraseSet annotations + * @property {string|null} [etag] PhraseSet etag + * @property {boolean|null} [reconciling] PhraseSet reconciling + */ + + /** + * Constructs a new PhraseSet. + * @memberof google.cloud.speech.v1p1beta1 + * @classdesc Represents a PhraseSet. + * @implements IPhraseSet + * @constructor + * @param {google.cloud.speech.v1p1beta1.IPhraseSet=} [properties] Properties to set + */ + function PhraseSet(properties) { + this.phrases = []; + this.annotations = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PhraseSet name. + * @member {string} name + * @memberof google.cloud.speech.v1p1beta1.PhraseSet + * @instance + */ + PhraseSet.prototype.name = ""; + + /** + * PhraseSet phrases. + * @member {Array.} phrases + * @memberof google.cloud.speech.v1p1beta1.PhraseSet + * @instance + */ + PhraseSet.prototype.phrases = $util.emptyArray; + + /** + * PhraseSet boost. + * @member {number} boost + * @memberof google.cloud.speech.v1p1beta1.PhraseSet + * @instance + */ + PhraseSet.prototype.boost = 0; + + /** + * PhraseSet kmsKeyName. + * @member {string} kmsKeyName + * @memberof google.cloud.speech.v1p1beta1.PhraseSet + * @instance + */ + PhraseSet.prototype.kmsKeyName = ""; + + /** + * PhraseSet kmsKeyVersionName. + * @member {string} kmsKeyVersionName + * @memberof google.cloud.speech.v1p1beta1.PhraseSet + * @instance + */ + PhraseSet.prototype.kmsKeyVersionName = ""; + + /** + * PhraseSet uid. + * @member {string} uid + * @memberof google.cloud.speech.v1p1beta1.PhraseSet + * @instance + */ + PhraseSet.prototype.uid = ""; + + /** + * PhraseSet displayName. + * @member {string} displayName + * @memberof google.cloud.speech.v1p1beta1.PhraseSet + * @instance + */ + PhraseSet.prototype.displayName = ""; + + /** + * PhraseSet state. + * @member {google.cloud.speech.v1p1beta1.PhraseSet.State} state + * @memberof google.cloud.speech.v1p1beta1.PhraseSet + * @instance + */ + PhraseSet.prototype.state = 0; + + /** + * PhraseSet deleteTime. + * @member {google.protobuf.ITimestamp|null|undefined} deleteTime + * @memberof google.cloud.speech.v1p1beta1.PhraseSet + * @instance + */ + PhraseSet.prototype.deleteTime = null; + + /** + * PhraseSet expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.cloud.speech.v1p1beta1.PhraseSet + * @instance + */ + PhraseSet.prototype.expireTime = null; + + /** + * PhraseSet annotations. + * @member {Object.} annotations + * @memberof google.cloud.speech.v1p1beta1.PhraseSet + * @instance + */ + PhraseSet.prototype.annotations = $util.emptyObject; + + /** + * PhraseSet etag. + * @member {string} etag + * @memberof google.cloud.speech.v1p1beta1.PhraseSet + * @instance + */ + PhraseSet.prototype.etag = ""; + + /** + * PhraseSet reconciling. + * @member {boolean} reconciling + * @memberof google.cloud.speech.v1p1beta1.PhraseSet + * @instance + */ + PhraseSet.prototype.reconciling = false; + + /** + * Creates a new PhraseSet instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1p1beta1.PhraseSet + * @static + * @param {google.cloud.speech.v1p1beta1.IPhraseSet=} [properties] Properties to set + * @returns {google.cloud.speech.v1p1beta1.PhraseSet} PhraseSet instance + */ + PhraseSet.create = function create(properties) { + return new PhraseSet(properties); + }; + + /** + * Encodes the specified PhraseSet message. Does not implicitly {@link google.cloud.speech.v1p1beta1.PhraseSet.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1p1beta1.PhraseSet + * @static + * @param {google.cloud.speech.v1p1beta1.IPhraseSet} message PhraseSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhraseSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.phrases != null && message.phrases.length) + for (var i = 0; i < message.phrases.length; ++i) + $root.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.encode(message.phrases[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.boost != null && Object.hasOwnProperty.call(message, "boost")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.boost); + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.kmsKeyName); + if (message.kmsKeyVersionName != null && Object.hasOwnProperty.call(message, "kmsKeyVersionName")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.kmsKeyVersionName); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.uid); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.displayName); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.state); + if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) + $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i) + writer.uint32(/* id 14, wireType 2 =*/114).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.etag); + if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.reconciling); + return writer; + }; + + /** + * Encodes the specified PhraseSet message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.PhraseSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1p1beta1.PhraseSet + * @static + * @param {google.cloud.speech.v1p1beta1.IPhraseSet} message PhraseSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhraseSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PhraseSet message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1p1beta1.PhraseSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1p1beta1.PhraseSet} PhraseSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhraseSet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.PhraseSet(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.phrases && message.phrases.length)) + message.phrases = []; + message.phrases.push($root.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.decode(reader, reader.uint32())); + break; + } + case 4: { + message.boost = reader.float(); + break; + } + case 7: { + message.kmsKeyName = reader.string(); + break; + } + case 8: { + message.kmsKeyVersionName = reader.string(); + break; + } + case 9: { + message.uid = reader.string(); + break; + } + case 10: { + message.displayName = reader.string(); + break; + } + case 11: { + message.state = reader.int32(); + break; + } + case 12: { + message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 13: { + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 14: { + if (message.annotations === $util.emptyObject) + message.annotations = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.annotations[key] = value; + break; + } + case 15: { + message.etag = reader.string(); + break; + } + case 16: { + message.reconciling = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PhraseSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1p1beta1.PhraseSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1p1beta1.PhraseSet} PhraseSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhraseSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PhraseSet message. + * @function verify + * @memberof google.cloud.speech.v1p1beta1.PhraseSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PhraseSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.phrases != null && message.hasOwnProperty("phrases")) { + if (!Array.isArray(message.phrases)) + return "phrases: array expected"; + for (var i = 0; i < message.phrases.length; ++i) { + var error = $root.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.verify(message.phrases[i]); + if (error) + return "phrases." + error; + } + } + if (message.boost != null && message.hasOwnProperty("boost")) + if (typeof message.boost !== "number") + return "boost: number expected"; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (!$util.isString(message.kmsKeyName)) + return "kmsKeyName: string expected"; + if (message.kmsKeyVersionName != null && message.hasOwnProperty("kmsKeyVersionName")) + if (!$util.isString(message.kmsKeyVersionName)) + return "kmsKeyVersionName: string expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 2: + case 4: + break; + } + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); + if (error) + return "deleteTime." + error; + } + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + error; + } + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!$util.isObject(message.annotations)) + return "annotations: object expected"; + var key = Object.keys(message.annotations); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.annotations[key[i]])) + return "annotations: string{k:string} expected"; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + if (typeof message.reconciling !== "boolean") + return "reconciling: boolean expected"; + return null; + }; + + /** + * Creates a PhraseSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1p1beta1.PhraseSet + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1p1beta1.PhraseSet} PhraseSet + */ + PhraseSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1p1beta1.PhraseSet) + return object; + var message = new $root.google.cloud.speech.v1p1beta1.PhraseSet(); + if (object.name != null) + message.name = String(object.name); + if (object.phrases) { + if (!Array.isArray(object.phrases)) + throw TypeError(".google.cloud.speech.v1p1beta1.PhraseSet.phrases: array expected"); + message.phrases = []; + for (var i = 0; i < object.phrases.length; ++i) { + if (typeof object.phrases[i] !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.PhraseSet.phrases: object expected"); + message.phrases[i] = $root.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.fromObject(object.phrases[i]); + } + } + if (object.boost != null) + message.boost = Number(object.boost); + if (object.kmsKeyName != null) + message.kmsKeyName = String(object.kmsKeyName); + if (object.kmsKeyVersionName != null) + message.kmsKeyVersionName = String(object.kmsKeyVersionName); + if (object.uid != null) + message.uid = String(object.uid); + if (object.displayName != null) + message.displayName = String(object.displayName); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 2: + message.state = 2; + break; + case "DELETED": + case 4: + message.state = 4; + break; + } + if (object.deleteTime != null) { + if (typeof object.deleteTime !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.PhraseSet.deleteTime: object expected"); + message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); + } + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.PhraseSet.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + if (object.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.PhraseSet.annotations: object expected"); + message.annotations = {}; + for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) + message.annotations[keys[i]] = String(object.annotations[keys[i]]); + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.reconciling != null) + message.reconciling = Boolean(object.reconciling); + return message; + }; + + /** + * Creates a plain object from a PhraseSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1p1beta1.PhraseSet + * @static + * @param {google.cloud.speech.v1p1beta1.PhraseSet} message PhraseSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PhraseSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.phrases = []; + if (options.objects || options.defaults) + object.annotations = {}; + if (options.defaults) { + object.name = ""; + object.boost = 0; + object.kmsKeyName = ""; + object.kmsKeyVersionName = ""; + object.uid = ""; + object.displayName = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.deleteTime = null; + object.expireTime = null; + object.etag = ""; + object.reconciling = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.phrases && message.phrases.length) { + object.phrases = []; + for (var j = 0; j < message.phrases.length; ++j) + object.phrases[j] = $root.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.toObject(message.phrases[j], options); + } + if (message.boost != null && message.hasOwnProperty("boost")) + object.boost = options.json && !isFinite(message.boost) ? String(message.boost) : message.boost; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + object.kmsKeyName = message.kmsKeyName; + if (message.kmsKeyVersionName != null && message.hasOwnProperty("kmsKeyVersionName")) + object.kmsKeyVersionName = message.kmsKeyVersionName; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.speech.v1p1beta1.PhraseSet.State[message.state] === undefined ? message.state : $root.google.cloud.speech.v1p1beta1.PhraseSet.State[message.state] : message.state; + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) + object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + var keys2; + if (message.annotations && (keys2 = Object.keys(message.annotations)).length) { + object.annotations = {}; + for (var j = 0; j < keys2.length; ++j) + object.annotations[keys2[j]] = message.annotations[keys2[j]]; + } + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + object.reconciling = message.reconciling; + return object; + }; + + /** + * Converts this PhraseSet to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1p1beta1.PhraseSet + * @instance + * @returns {Object.} JSON object + */ + PhraseSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PhraseSet + * @function getTypeUrl + * @memberof google.cloud.speech.v1p1beta1.PhraseSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PhraseSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1p1beta1.PhraseSet"; + }; + + PhraseSet.Phrase = (function() { + + /** + * Properties of a Phrase. + * @memberof google.cloud.speech.v1p1beta1.PhraseSet + * @interface IPhrase + * @property {string|null} [value] Phrase value + * @property {number|null} [boost] Phrase boost + */ + + /** + * Constructs a new Phrase. + * @memberof google.cloud.speech.v1p1beta1.PhraseSet + * @classdesc Represents a Phrase. + * @implements IPhrase + * @constructor + * @param {google.cloud.speech.v1p1beta1.PhraseSet.IPhrase=} [properties] Properties to set + */ + function Phrase(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Phrase value. + * @member {string} value + * @memberof google.cloud.speech.v1p1beta1.PhraseSet.Phrase + * @instance + */ + Phrase.prototype.value = ""; + + /** + * Phrase boost. + * @member {number} boost + * @memberof google.cloud.speech.v1p1beta1.PhraseSet.Phrase + * @instance + */ + Phrase.prototype.boost = 0; + + /** + * Creates a new Phrase instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1p1beta1.PhraseSet.Phrase + * @static + * @param {google.cloud.speech.v1p1beta1.PhraseSet.IPhrase=} [properties] Properties to set + * @returns {google.cloud.speech.v1p1beta1.PhraseSet.Phrase} Phrase instance + */ + Phrase.create = function create(properties) { + return new Phrase(properties); + }; + + /** + * Encodes the specified Phrase message. Does not implicitly {@link google.cloud.speech.v1p1beta1.PhraseSet.Phrase.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1p1beta1.PhraseSet.Phrase + * @static + * @param {google.cloud.speech.v1p1beta1.PhraseSet.IPhrase} message Phrase message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Phrase.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + if (message.boost != null && Object.hasOwnProperty.call(message, "boost")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.boost); + return writer; + }; + + /** + * Encodes the specified Phrase message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.PhraseSet.Phrase.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1p1beta1.PhraseSet.Phrase + * @static + * @param {google.cloud.speech.v1p1beta1.PhraseSet.IPhrase} message Phrase message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Phrase.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Phrase message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1p1beta1.PhraseSet.Phrase + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1p1beta1.PhraseSet.Phrase} Phrase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Phrase.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.PhraseSet.Phrase(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.string(); + break; + } + case 2: { + message.boost = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Phrase message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1p1beta1.PhraseSet.Phrase + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1p1beta1.PhraseSet.Phrase} Phrase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Phrase.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Phrase message. + * @function verify + * @memberof google.cloud.speech.v1p1beta1.PhraseSet.Phrase + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Phrase.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + if (message.boost != null && message.hasOwnProperty("boost")) + if (typeof message.boost !== "number") + return "boost: number expected"; + return null; + }; + + /** + * Creates a Phrase message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1p1beta1.PhraseSet.Phrase + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1p1beta1.PhraseSet.Phrase} Phrase + */ + Phrase.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1p1beta1.PhraseSet.Phrase) + return object; + var message = new $root.google.cloud.speech.v1p1beta1.PhraseSet.Phrase(); + if (object.value != null) + message.value = String(object.value); + if (object.boost != null) + message.boost = Number(object.boost); + return message; + }; + + /** + * Creates a plain object from a Phrase message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1p1beta1.PhraseSet.Phrase + * @static + * @param {google.cloud.speech.v1p1beta1.PhraseSet.Phrase} message Phrase + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Phrase.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + object.boost = 0; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.boost != null && message.hasOwnProperty("boost")) + object.boost = options.json && !isFinite(message.boost) ? String(message.boost) : message.boost; + return object; + }; + + /** + * Converts this Phrase to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1p1beta1.PhraseSet.Phrase + * @instance + * @returns {Object.} JSON object + */ + Phrase.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Phrase + * @function getTypeUrl + * @memberof google.cloud.speech.v1p1beta1.PhraseSet.Phrase + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Phrase.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1p1beta1.PhraseSet.Phrase"; + }; + + return Phrase; + })(); + + /** + * State enum. + * @name google.cloud.speech.v1p1beta1.PhraseSet.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=2 ACTIVE value + * @property {number} DELETED=4 DELETED value + */ + PhraseSet.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[2] = "ACTIVE"] = 2; + values[valuesById[4] = "DELETED"] = 4; + return values; + })(); + + return PhraseSet; + })(); + + v1p1beta1.SpeechAdaptation = (function() { + + /** + * Properties of a SpeechAdaptation. + * @memberof google.cloud.speech.v1p1beta1 + * @interface ISpeechAdaptation + * @property {Array.|null} [phraseSets] SpeechAdaptation phraseSets + * @property {Array.|null} [phraseSetReferences] SpeechAdaptation phraseSetReferences + * @property {Array.|null} [customClasses] SpeechAdaptation customClasses + * @property {google.cloud.speech.v1p1beta1.SpeechAdaptation.IABNFGrammar|null} [abnfGrammar] SpeechAdaptation abnfGrammar + */ + + /** + * Constructs a new SpeechAdaptation. + * @memberof google.cloud.speech.v1p1beta1 + * @classdesc Represents a SpeechAdaptation. + * @implements ISpeechAdaptation + * @constructor + * @param {google.cloud.speech.v1p1beta1.ISpeechAdaptation=} [properties] Properties to set + */ + function SpeechAdaptation(properties) { + this.phraseSets = []; + this.phraseSetReferences = []; + this.customClasses = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpeechAdaptation phraseSets. + * @member {Array.} phraseSets + * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptation + * @instance + */ + SpeechAdaptation.prototype.phraseSets = $util.emptyArray; + + /** + * SpeechAdaptation phraseSetReferences. + * @member {Array.} phraseSetReferences + * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptation + * @instance + */ + SpeechAdaptation.prototype.phraseSetReferences = $util.emptyArray; + + /** + * SpeechAdaptation customClasses. + * @member {Array.} customClasses + * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptation + * @instance + */ + SpeechAdaptation.prototype.customClasses = $util.emptyArray; + + /** + * SpeechAdaptation abnfGrammar. + * @member {google.cloud.speech.v1p1beta1.SpeechAdaptation.IABNFGrammar|null|undefined} abnfGrammar + * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptation + * @instance + */ + SpeechAdaptation.prototype.abnfGrammar = null; + + /** + * Creates a new SpeechAdaptation instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptation + * @static + * @param {google.cloud.speech.v1p1beta1.ISpeechAdaptation=} [properties] Properties to set + * @returns {google.cloud.speech.v1p1beta1.SpeechAdaptation} SpeechAdaptation instance + */ + SpeechAdaptation.create = function create(properties) { + return new SpeechAdaptation(properties); + }; + + /** + * Encodes the specified SpeechAdaptation message. Does not implicitly {@link google.cloud.speech.v1p1beta1.SpeechAdaptation.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptation + * @static + * @param {google.cloud.speech.v1p1beta1.ISpeechAdaptation} message SpeechAdaptation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechAdaptation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.phraseSets != null && message.phraseSets.length) + for (var i = 0; i < message.phraseSets.length; ++i) + $root.google.cloud.speech.v1p1beta1.PhraseSet.encode(message.phraseSets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.phraseSetReferences != null && message.phraseSetReferences.length) + for (var i = 0; i < message.phraseSetReferences.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.phraseSetReferences[i]); + if (message.customClasses != null && message.customClasses.length) + for (var i = 0; i < message.customClasses.length; ++i) + $root.google.cloud.speech.v1p1beta1.CustomClass.encode(message.customClasses[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.abnfGrammar != null && Object.hasOwnProperty.call(message, "abnfGrammar")) + $root.google.cloud.speech.v1p1beta1.SpeechAdaptation.ABNFGrammar.encode(message.abnfGrammar, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SpeechAdaptation message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.SpeechAdaptation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptation + * @static + * @param {google.cloud.speech.v1p1beta1.ISpeechAdaptation} message SpeechAdaptation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechAdaptation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpeechAdaptation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1p1beta1.SpeechAdaptation} SpeechAdaptation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechAdaptation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.SpeechAdaptation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.phraseSets && message.phraseSets.length)) + message.phraseSets = []; + message.phraseSets.push($root.google.cloud.speech.v1p1beta1.PhraseSet.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.phraseSetReferences && message.phraseSetReferences.length)) + message.phraseSetReferences = []; + message.phraseSetReferences.push(reader.string()); + break; + } + case 3: { + if (!(message.customClasses && message.customClasses.length)) + message.customClasses = []; + message.customClasses.push($root.google.cloud.speech.v1p1beta1.CustomClass.decode(reader, reader.uint32())); + break; + } + case 4: { + message.abnfGrammar = $root.google.cloud.speech.v1p1beta1.SpeechAdaptation.ABNFGrammar.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpeechAdaptation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1p1beta1.SpeechAdaptation} SpeechAdaptation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechAdaptation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpeechAdaptation message. + * @function verify + * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpeechAdaptation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.phraseSets != null && message.hasOwnProperty("phraseSets")) { + if (!Array.isArray(message.phraseSets)) + return "phraseSets: array expected"; + for (var i = 0; i < message.phraseSets.length; ++i) { + var error = $root.google.cloud.speech.v1p1beta1.PhraseSet.verify(message.phraseSets[i]); + if (error) + return "phraseSets." + error; + } + } + if (message.phraseSetReferences != null && message.hasOwnProperty("phraseSetReferences")) { + if (!Array.isArray(message.phraseSetReferences)) + return "phraseSetReferences: array expected"; + for (var i = 0; i < message.phraseSetReferences.length; ++i) + if (!$util.isString(message.phraseSetReferences[i])) + return "phraseSetReferences: string[] expected"; + } + if (message.customClasses != null && message.hasOwnProperty("customClasses")) { + if (!Array.isArray(message.customClasses)) + return "customClasses: array expected"; + for (var i = 0; i < message.customClasses.length; ++i) { + var error = $root.google.cloud.speech.v1p1beta1.CustomClass.verify(message.customClasses[i]); + if (error) + return "customClasses." + error; + } + } + if (message.abnfGrammar != null && message.hasOwnProperty("abnfGrammar")) { + var error = $root.google.cloud.speech.v1p1beta1.SpeechAdaptation.ABNFGrammar.verify(message.abnfGrammar); + if (error) + return "abnfGrammar." + error; + } + return null; + }; + + /** + * Creates a SpeechAdaptation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1p1beta1.SpeechAdaptation} SpeechAdaptation + */ + SpeechAdaptation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1p1beta1.SpeechAdaptation) + return object; + var message = new $root.google.cloud.speech.v1p1beta1.SpeechAdaptation(); + if (object.phraseSets) { + if (!Array.isArray(object.phraseSets)) + throw TypeError(".google.cloud.speech.v1p1beta1.SpeechAdaptation.phraseSets: array expected"); + message.phraseSets = []; + for (var i = 0; i < object.phraseSets.length; ++i) { + if (typeof object.phraseSets[i] !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.SpeechAdaptation.phraseSets: object expected"); + message.phraseSets[i] = $root.google.cloud.speech.v1p1beta1.PhraseSet.fromObject(object.phraseSets[i]); + } + } + if (object.phraseSetReferences) { + if (!Array.isArray(object.phraseSetReferences)) + throw TypeError(".google.cloud.speech.v1p1beta1.SpeechAdaptation.phraseSetReferences: array expected"); + message.phraseSetReferences = []; + for (var i = 0; i < object.phraseSetReferences.length; ++i) + message.phraseSetReferences[i] = String(object.phraseSetReferences[i]); + } + if (object.customClasses) { + if (!Array.isArray(object.customClasses)) + throw TypeError(".google.cloud.speech.v1p1beta1.SpeechAdaptation.customClasses: array expected"); + message.customClasses = []; + for (var i = 0; i < object.customClasses.length; ++i) { + if (typeof object.customClasses[i] !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.SpeechAdaptation.customClasses: object expected"); + message.customClasses[i] = $root.google.cloud.speech.v1p1beta1.CustomClass.fromObject(object.customClasses[i]); + } + } + if (object.abnfGrammar != null) { + if (typeof object.abnfGrammar !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.SpeechAdaptation.abnfGrammar: object expected"); + message.abnfGrammar = $root.google.cloud.speech.v1p1beta1.SpeechAdaptation.ABNFGrammar.fromObject(object.abnfGrammar); + } + return message; + }; + + /** + * Creates a plain object from a SpeechAdaptation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptation + * @static + * @param {google.cloud.speech.v1p1beta1.SpeechAdaptation} message SpeechAdaptation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpeechAdaptation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.phraseSets = []; + object.phraseSetReferences = []; + object.customClasses = []; + } + if (options.defaults) + object.abnfGrammar = null; + if (message.phraseSets && message.phraseSets.length) { + object.phraseSets = []; + for (var j = 0; j < message.phraseSets.length; ++j) + object.phraseSets[j] = $root.google.cloud.speech.v1p1beta1.PhraseSet.toObject(message.phraseSets[j], options); + } + if (message.phraseSetReferences && message.phraseSetReferences.length) { + object.phraseSetReferences = []; + for (var j = 0; j < message.phraseSetReferences.length; ++j) + object.phraseSetReferences[j] = message.phraseSetReferences[j]; + } + if (message.customClasses && message.customClasses.length) { + object.customClasses = []; + for (var j = 0; j < message.customClasses.length; ++j) + object.customClasses[j] = $root.google.cloud.speech.v1p1beta1.CustomClass.toObject(message.customClasses[j], options); + } + if (message.abnfGrammar != null && message.hasOwnProperty("abnfGrammar")) + object.abnfGrammar = $root.google.cloud.speech.v1p1beta1.SpeechAdaptation.ABNFGrammar.toObject(message.abnfGrammar, options); + return object; + }; + + /** + * Converts this SpeechAdaptation to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptation + * @instance + * @returns {Object.} JSON object + */ + SpeechAdaptation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpeechAdaptation + * @function getTypeUrl + * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpeechAdaptation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1p1beta1.SpeechAdaptation"; + }; + + SpeechAdaptation.ABNFGrammar = (function() { + + /** + * Properties of a ABNFGrammar. + * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptation + * @interface IABNFGrammar + * @property {Array.|null} [abnfStrings] ABNFGrammar abnfStrings + */ + + /** + * Constructs a new ABNFGrammar. + * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptation + * @classdesc Represents a ABNFGrammar. + * @implements IABNFGrammar + * @constructor + * @param {google.cloud.speech.v1p1beta1.SpeechAdaptation.IABNFGrammar=} [properties] Properties to set + */ + function ABNFGrammar(properties) { + this.abnfStrings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ABNFGrammar abnfStrings. + * @member {Array.} abnfStrings + * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptation.ABNFGrammar + * @instance + */ + ABNFGrammar.prototype.abnfStrings = $util.emptyArray; + + /** + * Creates a new ABNFGrammar instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptation.ABNFGrammar + * @static + * @param {google.cloud.speech.v1p1beta1.SpeechAdaptation.IABNFGrammar=} [properties] Properties to set + * @returns {google.cloud.speech.v1p1beta1.SpeechAdaptation.ABNFGrammar} ABNFGrammar instance + */ + ABNFGrammar.create = function create(properties) { + return new ABNFGrammar(properties); + }; + + /** + * Encodes the specified ABNFGrammar message. Does not implicitly {@link google.cloud.speech.v1p1beta1.SpeechAdaptation.ABNFGrammar.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptation.ABNFGrammar + * @static + * @param {google.cloud.speech.v1p1beta1.SpeechAdaptation.IABNFGrammar} message ABNFGrammar message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ABNFGrammar.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.abnfStrings != null && message.abnfStrings.length) + for (var i = 0; i < message.abnfStrings.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.abnfStrings[i]); + return writer; + }; + + /** + * Encodes the specified ABNFGrammar message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.SpeechAdaptation.ABNFGrammar.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptation.ABNFGrammar + * @static + * @param {google.cloud.speech.v1p1beta1.SpeechAdaptation.IABNFGrammar} message ABNFGrammar message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ABNFGrammar.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ABNFGrammar message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptation.ABNFGrammar + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1p1beta1.SpeechAdaptation.ABNFGrammar} ABNFGrammar + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ABNFGrammar.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.SpeechAdaptation.ABNFGrammar(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.abnfStrings && message.abnfStrings.length)) + message.abnfStrings = []; + message.abnfStrings.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ABNFGrammar message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptation.ABNFGrammar + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1p1beta1.SpeechAdaptation.ABNFGrammar} ABNFGrammar + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ABNFGrammar.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ABNFGrammar message. + * @function verify + * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptation.ABNFGrammar + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ABNFGrammar.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.abnfStrings != null && message.hasOwnProperty("abnfStrings")) { + if (!Array.isArray(message.abnfStrings)) + return "abnfStrings: array expected"; + for (var i = 0; i < message.abnfStrings.length; ++i) + if (!$util.isString(message.abnfStrings[i])) + return "abnfStrings: string[] expected"; + } + return null; + }; + + /** + * Creates a ABNFGrammar message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptation.ABNFGrammar + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1p1beta1.SpeechAdaptation.ABNFGrammar} ABNFGrammar + */ + ABNFGrammar.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1p1beta1.SpeechAdaptation.ABNFGrammar) + return object; + var message = new $root.google.cloud.speech.v1p1beta1.SpeechAdaptation.ABNFGrammar(); + if (object.abnfStrings) { + if (!Array.isArray(object.abnfStrings)) + throw TypeError(".google.cloud.speech.v1p1beta1.SpeechAdaptation.ABNFGrammar.abnfStrings: array expected"); + message.abnfStrings = []; + for (var i = 0; i < object.abnfStrings.length; ++i) + message.abnfStrings[i] = String(object.abnfStrings[i]); + } + return message; + }; + + /** + * Creates a plain object from a ABNFGrammar message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptation.ABNFGrammar + * @static + * @param {google.cloud.speech.v1p1beta1.SpeechAdaptation.ABNFGrammar} message ABNFGrammar + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ABNFGrammar.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.abnfStrings = []; + if (message.abnfStrings && message.abnfStrings.length) { + object.abnfStrings = []; + for (var j = 0; j < message.abnfStrings.length; ++j) + object.abnfStrings[j] = message.abnfStrings[j]; + } + return object; + }; + + /** + * Converts this ABNFGrammar to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptation.ABNFGrammar + * @instance + * @returns {Object.} JSON object + */ + ABNFGrammar.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ABNFGrammar + * @function getTypeUrl + * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptation.ABNFGrammar + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ABNFGrammar.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1p1beta1.SpeechAdaptation.ABNFGrammar"; + }; + + return ABNFGrammar; + })(); + + return SpeechAdaptation; + })(); + + v1p1beta1.TranscriptNormalization = (function() { + + /** + * Properties of a TranscriptNormalization. + * @memberof google.cloud.speech.v1p1beta1 + * @interface ITranscriptNormalization + * @property {Array.|null} [entries] TranscriptNormalization entries + */ + + /** + * Constructs a new TranscriptNormalization. + * @memberof google.cloud.speech.v1p1beta1 + * @classdesc Represents a TranscriptNormalization. + * @implements ITranscriptNormalization + * @constructor + * @param {google.cloud.speech.v1p1beta1.ITranscriptNormalization=} [properties] Properties to set + */ + function TranscriptNormalization(properties) { + this.entries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TranscriptNormalization entries. + * @member {Array.} entries + * @memberof google.cloud.speech.v1p1beta1.TranscriptNormalization + * @instance + */ + TranscriptNormalization.prototype.entries = $util.emptyArray; + + /** + * Creates a new TranscriptNormalization instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1p1beta1.TranscriptNormalization + * @static + * @param {google.cloud.speech.v1p1beta1.ITranscriptNormalization=} [properties] Properties to set + * @returns {google.cloud.speech.v1p1beta1.TranscriptNormalization} TranscriptNormalization instance + */ + TranscriptNormalization.create = function create(properties) { + return new TranscriptNormalization(properties); + }; + + /** + * Encodes the specified TranscriptNormalization message. Does not implicitly {@link google.cloud.speech.v1p1beta1.TranscriptNormalization.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1p1beta1.TranscriptNormalization + * @static + * @param {google.cloud.speech.v1p1beta1.ITranscriptNormalization} message TranscriptNormalization message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranscriptNormalization.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entries != null && message.entries.length) + for (var i = 0; i < message.entries.length; ++i) + $root.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry.encode(message.entries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TranscriptNormalization message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.TranscriptNormalization.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1p1beta1.TranscriptNormalization + * @static + * @param {google.cloud.speech.v1p1beta1.ITranscriptNormalization} message TranscriptNormalization message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranscriptNormalization.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TranscriptNormalization message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1p1beta1.TranscriptNormalization + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1p1beta1.TranscriptNormalization} TranscriptNormalization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranscriptNormalization.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.TranscriptNormalization(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.entries && message.entries.length)) + message.entries = []; + message.entries.push($root.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TranscriptNormalization message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1p1beta1.TranscriptNormalization + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1p1beta1.TranscriptNormalization} TranscriptNormalization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranscriptNormalization.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TranscriptNormalization message. + * @function verify + * @memberof google.cloud.speech.v1p1beta1.TranscriptNormalization + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TranscriptNormalization.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entries != null && message.hasOwnProperty("entries")) { + if (!Array.isArray(message.entries)) + return "entries: array expected"; + for (var i = 0; i < message.entries.length; ++i) { + var error = $root.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry.verify(message.entries[i]); + if (error) + return "entries." + error; + } + } + return null; + }; + + /** + * Creates a TranscriptNormalization message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1p1beta1.TranscriptNormalization + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1p1beta1.TranscriptNormalization} TranscriptNormalization + */ + TranscriptNormalization.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1p1beta1.TranscriptNormalization) + return object; + var message = new $root.google.cloud.speech.v1p1beta1.TranscriptNormalization(); + if (object.entries) { + if (!Array.isArray(object.entries)) + throw TypeError(".google.cloud.speech.v1p1beta1.TranscriptNormalization.entries: array expected"); + message.entries = []; + for (var i = 0; i < object.entries.length; ++i) { + if (typeof object.entries[i] !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.TranscriptNormalization.entries: object expected"); + message.entries[i] = $root.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry.fromObject(object.entries[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TranscriptNormalization message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1p1beta1.TranscriptNormalization + * @static + * @param {google.cloud.speech.v1p1beta1.TranscriptNormalization} message TranscriptNormalization + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TranscriptNormalization.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.entries = []; + if (message.entries && message.entries.length) { + object.entries = []; + for (var j = 0; j < message.entries.length; ++j) + object.entries[j] = $root.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry.toObject(message.entries[j], options); + } + return object; + }; + + /** + * Converts this TranscriptNormalization to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1p1beta1.TranscriptNormalization + * @instance + * @returns {Object.} JSON object + */ + TranscriptNormalization.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TranscriptNormalization + * @function getTypeUrl + * @memberof google.cloud.speech.v1p1beta1.TranscriptNormalization + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TranscriptNormalization.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1p1beta1.TranscriptNormalization"; + }; + + TranscriptNormalization.Entry = (function() { + + /** + * Properties of an Entry. + * @memberof google.cloud.speech.v1p1beta1.TranscriptNormalization + * @interface IEntry + * @property {string|null} [search] Entry search + * @property {string|null} [replace] Entry replace + * @property {boolean|null} [caseSensitive] Entry caseSensitive + */ + + /** + * Constructs a new Entry. + * @memberof google.cloud.speech.v1p1beta1.TranscriptNormalization + * @classdesc Represents an Entry. + * @implements IEntry + * @constructor + * @param {google.cloud.speech.v1p1beta1.TranscriptNormalization.IEntry=} [properties] Properties to set + */ + function Entry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Entry search. + * @member {string} search + * @memberof google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry + * @instance + */ + Entry.prototype.search = ""; + + /** + * Entry replace. + * @member {string} replace + * @memberof google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry + * @instance + */ + Entry.prototype.replace = ""; + + /** + * Entry caseSensitive. + * @member {boolean} caseSensitive + * @memberof google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry + * @instance + */ + Entry.prototype.caseSensitive = false; + + /** + * Creates a new Entry instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry + * @static + * @param {google.cloud.speech.v1p1beta1.TranscriptNormalization.IEntry=} [properties] Properties to set + * @returns {google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry} Entry instance + */ + Entry.create = function create(properties) { + return new Entry(properties); + }; + + /** + * Encodes the specified Entry message. Does not implicitly {@link google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry + * @static + * @param {google.cloud.speech.v1p1beta1.TranscriptNormalization.IEntry} message Entry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.search != null && Object.hasOwnProperty.call(message, "search")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.search); + if (message.replace != null && Object.hasOwnProperty.call(message, "replace")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.replace); + if (message.caseSensitive != null && Object.hasOwnProperty.call(message, "caseSensitive")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.caseSensitive); + return writer; + }; + + /** + * Encodes the specified Entry message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry + * @static + * @param {google.cloud.speech.v1p1beta1.TranscriptNormalization.IEntry} message Entry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Entry message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry} Entry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entry.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.search = reader.string(); + break; + } + case 2: { + message.replace = reader.string(); + break; + } + case 3: { + message.caseSensitive = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Entry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry} Entry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Entry message. + * @function verify + * @memberof google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Entry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.search != null && message.hasOwnProperty("search")) + if (!$util.isString(message.search)) + return "search: string expected"; + if (message.replace != null && message.hasOwnProperty("replace")) + if (!$util.isString(message.replace)) + return "replace: string expected"; + if (message.caseSensitive != null && message.hasOwnProperty("caseSensitive")) + if (typeof message.caseSensitive !== "boolean") + return "caseSensitive: boolean expected"; + return null; + }; + + /** + * Creates an Entry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry} Entry + */ + Entry.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry) + return object; + var message = new $root.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry(); + if (object.search != null) + message.search = String(object.search); + if (object.replace != null) + message.replace = String(object.replace); + if (object.caseSensitive != null) + message.caseSensitive = Boolean(object.caseSensitive); + return message; + }; + + /** + * Creates a plain object from an Entry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry + * @static + * @param {google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry} message Entry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Entry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.search = ""; + object.replace = ""; + object.caseSensitive = false; + } + if (message.search != null && message.hasOwnProperty("search")) + object.search = message.search; + if (message.replace != null && message.hasOwnProperty("replace")) + object.replace = message.replace; + if (message.caseSensitive != null && message.hasOwnProperty("caseSensitive")) + object.caseSensitive = message.caseSensitive; + return object; + }; + + /** + * Converts this Entry to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry + * @instance + * @returns {Object.} JSON object + */ + Entry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Entry + * @function getTypeUrl + * @memberof google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Entry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry"; + }; + + return Entry; + })(); + + return TranscriptNormalization; + })(); + + v1p1beta1.Adaptation = (function() { + + /** + * Constructs a new Adaptation service. + * @memberof google.cloud.speech.v1p1beta1 + * @classdesc Represents an Adaptation + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Adaptation(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Adaptation.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Adaptation; + + /** + * Creates new Adaptation service using the specified rpc implementation. + * @function create + * @memberof google.cloud.speech.v1p1beta1.Adaptation + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Adaptation} RPC service. Useful where requests and/or responses are streamed. + */ + Adaptation.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.speech.v1p1beta1.Adaptation|createPhraseSet}. + * @memberof google.cloud.speech.v1p1beta1.Adaptation + * @typedef CreatePhraseSetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.speech.v1p1beta1.PhraseSet} [response] PhraseSet + */ + + /** + * Calls CreatePhraseSet. + * @function createPhraseSet + * @memberof google.cloud.speech.v1p1beta1.Adaptation + * @instance + * @param {google.cloud.speech.v1p1beta1.ICreatePhraseSetRequest} request CreatePhraseSetRequest message or plain object + * @param {google.cloud.speech.v1p1beta1.Adaptation.CreatePhraseSetCallback} callback Node-style callback called with the error, if any, and PhraseSet + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Adaptation.prototype.createPhraseSet = function createPhraseSet(request, callback) { + return this.rpcCall(createPhraseSet, $root.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest, $root.google.cloud.speech.v1p1beta1.PhraseSet, request, callback); + }, "name", { value: "CreatePhraseSet" }); + + /** + * Calls CreatePhraseSet. + * @function createPhraseSet + * @memberof google.cloud.speech.v1p1beta1.Adaptation + * @instance + * @param {google.cloud.speech.v1p1beta1.ICreatePhraseSetRequest} request CreatePhraseSetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.speech.v1p1beta1.Adaptation|getPhraseSet}. + * @memberof google.cloud.speech.v1p1beta1.Adaptation + * @typedef GetPhraseSetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.speech.v1p1beta1.PhraseSet} [response] PhraseSet + */ + + /** + * Calls GetPhraseSet. + * @function getPhraseSet + * @memberof google.cloud.speech.v1p1beta1.Adaptation + * @instance + * @param {google.cloud.speech.v1p1beta1.IGetPhraseSetRequest} request GetPhraseSetRequest message or plain object + * @param {google.cloud.speech.v1p1beta1.Adaptation.GetPhraseSetCallback} callback Node-style callback called with the error, if any, and PhraseSet + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Adaptation.prototype.getPhraseSet = function getPhraseSet(request, callback) { + return this.rpcCall(getPhraseSet, $root.google.cloud.speech.v1p1beta1.GetPhraseSetRequest, $root.google.cloud.speech.v1p1beta1.PhraseSet, request, callback); + }, "name", { value: "GetPhraseSet" }); + + /** + * Calls GetPhraseSet. + * @function getPhraseSet + * @memberof google.cloud.speech.v1p1beta1.Adaptation + * @instance + * @param {google.cloud.speech.v1p1beta1.IGetPhraseSetRequest} request GetPhraseSetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.speech.v1p1beta1.Adaptation|listPhraseSet}. + * @memberof google.cloud.speech.v1p1beta1.Adaptation + * @typedef ListPhraseSetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.speech.v1p1beta1.ListPhraseSetResponse} [response] ListPhraseSetResponse + */ + + /** + * Calls ListPhraseSet. + * @function listPhraseSet + * @memberof google.cloud.speech.v1p1beta1.Adaptation + * @instance + * @param {google.cloud.speech.v1p1beta1.IListPhraseSetRequest} request ListPhraseSetRequest message or plain object + * @param {google.cloud.speech.v1p1beta1.Adaptation.ListPhraseSetCallback} callback Node-style callback called with the error, if any, and ListPhraseSetResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Adaptation.prototype.listPhraseSet = function listPhraseSet(request, callback) { + return this.rpcCall(listPhraseSet, $root.google.cloud.speech.v1p1beta1.ListPhraseSetRequest, $root.google.cloud.speech.v1p1beta1.ListPhraseSetResponse, request, callback); + }, "name", { value: "ListPhraseSet" }); + + /** + * Calls ListPhraseSet. + * @function listPhraseSet + * @memberof google.cloud.speech.v1p1beta1.Adaptation + * @instance + * @param {google.cloud.speech.v1p1beta1.IListPhraseSetRequest} request ListPhraseSetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.speech.v1p1beta1.Adaptation|updatePhraseSet}. + * @memberof google.cloud.speech.v1p1beta1.Adaptation + * @typedef UpdatePhraseSetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.speech.v1p1beta1.PhraseSet} [response] PhraseSet + */ + + /** + * Calls UpdatePhraseSet. + * @function updatePhraseSet + * @memberof google.cloud.speech.v1p1beta1.Adaptation + * @instance + * @param {google.cloud.speech.v1p1beta1.IUpdatePhraseSetRequest} request UpdatePhraseSetRequest message or plain object + * @param {google.cloud.speech.v1p1beta1.Adaptation.UpdatePhraseSetCallback} callback Node-style callback called with the error, if any, and PhraseSet + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Adaptation.prototype.updatePhraseSet = function updatePhraseSet(request, callback) { + return this.rpcCall(updatePhraseSet, $root.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest, $root.google.cloud.speech.v1p1beta1.PhraseSet, request, callback); + }, "name", { value: "UpdatePhraseSet" }); + + /** + * Calls UpdatePhraseSet. + * @function updatePhraseSet + * @memberof google.cloud.speech.v1p1beta1.Adaptation + * @instance + * @param {google.cloud.speech.v1p1beta1.IUpdatePhraseSetRequest} request UpdatePhraseSetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.speech.v1p1beta1.Adaptation|deletePhraseSet}. + * @memberof google.cloud.speech.v1p1beta1.Adaptation + * @typedef DeletePhraseSetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeletePhraseSet. + * @function deletePhraseSet + * @memberof google.cloud.speech.v1p1beta1.Adaptation + * @instance + * @param {google.cloud.speech.v1p1beta1.IDeletePhraseSetRequest} request DeletePhraseSetRequest message or plain object + * @param {google.cloud.speech.v1p1beta1.Adaptation.DeletePhraseSetCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Adaptation.prototype.deletePhraseSet = function deletePhraseSet(request, callback) { + return this.rpcCall(deletePhraseSet, $root.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeletePhraseSet" }); + + /** + * Calls DeletePhraseSet. + * @function deletePhraseSet + * @memberof google.cloud.speech.v1p1beta1.Adaptation + * @instance + * @param {google.cloud.speech.v1p1beta1.IDeletePhraseSetRequest} request DeletePhraseSetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.speech.v1p1beta1.Adaptation|createCustomClass}. + * @memberof google.cloud.speech.v1p1beta1.Adaptation + * @typedef CreateCustomClassCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.speech.v1p1beta1.CustomClass} [response] CustomClass + */ + + /** + * Calls CreateCustomClass. + * @function createCustomClass + * @memberof google.cloud.speech.v1p1beta1.Adaptation + * @instance + * @param {google.cloud.speech.v1p1beta1.ICreateCustomClassRequest} request CreateCustomClassRequest message or plain object + * @param {google.cloud.speech.v1p1beta1.Adaptation.CreateCustomClassCallback} callback Node-style callback called with the error, if any, and CustomClass + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Adaptation.prototype.createCustomClass = function createCustomClass(request, callback) { + return this.rpcCall(createCustomClass, $root.google.cloud.speech.v1p1beta1.CreateCustomClassRequest, $root.google.cloud.speech.v1p1beta1.CustomClass, request, callback); + }, "name", { value: "CreateCustomClass" }); + + /** + * Calls CreateCustomClass. + * @function createCustomClass + * @memberof google.cloud.speech.v1p1beta1.Adaptation + * @instance + * @param {google.cloud.speech.v1p1beta1.ICreateCustomClassRequest} request CreateCustomClassRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.speech.v1p1beta1.Adaptation|getCustomClass}. + * @memberof google.cloud.speech.v1p1beta1.Adaptation + * @typedef GetCustomClassCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.speech.v1p1beta1.CustomClass} [response] CustomClass + */ + + /** + * Calls GetCustomClass. + * @function getCustomClass + * @memberof google.cloud.speech.v1p1beta1.Adaptation + * @instance + * @param {google.cloud.speech.v1p1beta1.IGetCustomClassRequest} request GetCustomClassRequest message or plain object + * @param {google.cloud.speech.v1p1beta1.Adaptation.GetCustomClassCallback} callback Node-style callback called with the error, if any, and CustomClass + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Adaptation.prototype.getCustomClass = function getCustomClass(request, callback) { + return this.rpcCall(getCustomClass, $root.google.cloud.speech.v1p1beta1.GetCustomClassRequest, $root.google.cloud.speech.v1p1beta1.CustomClass, request, callback); + }, "name", { value: "GetCustomClass" }); + + /** + * Calls GetCustomClass. + * @function getCustomClass + * @memberof google.cloud.speech.v1p1beta1.Adaptation + * @instance + * @param {google.cloud.speech.v1p1beta1.IGetCustomClassRequest} request GetCustomClassRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.speech.v1p1beta1.Adaptation|listCustomClasses}. + * @memberof google.cloud.speech.v1p1beta1.Adaptation + * @typedef ListCustomClassesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.speech.v1p1beta1.ListCustomClassesResponse} [response] ListCustomClassesResponse + */ + + /** + * Calls ListCustomClasses. + * @function listCustomClasses + * @memberof google.cloud.speech.v1p1beta1.Adaptation + * @instance + * @param {google.cloud.speech.v1p1beta1.IListCustomClassesRequest} request ListCustomClassesRequest message or plain object + * @param {google.cloud.speech.v1p1beta1.Adaptation.ListCustomClassesCallback} callback Node-style callback called with the error, if any, and ListCustomClassesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Adaptation.prototype.listCustomClasses = function listCustomClasses(request, callback) { + return this.rpcCall(listCustomClasses, $root.google.cloud.speech.v1p1beta1.ListCustomClassesRequest, $root.google.cloud.speech.v1p1beta1.ListCustomClassesResponse, request, callback); + }, "name", { value: "ListCustomClasses" }); + + /** + * Calls ListCustomClasses. + * @function listCustomClasses + * @memberof google.cloud.speech.v1p1beta1.Adaptation + * @instance + * @param {google.cloud.speech.v1p1beta1.IListCustomClassesRequest} request ListCustomClassesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.speech.v1p1beta1.Adaptation|updateCustomClass}. + * @memberof google.cloud.speech.v1p1beta1.Adaptation + * @typedef UpdateCustomClassCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.speech.v1p1beta1.CustomClass} [response] CustomClass + */ + + /** + * Calls UpdateCustomClass. + * @function updateCustomClass + * @memberof google.cloud.speech.v1p1beta1.Adaptation + * @instance + * @param {google.cloud.speech.v1p1beta1.IUpdateCustomClassRequest} request UpdateCustomClassRequest message or plain object + * @param {google.cloud.speech.v1p1beta1.Adaptation.UpdateCustomClassCallback} callback Node-style callback called with the error, if any, and CustomClass + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Adaptation.prototype.updateCustomClass = function updateCustomClass(request, callback) { + return this.rpcCall(updateCustomClass, $root.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest, $root.google.cloud.speech.v1p1beta1.CustomClass, request, callback); + }, "name", { value: "UpdateCustomClass" }); + + /** + * Calls UpdateCustomClass. + * @function updateCustomClass + * @memberof google.cloud.speech.v1p1beta1.Adaptation + * @instance + * @param {google.cloud.speech.v1p1beta1.IUpdateCustomClassRequest} request UpdateCustomClassRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.speech.v1p1beta1.Adaptation|deleteCustomClass}. + * @memberof google.cloud.speech.v1p1beta1.Adaptation + * @typedef DeleteCustomClassCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteCustomClass. + * @function deleteCustomClass + * @memberof google.cloud.speech.v1p1beta1.Adaptation + * @instance + * @param {google.cloud.speech.v1p1beta1.IDeleteCustomClassRequest} request DeleteCustomClassRequest message or plain object + * @param {google.cloud.speech.v1p1beta1.Adaptation.DeleteCustomClassCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Adaptation.prototype.deleteCustomClass = function deleteCustomClass(request, callback) { + return this.rpcCall(deleteCustomClass, $root.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteCustomClass" }); + + /** + * Calls DeleteCustomClass. + * @function deleteCustomClass + * @memberof google.cloud.speech.v1p1beta1.Adaptation + * @instance + * @param {google.cloud.speech.v1p1beta1.IDeleteCustomClassRequest} request DeleteCustomClassRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Adaptation; + })(); + + v1p1beta1.CreatePhraseSetRequest = (function() { + + /** + * Properties of a CreatePhraseSetRequest. + * @memberof google.cloud.speech.v1p1beta1 + * @interface ICreatePhraseSetRequest + * @property {string|null} [parent] CreatePhraseSetRequest parent + * @property {string|null} [phraseSetId] CreatePhraseSetRequest phraseSetId + * @property {google.cloud.speech.v1p1beta1.IPhraseSet|null} [phraseSet] CreatePhraseSetRequest phraseSet + */ + + /** + * Constructs a new CreatePhraseSetRequest. + * @memberof google.cloud.speech.v1p1beta1 + * @classdesc Represents a CreatePhraseSetRequest. + * @implements ICreatePhraseSetRequest + * @constructor + * @param {google.cloud.speech.v1p1beta1.ICreatePhraseSetRequest=} [properties] Properties to set + */ + function CreatePhraseSetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreatePhraseSetRequest parent. + * @member {string} parent + * @memberof google.cloud.speech.v1p1beta1.CreatePhraseSetRequest + * @instance + */ + CreatePhraseSetRequest.prototype.parent = ""; + + /** + * CreatePhraseSetRequest phraseSetId. + * @member {string} phraseSetId + * @memberof google.cloud.speech.v1p1beta1.CreatePhraseSetRequest + * @instance + */ + CreatePhraseSetRequest.prototype.phraseSetId = ""; + + /** + * CreatePhraseSetRequest phraseSet. + * @member {google.cloud.speech.v1p1beta1.IPhraseSet|null|undefined} phraseSet + * @memberof google.cloud.speech.v1p1beta1.CreatePhraseSetRequest + * @instance + */ + CreatePhraseSetRequest.prototype.phraseSet = null; + + /** + * Creates a new CreatePhraseSetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1p1beta1.CreatePhraseSetRequest + * @static + * @param {google.cloud.speech.v1p1beta1.ICreatePhraseSetRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v1p1beta1.CreatePhraseSetRequest} CreatePhraseSetRequest instance + */ + CreatePhraseSetRequest.create = function create(properties) { + return new CreatePhraseSetRequest(properties); + }; + + /** + * Encodes the specified CreatePhraseSetRequest message. Does not implicitly {@link google.cloud.speech.v1p1beta1.CreatePhraseSetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1p1beta1.CreatePhraseSetRequest + * @static + * @param {google.cloud.speech.v1p1beta1.ICreatePhraseSetRequest} message CreatePhraseSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreatePhraseSetRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.phraseSetId != null && Object.hasOwnProperty.call(message, "phraseSetId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.phraseSetId); + if (message.phraseSet != null && Object.hasOwnProperty.call(message, "phraseSet")) + $root.google.cloud.speech.v1p1beta1.PhraseSet.encode(message.phraseSet, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreatePhraseSetRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.CreatePhraseSetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1p1beta1.CreatePhraseSetRequest + * @static + * @param {google.cloud.speech.v1p1beta1.ICreatePhraseSetRequest} message CreatePhraseSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreatePhraseSetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreatePhraseSetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1p1beta1.CreatePhraseSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1p1beta1.CreatePhraseSetRequest} CreatePhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreatePhraseSetRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.phraseSetId = reader.string(); + break; + } + case 3: { + message.phraseSet = $root.google.cloud.speech.v1p1beta1.PhraseSet.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreatePhraseSetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1p1beta1.CreatePhraseSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1p1beta1.CreatePhraseSetRequest} CreatePhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreatePhraseSetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreatePhraseSetRequest message. + * @function verify + * @memberof google.cloud.speech.v1p1beta1.CreatePhraseSetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreatePhraseSetRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.phraseSetId != null && message.hasOwnProperty("phraseSetId")) + if (!$util.isString(message.phraseSetId)) + return "phraseSetId: string expected"; + if (message.phraseSet != null && message.hasOwnProperty("phraseSet")) { + var error = $root.google.cloud.speech.v1p1beta1.PhraseSet.verify(message.phraseSet); + if (error) + return "phraseSet." + error; + } + return null; + }; + + /** + * Creates a CreatePhraseSetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1p1beta1.CreatePhraseSetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1p1beta1.CreatePhraseSetRequest} CreatePhraseSetRequest + */ + CreatePhraseSetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest) + return object; + var message = new $root.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.phraseSetId != null) + message.phraseSetId = String(object.phraseSetId); + if (object.phraseSet != null) { + if (typeof object.phraseSet !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.CreatePhraseSetRequest.phraseSet: object expected"); + message.phraseSet = $root.google.cloud.speech.v1p1beta1.PhraseSet.fromObject(object.phraseSet); + } + return message; + }; + + /** + * Creates a plain object from a CreatePhraseSetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1p1beta1.CreatePhraseSetRequest + * @static + * @param {google.cloud.speech.v1p1beta1.CreatePhraseSetRequest} message CreatePhraseSetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreatePhraseSetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.phraseSetId = ""; + object.phraseSet = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.phraseSetId != null && message.hasOwnProperty("phraseSetId")) + object.phraseSetId = message.phraseSetId; + if (message.phraseSet != null && message.hasOwnProperty("phraseSet")) + object.phraseSet = $root.google.cloud.speech.v1p1beta1.PhraseSet.toObject(message.phraseSet, options); + return object; + }; + + /** + * Converts this CreatePhraseSetRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1p1beta1.CreatePhraseSetRequest + * @instance + * @returns {Object.} JSON object + */ + CreatePhraseSetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreatePhraseSetRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v1p1beta1.CreatePhraseSetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreatePhraseSetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1p1beta1.CreatePhraseSetRequest"; + }; + + return CreatePhraseSetRequest; + })(); + + v1p1beta1.UpdatePhraseSetRequest = (function() { + + /** + * Properties of an UpdatePhraseSetRequest. + * @memberof google.cloud.speech.v1p1beta1 + * @interface IUpdatePhraseSetRequest + * @property {google.cloud.speech.v1p1beta1.IPhraseSet|null} [phraseSet] UpdatePhraseSetRequest phraseSet + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdatePhraseSetRequest updateMask + */ + + /** + * Constructs a new UpdatePhraseSetRequest. + * @memberof google.cloud.speech.v1p1beta1 + * @classdesc Represents an UpdatePhraseSetRequest. + * @implements IUpdatePhraseSetRequest + * @constructor + * @param {google.cloud.speech.v1p1beta1.IUpdatePhraseSetRequest=} [properties] Properties to set + */ + function UpdatePhraseSetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdatePhraseSetRequest phraseSet. + * @member {google.cloud.speech.v1p1beta1.IPhraseSet|null|undefined} phraseSet + * @memberof google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest + * @instance + */ + UpdatePhraseSetRequest.prototype.phraseSet = null; + + /** + * UpdatePhraseSetRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest + * @instance + */ + UpdatePhraseSetRequest.prototype.updateMask = null; + + /** + * Creates a new UpdatePhraseSetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest + * @static + * @param {google.cloud.speech.v1p1beta1.IUpdatePhraseSetRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest} UpdatePhraseSetRequest instance + */ + UpdatePhraseSetRequest.create = function create(properties) { + return new UpdatePhraseSetRequest(properties); + }; + + /** + * Encodes the specified UpdatePhraseSetRequest message. Does not implicitly {@link google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest + * @static + * @param {google.cloud.speech.v1p1beta1.IUpdatePhraseSetRequest} message UpdatePhraseSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdatePhraseSetRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.phraseSet != null && Object.hasOwnProperty.call(message, "phraseSet")) + $root.google.cloud.speech.v1p1beta1.PhraseSet.encode(message.phraseSet, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdatePhraseSetRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest + * @static + * @param {google.cloud.speech.v1p1beta1.IUpdatePhraseSetRequest} message UpdatePhraseSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdatePhraseSetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdatePhraseSetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest} UpdatePhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdatePhraseSetRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.phraseSet = $root.google.cloud.speech.v1p1beta1.PhraseSet.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdatePhraseSetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest} UpdatePhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdatePhraseSetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdatePhraseSetRequest message. + * @function verify + * @memberof google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdatePhraseSetRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.phraseSet != null && message.hasOwnProperty("phraseSet")) { + var error = $root.google.cloud.speech.v1p1beta1.PhraseSet.verify(message.phraseSet); + if (error) + return "phraseSet." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdatePhraseSetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest} UpdatePhraseSetRequest + */ + UpdatePhraseSetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest) + return object; + var message = new $root.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest(); + if (object.phraseSet != null) { + if (typeof object.phraseSet !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest.phraseSet: object expected"); + message.phraseSet = $root.google.cloud.speech.v1p1beta1.PhraseSet.fromObject(object.phraseSet); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdatePhraseSetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest + * @static + * @param {google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest} message UpdatePhraseSetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdatePhraseSetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.phraseSet = null; + object.updateMask = null; + } + if (message.phraseSet != null && message.hasOwnProperty("phraseSet")) + object.phraseSet = $root.google.cloud.speech.v1p1beta1.PhraseSet.toObject(message.phraseSet, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdatePhraseSetRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest + * @instance + * @returns {Object.} JSON object + */ + UpdatePhraseSetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdatePhraseSetRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdatePhraseSetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest"; + }; + + return UpdatePhraseSetRequest; + })(); + + v1p1beta1.GetPhraseSetRequest = (function() { + + /** + * Properties of a GetPhraseSetRequest. + * @memberof google.cloud.speech.v1p1beta1 + * @interface IGetPhraseSetRequest + * @property {string|null} [name] GetPhraseSetRequest name + */ + + /** + * Constructs a new GetPhraseSetRequest. + * @memberof google.cloud.speech.v1p1beta1 + * @classdesc Represents a GetPhraseSetRequest. + * @implements IGetPhraseSetRequest + * @constructor + * @param {google.cloud.speech.v1p1beta1.IGetPhraseSetRequest=} [properties] Properties to set + */ + function GetPhraseSetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetPhraseSetRequest name. + * @member {string} name + * @memberof google.cloud.speech.v1p1beta1.GetPhraseSetRequest + * @instance + */ + GetPhraseSetRequest.prototype.name = ""; + + /** + * Creates a new GetPhraseSetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1p1beta1.GetPhraseSetRequest + * @static + * @param {google.cloud.speech.v1p1beta1.IGetPhraseSetRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v1p1beta1.GetPhraseSetRequest} GetPhraseSetRequest instance + */ + GetPhraseSetRequest.create = function create(properties) { + return new GetPhraseSetRequest(properties); + }; + + /** + * Encodes the specified GetPhraseSetRequest message. Does not implicitly {@link google.cloud.speech.v1p1beta1.GetPhraseSetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1p1beta1.GetPhraseSetRequest + * @static + * @param {google.cloud.speech.v1p1beta1.IGetPhraseSetRequest} message GetPhraseSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPhraseSetRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetPhraseSetRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.GetPhraseSetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1p1beta1.GetPhraseSetRequest + * @static + * @param {google.cloud.speech.v1p1beta1.IGetPhraseSetRequest} message GetPhraseSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPhraseSetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPhraseSetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1p1beta1.GetPhraseSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1p1beta1.GetPhraseSetRequest} GetPhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPhraseSetRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.GetPhraseSetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetPhraseSetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1p1beta1.GetPhraseSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1p1beta1.GetPhraseSetRequest} GetPhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPhraseSetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPhraseSetRequest message. + * @function verify + * @memberof google.cloud.speech.v1p1beta1.GetPhraseSetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPhraseSetRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetPhraseSetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1p1beta1.GetPhraseSetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1p1beta1.GetPhraseSetRequest} GetPhraseSetRequest + */ + GetPhraseSetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1p1beta1.GetPhraseSetRequest) + return object; + var message = new $root.google.cloud.speech.v1p1beta1.GetPhraseSetRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetPhraseSetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1p1beta1.GetPhraseSetRequest + * @static + * @param {google.cloud.speech.v1p1beta1.GetPhraseSetRequest} message GetPhraseSetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPhraseSetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetPhraseSetRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1p1beta1.GetPhraseSetRequest + * @instance + * @returns {Object.} JSON object + */ + GetPhraseSetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetPhraseSetRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v1p1beta1.GetPhraseSetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetPhraseSetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1p1beta1.GetPhraseSetRequest"; + }; + + return GetPhraseSetRequest; + })(); + + v1p1beta1.ListPhraseSetRequest = (function() { + + /** + * Properties of a ListPhraseSetRequest. + * @memberof google.cloud.speech.v1p1beta1 + * @interface IListPhraseSetRequest + * @property {string|null} [parent] ListPhraseSetRequest parent + * @property {number|null} [pageSize] ListPhraseSetRequest pageSize + * @property {string|null} [pageToken] ListPhraseSetRequest pageToken + */ + + /** + * Constructs a new ListPhraseSetRequest. + * @memberof google.cloud.speech.v1p1beta1 + * @classdesc Represents a ListPhraseSetRequest. + * @implements IListPhraseSetRequest + * @constructor + * @param {google.cloud.speech.v1p1beta1.IListPhraseSetRequest=} [properties] Properties to set + */ + function ListPhraseSetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListPhraseSetRequest parent. + * @member {string} parent + * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetRequest + * @instance + */ + ListPhraseSetRequest.prototype.parent = ""; + + /** + * ListPhraseSetRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetRequest + * @instance + */ + ListPhraseSetRequest.prototype.pageSize = 0; + + /** + * ListPhraseSetRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetRequest + * @instance + */ + ListPhraseSetRequest.prototype.pageToken = ""; + + /** + * Creates a new ListPhraseSetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetRequest + * @static + * @param {google.cloud.speech.v1p1beta1.IListPhraseSetRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v1p1beta1.ListPhraseSetRequest} ListPhraseSetRequest instance + */ + ListPhraseSetRequest.create = function create(properties) { + return new ListPhraseSetRequest(properties); + }; + + /** + * Encodes the specified ListPhraseSetRequest message. Does not implicitly {@link google.cloud.speech.v1p1beta1.ListPhraseSetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetRequest + * @static + * @param {google.cloud.speech.v1p1beta1.IListPhraseSetRequest} message ListPhraseSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPhraseSetRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListPhraseSetRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.ListPhraseSetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetRequest + * @static + * @param {google.cloud.speech.v1p1beta1.IListPhraseSetRequest} message ListPhraseSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPhraseSetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPhraseSetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1p1beta1.ListPhraseSetRequest} ListPhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPhraseSetRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.ListPhraseSetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListPhraseSetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1p1beta1.ListPhraseSetRequest} ListPhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPhraseSetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPhraseSetRequest message. + * @function verify + * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPhraseSetRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListPhraseSetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1p1beta1.ListPhraseSetRequest} ListPhraseSetRequest + */ + ListPhraseSetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1p1beta1.ListPhraseSetRequest) + return object; + var message = new $root.google.cloud.speech.v1p1beta1.ListPhraseSetRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListPhraseSetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetRequest + * @static + * @param {google.cloud.speech.v1p1beta1.ListPhraseSetRequest} message ListPhraseSetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPhraseSetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListPhraseSetRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetRequest + * @instance + * @returns {Object.} JSON object + */ + ListPhraseSetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListPhraseSetRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPhraseSetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1p1beta1.ListPhraseSetRequest"; + }; + + return ListPhraseSetRequest; + })(); + + v1p1beta1.ListPhraseSetResponse = (function() { + + /** + * Properties of a ListPhraseSetResponse. + * @memberof google.cloud.speech.v1p1beta1 + * @interface IListPhraseSetResponse + * @property {Array.|null} [phraseSets] ListPhraseSetResponse phraseSets + * @property {string|null} [nextPageToken] ListPhraseSetResponse nextPageToken + */ + + /** + * Constructs a new ListPhraseSetResponse. + * @memberof google.cloud.speech.v1p1beta1 + * @classdesc Represents a ListPhraseSetResponse. + * @implements IListPhraseSetResponse + * @constructor + * @param {google.cloud.speech.v1p1beta1.IListPhraseSetResponse=} [properties] Properties to set + */ + function ListPhraseSetResponse(properties) { + this.phraseSets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListPhraseSetResponse phraseSets. + * @member {Array.} phraseSets + * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetResponse + * @instance + */ + ListPhraseSetResponse.prototype.phraseSets = $util.emptyArray; + + /** + * ListPhraseSetResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetResponse + * @instance + */ + ListPhraseSetResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListPhraseSetResponse instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetResponse + * @static + * @param {google.cloud.speech.v1p1beta1.IListPhraseSetResponse=} [properties] Properties to set + * @returns {google.cloud.speech.v1p1beta1.ListPhraseSetResponse} ListPhraseSetResponse instance + */ + ListPhraseSetResponse.create = function create(properties) { + return new ListPhraseSetResponse(properties); + }; + + /** + * Encodes the specified ListPhraseSetResponse message. Does not implicitly {@link google.cloud.speech.v1p1beta1.ListPhraseSetResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetResponse + * @static + * @param {google.cloud.speech.v1p1beta1.IListPhraseSetResponse} message ListPhraseSetResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPhraseSetResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.phraseSets != null && message.phraseSets.length) + for (var i = 0; i < message.phraseSets.length; ++i) + $root.google.cloud.speech.v1p1beta1.PhraseSet.encode(message.phraseSets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListPhraseSetResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.ListPhraseSetResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetResponse + * @static + * @param {google.cloud.speech.v1p1beta1.IListPhraseSetResponse} message ListPhraseSetResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPhraseSetResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPhraseSetResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1p1beta1.ListPhraseSetResponse} ListPhraseSetResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPhraseSetResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.ListPhraseSetResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.phraseSets && message.phraseSets.length)) + message.phraseSets = []; + message.phraseSets.push($root.google.cloud.speech.v1p1beta1.PhraseSet.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListPhraseSetResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1p1beta1.ListPhraseSetResponse} ListPhraseSetResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPhraseSetResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPhraseSetResponse message. + * @function verify + * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPhraseSetResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.phraseSets != null && message.hasOwnProperty("phraseSets")) { + if (!Array.isArray(message.phraseSets)) + return "phraseSets: array expected"; + for (var i = 0; i < message.phraseSets.length; ++i) { + var error = $root.google.cloud.speech.v1p1beta1.PhraseSet.verify(message.phraseSets[i]); + if (error) + return "phraseSets." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListPhraseSetResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1p1beta1.ListPhraseSetResponse} ListPhraseSetResponse + */ + ListPhraseSetResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1p1beta1.ListPhraseSetResponse) + return object; + var message = new $root.google.cloud.speech.v1p1beta1.ListPhraseSetResponse(); + if (object.phraseSets) { + if (!Array.isArray(object.phraseSets)) + throw TypeError(".google.cloud.speech.v1p1beta1.ListPhraseSetResponse.phraseSets: array expected"); + message.phraseSets = []; + for (var i = 0; i < object.phraseSets.length; ++i) { + if (typeof object.phraseSets[i] !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.ListPhraseSetResponse.phraseSets: object expected"); + message.phraseSets[i] = $root.google.cloud.speech.v1p1beta1.PhraseSet.fromObject(object.phraseSets[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListPhraseSetResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetResponse + * @static + * @param {google.cloud.speech.v1p1beta1.ListPhraseSetResponse} message ListPhraseSetResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPhraseSetResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.phraseSets = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.phraseSets && message.phraseSets.length) { + object.phraseSets = []; + for (var j = 0; j < message.phraseSets.length; ++j) + object.phraseSets[j] = $root.google.cloud.speech.v1p1beta1.PhraseSet.toObject(message.phraseSets[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListPhraseSetResponse to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetResponse + * @instance + * @returns {Object.} JSON object + */ + ListPhraseSetResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListPhraseSetResponse + * @function getTypeUrl + * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPhraseSetResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1p1beta1.ListPhraseSetResponse"; + }; + + return ListPhraseSetResponse; + })(); + + v1p1beta1.DeletePhraseSetRequest = (function() { + + /** + * Properties of a DeletePhraseSetRequest. + * @memberof google.cloud.speech.v1p1beta1 + * @interface IDeletePhraseSetRequest + * @property {string|null} [name] DeletePhraseSetRequest name + */ + + /** + * Constructs a new DeletePhraseSetRequest. + * @memberof google.cloud.speech.v1p1beta1 + * @classdesc Represents a DeletePhraseSetRequest. + * @implements IDeletePhraseSetRequest + * @constructor + * @param {google.cloud.speech.v1p1beta1.IDeletePhraseSetRequest=} [properties] Properties to set + */ + function DeletePhraseSetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeletePhraseSetRequest name. + * @member {string} name + * @memberof google.cloud.speech.v1p1beta1.DeletePhraseSetRequest + * @instance + */ + DeletePhraseSetRequest.prototype.name = ""; + + /** + * Creates a new DeletePhraseSetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1p1beta1.DeletePhraseSetRequest + * @static + * @param {google.cloud.speech.v1p1beta1.IDeletePhraseSetRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v1p1beta1.DeletePhraseSetRequest} DeletePhraseSetRequest instance + */ + DeletePhraseSetRequest.create = function create(properties) { + return new DeletePhraseSetRequest(properties); + }; + + /** + * Encodes the specified DeletePhraseSetRequest message. Does not implicitly {@link google.cloud.speech.v1p1beta1.DeletePhraseSetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1p1beta1.DeletePhraseSetRequest + * @static + * @param {google.cloud.speech.v1p1beta1.IDeletePhraseSetRequest} message DeletePhraseSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeletePhraseSetRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeletePhraseSetRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.DeletePhraseSetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1p1beta1.DeletePhraseSetRequest + * @static + * @param {google.cloud.speech.v1p1beta1.IDeletePhraseSetRequest} message DeletePhraseSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeletePhraseSetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeletePhraseSetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1p1beta1.DeletePhraseSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1p1beta1.DeletePhraseSetRequest} DeletePhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeletePhraseSetRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeletePhraseSetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1p1beta1.DeletePhraseSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1p1beta1.DeletePhraseSetRequest} DeletePhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeletePhraseSetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeletePhraseSetRequest message. + * @function verify + * @memberof google.cloud.speech.v1p1beta1.DeletePhraseSetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeletePhraseSetRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeletePhraseSetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1p1beta1.DeletePhraseSetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1p1beta1.DeletePhraseSetRequest} DeletePhraseSetRequest + */ + DeletePhraseSetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest) + return object; + var message = new $root.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeletePhraseSetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1p1beta1.DeletePhraseSetRequest + * @static + * @param {google.cloud.speech.v1p1beta1.DeletePhraseSetRequest} message DeletePhraseSetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeletePhraseSetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeletePhraseSetRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1p1beta1.DeletePhraseSetRequest + * @instance + * @returns {Object.} JSON object + */ + DeletePhraseSetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeletePhraseSetRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v1p1beta1.DeletePhraseSetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeletePhraseSetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1p1beta1.DeletePhraseSetRequest"; + }; + + return DeletePhraseSetRequest; + })(); + + v1p1beta1.CreateCustomClassRequest = (function() { + + /** + * Properties of a CreateCustomClassRequest. + * @memberof google.cloud.speech.v1p1beta1 + * @interface ICreateCustomClassRequest + * @property {string|null} [parent] CreateCustomClassRequest parent + * @property {string|null} [customClassId] CreateCustomClassRequest customClassId + * @property {google.cloud.speech.v1p1beta1.ICustomClass|null} [customClass] CreateCustomClassRequest customClass + */ + + /** + * Constructs a new CreateCustomClassRequest. + * @memberof google.cloud.speech.v1p1beta1 + * @classdesc Represents a CreateCustomClassRequest. + * @implements ICreateCustomClassRequest + * @constructor + * @param {google.cloud.speech.v1p1beta1.ICreateCustomClassRequest=} [properties] Properties to set + */ + function CreateCustomClassRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateCustomClassRequest parent. + * @member {string} parent + * @memberof google.cloud.speech.v1p1beta1.CreateCustomClassRequest + * @instance + */ + CreateCustomClassRequest.prototype.parent = ""; + + /** + * CreateCustomClassRequest customClassId. + * @member {string} customClassId + * @memberof google.cloud.speech.v1p1beta1.CreateCustomClassRequest + * @instance + */ + CreateCustomClassRequest.prototype.customClassId = ""; + + /** + * CreateCustomClassRequest customClass. + * @member {google.cloud.speech.v1p1beta1.ICustomClass|null|undefined} customClass + * @memberof google.cloud.speech.v1p1beta1.CreateCustomClassRequest + * @instance + */ + CreateCustomClassRequest.prototype.customClass = null; + + /** + * Creates a new CreateCustomClassRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1p1beta1.CreateCustomClassRequest + * @static + * @param {google.cloud.speech.v1p1beta1.ICreateCustomClassRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v1p1beta1.CreateCustomClassRequest} CreateCustomClassRequest instance + */ + CreateCustomClassRequest.create = function create(properties) { + return new CreateCustomClassRequest(properties); + }; + + /** + * Encodes the specified CreateCustomClassRequest message. Does not implicitly {@link google.cloud.speech.v1p1beta1.CreateCustomClassRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1p1beta1.CreateCustomClassRequest + * @static + * @param {google.cloud.speech.v1p1beta1.ICreateCustomClassRequest} message CreateCustomClassRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCustomClassRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.customClassId != null && Object.hasOwnProperty.call(message, "customClassId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.customClassId); + if (message.customClass != null && Object.hasOwnProperty.call(message, "customClass")) + $root.google.cloud.speech.v1p1beta1.CustomClass.encode(message.customClass, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateCustomClassRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.CreateCustomClassRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1p1beta1.CreateCustomClassRequest + * @static + * @param {google.cloud.speech.v1p1beta1.ICreateCustomClassRequest} message CreateCustomClassRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCustomClassRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateCustomClassRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1p1beta1.CreateCustomClassRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1p1beta1.CreateCustomClassRequest} CreateCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCustomClassRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.CreateCustomClassRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.customClassId = reader.string(); + break; + } + case 3: { + message.customClass = $root.google.cloud.speech.v1p1beta1.CustomClass.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateCustomClassRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1p1beta1.CreateCustomClassRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1p1beta1.CreateCustomClassRequest} CreateCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCustomClassRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateCustomClassRequest message. + * @function verify + * @memberof google.cloud.speech.v1p1beta1.CreateCustomClassRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateCustomClassRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.customClassId != null && message.hasOwnProperty("customClassId")) + if (!$util.isString(message.customClassId)) + return "customClassId: string expected"; + if (message.customClass != null && message.hasOwnProperty("customClass")) { + var error = $root.google.cloud.speech.v1p1beta1.CustomClass.verify(message.customClass); + if (error) + return "customClass." + error; + } + return null; + }; + + /** + * Creates a CreateCustomClassRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1p1beta1.CreateCustomClassRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1p1beta1.CreateCustomClassRequest} CreateCustomClassRequest + */ + CreateCustomClassRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1p1beta1.CreateCustomClassRequest) + return object; + var message = new $root.google.cloud.speech.v1p1beta1.CreateCustomClassRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.customClassId != null) + message.customClassId = String(object.customClassId); + if (object.customClass != null) { + if (typeof object.customClass !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.CreateCustomClassRequest.customClass: object expected"); + message.customClass = $root.google.cloud.speech.v1p1beta1.CustomClass.fromObject(object.customClass); + } + return message; + }; + + /** + * Creates a plain object from a CreateCustomClassRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1p1beta1.CreateCustomClassRequest + * @static + * @param {google.cloud.speech.v1p1beta1.CreateCustomClassRequest} message CreateCustomClassRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateCustomClassRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.customClassId = ""; + object.customClass = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.customClassId != null && message.hasOwnProperty("customClassId")) + object.customClassId = message.customClassId; + if (message.customClass != null && message.hasOwnProperty("customClass")) + object.customClass = $root.google.cloud.speech.v1p1beta1.CustomClass.toObject(message.customClass, options); + return object; + }; + + /** + * Converts this CreateCustomClassRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1p1beta1.CreateCustomClassRequest + * @instance + * @returns {Object.} JSON object + */ + CreateCustomClassRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateCustomClassRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v1p1beta1.CreateCustomClassRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateCustomClassRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1p1beta1.CreateCustomClassRequest"; + }; + + return CreateCustomClassRequest; + })(); + + v1p1beta1.UpdateCustomClassRequest = (function() { + + /** + * Properties of an UpdateCustomClassRequest. + * @memberof google.cloud.speech.v1p1beta1 + * @interface IUpdateCustomClassRequest + * @property {google.cloud.speech.v1p1beta1.ICustomClass|null} [customClass] UpdateCustomClassRequest customClass + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCustomClassRequest updateMask + */ + + /** + * Constructs a new UpdateCustomClassRequest. + * @memberof google.cloud.speech.v1p1beta1 + * @classdesc Represents an UpdateCustomClassRequest. + * @implements IUpdateCustomClassRequest + * @constructor + * @param {google.cloud.speech.v1p1beta1.IUpdateCustomClassRequest=} [properties] Properties to set + */ + function UpdateCustomClassRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateCustomClassRequest customClass. + * @member {google.cloud.speech.v1p1beta1.ICustomClass|null|undefined} customClass + * @memberof google.cloud.speech.v1p1beta1.UpdateCustomClassRequest + * @instance + */ + UpdateCustomClassRequest.prototype.customClass = null; + + /** + * UpdateCustomClassRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.speech.v1p1beta1.UpdateCustomClassRequest + * @instance + */ + UpdateCustomClassRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateCustomClassRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1p1beta1.UpdateCustomClassRequest + * @static + * @param {google.cloud.speech.v1p1beta1.IUpdateCustomClassRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v1p1beta1.UpdateCustomClassRequest} UpdateCustomClassRequest instance + */ + UpdateCustomClassRequest.create = function create(properties) { + return new UpdateCustomClassRequest(properties); + }; + + /** + * Encodes the specified UpdateCustomClassRequest message. Does not implicitly {@link google.cloud.speech.v1p1beta1.UpdateCustomClassRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1p1beta1.UpdateCustomClassRequest + * @static + * @param {google.cloud.speech.v1p1beta1.IUpdateCustomClassRequest} message UpdateCustomClassRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCustomClassRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.customClass != null && Object.hasOwnProperty.call(message, "customClass")) + $root.google.cloud.speech.v1p1beta1.CustomClass.encode(message.customClass, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateCustomClassRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.UpdateCustomClassRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1p1beta1.UpdateCustomClassRequest + * @static + * @param {google.cloud.speech.v1p1beta1.IUpdateCustomClassRequest} message UpdateCustomClassRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCustomClassRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateCustomClassRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1p1beta1.UpdateCustomClassRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1p1beta1.UpdateCustomClassRequest} UpdateCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCustomClassRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.customClass = $root.google.cloud.speech.v1p1beta1.CustomClass.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateCustomClassRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1p1beta1.UpdateCustomClassRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1p1beta1.UpdateCustomClassRequest} UpdateCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCustomClassRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateCustomClassRequest message. + * @function verify + * @memberof google.cloud.speech.v1p1beta1.UpdateCustomClassRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateCustomClassRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.customClass != null && message.hasOwnProperty("customClass")) { + var error = $root.google.cloud.speech.v1p1beta1.CustomClass.verify(message.customClass); + if (error) + return "customClass." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateCustomClassRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1p1beta1.UpdateCustomClassRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1p1beta1.UpdateCustomClassRequest} UpdateCustomClassRequest + */ + UpdateCustomClassRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest) + return object; + var message = new $root.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest(); + if (object.customClass != null) { + if (typeof object.customClass !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.UpdateCustomClassRequest.customClass: object expected"); + message.customClass = $root.google.cloud.speech.v1p1beta1.CustomClass.fromObject(object.customClass); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.UpdateCustomClassRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateCustomClassRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1p1beta1.UpdateCustomClassRequest + * @static + * @param {google.cloud.speech.v1p1beta1.UpdateCustomClassRequest} message UpdateCustomClassRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateCustomClassRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.customClass = null; + object.updateMask = null; + } + if (message.customClass != null && message.hasOwnProperty("customClass")) + object.customClass = $root.google.cloud.speech.v1p1beta1.CustomClass.toObject(message.customClass, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateCustomClassRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1p1beta1.UpdateCustomClassRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateCustomClassRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateCustomClassRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v1p1beta1.UpdateCustomClassRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateCustomClassRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1p1beta1.UpdateCustomClassRequest"; + }; + + return UpdateCustomClassRequest; + })(); + + v1p1beta1.GetCustomClassRequest = (function() { + + /** + * Properties of a GetCustomClassRequest. + * @memberof google.cloud.speech.v1p1beta1 + * @interface IGetCustomClassRequest + * @property {string|null} [name] GetCustomClassRequest name + */ + + /** + * Constructs a new GetCustomClassRequest. + * @memberof google.cloud.speech.v1p1beta1 + * @classdesc Represents a GetCustomClassRequest. + * @implements IGetCustomClassRequest + * @constructor + * @param {google.cloud.speech.v1p1beta1.IGetCustomClassRequest=} [properties] Properties to set + */ + function GetCustomClassRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetCustomClassRequest name. + * @member {string} name + * @memberof google.cloud.speech.v1p1beta1.GetCustomClassRequest + * @instance + */ + GetCustomClassRequest.prototype.name = ""; + + /** + * Creates a new GetCustomClassRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1p1beta1.GetCustomClassRequest + * @static + * @param {google.cloud.speech.v1p1beta1.IGetCustomClassRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v1p1beta1.GetCustomClassRequest} GetCustomClassRequest instance + */ + GetCustomClassRequest.create = function create(properties) { + return new GetCustomClassRequest(properties); + }; + + /** + * Encodes the specified GetCustomClassRequest message. Does not implicitly {@link google.cloud.speech.v1p1beta1.GetCustomClassRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1p1beta1.GetCustomClassRequest + * @static + * @param {google.cloud.speech.v1p1beta1.IGetCustomClassRequest} message GetCustomClassRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCustomClassRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetCustomClassRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.GetCustomClassRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1p1beta1.GetCustomClassRequest + * @static + * @param {google.cloud.speech.v1p1beta1.IGetCustomClassRequest} message GetCustomClassRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCustomClassRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetCustomClassRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1p1beta1.GetCustomClassRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1p1beta1.GetCustomClassRequest} GetCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCustomClassRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.GetCustomClassRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetCustomClassRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1p1beta1.GetCustomClassRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1p1beta1.GetCustomClassRequest} GetCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCustomClassRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetCustomClassRequest message. + * @function verify + * @memberof google.cloud.speech.v1p1beta1.GetCustomClassRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetCustomClassRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetCustomClassRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1p1beta1.GetCustomClassRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1p1beta1.GetCustomClassRequest} GetCustomClassRequest + */ + GetCustomClassRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1p1beta1.GetCustomClassRequest) + return object; + var message = new $root.google.cloud.speech.v1p1beta1.GetCustomClassRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetCustomClassRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1p1beta1.GetCustomClassRequest + * @static + * @param {google.cloud.speech.v1p1beta1.GetCustomClassRequest} message GetCustomClassRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetCustomClassRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetCustomClassRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1p1beta1.GetCustomClassRequest + * @instance + * @returns {Object.} JSON object + */ + GetCustomClassRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetCustomClassRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v1p1beta1.GetCustomClassRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetCustomClassRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1p1beta1.GetCustomClassRequest"; + }; + + return GetCustomClassRequest; + })(); + + v1p1beta1.ListCustomClassesRequest = (function() { + + /** + * Properties of a ListCustomClassesRequest. + * @memberof google.cloud.speech.v1p1beta1 + * @interface IListCustomClassesRequest + * @property {string|null} [parent] ListCustomClassesRequest parent + * @property {number|null} [pageSize] ListCustomClassesRequest pageSize + * @property {string|null} [pageToken] ListCustomClassesRequest pageToken + */ + + /** + * Constructs a new ListCustomClassesRequest. + * @memberof google.cloud.speech.v1p1beta1 + * @classdesc Represents a ListCustomClassesRequest. + * @implements IListCustomClassesRequest + * @constructor + * @param {google.cloud.speech.v1p1beta1.IListCustomClassesRequest=} [properties] Properties to set + */ + function ListCustomClassesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCustomClassesRequest parent. + * @member {string} parent + * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesRequest + * @instance + */ + ListCustomClassesRequest.prototype.parent = ""; + + /** + * ListCustomClassesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesRequest + * @instance + */ + ListCustomClassesRequest.prototype.pageSize = 0; + + /** + * ListCustomClassesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesRequest + * @instance + */ + ListCustomClassesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListCustomClassesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesRequest + * @static + * @param {google.cloud.speech.v1p1beta1.IListCustomClassesRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v1p1beta1.ListCustomClassesRequest} ListCustomClassesRequest instance + */ + ListCustomClassesRequest.create = function create(properties) { + return new ListCustomClassesRequest(properties); + }; + + /** + * Encodes the specified ListCustomClassesRequest message. Does not implicitly {@link google.cloud.speech.v1p1beta1.ListCustomClassesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesRequest + * @static + * @param {google.cloud.speech.v1p1beta1.IListCustomClassesRequest} message ListCustomClassesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCustomClassesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListCustomClassesRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.ListCustomClassesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesRequest + * @static + * @param {google.cloud.speech.v1p1beta1.IListCustomClassesRequest} message ListCustomClassesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCustomClassesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCustomClassesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1p1beta1.ListCustomClassesRequest} ListCustomClassesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCustomClassesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.ListCustomClassesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCustomClassesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1p1beta1.ListCustomClassesRequest} ListCustomClassesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCustomClassesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCustomClassesRequest message. + * @function verify + * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCustomClassesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListCustomClassesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1p1beta1.ListCustomClassesRequest} ListCustomClassesRequest + */ + ListCustomClassesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1p1beta1.ListCustomClassesRequest) + return object; + var message = new $root.google.cloud.speech.v1p1beta1.ListCustomClassesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListCustomClassesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesRequest + * @static + * @param {google.cloud.speech.v1p1beta1.ListCustomClassesRequest} message ListCustomClassesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCustomClassesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListCustomClassesRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesRequest + * @instance + * @returns {Object.} JSON object + */ + ListCustomClassesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCustomClassesRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCustomClassesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1p1beta1.ListCustomClassesRequest"; + }; + + return ListCustomClassesRequest; + })(); + + v1p1beta1.ListCustomClassesResponse = (function() { + + /** + * Properties of a ListCustomClassesResponse. + * @memberof google.cloud.speech.v1p1beta1 + * @interface IListCustomClassesResponse + * @property {Array.|null} [customClasses] ListCustomClassesResponse customClasses + * @property {string|null} [nextPageToken] ListCustomClassesResponse nextPageToken + */ + + /** + * Constructs a new ListCustomClassesResponse. + * @memberof google.cloud.speech.v1p1beta1 + * @classdesc Represents a ListCustomClassesResponse. + * @implements IListCustomClassesResponse + * @constructor + * @param {google.cloud.speech.v1p1beta1.IListCustomClassesResponse=} [properties] Properties to set + */ + function ListCustomClassesResponse(properties) { + this.customClasses = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCustomClassesResponse customClasses. + * @member {Array.} customClasses + * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesResponse + * @instance + */ + ListCustomClassesResponse.prototype.customClasses = $util.emptyArray; + + /** + * ListCustomClassesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesResponse + * @instance + */ + ListCustomClassesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListCustomClassesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesResponse + * @static + * @param {google.cloud.speech.v1p1beta1.IListCustomClassesResponse=} [properties] Properties to set + * @returns {google.cloud.speech.v1p1beta1.ListCustomClassesResponse} ListCustomClassesResponse instance + */ + ListCustomClassesResponse.create = function create(properties) { + return new ListCustomClassesResponse(properties); + }; + + /** + * Encodes the specified ListCustomClassesResponse message. Does not implicitly {@link google.cloud.speech.v1p1beta1.ListCustomClassesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesResponse + * @static + * @param {google.cloud.speech.v1p1beta1.IListCustomClassesResponse} message ListCustomClassesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCustomClassesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.customClasses != null && message.customClasses.length) + for (var i = 0; i < message.customClasses.length; ++i) + $root.google.cloud.speech.v1p1beta1.CustomClass.encode(message.customClasses[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListCustomClassesResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.ListCustomClassesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesResponse + * @static + * @param {google.cloud.speech.v1p1beta1.IListCustomClassesResponse} message ListCustomClassesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCustomClassesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCustomClassesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1p1beta1.ListCustomClassesResponse} ListCustomClassesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCustomClassesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.ListCustomClassesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.customClasses && message.customClasses.length)) + message.customClasses = []; + message.customClasses.push($root.google.cloud.speech.v1p1beta1.CustomClass.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCustomClassesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1p1beta1.ListCustomClassesResponse} ListCustomClassesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCustomClassesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCustomClassesResponse message. + * @function verify + * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCustomClassesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.customClasses != null && message.hasOwnProperty("customClasses")) { + if (!Array.isArray(message.customClasses)) + return "customClasses: array expected"; + for (var i = 0; i < message.customClasses.length; ++i) { + var error = $root.google.cloud.speech.v1p1beta1.CustomClass.verify(message.customClasses[i]); + if (error) + return "customClasses." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListCustomClassesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1p1beta1.ListCustomClassesResponse} ListCustomClassesResponse + */ + ListCustomClassesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1p1beta1.ListCustomClassesResponse) + return object; + var message = new $root.google.cloud.speech.v1p1beta1.ListCustomClassesResponse(); + if (object.customClasses) { + if (!Array.isArray(object.customClasses)) + throw TypeError(".google.cloud.speech.v1p1beta1.ListCustomClassesResponse.customClasses: array expected"); + message.customClasses = []; + for (var i = 0; i < object.customClasses.length; ++i) { + if (typeof object.customClasses[i] !== "object") + throw TypeError(".google.cloud.speech.v1p1beta1.ListCustomClassesResponse.customClasses: object expected"); + message.customClasses[i] = $root.google.cloud.speech.v1p1beta1.CustomClass.fromObject(object.customClasses[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListCustomClassesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesResponse + * @static + * @param {google.cloud.speech.v1p1beta1.ListCustomClassesResponse} message ListCustomClassesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCustomClassesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.customClasses = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.customClasses && message.customClasses.length) { + object.customClasses = []; + for (var j = 0; j < message.customClasses.length; ++j) + object.customClasses[j] = $root.google.cloud.speech.v1p1beta1.CustomClass.toObject(message.customClasses[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListCustomClassesResponse to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesResponse + * @instance + * @returns {Object.} JSON object + */ + ListCustomClassesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCustomClassesResponse + * @function getTypeUrl + * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCustomClassesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1p1beta1.ListCustomClassesResponse"; + }; + + return ListCustomClassesResponse; + })(); + + v1p1beta1.DeleteCustomClassRequest = (function() { + + /** + * Properties of a DeleteCustomClassRequest. + * @memberof google.cloud.speech.v1p1beta1 + * @interface IDeleteCustomClassRequest + * @property {string|null} [name] DeleteCustomClassRequest name + */ + + /** + * Constructs a new DeleteCustomClassRequest. + * @memberof google.cloud.speech.v1p1beta1 + * @classdesc Represents a DeleteCustomClassRequest. + * @implements IDeleteCustomClassRequest + * @constructor + * @param {google.cloud.speech.v1p1beta1.IDeleteCustomClassRequest=} [properties] Properties to set + */ + function DeleteCustomClassRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteCustomClassRequest name. + * @member {string} name + * @memberof google.cloud.speech.v1p1beta1.DeleteCustomClassRequest + * @instance + */ + DeleteCustomClassRequest.prototype.name = ""; + + /** + * Creates a new DeleteCustomClassRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1p1beta1.DeleteCustomClassRequest + * @static + * @param {google.cloud.speech.v1p1beta1.IDeleteCustomClassRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v1p1beta1.DeleteCustomClassRequest} DeleteCustomClassRequest instance + */ + DeleteCustomClassRequest.create = function create(properties) { + return new DeleteCustomClassRequest(properties); + }; + + /** + * Encodes the specified DeleteCustomClassRequest message. Does not implicitly {@link google.cloud.speech.v1p1beta1.DeleteCustomClassRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1p1beta1.DeleteCustomClassRequest + * @static + * @param {google.cloud.speech.v1p1beta1.IDeleteCustomClassRequest} message DeleteCustomClassRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteCustomClassRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteCustomClassRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.DeleteCustomClassRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1p1beta1.DeleteCustomClassRequest + * @static + * @param {google.cloud.speech.v1p1beta1.IDeleteCustomClassRequest} message DeleteCustomClassRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteCustomClassRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteCustomClassRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1p1beta1.DeleteCustomClassRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1p1beta1.DeleteCustomClassRequest} DeleteCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteCustomClassRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteCustomClassRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1p1beta1.DeleteCustomClassRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1p1beta1.DeleteCustomClassRequest} DeleteCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteCustomClassRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteCustomClassRequest message. + * @function verify + * @memberof google.cloud.speech.v1p1beta1.DeleteCustomClassRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteCustomClassRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteCustomClassRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1p1beta1.DeleteCustomClassRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1p1beta1.DeleteCustomClassRequest} DeleteCustomClassRequest + */ + DeleteCustomClassRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest) + return object; + var message = new $root.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteCustomClassRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1p1beta1.DeleteCustomClassRequest + * @static + * @param {google.cloud.speech.v1p1beta1.DeleteCustomClassRequest} message DeleteCustomClassRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteCustomClassRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteCustomClassRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1p1beta1.DeleteCustomClassRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteCustomClassRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteCustomClassRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v1p1beta1.DeleteCustomClassRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteCustomClassRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1p1beta1.DeleteCustomClassRequest"; + }; + + return DeleteCustomClassRequest; + })(); + + return v1p1beta1; + })(); + + return speech; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.fullyDecodeReservedExpansion = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Http + * @function getTypeUrl + * @memberof google.api.Http + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Http"; + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; + + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.get = reader.string(); + break; + } + case 3: { + message.put = reader.string(); + break; + } + case 4: { + message.post = reader.string(); + break; + } + case 5: { + message["delete"] = reader.string(); + break; + } + case 6: { + message.patch = reader.string(); + break; + } + case 8: { + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + } + case 7: { + message.body = reader.string(); + break; + } + case 12: { + message.responseBody = reader.string(); + break; + } + case 11: { + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) + return object; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + return object; + }; + + /** + * Converts this HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpRule + * @function getTypeUrl + * @memberof google.api.HttpRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpRule"; + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomHttpPattern + * @function getTypeUrl + * @memberof google.api.CustomHttpPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CustomHttpPattern"; + }; + + return CustomHttpPattern; + })(); + + api.CommonLanguageSettings = (function() { + + /** + * Properties of a CommonLanguageSettings. + * @memberof google.api + * @interface ICommonLanguageSettings + * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri + * @property {Array.|null} [destinations] CommonLanguageSettings destinations + */ + + /** + * Constructs a new CommonLanguageSettings. + * @memberof google.api + * @classdesc Represents a CommonLanguageSettings. + * @implements ICommonLanguageSettings + * @constructor + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + */ + function CommonLanguageSettings(properties) { + this.destinations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommonLanguageSettings referenceDocsUri. + * @member {string} referenceDocsUri + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.referenceDocsUri = ""; + + /** + * CommonLanguageSettings destinations. + * @member {Array.} destinations + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.destinations = $util.emptyArray; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @function create + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings instance + */ + CommonLanguageSettings.create = function create(properties) { + return new CommonLanguageSettings(properties); + }; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.referenceDocsUri); + if (message.destinations != null && message.destinations.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.destinations.length; ++i) + writer.int32(message.destinations[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CommonLanguageSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.referenceDocsUri = reader.string(); + break; + } + case 2: { + if (!(message.destinations && message.destinations.length)) + message.destinations = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.destinations.push(reader.int32()); + } else + message.destinations.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommonLanguageSettings message. + * @function verify + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommonLanguageSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + if (!$util.isString(message.referenceDocsUri)) + return "referenceDocsUri: string expected"; + if (message.destinations != null && message.hasOwnProperty("destinations")) { + if (!Array.isArray(message.destinations)) + return "destinations: array expected"; + for (var i = 0; i < message.destinations.length; ++i) + switch (message.destinations[i]) { + default: + return "destinations: enum value[] expected"; + case 0: + case 10: + case 20: + break; + } + } + return null; + }; + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + */ + CommonLanguageSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CommonLanguageSettings) + return object; + var message = new $root.google.api.CommonLanguageSettings(); + if (object.referenceDocsUri != null) + message.referenceDocsUri = String(object.referenceDocsUri); + if (object.destinations) { + if (!Array.isArray(object.destinations)) + throw TypeError(".google.api.CommonLanguageSettings.destinations: array expected"); + message.destinations = []; + for (var i = 0; i < object.destinations.length; ++i) + switch (object.destinations[i]) { + default: + if (typeof object.destinations[i] === "number") { + message.destinations[i] = object.destinations[i]; + break; + } + case "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": + case 0: + message.destinations[i] = 0; + break; + case "GITHUB": + case 10: + message.destinations[i] = 10; + break; + case "PACKAGE_MANAGER": + case 20: + message.destinations[i] = 20; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommonLanguageSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.destinations = []; + if (options.defaults) + object.referenceDocsUri = ""; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + object.referenceDocsUri = message.referenceDocsUri; + if (message.destinations && message.destinations.length) { + object.destinations = []; + for (var j = 0; j < message.destinations.length; ++j) + object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; + } + return object; + }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @function toJSON + * @memberof google.api.CommonLanguageSettings + * @instance + * @returns {Object.} JSON object + */ + CommonLanguageSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommonLanguageSettings + * @function getTypeUrl + * @memberof google.api.CommonLanguageSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CommonLanguageSettings"; + }; + + return CommonLanguageSettings; + })(); + + api.ClientLibrarySettings = (function() { + + /** + * Properties of a ClientLibrarySettings. + * @memberof google.api + * @interface IClientLibrarySettings + * @property {string|null} [version] ClientLibrarySettings version + * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage + * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums + * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings + * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings + * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings + * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings + * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings + * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings + * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings + * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings + */ + + /** + * Constructs a new ClientLibrarySettings. + * @memberof google.api + * @classdesc Represents a ClientLibrarySettings. + * @implements IClientLibrarySettings + * @constructor + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + */ + function ClientLibrarySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClientLibrarySettings version. + * @member {string} version + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.version = ""; + + /** + * ClientLibrarySettings launchStage. + * @member {google.api.LaunchStage} launchStage + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.launchStage = 0; + + /** + * ClientLibrarySettings restNumericEnums. + * @member {boolean} restNumericEnums + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.restNumericEnums = false; + + /** + * ClientLibrarySettings javaSettings. + * @member {google.api.IJavaSettings|null|undefined} javaSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.javaSettings = null; + + /** + * ClientLibrarySettings cppSettings. + * @member {google.api.ICppSettings|null|undefined} cppSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.cppSettings = null; + + /** + * ClientLibrarySettings phpSettings. + * @member {google.api.IPhpSettings|null|undefined} phpSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.phpSettings = null; + + /** + * ClientLibrarySettings pythonSettings. + * @member {google.api.IPythonSettings|null|undefined} pythonSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.pythonSettings = null; + + /** + * ClientLibrarySettings nodeSettings. + * @member {google.api.INodeSettings|null|undefined} nodeSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.nodeSettings = null; + + /** + * ClientLibrarySettings dotnetSettings. + * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.dotnetSettings = null; + + /** + * ClientLibrarySettings rubySettings. + * @member {google.api.IRubySettings|null|undefined} rubySettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.rubySettings = null; + + /** + * ClientLibrarySettings goSettings. + * @member {google.api.IGoSettings|null|undefined} goSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.goSettings = null; + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @function create + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance + */ + ClientLibrarySettings.create = function create(properties) { + return new ClientLibrarySettings(properties); + }; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage); + if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums); + if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) + $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) + $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) + $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) + $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) + $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) + $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) + $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) + $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ClientLibrarySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.version = reader.string(); + break; + } + case 2: { + message.launchStage = reader.int32(); + break; + } + case 3: { + message.restNumericEnums = reader.bool(); + break; + } + case 21: { + message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32()); + break; + } + case 22: { + message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32()); + break; + } + case 23: { + message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32()); + break; + } + case 24: { + message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32()); + break; + } + case 25: { + message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32()); + break; + } + case 26: { + message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32()); + break; + } + case 27: { + message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32()); + break; + } + case 28: { + message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientLibrarySettings message. + * @function verify + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientLibrarySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + switch (message.launchStage) { + default: + return "launchStage: enum value expected"; + case 0: + case 6: + case 7: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + if (typeof message.restNumericEnums !== "boolean") + return "restNumericEnums: boolean expected"; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) { + var error = $root.google.api.JavaSettings.verify(message.javaSettings); + if (error) + return "javaSettings." + error; + } + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) { + var error = $root.google.api.CppSettings.verify(message.cppSettings); + if (error) + return "cppSettings." + error; + } + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) { + var error = $root.google.api.PhpSettings.verify(message.phpSettings); + if (error) + return "phpSettings." + error; + } + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) { + var error = $root.google.api.PythonSettings.verify(message.pythonSettings); + if (error) + return "pythonSettings." + error; + } + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) { + var error = $root.google.api.NodeSettings.verify(message.nodeSettings); + if (error) + return "nodeSettings." + error; + } + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) { + var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings); + if (error) + return "dotnetSettings." + error; + } + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) { + var error = $root.google.api.RubySettings.verify(message.rubySettings); + if (error) + return "rubySettings." + error; + } + if (message.goSettings != null && message.hasOwnProperty("goSettings")) { + var error = $root.google.api.GoSettings.verify(message.goSettings); + if (error) + return "goSettings." + error; + } + return null; + }; + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + */ + ClientLibrarySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ClientLibrarySettings) + return object; + var message = new $root.google.api.ClientLibrarySettings(); + if (object.version != null) + message.version = String(object.version); + switch (object.launchStage) { + default: + if (typeof object.launchStage === "number") { + message.launchStage = object.launchStage; + break; + } + break; + case "LAUNCH_STAGE_UNSPECIFIED": + case 0: + message.launchStage = 0; + break; + case "UNIMPLEMENTED": + case 6: + message.launchStage = 6; + break; + case "PRELAUNCH": + case 7: + message.launchStage = 7; + break; + case "EARLY_ACCESS": + case 1: + message.launchStage = 1; + break; + case "ALPHA": + case 2: + message.launchStage = 2; + break; + case "BETA": + case 3: + message.launchStage = 3; + break; + case "GA": + case 4: + message.launchStage = 4; + break; + case "DEPRECATED": + case 5: + message.launchStage = 5; + break; + } + if (object.restNumericEnums != null) + message.restNumericEnums = Boolean(object.restNumericEnums); + if (object.javaSettings != null) { + if (typeof object.javaSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); + message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings); + } + if (object.cppSettings != null) { + if (typeof object.cppSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); + message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings); + } + if (object.phpSettings != null) { + if (typeof object.phpSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); + message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings); + } + if (object.pythonSettings != null) { + if (typeof object.pythonSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); + message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings); + } + if (object.nodeSettings != null) { + if (typeof object.nodeSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); + message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings); + } + if (object.dotnetSettings != null) { + if (typeof object.dotnetSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); + message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings); + } + if (object.rubySettings != null) { + if (typeof object.rubySettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); + message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings); + } + if (object.goSettings != null) { + if (typeof object.goSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); + message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings); + } + return message; + }; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientLibrarySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + object.restNumericEnums = false; + object.javaSettings = null; + object.cppSettings = null; + object.phpSettings = null; + object.pythonSettings = null; + object.nodeSettings = null; + object.dotnetSettings = null; + object.rubySettings = null; + object.goSettings = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + object.restNumericEnums = message.restNumericEnums; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) + object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options); + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) + object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options); + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) + object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options); + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) + object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options); + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) + object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options); + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) + object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options); + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) + object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options); + if (message.goSettings != null && message.hasOwnProperty("goSettings")) + object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options); + return object; + }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @function toJSON + * @memberof google.api.ClientLibrarySettings + * @instance + * @returns {Object.} JSON object + */ + ClientLibrarySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientLibrarySettings + * @function getTypeUrl + * @memberof google.api.ClientLibrarySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ClientLibrarySettings"; + }; + + return ClientLibrarySettings; + })(); + + api.Publishing = (function() { + + /** + * Properties of a Publishing. + * @memberof google.api + * @interface IPublishing + * @property {Array.|null} [methodSettings] Publishing methodSettings + * @property {string|null} [newIssueUri] Publishing newIssueUri + * @property {string|null} [documentationUri] Publishing documentationUri + * @property {string|null} [apiShortName] Publishing apiShortName + * @property {string|null} [githubLabel] Publishing githubLabel + * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams + * @property {string|null} [docTagPrefix] Publishing docTagPrefix + * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization + * @property {Array.|null} [librarySettings] Publishing librarySettings + * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri + * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri + */ + + /** + * Constructs a new Publishing. + * @memberof google.api + * @classdesc Represents a Publishing. + * @implements IPublishing + * @constructor + * @param {google.api.IPublishing=} [properties] Properties to set + */ + function Publishing(properties) { + this.methodSettings = []; + this.codeownerGithubTeams = []; + this.librarySettings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Publishing methodSettings. + * @member {Array.} methodSettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.methodSettings = $util.emptyArray; + + /** + * Publishing newIssueUri. + * @member {string} newIssueUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.newIssueUri = ""; + + /** + * Publishing documentationUri. + * @member {string} documentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.documentationUri = ""; + + /** + * Publishing apiShortName. + * @member {string} apiShortName + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.apiShortName = ""; + + /** + * Publishing githubLabel. + * @member {string} githubLabel + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.githubLabel = ""; + + /** + * Publishing codeownerGithubTeams. + * @member {Array.} codeownerGithubTeams + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.codeownerGithubTeams = $util.emptyArray; + + /** + * Publishing docTagPrefix. + * @member {string} docTagPrefix + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.docTagPrefix = ""; + + /** + * Publishing organization. + * @member {google.api.ClientLibraryOrganization} organization + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.organization = 0; + + /** + * Publishing librarySettings. + * @member {Array.} librarySettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.librarySettings = $util.emptyArray; + + /** + * Publishing protoReferenceDocumentationUri. + * @member {string} protoReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.protoReferenceDocumentationUri = ""; + + /** + * Publishing restReferenceDocumentationUri. + * @member {string} restReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.restReferenceDocumentationUri = ""; + + /** + * Creates a new Publishing instance using the specified properties. + * @function create + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing=} [properties] Properties to set + * @returns {google.api.Publishing} Publishing instance + */ + Publishing.create = function create(properties) { + return new Publishing(properties); + }; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encode + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.methodSettings != null && message.methodSettings.length) + for (var i = 0; i < message.methodSettings.length; ++i) + $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) + writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri); + if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) + writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri); + if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) + writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName); + if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) + writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel); + if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length) + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]); + if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) + writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization); + if (message.librarySettings != null && message.librarySettings.length) + for (var i = 0; i < message.librarySettings.length; ++i) + $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); + if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) + writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); + if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) + writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); + return writer; + }; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @function decode + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Publishing(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.methodSettings && message.methodSettings.length)) + message.methodSettings = []; + message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32())); + break; + } + case 101: { + message.newIssueUri = reader.string(); + break; + } + case 102: { + message.documentationUri = reader.string(); + break; + } + case 103: { + message.apiShortName = reader.string(); + break; + } + case 104: { + message.githubLabel = reader.string(); + break; + } + case 105: { + if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) + message.codeownerGithubTeams = []; + message.codeownerGithubTeams.push(reader.string()); + break; + } + case 106: { + message.docTagPrefix = reader.string(); + break; + } + case 107: { + message.organization = reader.int32(); + break; + } + case 109: { + if (!(message.librarySettings && message.librarySettings.length)) + message.librarySettings = []; + message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32())); + break; + } + case 110: { + message.protoReferenceDocumentationUri = reader.string(); + break; + } + case 111: { + message.restReferenceDocumentationUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Publishing message. + * @function verify + * @memberof google.api.Publishing + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Publishing.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.methodSettings != null && message.hasOwnProperty("methodSettings")) { + if (!Array.isArray(message.methodSettings)) + return "methodSettings: array expected"; + for (var i = 0; i < message.methodSettings.length; ++i) { + var error = $root.google.api.MethodSettings.verify(message.methodSettings[i]); + if (error) + return "methodSettings." + error; + } + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + if (!$util.isString(message.newIssueUri)) + return "newIssueUri: string expected"; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + if (!$util.isString(message.documentationUri)) + return "documentationUri: string expected"; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + if (!$util.isString(message.apiShortName)) + return "apiShortName: string expected"; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + if (!$util.isString(message.githubLabel)) + return "githubLabel: string expected"; + if (message.codeownerGithubTeams != null && message.hasOwnProperty("codeownerGithubTeams")) { + if (!Array.isArray(message.codeownerGithubTeams)) + return "codeownerGithubTeams: array expected"; + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + if (!$util.isString(message.codeownerGithubTeams[i])) + return "codeownerGithubTeams: string[] expected"; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + if (!$util.isString(message.docTagPrefix)) + return "docTagPrefix: string expected"; + if (message.organization != null && message.hasOwnProperty("organization")) + switch (message.organization) { + default: + return "organization: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { + if (!Array.isArray(message.librarySettings)) + return "librarySettings: array expected"; + for (var i = 0; i < message.librarySettings.length; ++i) { + var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i]); + if (error) + return "librarySettings." + error; + } + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + if (!$util.isString(message.protoReferenceDocumentationUri)) + return "protoReferenceDocumentationUri: string expected"; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + if (!$util.isString(message.restReferenceDocumentationUri)) + return "restReferenceDocumentationUri: string expected"; + return null; + }; + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Publishing + * @static + * @param {Object.} object Plain object + * @returns {google.api.Publishing} Publishing + */ + Publishing.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Publishing) + return object; + var message = new $root.google.api.Publishing(); + if (object.methodSettings) { + if (!Array.isArray(object.methodSettings)) + throw TypeError(".google.api.Publishing.methodSettings: array expected"); + message.methodSettings = []; + for (var i = 0; i < object.methodSettings.length; ++i) { + if (typeof object.methodSettings[i] !== "object") + throw TypeError(".google.api.Publishing.methodSettings: object expected"); + message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i]); + } + } + if (object.newIssueUri != null) + message.newIssueUri = String(object.newIssueUri); + if (object.documentationUri != null) + message.documentationUri = String(object.documentationUri); + if (object.apiShortName != null) + message.apiShortName = String(object.apiShortName); + if (object.githubLabel != null) + message.githubLabel = String(object.githubLabel); + if (object.codeownerGithubTeams) { + if (!Array.isArray(object.codeownerGithubTeams)) + throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); + message.codeownerGithubTeams = []; + for (var i = 0; i < object.codeownerGithubTeams.length; ++i) + message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); + } + if (object.docTagPrefix != null) + message.docTagPrefix = String(object.docTagPrefix); + switch (object.organization) { + default: + if (typeof object.organization === "number") { + message.organization = object.organization; + break; + } + break; + case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": + case 0: + message.organization = 0; + break; + case "CLOUD": + case 1: + message.organization = 1; + break; + case "ADS": + case 2: + message.organization = 2; + break; + case "PHOTOS": + case 3: + message.organization = 3; + break; + case "STREET_VIEW": + case 4: + message.organization = 4; + break; + case "SHOPPING": + case 5: + message.organization = 5; + break; + case "GEO": + case 6: + message.organization = 6; + break; + case "GENERATIVE_AI": + case 7: + message.organization = 7; + break; + } + if (object.librarySettings) { + if (!Array.isArray(object.librarySettings)) + throw TypeError(".google.api.Publishing.librarySettings: array expected"); + message.librarySettings = []; + for (var i = 0; i < object.librarySettings.length; ++i) { + if (typeof object.librarySettings[i] !== "object") + throw TypeError(".google.api.Publishing.librarySettings: object expected"); + message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]); + } + } + if (object.protoReferenceDocumentationUri != null) + message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); + if (object.restReferenceDocumentationUri != null) + message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); + return message; + }; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Publishing + * @static + * @param {google.api.Publishing} message Publishing + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Publishing.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.methodSettings = []; + object.codeownerGithubTeams = []; + object.librarySettings = []; + } + if (options.defaults) { + object.newIssueUri = ""; + object.documentationUri = ""; + object.apiShortName = ""; + object.githubLabel = ""; + object.docTagPrefix = ""; + object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; + object.protoReferenceDocumentationUri = ""; + object.restReferenceDocumentationUri = ""; + } + if (message.methodSettings && message.methodSettings.length) { + object.methodSettings = []; + for (var j = 0; j < message.methodSettings.length; ++j) + object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options); + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + object.newIssueUri = message.newIssueUri; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + object.documentationUri = message.documentationUri; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + object.apiShortName = message.apiShortName; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + object.githubLabel = message.githubLabel; + if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { + object.codeownerGithubTeams = []; + for (var j = 0; j < message.codeownerGithubTeams.length; ++j) + object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + object.docTagPrefix = message.docTagPrefix; + if (message.organization != null && message.hasOwnProperty("organization")) + object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; + if (message.librarySettings && message.librarySettings.length) { + object.librarySettings = []; + for (var j = 0; j < message.librarySettings.length; ++j) + object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; + return object; + }; + + /** + * Converts this Publishing to JSON. + * @function toJSON + * @memberof google.api.Publishing + * @instance + * @returns {Object.} JSON object + */ + Publishing.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Publishing + * @function getTypeUrl + * @memberof google.api.Publishing + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Publishing"; + }; + + return Publishing; + })(); + + api.JavaSettings = (function() { + + /** + * Properties of a JavaSettings. + * @memberof google.api + * @interface IJavaSettings + * @property {string|null} [libraryPackage] JavaSettings libraryPackage + * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames + * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common + */ + + /** + * Constructs a new JavaSettings. + * @memberof google.api + * @classdesc Represents a JavaSettings. + * @implements IJavaSettings + * @constructor + * @param {google.api.IJavaSettings=} [properties] Properties to set + */ + function JavaSettings(properties) { + this.serviceClassNames = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JavaSettings libraryPackage. + * @member {string} libraryPackage + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.libraryPackage = ""; + + /** + * JavaSettings serviceClassNames. + * @member {Object.} serviceClassNames + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.serviceClassNames = $util.emptyObject; + + /** + * JavaSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.common = null; + + /** + * Creates a new JavaSettings instance using the specified properties. + * @function create + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings=} [properties] Properties to set + * @returns {google.api.JavaSettings} JavaSettings instance + */ + JavaSettings.create = function create(properties) { + return new JavaSettings(properties); + }; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encode + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage); + if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) + for (var keys = Object.keys(message.serviceClassNames), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.serviceClassNames[keys[i]]).ldelim(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.JavaSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.libraryPackage = reader.string(); + break; + } + case 2: { + if (message.serviceClassNames === $util.emptyObject) + message.serviceClassNames = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.serviceClassNames[key] = value; + break; + } + case 3: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JavaSettings message. + * @function verify + * @memberof google.api.JavaSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JavaSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + if (!$util.isString(message.libraryPackage)) + return "libraryPackage: string expected"; + if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) { + if (!$util.isObject(message.serviceClassNames)) + return "serviceClassNames: object expected"; + var key = Object.keys(message.serviceClassNames); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.serviceClassNames[key[i]])) + return "serviceClassNames: string{k:string} expected"; + } + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.JavaSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.JavaSettings} JavaSettings + */ + JavaSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.JavaSettings) + return object; + var message = new $root.google.api.JavaSettings(); + if (object.libraryPackage != null) + message.libraryPackage = String(object.libraryPackage); + if (object.serviceClassNames) { + if (typeof object.serviceClassNames !== "object") + throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); + message.serviceClassNames = {}; + for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) + message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); + } + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.JavaSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.JavaSettings + * @static + * @param {google.api.JavaSettings} message JavaSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JavaSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.serviceClassNames = {}; + if (options.defaults) { + object.libraryPackage = ""; + object.common = null; + } + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + object.libraryPackage = message.libraryPackage; + var keys2; + if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { + object.serviceClassNames = {}; + for (var j = 0; j < keys2.length; ++j) + object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; + } + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this JavaSettings to JSON. + * @function toJSON + * @memberof google.api.JavaSettings + * @instance + * @returns {Object.} JSON object + */ + JavaSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JavaSettings + * @function getTypeUrl + * @memberof google.api.JavaSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.JavaSettings"; + }; + + return JavaSettings; + })(); + + api.CppSettings = (function() { + + /** + * Properties of a CppSettings. + * @memberof google.api + * @interface ICppSettings + * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common + */ + + /** + * Constructs a new CppSettings. + * @memberof google.api + * @classdesc Represents a CppSettings. + * @implements ICppSettings + * @constructor + * @param {google.api.ICppSettings=} [properties] Properties to set + */ + function CppSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CppSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.CppSettings + * @instance + */ + CppSettings.prototype.common = null; + + /** + * Creates a new CppSettings instance using the specified properties. + * @function create + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings=} [properties] Properties to set + * @returns {google.api.CppSettings} CppSettings instance + */ + CppSettings.create = function create(properties) { + return new CppSettings(properties); + }; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CppSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CppSettings message. + * @function verify + * @memberof google.api.CppSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CppSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CppSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CppSettings} CppSettings + */ + CppSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CppSettings) + return object; + var message = new $root.google.api.CppSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.CppSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CppSettings + * @static + * @param {google.api.CppSettings} message CppSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CppSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this CppSettings to JSON. + * @function toJSON + * @memberof google.api.CppSettings + * @instance + * @returns {Object.} JSON object + */ + CppSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CppSettings + * @function getTypeUrl + * @memberof google.api.CppSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CppSettings"; + }; + + return CppSettings; + })(); + + api.PhpSettings = (function() { + + /** + * Properties of a PhpSettings. + * @memberof google.api + * @interface IPhpSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common + */ + + /** + * Constructs a new PhpSettings. + * @memberof google.api + * @classdesc Represents a PhpSettings. + * @implements IPhpSettings + * @constructor + * @param {google.api.IPhpSettings=} [properties] Properties to set + */ + function PhpSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PhpSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PhpSettings + * @instance + */ + PhpSettings.prototype.common = null; + + /** + * Creates a new PhpSettings instance using the specified properties. + * @function create + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings=} [properties] Properties to set + * @returns {google.api.PhpSettings} PhpSettings instance + */ + PhpSettings.create = function create(properties) { + return new PhpSettings(properties); + }; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PhpSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PhpSettings message. + * @function verify + * @memberof google.api.PhpSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PhpSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PhpSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PhpSettings} PhpSettings + */ + PhpSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PhpSettings) + return object; + var message = new $root.google.api.PhpSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PhpSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PhpSettings + * @static + * @param {google.api.PhpSettings} message PhpSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PhpSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PhpSettings to JSON. + * @function toJSON + * @memberof google.api.PhpSettings + * @instance + * @returns {Object.} JSON object + */ + PhpSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PhpSettings + * @function getTypeUrl + * @memberof google.api.PhpSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PhpSettings"; + }; + + return PhpSettings; + })(); + + api.PythonSettings = (function() { + + /** + * Properties of a PythonSettings. + * @memberof google.api + * @interface IPythonSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common + */ + + /** + * Constructs a new PythonSettings. + * @memberof google.api + * @classdesc Represents a PythonSettings. + * @implements IPythonSettings + * @constructor + * @param {google.api.IPythonSettings=} [properties] Properties to set + */ + function PythonSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PythonSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.common = null; + + /** + * Creates a new PythonSettings instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings=} [properties] Properties to set + * @returns {google.api.PythonSettings} PythonSettings instance + */ + PythonSettings.create = function create(properties) { + return new PythonSettings(properties); + }; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PythonSettings message. + * @function verify + * @memberof google.api.PythonSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PythonSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings} PythonSettings + */ + PythonSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PythonSettings) + return object; + var message = new $root.google.api.PythonSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PythonSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings + * @static + * @param {google.api.PythonSettings} message PythonSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PythonSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PythonSettings to JSON. + * @function toJSON + * @memberof google.api.PythonSettings + * @instance + * @returns {Object.} JSON object + */ + PythonSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PythonSettings + * @function getTypeUrl + * @memberof google.api.PythonSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings"; + }; + + return PythonSettings; + })(); + + api.NodeSettings = (function() { + + /** + * Properties of a NodeSettings. + * @memberof google.api + * @interface INodeSettings + * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common + */ + + /** + * Constructs a new NodeSettings. + * @memberof google.api + * @classdesc Represents a NodeSettings. + * @implements INodeSettings + * @constructor + * @param {google.api.INodeSettings=} [properties] Properties to set + */ + function NodeSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.NodeSettings + * @instance + */ + NodeSettings.prototype.common = null; + + /** + * Creates a new NodeSettings instance using the specified properties. + * @function create + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings=} [properties] Properties to set + * @returns {google.api.NodeSettings} NodeSettings instance + */ + NodeSettings.create = function create(properties) { + return new NodeSettings(properties); + }; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encode + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.NodeSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeSettings message. + * @function verify + * @memberof google.api.NodeSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.NodeSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.NodeSettings} NodeSettings + */ + NodeSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.NodeSettings) + return object; + var message = new $root.google.api.NodeSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.NodeSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.NodeSettings + * @static + * @param {google.api.NodeSettings} message NodeSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this NodeSettings to JSON. + * @function toJSON + * @memberof google.api.NodeSettings + * @instance + * @returns {Object.} JSON object + */ + NodeSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeSettings + * @function getTypeUrl + * @memberof google.api.NodeSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.NodeSettings"; + }; + + return NodeSettings; + })(); + + api.DotnetSettings = (function() { + + /** + * Properties of a DotnetSettings. + * @memberof google.api + * @interface IDotnetSettings + * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common + * @property {Object.|null} [renamedServices] DotnetSettings renamedServices + * @property {Object.|null} [renamedResources] DotnetSettings renamedResources + * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources + * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases + * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures + */ + + /** + * Constructs a new DotnetSettings. + * @memberof google.api + * @classdesc Represents a DotnetSettings. + * @implements IDotnetSettings + * @constructor + * @param {google.api.IDotnetSettings=} [properties] Properties to set + */ + function DotnetSettings(properties) { + this.renamedServices = {}; + this.renamedResources = {}; + this.ignoredResources = []; + this.forcedNamespaceAliases = []; + this.handwrittenSignatures = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DotnetSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.common = null; + + /** + * DotnetSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedServices = $util.emptyObject; + + /** + * DotnetSettings renamedResources. + * @member {Object.} renamedResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedResources = $util.emptyObject; + + /** + * DotnetSettings ignoredResources. + * @member {Array.} ignoredResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.ignoredResources = $util.emptyArray; + + /** + * DotnetSettings forcedNamespaceAliases. + * @member {Array.} forcedNamespaceAliases + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; + + /** + * DotnetSettings handwrittenSignatures. + * @member {Array.} handwrittenSignatures + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @function create + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings=} [properties] Properties to set + * @returns {google.api.DotnetSettings} DotnetSettings instance + */ + DotnetSettings.create = function create(properties) { + return new DotnetSettings(properties); + }; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encode + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); + if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) + for (var keys = Object.keys(message.renamedResources), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedResources[keys[i]]).ldelim(); + if (message.ignoredResources != null && message.ignoredResources.length) + for (var i = 0; i < message.ignoredResources.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]); + if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length) + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]); + if (message.handwrittenSignatures != null && message.handwrittenSignatures.length) + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]); + return writer; + }; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedServices[key] = value; + break; + } + case 3: { + if (message.renamedResources === $util.emptyObject) + message.renamedResources = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedResources[key] = value; + break; + } + case 4: { + if (!(message.ignoredResources && message.ignoredResources.length)) + message.ignoredResources = []; + message.ignoredResources.push(reader.string()); + break; + } + case 5: { + if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length)) + message.forcedNamespaceAliases = []; + message.forcedNamespaceAliases.push(reader.string()); + break; + } + case 6: { + if (!(message.handwrittenSignatures && message.handwrittenSignatures.length)) + message.handwrittenSignatures = []; + message.handwrittenSignatures.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DotnetSettings message. + * @function verify + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DotnetSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } + if (message.renamedResources != null && message.hasOwnProperty("renamedResources")) { + if (!$util.isObject(message.renamedResources)) + return "renamedResources: object expected"; + var key = Object.keys(message.renamedResources); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedResources[key[i]])) + return "renamedResources: string{k:string} expected"; + } + if (message.ignoredResources != null && message.hasOwnProperty("ignoredResources")) { + if (!Array.isArray(message.ignoredResources)) + return "ignoredResources: array expected"; + for (var i = 0; i < message.ignoredResources.length; ++i) + if (!$util.isString(message.ignoredResources[i])) + return "ignoredResources: string[] expected"; + } + if (message.forcedNamespaceAliases != null && message.hasOwnProperty("forcedNamespaceAliases")) { + if (!Array.isArray(message.forcedNamespaceAliases)) + return "forcedNamespaceAliases: array expected"; + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + if (!$util.isString(message.forcedNamespaceAliases[i])) + return "forcedNamespaceAliases: string[] expected"; + } + if (message.handwrittenSignatures != null && message.hasOwnProperty("handwrittenSignatures")) { + if (!Array.isArray(message.handwrittenSignatures)) + return "handwrittenSignatures: array expected"; + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + if (!$util.isString(message.handwrittenSignatures[i])) + return "handwrittenSignatures: string[] expected"; + } + return null; + }; + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.DotnetSettings} DotnetSettings + */ + DotnetSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.DotnetSettings) + return object; + var message = new $root.google.api.DotnetSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.DotnetSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + if (object.renamedServices) { + if (typeof object.renamedServices !== "object") + throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } + if (object.renamedResources) { + if (typeof object.renamedResources !== "object") + throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); + message.renamedResources = {}; + for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) + message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]); + } + if (object.ignoredResources) { + if (!Array.isArray(object.ignoredResources)) + throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected"); + message.ignoredResources = []; + for (var i = 0; i < object.ignoredResources.length; ++i) + message.ignoredResources[i] = String(object.ignoredResources[i]); + } + if (object.forcedNamespaceAliases) { + if (!Array.isArray(object.forcedNamespaceAliases)) + throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected"); + message.forcedNamespaceAliases = []; + for (var i = 0; i < object.forcedNamespaceAliases.length; ++i) + message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]); + } + if (object.handwrittenSignatures) { + if (!Array.isArray(object.handwrittenSignatures)) + throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected"); + message.handwrittenSignatures = []; + for (var i = 0; i < object.handwrittenSignatures.length; ++i) + message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]); + } + return message; + }; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.DotnetSettings} message DotnetSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DotnetSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ignoredResources = []; + object.forcedNamespaceAliases = []; + object.handwrittenSignatures = []; + } + if (options.objects || options.defaults) { + object.renamedServices = {}; + object.renamedResources = {}; + } + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } + if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) { + object.renamedResources = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]]; + } + if (message.ignoredResources && message.ignoredResources.length) { + object.ignoredResources = []; + for (var j = 0; j < message.ignoredResources.length; ++j) + object.ignoredResources[j] = message.ignoredResources[j]; + } + if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) { + object.forcedNamespaceAliases = []; + for (var j = 0; j < message.forcedNamespaceAliases.length; ++j) + object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j]; + } + if (message.handwrittenSignatures && message.handwrittenSignatures.length) { + object.handwrittenSignatures = []; + for (var j = 0; j < message.handwrittenSignatures.length; ++j) + object.handwrittenSignatures[j] = message.handwrittenSignatures[j]; + } + return object; + }; + + /** + * Converts this DotnetSettings to JSON. + * @function toJSON + * @memberof google.api.DotnetSettings + * @instance + * @returns {Object.} JSON object + */ + DotnetSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DotnetSettings + * @function getTypeUrl + * @memberof google.api.DotnetSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.DotnetSettings"; + }; + + return DotnetSettings; + })(); + + api.RubySettings = (function() { + + /** + * Properties of a RubySettings. + * @memberof google.api + * @interface IRubySettings + * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common + */ + + /** + * Constructs a new RubySettings. + * @memberof google.api + * @classdesc Represents a RubySettings. + * @implements IRubySettings + * @constructor + * @param {google.api.IRubySettings=} [properties] Properties to set + */ + function RubySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RubySettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.RubySettings + * @instance + */ + RubySettings.prototype.common = null; + + /** + * Creates a new RubySettings instance using the specified properties. + * @function create + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings=} [properties] Properties to set + * @returns {google.api.RubySettings} RubySettings instance + */ + RubySettings.create = function create(properties) { + return new RubySettings(properties); + }; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encode + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RubySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RubySettings message. + * @function verify + * @memberof google.api.RubySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RubySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.RubySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.RubySettings} RubySettings + */ + RubySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.RubySettings) + return object; + var message = new $root.google.api.RubySettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.RubySettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.RubySettings + * @static + * @param {google.api.RubySettings} message RubySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RubySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this RubySettings to JSON. + * @function toJSON + * @memberof google.api.RubySettings + * @instance + * @returns {Object.} JSON object + */ + RubySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RubySettings + * @function getTypeUrl + * @memberof google.api.RubySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.RubySettings"; + }; + + return RubySettings; + })(); + + api.GoSettings = (function() { + + /** + * Properties of a GoSettings. + * @memberof google.api + * @interface IGoSettings + * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common + */ + + /** + * Constructs a new GoSettings. + * @memberof google.api + * @classdesc Represents a GoSettings. + * @implements IGoSettings + * @constructor + * @param {google.api.IGoSettings=} [properties] Properties to set + */ + function GoSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GoSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.common = null; + + /** + * Creates a new GoSettings instance using the specified properties. + * @function create + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings=} [properties] Properties to set + * @returns {google.api.GoSettings} GoSettings instance + */ + GoSettings.create = function create(properties) { + return new GoSettings(properties); + }; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encode + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoSettings message. + * @function verify + * @memberof google.api.GoSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.GoSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.GoSettings} GoSettings + */ + GoSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.GoSettings) + return object; + var message = new $root.google.api.GoSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.GoSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.GoSettings + * @static + * @param {google.api.GoSettings} message GoSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this GoSettings to JSON. + * @function toJSON + * @memberof google.api.GoSettings + * @instance + * @returns {Object.} JSON object + */ + GoSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoSettings + * @function getTypeUrl + * @memberof google.api.GoSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.GoSettings"; + }; + + return GoSettings; + })(); + + api.MethodSettings = (function() { + + /** + * Properties of a MethodSettings. + * @memberof google.api + * @interface IMethodSettings + * @property {string|null} [selector] MethodSettings selector + * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning + * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields + */ + + /** + * Constructs a new MethodSettings. + * @memberof google.api + * @classdesc Represents a MethodSettings. + * @implements IMethodSettings + * @constructor + * @param {google.api.IMethodSettings=} [properties] Properties to set + */ + function MethodSettings(properties) { + this.autoPopulatedFields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodSettings selector. + * @member {string} selector + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.selector = ""; + + /** + * MethodSettings longRunning. + * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.longRunning = null; + + /** + * MethodSettings autoPopulatedFields. + * @member {Array.} autoPopulatedFields + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.autoPopulatedFields = $util.emptyArray; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings=} [properties] Properties to set + * @returns {google.api.MethodSettings} MethodSettings instance + */ + MethodSettings.create = function create(properties) { + return new MethodSettings(properties); + }; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) + $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.autoPopulatedFields != null && message.autoPopulatedFields.length) + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]); + return writer; + }; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.autoPopulatedFields && message.autoPopulatedFields.length)) + message.autoPopulatedFields = []; + message.autoPopulatedFields.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodSettings message. + * @function verify + * @memberof google.api.MethodSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) { + var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning); + if (error) + return "longRunning." + error; + } + if (message.autoPopulatedFields != null && message.hasOwnProperty("autoPopulatedFields")) { + if (!Array.isArray(message.autoPopulatedFields)) + return "autoPopulatedFields: array expected"; + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + if (!$util.isString(message.autoPopulatedFields[i])) + return "autoPopulatedFields: string[] expected"; + } + return null; + }; + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings} MethodSettings + */ + MethodSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings) + return object; + var message = new $root.google.api.MethodSettings(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.longRunning != null) { + if (typeof object.longRunning !== "object") + throw TypeError(".google.api.MethodSettings.longRunning: object expected"); + message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning); + } + if (object.autoPopulatedFields) { + if (!Array.isArray(object.autoPopulatedFields)) + throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected"); + message.autoPopulatedFields = []; + for (var i = 0; i < object.autoPopulatedFields.length; ++i) + message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]); + } + return message; + }; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings + * @static + * @param {google.api.MethodSettings} message MethodSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.autoPopulatedFields = []; + if (options.defaults) { + object.selector = ""; + object.longRunning = null; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) + object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options); + if (message.autoPopulatedFields && message.autoPopulatedFields.length) { + object.autoPopulatedFields = []; + for (var j = 0; j < message.autoPopulatedFields.length; ++j) + object.autoPopulatedFields[j] = message.autoPopulatedFields[j]; + } + return object; + }; + + /** + * Converts this MethodSettings to JSON. + * @function toJSON + * @memberof google.api.MethodSettings + * @instance + * @returns {Object.} JSON object + */ + MethodSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodSettings + * @function getTypeUrl + * @memberof google.api.MethodSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings"; + }; + + MethodSettings.LongRunning = (function() { + + /** + * Properties of a LongRunning. + * @memberof google.api.MethodSettings + * @interface ILongRunning + * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay + * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier + * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay + * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout + */ + + /** + * Constructs a new LongRunning. + * @memberof google.api.MethodSettings + * @classdesc Represents a LongRunning. + * @implements ILongRunning + * @constructor + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + */ + function LongRunning(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LongRunning initialPollDelay. + * @member {google.protobuf.IDuration|null|undefined} initialPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.initialPollDelay = null; + + /** + * LongRunning pollDelayMultiplier. + * @member {number} pollDelayMultiplier + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.pollDelayMultiplier = 0; + + /** + * LongRunning maxPollDelay. + * @member {google.protobuf.IDuration|null|undefined} maxPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.maxPollDelay = null; + + /** + * LongRunning totalPollTimeout. + * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.totalPollTimeout = null; + + /** + * Creates a new LongRunning instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + * @returns {google.api.MethodSettings.LongRunning} LongRunning instance + */ + LongRunning.create = function create(properties) { + return new LongRunning(properties); + }; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) + $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier); + if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) + $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) + $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings.LongRunning(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.pollDelayMultiplier = reader.float(); + break; + } + case 3: { + message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LongRunning message. + * @function verify + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LongRunning.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.initialPollDelay); + if (error) + return "initialPollDelay." + error; + } + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + if (typeof message.pollDelayMultiplier !== "number") + return "pollDelayMultiplier: number expected"; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.maxPollDelay); + if (error) + return "maxPollDelay." + error; + } + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout); + if (error) + return "totalPollTimeout." + error; + } + return null; + }; + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings.LongRunning} LongRunning + */ + LongRunning.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings.LongRunning) + return object; + var message = new $root.google.api.MethodSettings.LongRunning(); + if (object.initialPollDelay != null) { + if (typeof object.initialPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); + message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay); + } + if (object.pollDelayMultiplier != null) + message.pollDelayMultiplier = Number(object.pollDelayMultiplier); + if (object.maxPollDelay != null) { + if (typeof object.maxPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); + message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay); + } + if (object.totalPollTimeout != null) { + if (typeof object.totalPollTimeout !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); + message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout); + } + return message; + }; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.LongRunning} message LongRunning + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LongRunning.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.initialPollDelay = null; + object.pollDelayMultiplier = 0; + object.maxPollDelay = null; + object.totalPollTimeout = null; + } + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) + object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options); + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) + object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options); + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) + object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options); + return object; + }; + + /** + * Converts this LongRunning to JSON. + * @function toJSON + * @memberof google.api.MethodSettings.LongRunning + * @instance + * @returns {Object.} JSON object + */ + LongRunning.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LongRunning + * @function getTypeUrl + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; + }; + + return LongRunning; + })(); + + return MethodSettings; + })(); + + /** + * ClientLibraryOrganization enum. + * @name google.api.ClientLibraryOrganization + * @enum {number} + * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value + * @property {number} CLOUD=1 CLOUD value + * @property {number} ADS=2 ADS value + * @property {number} PHOTOS=3 PHOTOS value + * @property {number} STREET_VIEW=4 STREET_VIEW value + * @property {number} SHOPPING=5 SHOPPING value + * @property {number} GEO=6 GEO value + * @property {number} GENERATIVE_AI=7 GENERATIVE_AI value + */ + api.ClientLibraryOrganization = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD"] = 1; + values[valuesById[2] = "ADS"] = 2; + values[valuesById[3] = "PHOTOS"] = 3; + values[valuesById[4] = "STREET_VIEW"] = 4; + values[valuesById[5] = "SHOPPING"] = 5; + values[valuesById[6] = "GEO"] = 6; + values[valuesById[7] = "GENERATIVE_AI"] = 7; + return values; + })(); + + /** + * ClientLibraryDestination enum. + * @name google.api.ClientLibraryDestination + * @enum {number} + * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value + * @property {number} GITHUB=10 GITHUB value + * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value + */ + api.ClientLibraryDestination = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0; + values[valuesById[10] = "GITHUB"] = 10; + values[valuesById[20] = "PACKAGE_MANAGER"] = 20; + return values; + })(); + + /** + * LaunchStage enum. + * @name google.api.LaunchStage + * @enum {number} + * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value + * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value + * @property {number} PRELAUNCH=7 PRELAUNCH value + * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value + * @property {number} ALPHA=2 ALPHA value + * @property {number} BETA=3 BETA value + * @property {number} GA=4 GA value + * @property {number} DEPRECATED=5 DEPRECATED value + */ + api.LaunchStage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; + values[valuesById[6] = "UNIMPLEMENTED"] = 6; + values[valuesById[7] = "PRELAUNCH"] = 7; + values[valuesById[1] = "EARLY_ACCESS"] = 1; + values[valuesById[2] = "ALPHA"] = 2; + values[valuesById[3] = "BETA"] = 3; + values[valuesById[4] = "GA"] = 4; + values[valuesById[5] = "DEPRECATED"] = 5; + return values; + })(); + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {number} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value + * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value + * @property {number} IDENTIFIER=8 IDENTIFIER value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + values[valuesById[6] = "UNORDERED_LIST"] = 6; + values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; + values[valuesById[8] = "IDENTIFIER"] = 8; + return values; + })(); + + api.ResourceDescriptor = (function() { + + /** + * Properties of a ResourceDescriptor. + * @memberof google.api + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular + * @property {Array.|null} [style] ResourceDescriptor style + */ + + /** + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor + * @constructor + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + */ + function ResourceDescriptor(properties) { + this.pattern = []; + this.style = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.type = ""; + + /** + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; + + /** + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; + + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; + + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; + + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; + + /** + * ResourceDescriptor style. + * @member {Array.} style + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.style = $util.emptyArray; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @function create + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + */ + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); + }; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.style != null && message.style.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.style.length; ++i) + writer.int32(message.style[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + } + case 3: { + message.nameField = reader.string(); + break; + } + case 4: { + message.history = reader.int32(); + break; + } + case 5: { + message.plural = reader.string(); + break; + } + case 6: { + message.singular = reader.string(); + break; + } + case 10: { + if (!(message.style && message.style.length)) + message.style = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.style.push(reader.int32()); + } else + message.style.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + if (message.style != null && message.hasOwnProperty("style")) { + if (!Array.isArray(message.style)) + return "style: array expected"; + for (var i = 0; i < message.style.length; ++i) + switch (message.style[i]) { + default: + return "style: enum value[] expected"; + case 0: + case 1: + break; + } + } + return null; + }; + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) + return object; + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + default: + if (typeof object.history === "number") { + message.history = object.history; + break; + } + break; + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + if (object.style) { + if (!Array.isArray(object.style)) + throw TypeError(".google.api.ResourceDescriptor.style: array expected"); + message.style = []; + for (var i = 0; i < object.style.length; ++i) + switch (object.style[i]) { + default: + if (typeof object.style[i] === "number") { + message.style[i] = object.style[i]; + break; + } + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pattern = []; + object.style = []; + } + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + if (message.style && message.style.length) { + object.style = []; + for (var j = 0; j < message.style.length; ++j) + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + } + return object; + }; + + /** + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + ResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceDescriptor + * @function getTypeUrl + * @memberof google.api.ResourceDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceDescriptor"; + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {number} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); + + /** + * Style enum. + * @name google.api.ResourceDescriptor.Style + * @enum {number} + * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value + * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value + */ + ResourceDescriptor.Style = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; + return values; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.childType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceReference message. + * @function verify + * @memberof google.api.ResourceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; + return null; + }; + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceReference} ResourceReference + */ + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) + return object; + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); + return message; + }; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceReference + * @static + * @param {google.api.ResourceReference} message ResourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.childType = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; + return object; + }; + + /** + * Converts this ResourceReference to JSON. + * @function toJSON + * @memberof google.api.ResourceReference + * @instance + * @returns {Object.} JSON object + */ + ResourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceReference + * @function getTypeUrl + * @memberof google.api.ResourceReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceReference"; + }; + + return ResourceReference; + })(); + + return api; + })(); + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorSet + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; + }; + + return FileDescriptorSet; + })(); + + /** + * Edition enum. + * @name google.protobuf.Edition + * @enum {number} + * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value + * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value + * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value + * @property {number} EDITION_2023=1000 EDITION_2023 value + * @property {number} EDITION_2024=1001 EDITION_2024 value + * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value + * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value + * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value + * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value + * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value + * @property {number} EDITION_MAX=2147483647 EDITION_MAX value + */ + protobuf.Edition = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EDITION_UNKNOWN"] = 0; + values[valuesById[998] = "EDITION_PROTO2"] = 998; + values[valuesById[999] = "EDITION_PROTO3"] = 999; + values[valuesById[1000] = "EDITION_2023"] = 1000; + values[valuesById[1001] = "EDITION_2024"] = 1001; + values[valuesById[1] = "EDITION_1_TEST_ONLY"] = 1; + values[valuesById[2] = "EDITION_2_TEST_ONLY"] = 2; + values[valuesById[99997] = "EDITION_99997_TEST_ONLY"] = 99997; + values[valuesById[99998] = "EDITION_99998_TEST_ONLY"] = 99998; + values[valuesById[99999] = "EDITION_99999_TEST_ONLY"] = 99999; + values[valuesById[2147483647] = "EDITION_MAX"] = 2147483647; + return values; + })(); + + protobuf.FileDescriptorProto = (function() { + + /** + * Properties of a FileDescriptorProto. + * @memberof google.protobuf + * @interface IFileDescriptorProto + * @property {string|null} [name] FileDescriptorProto name + * @property {string|null} ["package"] FileDescriptorProto package + * @property {Array.|null} [dependency] FileDescriptorProto dependency + * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency + * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [messageType] FileDescriptorProto messageType + * @property {Array.|null} [enumType] FileDescriptorProto enumType + * @property {Array.|null} [service] FileDescriptorProto service + * @property {Array.|null} [extension] FileDescriptorProto extension + * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options + * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo + * @property {string|null} [syntax] FileDescriptorProto syntax + * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition + */ + + /** + * Constructs a new FileDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto + * @constructor + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + */ + function FileDescriptorProto(properties) { + this.dependency = []; + this.publicDependency = []; + this.weakDependency = []; + this.messageType = []; + this.enumType = []; + this.service = []; + this.extension = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; + + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; + + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; + + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; + + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; + + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; + + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; + + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; + + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; + + /** + * FileDescriptorProto edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = 0; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message["package"] = reader.string(); + break; + } + case 3: { + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + } + case 10: { + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + } + case 11: { + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + } + case 4: { + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 8: { + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + } + case 12: { + message.syntax = reader.string(); + break; + } + case 14: { + message.edition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorProto message. + * @function verify + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message["package"] != null && message.hasOwnProperty("package")) + if (!$util.isString(message["package"])) + return "package: string expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + if (!Array.isArray(message.dependency)) + return "dependency: array expected"; + for (var i = 0; i < message.dependency.length; ++i) + if (!$util.isString(message.dependency[i])) + return "dependency: string[] expected"; + } + if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { + if (!Array.isArray(message.publicDependency)) + return "publicDependency: array expected"; + for (var i = 0; i < message.publicDependency.length; ++i) + if (!$util.isInteger(message.publicDependency[i])) + return "publicDependency: integer[] expected"; + } + if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { + if (!Array.isArray(message.weakDependency)) + return "weakDependency: array expected"; + for (var i = 0; i < message.weakDependency.length; ++i) + if (!$util.isInteger(message.weakDependency[i])) + return "weakDependency: integer[] expected"; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (!Array.isArray(message.messageType)) + return "messageType: array expected"; + for (var i = 0; i < message.messageType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); + if (error) + return "messageType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.service != null && message.hasOwnProperty("service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); + if (error) + return "service." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + */ + FileDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) + return object; + var message = new $root.google.protobuf.FileDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object["package"] != null) + message["package"] = String(object["package"]); + if (object.dependency) { + if (!Array.isArray(object.dependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); + message.dependency = []; + for (var i = 0; i < object.dependency.length; ++i) + message.dependency[i] = String(object.dependency[i]); + } + if (object.publicDependency) { + if (!Array.isArray(object.publicDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); + message.publicDependency = []; + for (var i = 0; i < object.publicDependency.length; ++i) + message.publicDependency[i] = object.publicDependency[i] | 0; + } + if (object.weakDependency) { + if (!Array.isArray(object.weakDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); + message.weakDependency = []; + for (var i = 0; i < object.weakDependency.length; ++i) + message.weakDependency[i] = object.weakDependency[i] | 0; + } + if (object.messageType) { + if (!Array.isArray(object.messageType)) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); + message.messageType = []; + for (var i = 0; i < object.messageType.length; ++i) { + if (typeof object.messageType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); + message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (typeof object.service[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); + message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options); + } + if (object.sourceCodeInfo != null) { + if (typeof object.sourceCodeInfo !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message["package"] != null && message.hasOwnProperty("package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = message.syntax; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + */ + + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; + + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; + + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; + + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; + + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; + + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; + + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; + + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescriptorProto message. + * @function verify + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.field != null && message.hasOwnProperty("field")) { + if (!Array.isArray(message.field)) + return "field: array expected"; + for (var i = 0; i < message.field.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); + if (error) + return "field." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.nestedType != null && message.hasOwnProperty("nestedType")) { + if (!Array.isArray(message.nestedType)) + return "nestedType: array expected"; + for (var i = 0; i < message.nestedType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); + if (error) + return "nestedType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { + if (!Array.isArray(message.extensionRange)) + return "extensionRange: array expected"; + for (var i = 0; i < message.extensionRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); + if (error) + return "extensionRange." + error; + } + } + if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { + if (!Array.isArray(message.oneofDecl)) + return "oneofDecl: array expected"; + for (var i = 0; i < message.oneofDecl.length; ++i) { + var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); + if (error) + return "oneofDecl." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MessageOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto} DescriptorProto + */ + DescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto) + return object; + var message = new $root.google.protobuf.DescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.field) { + if (!Array.isArray(object.field)) + throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); + message.field = []; + for (var i = 0; i < object.field.length; ++i) { + if (typeof object.field[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); + message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.nestedType) { + if (!Array.isArray(object.nestedType)) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); + message.nestedType = []; + for (var i = 0; i < object.nestedType.length; ++i) { + if (typeof object.nestedType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); + message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (typeof object.extensionRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (typeof object.oneofDecl[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto"; + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReservedRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + * @property {Array.|null} [declaration] ExtensionRangeOptions declaration + * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features + * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification + */ + + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + this.declaration = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ExtensionRangeOptions declaration. + * @member {Array.} declaration + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.declaration = $util.emptyArray; + + /** + * ExtensionRangeOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.features = null; + + /** + * ExtensionRangeOptions verification. + * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.verification = 1; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + */ + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.declaration != null && message.declaration.length) + for (var i = 0; i < message.declaration.length; ++i) + $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.declaration && message.declaration.length)) + message.declaration = []; + message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32())); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.verification = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message.declaration != null && message.hasOwnProperty("declaration")) { + if (!Array.isArray(message.declaration)) + return "declaration: array expected"; + for (var i = 0; i < message.declaration.length; ++i) { + var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i]); + if (error) + return "declaration." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.verification != null && message.hasOwnProperty("verification")) + switch (message.verification) { + default: + return "verification: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object.declaration) { + if (!Array.isArray(object.declaration)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); + message.declaration = []; + for (var i = 0; i < object.declaration.length; ++i) { + if (typeof object.declaration[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); + message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + switch (object.verification) { + case "DECLARATION": + case 0: + message.verification = 0; + break; + default: + if (typeof object.verification === "number") { + message.verification = object.verification; + break; + } + break; + case "UNVERIFIED": + case 1: + message.verification = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.declaration = []; + object.uninterpretedOption = []; + } + if (options.defaults) { + object.verification = options.enums === String ? "UNVERIFIED" : 1; + object.features = null; + } + if (message.declaration && message.declaration.length) { + object.declaration = []; + for (var j = 0; j < message.declaration.length; ++j) + object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); + } + if (message.verification != null && message.hasOwnProperty("verification")) + object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + * @returns {Object.} JSON object + */ + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; + }; + + ExtensionRangeOptions.Declaration = (function() { + + /** + * Properties of a Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @interface IDeclaration + * @property {number|null} [number] Declaration number + * @property {string|null} [fullName] Declaration fullName + * @property {string|null} [type] Declaration type + * @property {boolean|null} [reserved] Declaration reserved + * @property {boolean|null} [repeated] Declaration repeated + */ + + /** + * Constructs a new Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @classdesc Represents a Declaration. + * @implements IDeclaration + * @constructor + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + */ + function Declaration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Declaration number. + * @member {number} number + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.number = 0; + + /** + * Declaration fullName. + * @member {string} fullName + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.fullName = ""; + + /** + * Declaration type. + * @member {string} type + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.type = ""; + + /** + * Declaration reserved. + * @member {boolean} reserved + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.reserved = false; + + /** + * Declaration repeated. + * @member {boolean} repeated + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.repeated = false; + + /** + * Creates a new Declaration instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance + */ + Declaration.create = function create(properties) { + return new Declaration(properties); + }; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); + if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); + if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); + return writer; + }; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.number = reader.int32(); + break; + } + case 2: { + message.fullName = reader.string(); + break; + } + case 3: { + message.type = reader.string(); + break; + } + case 5: { + message.reserved = reader.bool(); + break; + } + case 6: { + message.repeated = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Declaration message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Declaration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.fullName != null && message.hasOwnProperty("fullName")) + if (!$util.isString(message.fullName)) + return "fullName: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.reserved != null && message.hasOwnProperty("reserved")) + if (typeof message.reserved !== "boolean") + return "reserved: boolean expected"; + if (message.repeated != null && message.hasOwnProperty("repeated")) + if (typeof message.repeated !== "boolean") + return "repeated: boolean expected"; + return null; + }; + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + */ + Declaration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + if (object.number != null) + message.number = object.number | 0; + if (object.fullName != null) + message.fullName = String(object.fullName); + if (object.type != null) + message.type = String(object.type); + if (object.reserved != null) + message.reserved = Boolean(object.reserved); + if (object.repeated != null) + message.repeated = Boolean(object.repeated); + return message; + }; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Declaration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.number = 0; + object.fullName = ""; + object.type = ""; + object.reserved = false; + object.repeated = false; + } + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.fullName != null && message.hasOwnProperty("fullName")) + object.fullName = message.fullName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.reserved != null && message.hasOwnProperty("reserved")) + object.reserved = message.reserved; + if (message.repeated != null && message.hasOwnProperty("repeated")) + object.repeated = message.repeated; + return object; + }; + + /** + * Converts this Declaration to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + * @returns {Object.} JSON object + */ + Declaration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Declaration + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"; + }; + + return Declaration; + })(); + + /** + * VerificationState enum. + * @name google.protobuf.ExtensionRangeOptions.VerificationState + * @enum {number} + * @property {number} DECLARATION=0 DECLARATION value + * @property {number} UNVERIFIED=1 UNVERIFIED value + */ + ExtensionRangeOptions.VerificationState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DECLARATION"] = 0; + values[valuesById[1] = "UNVERIFIED"] = 1; + return values; + })(); + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.number = reader.int32(); + break; + } + case 4: { + message.label = reader.int32(); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.typeName = reader.string(); + break; + } + case 2: { + message.extendee = reader.string(); + break; + } + case 7: { + message.defaultValue = reader.string(); + break; + } + case 9: { + message.oneofIndex = reader.int32(); + break; + } + case 10: { + message.jsonName = reader.string(); + break; + } + case 8: { + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + } + case 17: { + message.proto3Optional = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 3: + case 2: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + object.proto3Optional = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {number} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; + }; + + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + */ + + /** + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + */ + function EnumDescriptorProto(properties) { + this.value = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; + + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; + + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) { + var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); + if (error) + return "value." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + */ + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (typeof object.value[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); + message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumReservedRange message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumReservedRange + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.number = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); + if (error) + return "method." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (typeof object.method[i] !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.inputType = reader.string(); + break; + } + case 3: { + message.outputType = reader.string(); + break; + } + case 4: { + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.clientStreaming = reader.bool(); + break; + } + case 6: { + message.serverStreaming = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = message.inputType; + if (message.outputType != null && message.hasOwnProperty("outputType")) + object.outputType = message.outputType; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {google.protobuf.IFeatureSet|null} [features] FileOptions features + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.resourceDefinition"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = true; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.features = null; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.javaPackage = reader.string(); + break; + } + case 8: { + message.javaOuterClassname = reader.string(); + break; + } + case 10: { + message.javaMultipleFiles = reader.bool(); + break; + } + case 20: { + message.javaGenerateEqualsAndHash = reader.bool(); + break; + } + case 27: { + message.javaStringCheckUtf8 = reader.bool(); + break; + } + case 9: { + message.optimizeFor = reader.int32(); + break; + } + case 11: { + message.goPackage = reader.string(); + break; + } + case 16: { + message.ccGenericServices = reader.bool(); + break; + } + case 17: { + message.javaGenericServices = reader.bool(); + break; + } + case 18: { + message.pyGenericServices = reader.bool(); + break; + } + case 23: { + message.deprecated = reader.bool(); + break; + } + case 31: { + message.ccEnableArenas = reader.bool(); + break; + } + case 36: { + message.objcClassPrefix = reader.string(); + break; + } + case 37: { + message.csharpNamespace = reader.string(); + break; + } + case 39: { + message.swiftPrefix = reader.string(); + break; + } + case 40: { + message.phpClassPrefix = reader.string(); + break; + } + case 41: { + message.phpNamespace = reader.string(); + break; + } + case 44: { + message.phpMetadataNamespace = reader.string(); + break; + } + case 45: { + message.rubyPackage = reader.string(); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) + message[".google.api.resourceDefinition"] = []; + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { + if (!Array.isArray(message[".google.api.resourceDefinition"])) + return ".google.api.resourceDefinition: array expected"; + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); + if (error) + return ".google.api.resourceDefinition." + error; + } + } + return null; + }; + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + default: + if (typeof object.optimizeFor === "number") { + message.optimizeFor = object.optimizeFor; + break; + } + break; + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.ccEnableArenas != null) + message.ccEnableArenas = Boolean(object.ccEnableArenas); + if (object.objcClassPrefix != null) + message.objcClassPrefix = String(object.objcClassPrefix); + if (object.csharpNamespace != null) + message.csharpNamespace = String(object.csharpNamespace); + if (object.swiftPrefix != null) + message.swiftPrefix = String(object.swiftPrefix); + if (object.phpClassPrefix != null) + message.phpClassPrefix = String(object.phpClassPrefix); + if (object.phpNamespace != null) + message.phpNamespace = String(object.phpNamespace); + if (object.phpMetadataNamespace != null) + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + if (object.rubyPackage != null) + message.rubyPackage = String(object.rubyPackage); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FileOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resourceDefinition"]) { + if (!Array.isArray(object[".google.api.resourceDefinition"])) + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); + message[".google.api.resourceDefinition"] = []; + for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { + if (typeof object[".google.api.resourceDefinition"][i] !== "object") + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); + message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + object.features = null; + } + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { + object[".google.api.resourceDefinition"] = []; + for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} JSON object + */ + FileOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileOptions + * @function getTypeUrl + * @memberof google.protobuf.FileOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileOptions"; + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {number} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { + + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * MessageOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.features = null; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.messageSetWireFormat = reader.bool(); + break; + } + case 2: { + message.noStandardDescriptorAccessor = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 7: { + message.mapEntry = reader.bool(); + break; + } + case 11: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 12: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); + if (error) + return ".google.api.resource." + error; + } + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MessageOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resource"] != null) { + if (typeof object[".google.api.resource"] !== "object") + throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); + } + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + object[".google.api.resource"] = null; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); + return object; + }; + + /** + * Converts this MessageOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MessageOptions + * @instance + * @returns {Object.} JSON object + */ + MessageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessageOptions + * @function getTypeUrl + * @memberof google.protobuf.MessageOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MessageOptions"; + }; + + return MessageOptions; + })(); + + protobuf.FieldOptions = (function() { + + /** + * Properties of a FieldOptions. + * @memberof google.protobuf + * @interface IFieldOptions + * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype + * @property {boolean|null} [packed] FieldOptions packed + * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype + * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {boolean|null} [debugRedact] FieldOptions debugRedact + * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention + * @property {Array.|null} [targets] FieldOptions targets + * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults + * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + */ + + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.targets = []; + this.editionDefaults = []; + this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; + + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; + + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; + + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; + + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; + + /** + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; + + /** + * FieldOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.debugRedact = false; + + /** + * FieldOptions retention. + * @member {google.protobuf.FieldOptions.OptionRetention} retention + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.retention = 0; + + /** + * FieldOptions targets. + * @member {Array.} targets + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.targets = $util.emptyArray; + + /** + * FieldOptions editionDefaults. + * @member {Array.} editionDefaults + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.editionDefaults = $util.emptyArray; + + /** + * FieldOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.features = null; + + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact); + if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention); + if (message.targets != null && message.targets.length) + for (var i = 0; i < message.targets.length; ++i) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]); + if (message.editionDefaults != null && message.editionDefaults.length) + for (var i = 0; i < message.editionDefaults.length; ++i) + $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.ctype = reader.int32(); + break; + } + case 2: { + message.packed = reader.bool(); + break; + } + case 6: { + message.jstype = reader.int32(); + break; + } + case 5: { + message.lazy = reader.bool(); + break; + } + case 15: { + message.unverifiedLazy = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 10: { + message.weak = reader.bool(); + break; + } + case 16: { + message.debugRedact = reader.bool(); + break; + } + case 17: { + message.retention = reader.int32(); + break; + } + case 19: { + if (!(message.targets && message.targets.length)) + message.targets = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.targets.push(reader.int32()); + } else + message.targets.push(reader.int32()); + break; + } + case 20: { + if (!(message.editionDefaults && message.editionDefaults.length)) + message.editionDefaults = []; + message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32())); + break; + } + case 21: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + if (typeof message.unverifiedLazy !== "boolean") + return "unverifiedLazy: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.retention != null && message.hasOwnProperty("retention")) + switch (message.retention) { + default: + return "retention: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.targets != null && message.hasOwnProperty("targets")) { + if (!Array.isArray(message.targets)) + return "targets: array expected"; + for (var i = 0; i < message.targets.length; ++i) + switch (message.targets[i]) { + default: + return "targets: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + } + if (message.editionDefaults != null && message.hasOwnProperty("editionDefaults")) { + if (!Array.isArray(message.editionDefaults)) + return "editionDefaults: array expected"; + for (var i = 0; i < message.editionDefaults.length; ++i) { + var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i]); + if (error) + return "editionDefaults." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + default: + if (typeof object.ctype === "number") { + message.ctype = object.ctype; + break; + } + break; + case "STRING": + case 0: + message.ctype = 0; + break; + case "CORD": + case 1: + message.ctype = 1; + break; + case "STRING_PIECE": + case 2: + message.ctype = 2; + break; + } + if (object.packed != null) + message.packed = Boolean(object.packed); + switch (object.jstype) { + default: + if (typeof object.jstype === "number") { + message.jstype = object.jstype; + break; + } + break; + case "JS_NORMAL": + case 0: + message.jstype = 0; + break; + case "JS_STRING": + case 1: + message.jstype = 1; + break; + case "JS_NUMBER": + case 2: + message.jstype = 2; + break; + } + if (object.lazy != null) + message.lazy = Boolean(object.lazy); + if (object.unverifiedLazy != null) + message.unverifiedLazy = Boolean(object.unverifiedLazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + switch (object.retention) { + default: + if (typeof object.retention === "number") { + message.retention = object.retention; + break; + } + break; + case "RETENTION_UNKNOWN": + case 0: + message.retention = 0; + break; + case "RETENTION_RUNTIME": + case 1: + message.retention = 1; + break; + case "RETENTION_SOURCE": + case 2: + message.retention = 2; + break; + } + if (object.targets) { + if (!Array.isArray(object.targets)) + throw TypeError(".google.protobuf.FieldOptions.targets: array expected"); + message.targets = []; + for (var i = 0; i < object.targets.length; ++i) + switch (object.targets[i]) { + default: + if (typeof object.targets[i] === "number") { + message.targets[i] = object.targets[i]; + break; + } + case "TARGET_TYPE_UNKNOWN": + case 0: + message.targets[i] = 0; + break; + case "TARGET_TYPE_FILE": + case 1: + message.targets[i] = 1; + break; + case "TARGET_TYPE_EXTENSION_RANGE": + case 2: + message.targets[i] = 2; + break; + case "TARGET_TYPE_MESSAGE": + case 3: + message.targets[i] = 3; + break; + case "TARGET_TYPE_FIELD": + case 4: + message.targets[i] = 4; + break; + case "TARGET_TYPE_ONEOF": + case 5: + message.targets[i] = 5; + break; + case "TARGET_TYPE_ENUM": + case 6: + message.targets[i] = 6; + break; + case "TARGET_TYPE_ENUM_ENTRY": + case 7: + message.targets[i] = 7; + break; + case "TARGET_TYPE_SERVICE": + case 8: + message.targets[i] = 8; + break; + case "TARGET_TYPE_METHOD": + case 9: + message.targets[i] = 9; + break; + } + } + if (object.editionDefaults) { + if (!Array.isArray(object.editionDefaults)) + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected"); + message.editionDefaults = []; + for (var i = 0; i < object.editionDefaults.length; ++i) { + if (typeof object.editionDefaults[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); + message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FieldOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; + case "IDENTIFIER": + case 8: + message[".google.api.fieldBehavior"][i] = 8; + break; + } + } + if (object[".google.api.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + } + return message; + }; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.targets = []; + object.editionDefaults = []; + object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } + if (options.defaults) { + object.ctype = options.enums === String ? "STRING" : 0; + object.packed = false; + object.deprecated = false; + object.lazy = false; + object.jstype = options.enums === String ? "JS_NORMAL" : 0; + object.weak = false; + object.unverifiedLazy = false; + object.debugRedact = false; + object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; + object.features = null; + object[".google.api.resourceReference"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + if (message.packed != null && message.hasOwnProperty("packed")) + object.packed = message.packed; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.lazy != null && message.hasOwnProperty("lazy")) + object.lazy = message.lazy; + if (message.jstype != null && message.hasOwnProperty("jstype")) + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + object.unverifiedLazy = message.unverifiedLazy; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.retention != null && message.hasOwnProperty("retention")) + object.retention = options.enums === String ? $root.google.protobuf.FieldOptions.OptionRetention[message.retention] === undefined ? message.retention : $root.google.protobuf.FieldOptions.OptionRetention[message.retention] : message.retention; + if (message.targets && message.targets.length) { + object.targets = []; + for (var j = 0; j < message.targets.length; ++j) + object.targets[j] = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] === undefined ? message.targets[j] : $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] : message.targets[j]; + } + if (message.editionDefaults && message.editionDefaults.length) { + object.editionDefaults = []; + for (var j = 0; j < message.editionDefaults.length; ++j) + object.editionDefaults[j] = $root.google.protobuf.FieldOptions.EditionDefault.toObject(message.editionDefaults[j], options); + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { + object[".google.api.fieldBehavior"] = []; + for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldOptions + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions"; + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + /** + * OptionRetention enum. + * @name google.protobuf.FieldOptions.OptionRetention + * @enum {number} + * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value + * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value + * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value + */ + FieldOptions.OptionRetention = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; + values[valuesById[1] = "RETENTION_RUNTIME"] = 1; + values[valuesById[2] = "RETENTION_SOURCE"] = 2; + return values; + })(); + + /** + * OptionTargetType enum. + * @name google.protobuf.FieldOptions.OptionTargetType + * @enum {number} + * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value + * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value + * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value + * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value + * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value + * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value + * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value + * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value + * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value + * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value + */ + FieldOptions.OptionTargetType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; + values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; + values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; + values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; + values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; + values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; + values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; + values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; + values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; + return values; + })(); + + FieldOptions.EditionDefault = (function() { + + /** + * Properties of an EditionDefault. + * @memberof google.protobuf.FieldOptions + * @interface IEditionDefault + * @property {google.protobuf.Edition|null} [edition] EditionDefault edition + * @property {string|null} [value] EditionDefault value + */ + + /** + * Constructs a new EditionDefault. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents an EditionDefault. + * @implements IEditionDefault + * @constructor + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + */ + function EditionDefault(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.edition = 0; + + /** + * EditionDefault value. + * @member {string} value + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.value = ""; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance + */ + EditionDefault.create = function create(properties) { + return new EditionDefault(properties); + }; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EditionDefault message. + * @function verify + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + */ + EditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) + return object; + var message = new $root.google.protobuf.FieldOptions.EditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this EditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + * @returns {Object.} JSON object + */ + EditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; + }; + + return EditionDefault; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.features = null; + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + var message = new $root.google.protobuf.OneofOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.OneofOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.features = null; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofOptions + * @function getTypeUrl + * @memberof google.protobuf.OneofOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofOptions"; + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * EnumOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.features = null; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.allowAlias = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 6: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 7: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumOptions"; + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features + * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.features = null; + + /** + * EnumValueOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.debugRedact = false; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.deprecated = reader.bool(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.debugRedact = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object.debugRedact = false; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.features = null; + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * ServiceOptions .google.api.apiVersion. + * @member {string} .google.api.apiVersion + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.apiVersion"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) + writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 34: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + case 525000001: { + message[".google.api.apiVersion"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + if (!$util.isString(message[".google.api.apiVersion"])) + return ".google.api.apiVersion: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + if (object[".google.api.apiVersion"] != null) + message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + object[".google.api.apiVersion"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {google.protobuf.IFeatureSet|null} [features] MethodOptions features + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo + */ + + /** + * Constructs a new MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions + * @constructor + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + */ + function MethodOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.features = null; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + + /** + * MethodOptions .google.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.longrunning.operationInfo"] = null; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance + */ + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) + $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 35: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + } + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } + case 1049: { + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { + var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); + if (error) + return ".google.longrunning.operationInfo." + error; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodOptions} MethodOptions + */ + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) + return object; + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MethodOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } + if (object[".google.longrunning.operationInfo"] != null) { + if (typeof object[".google.longrunning.operationInfo"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object.features = null; + object[".google.longrunning.operationInfo"] = null; + object[".google.api.http"] = null; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodOptions + * @function getTypeUrl + * @memberof google.protobuf.MethodOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + } + case 3: { + message.identifierValue = reader.string(); + break; + } + case 4: { + message.positiveIntValue = reader.uint64(); + break; + } + case 5: { + message.negativeIntValue = reader.int64(); + break; + } + case 6: { + message.doubleValue = reader.double(); + break; + } + case 7: { + message.stringValue = reader.bytes(); + break; + } + case 8: { + message.aggregateValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length >= 0) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.FeatureSet = (function() { + + /** + * Properties of a FeatureSet. + * @memberof google.protobuf + * @interface IFeatureSet + * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence + * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType + * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding + * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation + * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding + * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat + */ + + /** + * Constructs a new FeatureSet. + * @memberof google.protobuf + * @classdesc Represents a FeatureSet. + * @implements IFeatureSet + * @constructor + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + */ + function FeatureSet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSet fieldPresence. + * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.fieldPresence = 0; + + /** + * FeatureSet enumType. + * @member {google.protobuf.FeatureSet.EnumType} enumType + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enumType = 0; + + /** + * FeatureSet repeatedFieldEncoding. + * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.repeatedFieldEncoding = 0; + + /** + * FeatureSet utf8Validation. + * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.utf8Validation = 0; + + /** + * FeatureSet messageEncoding. + * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.messageEncoding = 0; + + /** + * FeatureSet jsonFormat. + * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.jsonFormat = 0; + + /** + * Creates a new FeatureSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet} FeatureSet instance + */ + FeatureSet.create = function create(properties) { + return new FeatureSet(properties); + }; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); + if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); + if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); + if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); + if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); + if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); + return writer; + }; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.fieldPresence = reader.int32(); + break; + } + case 2: { + message.enumType = reader.int32(); + break; + } + case 3: { + message.repeatedFieldEncoding = reader.int32(); + break; + } + case 4: { + message.utf8Validation = reader.int32(); + break; + } + case 5: { + message.messageEncoding = reader.int32(); + break; + } + case 6: { + message.jsonFormat = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSet message. + * @function verify + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + switch (message.fieldPresence) { + default: + return "fieldPresence: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.enumType != null && message.hasOwnProperty("enumType")) + switch (message.enumType) { + default: + return "enumType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + switch (message.repeatedFieldEncoding) { + default: + return "repeatedFieldEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + switch (message.utf8Validation) { + default: + return "utf8Validation: enum value expected"; + case 0: + case 2: + case 3: + break; + } + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + switch (message.messageEncoding) { + default: + return "messageEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + switch (message.jsonFormat) { + default: + return "jsonFormat: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet} FeatureSet + */ + FeatureSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSet) + return object; + var message = new $root.google.protobuf.FeatureSet(); + switch (object.fieldPresence) { + default: + if (typeof object.fieldPresence === "number") { + message.fieldPresence = object.fieldPresence; + break; + } + break; + case "FIELD_PRESENCE_UNKNOWN": + case 0: + message.fieldPresence = 0; + break; + case "EXPLICIT": + case 1: + message.fieldPresence = 1; + break; + case "IMPLICIT": + case 2: + message.fieldPresence = 2; + break; + case "LEGACY_REQUIRED": + case 3: + message.fieldPresence = 3; + break; + } + switch (object.enumType) { + default: + if (typeof object.enumType === "number") { + message.enumType = object.enumType; + break; + } + break; + case "ENUM_TYPE_UNKNOWN": + case 0: + message.enumType = 0; + break; + case "OPEN": + case 1: + message.enumType = 1; + break; + case "CLOSED": + case 2: + message.enumType = 2; + break; + } + switch (object.repeatedFieldEncoding) { + default: + if (typeof object.repeatedFieldEncoding === "number") { + message.repeatedFieldEncoding = object.repeatedFieldEncoding; + break; + } + break; + case "REPEATED_FIELD_ENCODING_UNKNOWN": + case 0: + message.repeatedFieldEncoding = 0; + break; + case "PACKED": + case 1: + message.repeatedFieldEncoding = 1; + break; + case "EXPANDED": + case 2: + message.repeatedFieldEncoding = 2; + break; + } + switch (object.utf8Validation) { + default: + if (typeof object.utf8Validation === "number") { + message.utf8Validation = object.utf8Validation; + break; + } + break; + case "UTF8_VALIDATION_UNKNOWN": + case 0: + message.utf8Validation = 0; + break; + case "VERIFY": + case 2: + message.utf8Validation = 2; + break; + case "NONE": + case 3: + message.utf8Validation = 3; + break; + } + switch (object.messageEncoding) { + default: + if (typeof object.messageEncoding === "number") { + message.messageEncoding = object.messageEncoding; + break; + } + break; + case "MESSAGE_ENCODING_UNKNOWN": + case 0: + message.messageEncoding = 0; + break; + case "LENGTH_PREFIXED": + case 1: + message.messageEncoding = 1; + break; + case "DELIMITED": + case 2: + message.messageEncoding = 2; + break; + } + switch (object.jsonFormat) { + default: + if (typeof object.jsonFormat === "number") { + message.jsonFormat = object.jsonFormat; + break; + } + break; + case "JSON_FORMAT_UNKNOWN": + case 0: + message.jsonFormat = 0; + break; + case "ALLOW": + case 1: + message.jsonFormat = 1; + break; + case "LEGACY_BEST_EFFORT": + case 2: + message.jsonFormat = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.FeatureSet} message FeatureSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; + object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; + object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; + object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; + object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; + object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; + } + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; + if (message.enumType != null && message.hasOwnProperty("enumType")) + object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType; + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding; + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation; + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; + return object; + }; + + /** + * Converts this FeatureSet to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet + * @instance + * @returns {Object.} JSON object + */ + FeatureSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSet + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet"; + }; + + /** + * FieldPresence enum. + * @name google.protobuf.FeatureSet.FieldPresence + * @enum {number} + * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value + * @property {number} EXPLICIT=1 EXPLICIT value + * @property {number} IMPLICIT=2 IMPLICIT value + * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value + */ + FeatureSet.FieldPresence = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; + values[valuesById[1] = "EXPLICIT"] = 1; + values[valuesById[2] = "IMPLICIT"] = 2; + values[valuesById[3] = "LEGACY_REQUIRED"] = 3; + return values; + })(); + + /** + * EnumType enum. + * @name google.protobuf.FeatureSet.EnumType + * @enum {number} + * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value + * @property {number} OPEN=1 OPEN value + * @property {number} CLOSED=2 CLOSED value + */ + FeatureSet.EnumType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "OPEN"] = 1; + values[valuesById[2] = "CLOSED"] = 2; + return values; + })(); + + /** + * RepeatedFieldEncoding enum. + * @name google.protobuf.FeatureSet.RepeatedFieldEncoding + * @enum {number} + * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value + * @property {number} PACKED=1 PACKED value + * @property {number} EXPANDED=2 EXPANDED value + */ + FeatureSet.RepeatedFieldEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "PACKED"] = 1; + values[valuesById[2] = "EXPANDED"] = 2; + return values; + })(); + + /** + * Utf8Validation enum. + * @name google.protobuf.FeatureSet.Utf8Validation + * @enum {number} + * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value + * @property {number} VERIFY=2 VERIFY value + * @property {number} NONE=3 NONE value + */ + FeatureSet.Utf8Validation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; + values[valuesById[2] = "VERIFY"] = 2; + values[valuesById[3] = "NONE"] = 3; + return values; + })(); + + /** + * MessageEncoding enum. + * @name google.protobuf.FeatureSet.MessageEncoding + * @enum {number} + * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value + * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value + * @property {number} DELIMITED=2 DELIMITED value + */ + FeatureSet.MessageEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "LENGTH_PREFIXED"] = 1; + values[valuesById[2] = "DELIMITED"] = 2; + return values; + })(); + + /** + * JsonFormat enum. + * @name google.protobuf.FeatureSet.JsonFormat + * @enum {number} + * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value + * @property {number} ALLOW=1 ALLOW value + * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value + */ + FeatureSet.JsonFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; + values[valuesById[1] = "ALLOW"] = 1; + values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; + return values; + })(); + + return FeatureSet; + })(); + + protobuf.FeatureSetDefaults = (function() { + + /** + * Properties of a FeatureSetDefaults. + * @memberof google.protobuf + * @interface IFeatureSetDefaults + * @property {Array.|null} [defaults] FeatureSetDefaults defaults + * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition + * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition + */ + + /** + * Constructs a new FeatureSetDefaults. + * @memberof google.protobuf + * @classdesc Represents a FeatureSetDefaults. + * @implements IFeatureSetDefaults + * @constructor + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + */ + function FeatureSetDefaults(properties) { + this.defaults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSetDefaults defaults. + * @member {Array.} defaults + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.defaults = $util.emptyArray; + + /** + * FeatureSetDefaults minimumEdition. + * @member {google.protobuf.Edition} minimumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.minimumEdition = 0; + + /** + * FeatureSetDefaults maximumEdition. + * @member {google.protobuf.Edition} maximumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.maximumEdition = 0; + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance + */ + FeatureSetDefaults.create = function create(properties) { + return new FeatureSetDefaults(properties); + }; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.defaults != null && message.defaults.length) + for (var i = 0; i < message.defaults.length; ++i) + $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); + if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); + return writer; + }; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.defaults && message.defaults.length)) + message.defaults = []; + message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32())); + break; + } + case 4: { + message.minimumEdition = reader.int32(); + break; + } + case 5: { + message.maximumEdition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetDefaults message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetDefaults.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.defaults != null && message.hasOwnProperty("defaults")) { + if (!Array.isArray(message.defaults)) + return "defaults: array expected"; + for (var i = 0; i < message.defaults.length; ++i) { + var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i]); + if (error) + return "defaults." + error; + } + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + switch (message.minimumEdition) { + default: + return "minimumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + switch (message.maximumEdition) { + default: + return "maximumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + */ + FeatureSetDefaults.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults(); + if (object.defaults) { + if (!Array.isArray(object.defaults)) + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected"); + message.defaults = []; + for (var i = 0; i < object.defaults.length; ++i) { + if (typeof object.defaults[i] !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected"); + message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i]); + } + } + switch (object.minimumEdition) { + default: + if (typeof object.minimumEdition === "number") { + message.minimumEdition = object.minimumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.minimumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.minimumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.minimumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.minimumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.minimumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.minimumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.minimumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.minimumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.minimumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.minimumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.minimumEdition = 2147483647; + break; + } + switch (object.maximumEdition) { + default: + if (typeof object.maximumEdition === "number") { + message.maximumEdition = object.maximumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.maximumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.maximumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.maximumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.maximumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.maximumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.maximumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.maximumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.maximumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.maximumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.maximumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.maximumEdition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetDefaults.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.defaults = []; + if (options.defaults) { + object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.defaults && message.defaults.length) { + object.defaults = []; + for (var j = 0; j < message.defaults.length; ++j) + object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options); + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; + return object; + }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults + * @instance + * @returns {Object.} JSON object + */ + FeatureSetDefaults.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetDefaults + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; + }; + + FeatureSetDefaults.FeatureSetEditionDefault = (function() { + + /** + * Properties of a FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @interface IFeatureSetEditionDefault + * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition + * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features + */ + + /** + * Constructs a new FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @classdesc Represents a FeatureSetEditionDefault. + * @implements IFeatureSetEditionDefault + * @constructor + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + */ + function FeatureSetEditionDefault(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSetEditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.edition = 0; + + /** + * FeatureSetEditionDefault features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.features = null; + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance + */ + FeatureSetEditionDefault.create = function create(properties) { + return new FeatureSetEditionDefault(properties); + }; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetEditionDefault message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetEditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + return null; + }; + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + */ + FeatureSetEditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetEditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.features = null; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + * @returns {Object.} JSON object + */ + FeatureSetEditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; + }; + + return FeatureSetEditionDefault; + })(); + + return FeatureSetDefaults; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + } + case 3: { + message.leadingComments = reader.string(); + break; + } + case 4: { + message.trailingComments = reader.string(); + break; + } + case 6: { + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + message.sourceFile = reader.string(); + break; + } + case 3: { + message.begin = reader.int32(); + break; + } + case 4: { + message.end = reader.int32(); + break; + } + case 5: { + message.semantic = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.semantic != null && message.hasOwnProperty("semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) + return object; + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof google.protobuf.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Duration"; + }; + + return Duration; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.protobuf.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Timestamp"; + }; + + return Timestamp; + })(); + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + + return Any; + })(); + + protobuf.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + + return Empty; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] DoubleValue value + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Represents a DoubleValue. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + */ + function DoubleValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DoubleValue value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.value); + return writer; + }; + + /** + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DoubleValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DoubleValue message. + * @function verify + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DoubleValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DoubleValue} DoubleValue + */ + DoubleValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DoubleValue) + return object; + var message = new $root.google.protobuf.DoubleValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.DoubleValue} message DoubleValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DoubleValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this DoubleValue to JSON. + * @function toJSON + * @memberof google.protobuf.DoubleValue + * @instance + * @returns {Object.} JSON object + */ + DoubleValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] FloatValue value + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Represents a FloatValue. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + */ + function FloatValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FloatValue value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.value); + return writer; + }; + + /** + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FloatValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FloatValue message. + * @function verify + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FloatValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FloatValue} FloatValue + */ + FloatValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FloatValue) + return object; + var message = new $root.google.protobuf.FloatValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a FloatValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.FloatValue} message FloatValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FloatValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this FloatValue to JSON. + * @function toJSON + * @memberof google.protobuf.FloatValue + * @instance + * @returns {Object.} JSON object + */ + FloatValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {number|Long|null} [value] Int64Value value + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Represents an Int64Value. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + */ + function Int64Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Int64Value value. + * @member {number|Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.value); + return writer; + }; + + /** + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int64Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int64Value message. + * @function verify + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int64Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + return null; + }; + + /** + * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int64Value} Int64Value + */ + Int64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int64Value) + return object; + var message = new $root.google.protobuf.Int64Value(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = false; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.Int64Value} message Int64Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int64Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value; + return object; + }; + + /** + * Converts this Int64Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int64Value + * @instance + * @returns {Object.} JSON object + */ + Int64Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {number|Long|null} [value] UInt64Value value + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Represents a UInt64Value. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + */ + function UInt64Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UInt64Value value. + * @member {number|Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.value); + return writer; + }; + + /** + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt64Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.uint64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UInt64Value message. + * @function verify + * @memberof google.protobuf.UInt64Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UInt64Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + return null; + }; + + /** + * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UInt64Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UInt64Value} UInt64Value + */ + UInt64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt64Value) + return object; + var message = new $root.google.protobuf.UInt64Value(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = true; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.UInt64Value} message UInt64Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UInt64Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber(true) : message.value; + return object; + }; + + /** + * Converts this UInt64Value to JSON. + * @function toJSON + * @memberof google.protobuf.UInt64Value + * @instance + * @returns {Object.} JSON object + */ + UInt64Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] Int32Value value + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Represents an Int32Value. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + */ + function Int32Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Int32Value value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.value); + return writer; + }; + + /** + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int32Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int32Value message. + * @function verify + * @memberof google.protobuf.Int32Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int32Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; + return null; + }; + + /** + * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int32Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int32Value} Int32Value + */ + Int32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int32Value) + return object; + var message = new $root.google.protobuf.Int32Value(); + if (object.value != null) + message.value = object.value | 0; + return message; + }; + + /** + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.Int32Value} message Int32Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int32Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this Int32Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int32Value + * @instance + * @returns {Object.} JSON object + */ + Int32Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] UInt32Value value + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Represents a UInt32Value. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + */ + function UInt32Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UInt32Value value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.value); + return writer; + }; + + /** + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt32Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.uint32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UInt32Value message. + * @function verify + * @memberof google.protobuf.UInt32Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UInt32Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; + return null; + }; + + /** + * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UInt32Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UInt32Value} UInt32Value + */ + UInt32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt32Value) + return object; + var message = new $root.google.protobuf.UInt32Value(); + if (object.value != null) + message.value = object.value >>> 0; + return message; + }; + + /** + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.UInt32Value} message UInt32Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UInt32Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this UInt32Value to JSON. + * @function toJSON + * @memberof google.protobuf.UInt32Value + * @instance + * @returns {Object.} JSON object + */ + UInt32Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] BoolValue value + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Represents a BoolValue. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + */ + function BoolValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BoolValue value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.value); + return writer; + }; + + /** + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BoolValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoolValue message. + * @function verify + * @memberof google.protobuf.BoolValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoolValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "boolean") + return "value: boolean expected"; + return null; + }; + + /** + * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.BoolValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.BoolValue} BoolValue + */ + BoolValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BoolValue) + return object; + var message = new $root.google.protobuf.BoolValue(); + if (object.value != null) + message.value = Boolean(object.value); + return message; + }; + + /** + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.BoolValue} message BoolValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoolValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = false; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this BoolValue to JSON. + * @function toJSON + * @memberof google.protobuf.BoolValue + * @instance + * @returns {Object.} JSON object + */ + BoolValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] StringValue value + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Represents a StringValue. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [properties] Properties to set + */ + function StringValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StringValue value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + return writer; + }; + + /** + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.StringValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StringValue message. + * @function verify + * @memberof google.protobuf.StringValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StringValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates a StringValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.StringValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.StringValue} StringValue + */ + StringValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.StringValue) + return object; + var message = new $root.google.protobuf.StringValue(); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.StringValue} message StringValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StringValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = ""; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this StringValue to JSON. + * @function toJSON + * @memberof google.protobuf.StringValue + * @instance + * @returns {Object.} JSON object + */ + StringValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] BytesValue value + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Represents a BytesValue. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + */ + function BytesValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BytesValue value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BytesValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BytesValue message. + * @function verify + * @memberof google.protobuf.BytesValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BytesValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.BytesValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.BytesValue} BytesValue + */ + BytesValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BytesValue) + return object; + var message = new $root.google.protobuf.BytesValue(); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from a BytesValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.BytesValue} message BytesValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BytesValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this BytesValue to JSON. + * @function toJSON + * @memberof google.protobuf.BytesValue + * @instance + * @returns {Object.} JSON object + */ + BytesValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.FieldMask = (function() { + + /** + * Properties of a FieldMask. + * @memberof google.protobuf + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths + */ + + /** + * Constructs a new FieldMask. + * @memberof google.protobuf + * @classdesc Represents a FieldMask. + * @implements IFieldMask + * @constructor + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + */ + function FieldMask(properties) { + this.paths = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask + * @instance + */ + FieldMask.prototype.paths = $util.emptyArray; + + /** + * Creates a new FieldMask instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance + */ + FieldMask.create = function create(properties) { + return new FieldMask(properties); + }; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); + return writer; + }; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldMask message. + * @function verify + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldMask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } + return null; + }; + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldMask} FieldMask + */ + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) + return object; + var message = new $root.google.protobuf.FieldMask(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.protobuf.FieldMask.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + return message; + }; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.FieldMask} message FieldMask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldMask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + return object; + }; + + /** + * Converts this FieldMask to JSON. + * @function toJSON + * @memberof google.protobuf.FieldMask + * @instance + * @returns {Object.} JSON object + */ + FieldMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldMask + * @function getTypeUrl + * @memberof google.protobuf.FieldMask + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldMask"; + }; + + return FieldMask; + })(); + + return protobuf; + })(); + + google.longrunning = (function() { + + /** + * Namespace longrunning. + * @memberof google + * @namespace + */ + var longrunning = {}; + + longrunning.Operations = (function() { + + /** + * Constructs a new Operations service. + * @memberof google.longrunning + * @classdesc Represents an Operations + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Operations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; + + /** + * Creates new Operations service using the specified rpc implementation. + * @function create + * @memberof google.longrunning.Operations + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Operations} RPC service. Useful where requests and/or responses are streamed. + */ + Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @memberof google.longrunning.Operations + * @typedef ListOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse + */ + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { + return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); + }, "name", { value: "ListOperations" }); + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @memberof google.longrunning.Operations + * @typedef GetOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { + return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "GetOperation" }); + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @memberof google.longrunning.Operations + * @typedef DeleteOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { + return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteOperation" }); + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @memberof google.longrunning.Operations + * @typedef CancelOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { + return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "CancelOperation" }); + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @memberof google.longrunning.Operations + * @typedef WaitOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { + return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "WaitOperation" }); + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Operations; + })(); + + longrunning.Operation = (function() { + + /** + * Properties of an Operation. + * @memberof google.longrunning + * @interface IOperation + * @property {string|null} [name] Operation name + * @property {google.protobuf.IAny|null} [metadata] Operation metadata + * @property {boolean|null} [done] Operation done + * @property {google.rpc.IStatus|null} [error] Operation error + * @property {google.protobuf.IAny|null} [response] Operation response + */ + + /** + * Constructs a new Operation. + * @memberof google.longrunning + * @classdesc Represents an Operation. + * @implements IOperation + * @constructor + * @param {google.longrunning.IOperation=} [properties] Properties to set + */ + function Operation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Operation name. + * @member {string} name + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.name = ""; + + /** + * Operation metadata. + * @member {google.protobuf.IAny|null|undefined} metadata + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.metadata = null; + + /** + * Operation done. + * @member {boolean} done + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.done = false; + + /** + * Operation error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.error = null; + + /** + * Operation response. + * @member {google.protobuf.IAny|null|undefined} response + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Operation result. + * @member {"error"|"response"|undefined} result + * @memberof google.longrunning.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["error", "response"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Operation instance using the specified properties. + * @function create + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation=} [properties] Properties to set + * @returns {google.longrunning.Operation} Operation instance + */ + Operation.create = function create(properties) { + return new Operation(properties); + }; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encode + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.done != null && Object.hasOwnProperty.call(message, "done")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + case 3: { + message.done = reader.bool(); + break; + } + case 4: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 5: { + message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Operation message. + * @function verify + * @memberof google.longrunning.Operation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Operation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Any.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.done != null && message.hasOwnProperty("done")) + if (typeof message.done !== "boolean") + return "done: boolean expected"; + if (message.error != null && message.hasOwnProperty("error")) { + properties.result = 1; + { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.response != null && message.hasOwnProperty("response")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.protobuf.Any.verify(message.response); + if (error) + return "response." + error; + } + } + return null; + }; + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.Operation + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.Operation} Operation + */ + Operation.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.Operation) + return object; + var message = new $root.google.longrunning.Operation(); + if (object.name != null) + message.name = String(object.name); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.longrunning.Operation.metadata: object expected"); + message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); + } + if (object.done != null) + message.done = Boolean(object.done); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.longrunning.Operation.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.longrunning.Operation.response: object expected"); + message.response = $root.google.protobuf.Any.fromObject(object.response); + } + return message; + }; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.Operation} message Operation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Operation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.metadata = null; + object.done = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); + if (message.done != null && message.hasOwnProperty("done")) + object.done = message.done; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; + } + if (message.response != null && message.hasOwnProperty("response")) { + object.response = $root.google.protobuf.Any.toObject(message.response, options); + if (options.oneofs) + object.result = "response"; + } + return object; + }; + + /** + * Converts this Operation to JSON. + * @function toJSON + * @memberof google.longrunning.Operation + * @instance + * @returns {Object.} JSON object + */ + Operation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Operation + * @function getTypeUrl + * @memberof google.longrunning.Operation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.Operation"; + }; + + return Operation; + })(); + + longrunning.GetOperationRequest = (function() { + + /** + * Properties of a GetOperationRequest. + * @memberof google.longrunning + * @interface IGetOperationRequest + * @property {string|null} [name] GetOperationRequest name + */ + + /** + * Constructs a new GetOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a GetOperationRequest. + * @implements IGetOperationRequest + * @constructor + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + */ + function GetOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetOperationRequest name. + * @member {string} name + * @memberof google.longrunning.GetOperationRequest + * @instance + */ + GetOperationRequest.prototype.name = ""; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance + */ + GetOperationRequest.create = function create(properties) { + return new GetOperationRequest(properties); + }; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOperationRequest message. + * @function verify + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + */ + GetOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.GetOperationRequest) + return object; + var message = new $root.google.longrunning.GetOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.GetOperationRequest} message GetOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.GetOperationRequest + * @instance + * @returns {Object.} JSON object + */ + GetOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; + }; + + return GetOperationRequest; + })(); + + longrunning.ListOperationsRequest = (function() { + + /** + * Properties of a ListOperationsRequest. + * @memberof google.longrunning + * @interface IListOperationsRequest + * @property {string|null} [name] ListOperationsRequest name + * @property {string|null} [filter] ListOperationsRequest filter + * @property {number|null} [pageSize] ListOperationsRequest pageSize + * @property {string|null} [pageToken] ListOperationsRequest pageToken + */ + + /** + * Constructs a new ListOperationsRequest. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsRequest. + * @implements IListOperationsRequest + * @constructor + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + */ + function ListOperationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsRequest name. + * @member {string} name + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.name = ""; + + /** + * ListOperationsRequest filter. + * @member {string} filter + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.filter = ""; + + /** + * ListOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageSize = 0; + + /** + * ListOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance + */ + ListOperationsRequest.create = function create(properties) { + return new ListOperationsRequest(properties); + }; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + return writer; + }; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 4: { + message.name = reader.string(); + break; + } + case 1: { + message.filter = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsRequest message. + * @function verify + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + */ + ListOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsRequest) + return object; + var message = new $root.google.longrunning.ListOperationsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.name = ""; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this ListOperationsRequest to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsRequest + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; + }; + + return ListOperationsRequest; + })(); + + longrunning.ListOperationsResponse = (function() { + + /** + * Properties of a ListOperationsResponse. + * @memberof google.longrunning + * @interface IListOperationsResponse + * @property {Array.|null} [operations] ListOperationsResponse operations + * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken + */ + + /** + * Constructs a new ListOperationsResponse. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsResponse. + * @implements IListOperationsResponse + * @constructor + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + */ + function ListOperationsResponse(properties) { + this.operations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsResponse operations. + * @member {Array.} operations + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.operations = $util.emptyArray; + + /** + * ListOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance + */ + ListOperationsResponse.create = function create(properties) { + return new ListOperationsResponse(properties); + }; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsResponse message. + * @function verify + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + */ + ListOperationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsResponse) + return object; + var message = new $root.google.longrunning.ListOperationsResponse(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); + message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListOperationsResponse to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListOperationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsResponse + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; + }; + + return ListOperationsResponse; + })(); + + longrunning.CancelOperationRequest = (function() { + + /** + * Properties of a CancelOperationRequest. + * @memberof google.longrunning + * @interface ICancelOperationRequest + * @property {string|null} [name] CancelOperationRequest name + */ + + /** + * Constructs a new CancelOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a CancelOperationRequest. + * @implements ICancelOperationRequest + * @constructor + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + */ + function CancelOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CancelOperationRequest name. + * @member {string} name + * @memberof google.longrunning.CancelOperationRequest + * @instance + */ + CancelOperationRequest.prototype.name = ""; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance + */ + CancelOperationRequest.create = function create(properties) { + return new CancelOperationRequest(properties); + }; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelOperationRequest message. + * @function verify + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + */ + CancelOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.CancelOperationRequest) + return object; + var message = new $root.google.longrunning.CancelOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this CancelOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.CancelOperationRequest + * @instance + * @returns {Object.} JSON object + */ + CancelOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; + }; + + return CancelOperationRequest; + })(); + + longrunning.DeleteOperationRequest = (function() { + + /** + * Properties of a DeleteOperationRequest. + * @memberof google.longrunning + * @interface IDeleteOperationRequest + * @property {string|null} [name] DeleteOperationRequest name + */ + + /** + * Constructs a new DeleteOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a DeleteOperationRequest. + * @implements IDeleteOperationRequest + * @constructor + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + */ + function DeleteOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteOperationRequest name. + * @member {string} name + * @memberof google.longrunning.DeleteOperationRequest + * @instance + */ + DeleteOperationRequest.prototype.name = ""; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance + */ + DeleteOperationRequest.create = function create(properties) { + return new DeleteOperationRequest(properties); + }; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteOperationRequest message. + * @function verify + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + */ + DeleteOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.DeleteOperationRequest) + return object; + var message = new $root.google.longrunning.DeleteOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.DeleteOperationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; + }; + + return DeleteOperationRequest; + })(); + + longrunning.WaitOperationRequest = (function() { + + /** + * Properties of a WaitOperationRequest. + * @memberof google.longrunning + * @interface IWaitOperationRequest + * @property {string|null} [name] WaitOperationRequest name + * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout + */ + + /** + * Constructs a new WaitOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a WaitOperationRequest. + * @implements IWaitOperationRequest + * @constructor + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + */ + function WaitOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WaitOperationRequest name. + * @member {string} name + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.name = ""; + + /** + * WaitOperationRequest timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.timeout = null; + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance + */ + WaitOperationRequest.create = function create(properties) { + return new WaitOperationRequest(properties); + }; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitOperationRequest message. + * @function verify + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + return null; + }; + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + */ + WaitOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.WaitOperationRequest) + return object; + var message = new $root.google.longrunning.WaitOperationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + return message; + }; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.timeout = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + return object; + }; + + /** + * Converts this WaitOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.WaitOperationRequest + * @instance + * @returns {Object.} JSON object + */ + WaitOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WaitOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; + }; + + return WaitOperationRequest; + })(); + + longrunning.OperationInfo = (function() { + + /** + * Properties of an OperationInfo. + * @memberof google.longrunning + * @interface IOperationInfo + * @property {string|null} [responseType] OperationInfo responseType + * @property {string|null} [metadataType] OperationInfo metadataType + */ + + /** + * Constructs a new OperationInfo. + * @memberof google.longrunning + * @classdesc Represents an OperationInfo. + * @implements IOperationInfo + * @constructor + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + */ + function OperationInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationInfo responseType. + * @member {string} responseType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.responseType = ""; + + /** + * OperationInfo metadataType. + * @member {string} metadataType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.metadataType = ""; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @function create + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + * @returns {google.longrunning.OperationInfo} OperationInfo instance + */ + OperationInfo.create = function create(properties) { + return new OperationInfo(properties); + }; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encode + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); + if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); + return writer; + }; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.responseType = reader.string(); + break; + } + case 2: { + message.metadataType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationInfo message. + * @function verify + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responseType != null && message.hasOwnProperty("responseType")) + if (!$util.isString(message.responseType)) + return "responseType: string expected"; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + if (!$util.isString(message.metadataType)) + return "metadataType: string expected"; + return null; + }; + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.OperationInfo} OperationInfo + */ + OperationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.OperationInfo) + return object; + var message = new $root.google.longrunning.OperationInfo(); + if (object.responseType != null) + message.responseType = String(object.responseType); + if (object.metadataType != null) + message.metadataType = String(object.metadataType); + return message; + }; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.OperationInfo} message OperationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.responseType = ""; + object.metadataType = ""; + } + if (message.responseType != null && message.hasOwnProperty("responseType")) + object.responseType = message.responseType; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + object.metadataType = message.metadataType; + return object; + }; + + /** + * Converts this OperationInfo to JSON. + * @function toJSON + * @memberof google.longrunning.OperationInfo + * @instance + * @returns {Object.} JSON object + */ + OperationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationInfo + * @function getTypeUrl + * @memberof google.longrunning.OperationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.OperationInfo"; + }; + + return OperationInfo; + })(); + + return longrunning; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + + return Status; + })(); + + return rpc; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/protos/protos.json b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/protos/protos.json new file mode 100644 index 00000000000..daabd54d3db --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/protos/protos.json @@ -0,0 +1,3587 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "speech": { + "nested": { + "v1p1beta1": { + "options": { + "go_package": "cloud.google.com/go/speech/apiv1p1beta1/speechpb;speechpb", + "java_multiple_files": true, + "java_outer_classname": "SpeechAdaptationProto", + "java_package": "com.google.cloud.speech.v1p1beta1", + "objc_class_prefix": "GCS", + "(google.api.resource_definition).type": "cloudkms.googleapis.com/CryptoKeyVersion", + "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}" + }, + "nested": { + "Speech": { + "options": { + "(google.api.default_host)": "speech.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "Recognize": { + "requestType": "RecognizeRequest", + "responseType": "RecognizeResponse", + "options": { + "(google.api.http).post": "/v1p1beta1/speech:recognize", + "(google.api.http).body": "*", + "(google.api.method_signature)": "config,audio" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1p1beta1/speech:recognize", + "body": "*" + } + }, + { + "(google.api.method_signature)": "config,audio" + } + ] + }, + "LongRunningRecognize": { + "requestType": "LongRunningRecognizeRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1p1beta1/speech:longrunningrecognize", + "(google.api.http).body": "*", + "(google.api.method_signature)": "config,audio", + "(google.longrunning.operation_info).response_type": "LongRunningRecognizeResponse", + "(google.longrunning.operation_info).metadata_type": "LongRunningRecognizeMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1p1beta1/speech:longrunningrecognize", + "body": "*" + } + }, + { + "(google.api.method_signature)": "config,audio" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "LongRunningRecognizeResponse", + "metadata_type": "LongRunningRecognizeMetadata" + } + } + ] + }, + "StreamingRecognize": { + "requestType": "StreamingRecognizeRequest", + "requestStream": true, + "responseType": "StreamingRecognizeResponse", + "responseStream": true + } + } + }, + "RecognizeRequest": { + "fields": { + "config": { + "type": "RecognitionConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "audio": { + "type": "RecognitionAudio", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "LongRunningRecognizeRequest": { + "fields": { + "config": { + "type": "RecognitionConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "audio": { + "type": "RecognitionAudio", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "outputConfig": { + "type": "TranscriptOutputConfig", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "TranscriptOutputConfig": { + "oneofs": { + "outputType": { + "oneof": [ + "gcsUri" + ] + } + }, + "fields": { + "gcsUri": { + "type": "string", + "id": 1 + } + } + }, + "StreamingRecognizeRequest": { + "oneofs": { + "streamingRequest": { + "oneof": [ + "streamingConfig", + "audioContent" + ] + } + }, + "fields": { + "streamingConfig": { + "type": "StreamingRecognitionConfig", + "id": 1 + }, + "audioContent": { + "type": "bytes", + "id": 2 + } + } + }, + "StreamingRecognitionConfig": { + "fields": { + "config": { + "type": "RecognitionConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "singleUtterance": { + "type": "bool", + "id": 2 + }, + "interimResults": { + "type": "bool", + "id": 3 + }, + "enableVoiceActivityEvents": { + "type": "bool", + "id": 5 + }, + "voiceActivityTimeout": { + "type": "VoiceActivityTimeout", + "id": 6 + } + }, + "nested": { + "VoiceActivityTimeout": { + "fields": { + "speechStartTimeout": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "speechEndTimeout": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + } + } + }, + "RecognitionConfig": { + "fields": { + "encoding": { + "type": "AudioEncoding", + "id": 1 + }, + "sampleRateHertz": { + "type": "int32", + "id": 2 + }, + "audioChannelCount": { + "type": "int32", + "id": 7 + }, + "enableSeparateRecognitionPerChannel": { + "type": "bool", + "id": 12 + }, + "languageCode": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "alternativeLanguageCodes": { + "rule": "repeated", + "type": "string", + "id": 18 + }, + "maxAlternatives": { + "type": "int32", + "id": 4 + }, + "profanityFilter": { + "type": "bool", + "id": 5 + }, + "adaptation": { + "type": "SpeechAdaptation", + "id": 20 + }, + "transcriptNormalization": { + "type": "TranscriptNormalization", + "id": 24, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "speechContexts": { + "rule": "repeated", + "type": "SpeechContext", + "id": 6 + }, + "enableWordTimeOffsets": { + "type": "bool", + "id": 8 + }, + "enableWordConfidence": { + "type": "bool", + "id": 15 + }, + "enableAutomaticPunctuation": { + "type": "bool", + "id": 11 + }, + "enableSpokenPunctuation": { + "type": "google.protobuf.BoolValue", + "id": 22 + }, + "enableSpokenEmojis": { + "type": "google.protobuf.BoolValue", + "id": 23 + }, + "enableSpeakerDiarization": { + "type": "bool", + "id": 16, + "options": { + "deprecated": true + } + }, + "diarizationSpeakerCount": { + "type": "int32", + "id": 17, + "options": { + "deprecated": true + } + }, + "diarizationConfig": { + "type": "SpeakerDiarizationConfig", + "id": 19 + }, + "metadata": { + "type": "RecognitionMetadata", + "id": 9 + }, + "model": { + "type": "string", + "id": 13 + }, + "useEnhanced": { + "type": "bool", + "id": 14 + } + }, + "nested": { + "AudioEncoding": { + "values": { + "ENCODING_UNSPECIFIED": 0, + "LINEAR16": 1, + "FLAC": 2, + "MULAW": 3, + "AMR": 4, + "AMR_WB": 5, + "OGG_OPUS": 6, + "SPEEX_WITH_HEADER_BYTE": 7, + "MP3": 8, + "WEBM_OPUS": 9, + "ALAW": 10 + } + } + } + }, + "SpeakerDiarizationConfig": { + "fields": { + "enableSpeakerDiarization": { + "type": "bool", + "id": 1 + }, + "minSpeakerCount": { + "type": "int32", + "id": 2 + }, + "maxSpeakerCount": { + "type": "int32", + "id": 3 + }, + "speakerTag": { + "type": "int32", + "id": 5, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "RecognitionMetadata": { + "options": { + "deprecated": true + }, + "fields": { + "interactionType": { + "type": "InteractionType", + "id": 1 + }, + "industryNaicsCodeOfAudio": { + "type": "uint32", + "id": 3 + }, + "microphoneDistance": { + "type": "MicrophoneDistance", + "id": 4 + }, + "originalMediaType": { + "type": "OriginalMediaType", + "id": 5 + }, + "recordingDeviceType": { + "type": "RecordingDeviceType", + "id": 6 + }, + "recordingDeviceName": { + "type": "string", + "id": 7 + }, + "originalMimeType": { + "type": "string", + "id": 8 + }, + "obfuscatedId": { + "type": "int64", + "id": 9, + "options": { + "deprecated": true + } + }, + "audioTopic": { + "type": "string", + "id": 10 + } + }, + "nested": { + "InteractionType": { + "values": { + "INTERACTION_TYPE_UNSPECIFIED": 0, + "DISCUSSION": 1, + "PRESENTATION": 2, + "PHONE_CALL": 3, + "VOICEMAIL": 4, + "PROFESSIONALLY_PRODUCED": 5, + "VOICE_SEARCH": 6, + "VOICE_COMMAND": 7, + "DICTATION": 8 + } + }, + "MicrophoneDistance": { + "values": { + "MICROPHONE_DISTANCE_UNSPECIFIED": 0, + "NEARFIELD": 1, + "MIDFIELD": 2, + "FARFIELD": 3 + } + }, + "OriginalMediaType": { + "values": { + "ORIGINAL_MEDIA_TYPE_UNSPECIFIED": 0, + "AUDIO": 1, + "VIDEO": 2 + } + }, + "RecordingDeviceType": { + "values": { + "RECORDING_DEVICE_TYPE_UNSPECIFIED": 0, + "SMARTPHONE": 1, + "PC": 2, + "PHONE_LINE": 3, + "VEHICLE": 4, + "OTHER_OUTDOOR_DEVICE": 5, + "OTHER_INDOOR_DEVICE": 6 + } + } + } + }, + "SpeechContext": { + "fields": { + "phrases": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "boost": { + "type": "float", + "id": 4 + } + } + }, + "RecognitionAudio": { + "oneofs": { + "audioSource": { + "oneof": [ + "content", + "uri" + ] + } + }, + "fields": { + "content": { + "type": "bytes", + "id": 1 + }, + "uri": { + "type": "string", + "id": 2 + } + } + }, + "RecognizeResponse": { + "fields": { + "results": { + "rule": "repeated", + "type": "SpeechRecognitionResult", + "id": 2 + }, + "totalBilledTime": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "speechAdaptationInfo": { + "type": "SpeechAdaptationInfo", + "id": 7 + }, + "requestId": { + "type": "int64", + "id": 8 + }, + "usingLegacyModels": { + "type": "bool", + "id": 9 + } + } + }, + "LongRunningRecognizeResponse": { + "fields": { + "results": { + "rule": "repeated", + "type": "SpeechRecognitionResult", + "id": 2 + }, + "totalBilledTime": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "outputConfig": { + "type": "TranscriptOutputConfig", + "id": 6 + }, + "outputError": { + "type": "google.rpc.Status", + "id": 7 + }, + "speechAdaptationInfo": { + "type": "SpeechAdaptationInfo", + "id": 8 + }, + "requestId": { + "type": "int64", + "id": 9 + } + } + }, + "LongRunningRecognizeMetadata": { + "fields": { + "progressPercent": { + "type": "int32", + "id": 1 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "lastUpdateTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "uri": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "outputConfig": { + "type": "TranscriptOutputConfig", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "StreamingRecognizeResponse": { + "fields": { + "error": { + "type": "google.rpc.Status", + "id": 1 + }, + "results": { + "rule": "repeated", + "type": "StreamingRecognitionResult", + "id": 2 + }, + "speechEventType": { + "type": "SpeechEventType", + "id": 4 + }, + "speechEventTime": { + "type": "google.protobuf.Duration", + "id": 8 + }, + "totalBilledTime": { + "type": "google.protobuf.Duration", + "id": 5 + }, + "speechAdaptationInfo": { + "type": "SpeechAdaptationInfo", + "id": 9 + }, + "requestId": { + "type": "int64", + "id": 10 + } + }, + "nested": { + "SpeechEventType": { + "values": { + "SPEECH_EVENT_UNSPECIFIED": 0, + "END_OF_SINGLE_UTTERANCE": 1, + "SPEECH_ACTIVITY_BEGIN": 2, + "SPEECH_ACTIVITY_END": 3, + "SPEECH_ACTIVITY_TIMEOUT": 4 + } + } + } + }, + "StreamingRecognitionResult": { + "fields": { + "alternatives": { + "rule": "repeated", + "type": "SpeechRecognitionAlternative", + "id": 1 + }, + "isFinal": { + "type": "bool", + "id": 2 + }, + "stability": { + "type": "float", + "id": 3 + }, + "resultEndTime": { + "type": "google.protobuf.Duration", + "id": 4 + }, + "channelTag": { + "type": "int32", + "id": 5 + }, + "languageCode": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "SpeechRecognitionResult": { + "fields": { + "alternatives": { + "rule": "repeated", + "type": "SpeechRecognitionAlternative", + "id": 1 + }, + "channelTag": { + "type": "int32", + "id": 2 + }, + "resultEndTime": { + "type": "google.protobuf.Duration", + "id": 4 + }, + "languageCode": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "SpeechRecognitionAlternative": { + "fields": { + "transcript": { + "type": "string", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2 + }, + "words": { + "rule": "repeated", + "type": "WordInfo", + "id": 3 + } + } + }, + "WordInfo": { + "fields": { + "startTime": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Duration", + "id": 2 + }, + "word": { + "type": "string", + "id": 3 + }, + "confidence": { + "type": "float", + "id": 4 + }, + "speakerTag": { + "type": "int32", + "id": 5, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "speakerLabel": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "SpeechAdaptationInfo": { + "fields": { + "adaptationTimeout": { + "type": "bool", + "id": 1 + }, + "timeoutMessage": { + "type": "string", + "id": 4 + } + } + }, + "CustomClass": { + "options": { + "(google.api.resource).type": "speech.googleapis.com/CustomClass", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/customClasses/{custom_class}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "customClassId": { + "type": "string", + "id": 2 + }, + "items": { + "rule": "repeated", + "type": "ClassItem", + "id": 3 + }, + "kmsKeyName": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } + }, + "kmsKeyVersionName": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKeyVersion" + } + }, + "uid": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "displayName": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deleteTime": { + "type": "google.protobuf.Timestamp", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "annotations": { + "keyType": "string", + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "reconciling": { + "type": "bool", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "ClassItem": { + "fields": { + "value": { + "type": "string", + "id": 1 + } + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 2, + "DELETED": 4 + } + } + } + }, + "PhraseSet": { + "options": { + "(google.api.resource).type": "speech.googleapis.com/PhraseSet", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/phraseSets/{phrase_set}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "phrases": { + "rule": "repeated", + "type": "Phrase", + "id": 2 + }, + "boost": { + "type": "float", + "id": 4 + }, + "kmsKeyName": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } + }, + "kmsKeyVersionName": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKeyVersion" + } + }, + "uid": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "displayName": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deleteTime": { + "type": "google.protobuf.Timestamp", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "annotations": { + "keyType": "string", + "type": "string", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "reconciling": { + "type": "bool", + "id": 16, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "Phrase": { + "fields": { + "value": { + "type": "string", + "id": 1 + }, + "boost": { + "type": "float", + "id": 2 + } + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 2, + "DELETED": 4 + } + } + } + }, + "SpeechAdaptation": { + "fields": { + "phraseSets": { + "rule": "repeated", + "type": "PhraseSet", + "id": 1 + }, + "phraseSetReferences": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "speech.googleapis.com/PhraseSet" + } + }, + "customClasses": { + "rule": "repeated", + "type": "CustomClass", + "id": 3 + }, + "abnfGrammar": { + "type": "ABNFGrammar", + "id": 4 + } + }, + "nested": { + "ABNFGrammar": { + "fields": { + "abnfStrings": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + } + } + }, + "TranscriptNormalization": { + "fields": { + "entries": { + "rule": "repeated", + "type": "Entry", + "id": 1 + } + }, + "nested": { + "Entry": { + "fields": { + "search": { + "type": "string", + "id": 1 + }, + "replace": { + "type": "string", + "id": 2 + }, + "caseSensitive": { + "type": "bool", + "id": 3 + } + } + } + } + }, + "Adaptation": { + "options": { + "(google.api.default_host)": "speech.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreatePhraseSet": { + "requestType": "CreatePhraseSetRequest", + "responseType": "PhraseSet", + "options": { + "(google.api.http).post": "/v1p1beta1/{parent=projects/*/locations/*}/phraseSets", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,phrase_set,phrase_set_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1p1beta1/{parent=projects/*/locations/*}/phraseSets", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,phrase_set,phrase_set_id" + } + ] + }, + "GetPhraseSet": { + "requestType": "GetPhraseSetRequest", + "responseType": "PhraseSet", + "options": { + "(google.api.http).get": "/v1p1beta1/{name=projects/*/locations/*/phraseSets/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1p1beta1/{name=projects/*/locations/*/phraseSets/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListPhraseSet": { + "requestType": "ListPhraseSetRequest", + "responseType": "ListPhraseSetResponse", + "options": { + "(google.api.http).get": "/v1p1beta1/{parent=projects/*/locations/*}/phraseSets", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1p1beta1/{parent=projects/*/locations/*}/phraseSets" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdatePhraseSet": { + "requestType": "UpdatePhraseSetRequest", + "responseType": "PhraseSet", + "options": { + "(google.api.http).patch": "/v1p1beta1/{phrase_set.name=projects/*/locations/*/phraseSets/*}", + "(google.api.http).body": "phrase_set", + "(google.api.method_signature)": "phrase_set,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1p1beta1/{phrase_set.name=projects/*/locations/*/phraseSets/*}", + "body": "phrase_set" + } + }, + { + "(google.api.method_signature)": "phrase_set,update_mask" + } + ] + }, + "DeletePhraseSet": { + "requestType": "DeletePhraseSetRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1p1beta1/{name=projects/*/locations/*/phraseSets/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1p1beta1/{name=projects/*/locations/*/phraseSets/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateCustomClass": { + "requestType": "CreateCustomClassRequest", + "responseType": "CustomClass", + "options": { + "(google.api.http).post": "/v1p1beta1/{parent=projects/*/locations/*}/customClasses", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,custom_class,custom_class_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1p1beta1/{parent=projects/*/locations/*}/customClasses", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,custom_class,custom_class_id" + } + ] + }, + "GetCustomClass": { + "requestType": "GetCustomClassRequest", + "responseType": "CustomClass", + "options": { + "(google.api.http).get": "/v1p1beta1/{name=projects/*/locations/*/customClasses/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1p1beta1/{name=projects/*/locations/*/customClasses/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListCustomClasses": { + "requestType": "ListCustomClassesRequest", + "responseType": "ListCustomClassesResponse", + "options": { + "(google.api.http).get": "/v1p1beta1/{parent=projects/*/locations/*}/customClasses", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1p1beta1/{parent=projects/*/locations/*}/customClasses" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdateCustomClass": { + "requestType": "UpdateCustomClassRequest", + "responseType": "CustomClass", + "options": { + "(google.api.http).patch": "/v1p1beta1/{custom_class.name=projects/*/locations/*/customClasses/*}", + "(google.api.http).body": "custom_class", + "(google.api.method_signature)": "custom_class,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1p1beta1/{custom_class.name=projects/*/locations/*/customClasses/*}", + "body": "custom_class" + } + }, + { + "(google.api.method_signature)": "custom_class,update_mask" + } + ] + }, + "DeleteCustomClass": { + "requestType": "DeleteCustomClassRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1p1beta1/{name=projects/*/locations/*/customClasses/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1p1beta1/{name=projects/*/locations/*/customClasses/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "CreatePhraseSetRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "speech.googleapis.com/PhraseSet" + } + }, + "phraseSetId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "phraseSet": { + "type": "PhraseSet", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdatePhraseSetRequest": { + "fields": { + "phraseSet": { + "type": "PhraseSet", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "GetPhraseSetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "speech.googleapis.com/PhraseSet" + } + } + } + }, + "ListPhraseSetRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "speech.googleapis.com/PhraseSet" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListPhraseSetResponse": { + "fields": { + "phraseSets": { + "rule": "repeated", + "type": "PhraseSet", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DeletePhraseSetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "speech.googleapis.com/PhraseSet" + } + } + } + }, + "CreateCustomClassRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "speech.googleapis.com/CustomClass" + } + }, + "customClassId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "customClass": { + "type": "CustomClass", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateCustomClassRequest": { + "fields": { + "customClass": { + "type": "CustomClass", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "GetCustomClassRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "speech.googleapis.com/CustomClass" + } + } + } + }, + "ListCustomClassesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "speech.googleapis.com/CustomClass" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListCustomClassesResponse": { + "fields": { + "customClasses": { + "rule": "repeated", + "type": "CustomClass", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DeleteCustomClassRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "speech.googleapis.com/CustomClass" + } + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "ResourceProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + }, + "apiVersion": { + "type": "string", + "id": 525000001, + "extend": "google.protobuf.ServiceOptions" + }, + "CommonLanguageSettings": { + "fields": { + "referenceDocsUri": { + "type": "string", + "id": 1, + "options": { + "deprecated": true + } + }, + "destinations": { + "rule": "repeated", + "type": "ClientLibraryDestination", + "id": 2 + } + } + }, + "ClientLibrarySettings": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "launchStage": { + "type": "LaunchStage", + "id": 2 + }, + "restNumericEnums": { + "type": "bool", + "id": 3 + }, + "javaSettings": { + "type": "JavaSettings", + "id": 21 + }, + "cppSettings": { + "type": "CppSettings", + "id": 22 + }, + "phpSettings": { + "type": "PhpSettings", + "id": 23 + }, + "pythonSettings": { + "type": "PythonSettings", + "id": 24 + }, + "nodeSettings": { + "type": "NodeSettings", + "id": 25 + }, + "dotnetSettings": { + "type": "DotnetSettings", + "id": 26 + }, + "rubySettings": { + "type": "RubySettings", + "id": 27 + }, + "goSettings": { + "type": "GoSettings", + "id": 28 + } + } + }, + "Publishing": { + "fields": { + "methodSettings": { + "rule": "repeated", + "type": "MethodSettings", + "id": 2 + }, + "newIssueUri": { + "type": "string", + "id": 101 + }, + "documentationUri": { + "type": "string", + "id": 102 + }, + "apiShortName": { + "type": "string", + "id": 103 + }, + "githubLabel": { + "type": "string", + "id": 104 + }, + "codeownerGithubTeams": { + "rule": "repeated", + "type": "string", + "id": 105 + }, + "docTagPrefix": { + "type": "string", + "id": 106 + }, + "organization": { + "type": "ClientLibraryOrganization", + "id": 107 + }, + "librarySettings": { + "rule": "repeated", + "type": "ClientLibrarySettings", + "id": 109 + }, + "protoReferenceDocumentationUri": { + "type": "string", + "id": 110 + }, + "restReferenceDocumentationUri": { + "type": "string", + "id": 111 + } + } + }, + "JavaSettings": { + "fields": { + "libraryPackage": { + "type": "string", + "id": 1 + }, + "serviceClassNames": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "common": { + "type": "CommonLanguageSettings", + "id": 3 + } + } + }, + "CppSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PhpSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PythonSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "NodeSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "DotnetSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "renamedResources": { + "keyType": "string", + "type": "string", + "id": 3 + }, + "ignoredResources": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "forcedNamespaceAliases": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "handwrittenSignatures": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + }, + "RubySettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "GoSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "MethodSettings": { + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "longRunning": { + "type": "LongRunning", + "id": 2 + }, + "autoPopulatedFields": { + "rule": "repeated", + "type": "string", + "id": 3 + } + }, + "nested": { + "LongRunning": { + "fields": { + "initialPollDelay": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "pollDelayMultiplier": { + "type": "float", + "id": 2 + }, + "maxPollDelay": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "totalPollTimeout": { + "type": "google.protobuf.Duration", + "id": 4 + } + } + } + } + }, + "ClientLibraryOrganization": { + "values": { + "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, + "CLOUD": 1, + "ADS": 2, + "PHOTOS": 3, + "STREET_VIEW": 4, + "SHOPPING": 5, + "GEO": 6, + "GENERATIVE_AI": 7 + } + }, + "ClientLibraryDestination": { + "values": { + "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, + "GITHUB": 10, + "PACKAGE_MANAGER": 20 + } + }, + "LaunchStage": { + "values": { + "LAUNCH_STAGE_UNSPECIFIED": 0, + "UNIMPLEMENTED": 6, + "PRELAUNCH": 7, + "EARLY_ACCESS": 1, + "ALPHA": 2, + "BETA": 3, + "GA": 4, + "DEPRECATED": 5 + } + }, + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions", + "options": { + "packed": false + } + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5, + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7, + "IDENTIFIER": 8 + } + }, + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "protobuf": { + "options": { + "go_package": "google.golang.org/protobuf/types/descriptorpb", + "java_package": "com.google.protobuf", + "java_outer_classname": "DescriptorProtos", + "csharp_namespace": "Google.Protobuf.Reflection", + "objc_class_prefix": "GPB", + "cc_enable_arenas": true, + "optimize_for": "SPEED" + }, + "nested": { + "FileDescriptorSet": { + "edition": "proto2", + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "Edition": { + "edition": "proto2", + "values": { + "EDITION_UNKNOWN": 0, + "EDITION_PROTO2": 998, + "EDITION_PROTO3": 999, + "EDITION_2023": 1000, + "EDITION_2024": 1001, + "EDITION_1_TEST_ONLY": 1, + "EDITION_2_TEST_ONLY": 2, + "EDITION_99997_TEST_ONLY": 99997, + "EDITION_99998_TEST_ONLY": 99998, + "EDITION_99999_TEST_ONLY": 99999, + "EDITION_MAX": 2147483647 + } + }, + "FileDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "package": { + "type": "string", + "id": 2 + }, + "dependency": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "publicDependency": { + "rule": "repeated", + "type": "int32", + "id": 10 + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11 + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + }, + "edition": { + "type": "Edition", + "id": 14 + } + } + }, + "DescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "ExtensionRangeOptions": { + "edition": "proto2", + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + }, + "declaration": { + "rule": "repeated", + "type": "Declaration", + "id": 2, + "options": { + "retention": "RETENTION_SOURCE" + } + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "verification": { + "type": "VerificationState", + "id": 3, + "options": { + "default": "UNVERIFIED", + "retention": "RETENTION_SOURCE" + } + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "Declaration": { + "fields": { + "number": { + "type": "int32", + "id": 1 + }, + "fullName": { + "type": "string", + "id": 2 + }, + "type": { + "type": "string", + "id": 3 + }, + "reserved": { + "type": "bool", + "id": 5 + }, + "repeated": { + "type": "bool", + "id": 6 + } + }, + "reserved": [ + [ + 4, + 4 + ] + ] + }, + "VerificationState": { + "values": { + "DECLARATION": 0, + "UNVERIFIED": 1 + } + } + } + }, + "FieldDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REPEATED": 3, + "LABEL_REQUIRED": 2 + } + } + } + }, + "OneofDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputType": { + "type": "string", + "id": 2 + }, + "outputType": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "clientStreaming": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "serverStreaming": { + "type": "bool", + "id": 6, + "options": { + "default": false + } + } + } + }, + "FileOptions": { + "edition": "proto2", + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 42, + 42 + ], + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "edition": "proto2", + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 11, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 12 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "edition": "proto2", + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "debugRedact": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "retention": { + "type": "OptionRetention", + "id": 17 + }, + "targets": { + "rule": "repeated", + "type": "OptionTargetType", + "id": 19 + }, + "editionDefaults": { + "rule": "repeated", + "type": "EditionDefault", + "id": 20 + }, + "features": { + "type": "FeatureSet", + "id": 21 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 18, + 18 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + }, + "OptionRetention": { + "values": { + "RETENTION_UNKNOWN": 0, + "RETENTION_RUNTIME": 1, + "RETENTION_SOURCE": 2 + } + }, + "OptionTargetType": { + "values": { + "TARGET_TYPE_UNKNOWN": 0, + "TARGET_TYPE_FILE": 1, + "TARGET_TYPE_EXTENSION_RANGE": 2, + "TARGET_TYPE_MESSAGE": 3, + "TARGET_TYPE_FIELD": 4, + "TARGET_TYPE_ONEOF": 5, + "TARGET_TYPE_ENUM": 6, + "TARGET_TYPE_ENUM_ENTRY": 7, + "TARGET_TYPE_SERVICE": 8, + "TARGET_TYPE_METHOD": 9 + } + }, + "EditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "value": { + "type": "string", + "id": 2 + } + } + } + } + }, + "OneofOptions": { + "edition": "proto2", + "fields": { + "features": { + "type": "FeatureSet", + "id": 1 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "edition": "proto2", + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 6, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "edition": "proto2", + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "features": { + "type": "FeatureSet", + "id": 2 + }, + "debugRedact": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "edition": "proto2", + "fields": { + "features": { + "type": "FeatureSet", + "id": 34 + }, + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "edition": "proto2", + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "features": { + "type": "FeatureSet", + "id": 35 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "edition": "proto2", + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "FeatureSet": { + "edition": "proto2", + "fields": { + "fieldPresence": { + "type": "FieldPresence", + "id": 1, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_2023", + "edition_defaults.value": "EXPLICIT" + } + }, + "enumType": { + "type": "EnumType", + "id": 2, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "OPEN" + } + }, + "repeatedFieldEncoding": { + "type": "RepeatedFieldEncoding", + "id": 3, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "PACKED" + } + }, + "utf8Validation": { + "type": "Utf8Validation", + "id": 4, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "VERIFY" + } + }, + "messageEncoding": { + "type": "MessageEncoding", + "id": 5, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO2", + "edition_defaults.value": "LENGTH_PREFIXED" + } + }, + "jsonFormat": { + "type": "JsonFormat", + "id": 6, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "ALLOW" + } + } + }, + "extensions": [ + [ + 1000, + 1000 + ], + [ + 1001, + 1001 + ], + [ + 1002, + 1002 + ], + [ + 9990, + 9990 + ], + [ + 9995, + 9999 + ], + [ + 10000, + 10000 + ] + ], + "reserved": [ + [ + 999, + 999 + ] + ], + "nested": { + "FieldPresence": { + "values": { + "FIELD_PRESENCE_UNKNOWN": 0, + "EXPLICIT": 1, + "IMPLICIT": 2, + "LEGACY_REQUIRED": 3 + } + }, + "EnumType": { + "values": { + "ENUM_TYPE_UNKNOWN": 0, + "OPEN": 1, + "CLOSED": 2 + } + }, + "RepeatedFieldEncoding": { + "values": { + "REPEATED_FIELD_ENCODING_UNKNOWN": 0, + "PACKED": 1, + "EXPANDED": 2 + } + }, + "Utf8Validation": { + "values": { + "UTF8_VALIDATION_UNKNOWN": 0, + "VERIFY": 2, + "NONE": 3 + } + }, + "MessageEncoding": { + "values": { + "MESSAGE_ENCODING_UNKNOWN": 0, + "LENGTH_PREFIXED": 1, + "DELIMITED": 2 + } + }, + "JsonFormat": { + "values": { + "JSON_FORMAT_UNKNOWN": 0, + "ALLOW": 1, + "LEGACY_BEST_EFFORT": 2 + } + } + } + }, + "FeatureSetDefaults": { + "edition": "proto2", + "fields": { + "defaults": { + "rule": "repeated", + "type": "FeatureSetEditionDefault", + "id": 1 + }, + "minimumEdition": { + "type": "Edition", + "id": 4 + }, + "maximumEdition": { + "type": "Edition", + "id": 5 + } + }, + "nested": { + "FeatureSetEditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "features": { + "type": "FeatureSet", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "edition": "proto2", + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1, + "options": { + "packed": true + } + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2, + "options": { + "packed": true + } + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "edition": "proto2", + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1, + "options": { + "packed": true + } + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } + } + } + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + }, + "DoubleValue": { + "fields": { + "value": { + "type": "double", + "id": 1 + } + } + }, + "FloatValue": { + "fields": { + "value": { + "type": "float", + "id": 1 + } + } + }, + "Int64Value": { + "fields": { + "value": { + "type": "int64", + "id": 1 + } + } + }, + "UInt64Value": { + "fields": { + "value": { + "type": "uint64", + "id": 1 + } + } + }, + "Int32Value": { + "fields": { + "value": { + "type": "int32", + "id": 1 + } + } + }, + "UInt32Value": { + "fields": { + "value": { + "type": "uint32", + "id": 1 + } + } + }, + "BoolValue": { + "fields": { + "value": { + "type": "bool", + "id": 1 + } + } + }, + "StringValue": { + "fields": { + "value": { + "type": "string", + "id": 1 + } + } + }, + "BytesValue": { + "fields": { + "value": { + "type": "bytes", + "id": 1 + } + } + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "cloud.google.com/go/longrunning/autogen/longrunningpb;longrunningpb", + "java_multiple_files": true, + "java_outer_classname": "OperationsProto", + "java_package": "com.google.longrunning", + "php_namespace": "Google\\LongRunning" + }, + "nested": { + "operationInfo": { + "type": "google.longrunning.OperationInfo", + "id": 1049, + "extend": "google.protobuf.MethodOptions" + }, + "Operations": { + "options": { + "(google.api.default_host)": "longrunning.googleapis.com" + }, + "methods": { + "ListOperations": { + "requestType": "ListOperationsRequest", + "responseType": "ListOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{name=operations}", + "(google.api.method_signature)": "name,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations}" + } + }, + { + "(google.api.method_signature)": "name,filter" + } + ] + }, + "GetOperation": { + "requestType": "GetOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).get": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteOperation": { + "requestType": "DeleteOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CancelOperation": { + "requestType": "CancelOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=operations/**}:cancel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=operations/**}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "WaitOperation": { + "requestType": "WaitOperationRequest", + "responseType": "Operation" + } + } + }, + "Operation": { + "oneofs": { + "result": { + "oneof": [ + "error", + "response" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "metadata": { + "type": "google.protobuf.Any", + "id": 2 + }, + "done": { + "type": "bool", + "id": 3 + }, + "error": { + "type": "google.rpc.Status", + "id": 4 + }, + "response": { + "type": "google.protobuf.Any", + "id": 5 + } + } + }, + "GetOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListOperationsRequest": { + "fields": { + "name": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListOperationsResponse": { + "fields": { + "operations": { + "rule": "repeated", + "type": "Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CancelOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DeleteOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "WaitOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "OperationInfo": { + "fields": { + "responseType": { + "type": "string", + "id": 1 + }, + "metadataType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/samples/generated/v1p1beta1/adaptation.create_custom_class.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/samples/generated/v1p1beta1/adaptation.create_custom_class.js new file mode 100644 index 00000000000..dad2dd5b94f --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/samples/generated/v1p1beta1/adaptation.create_custom_class.js @@ -0,0 +1,81 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, customClassId, customClass) { + // [START speech_v1p1beta1_generated_Adaptation_CreateCustomClass_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource where this custom class will be created. + * Format: + * `projects/{project}/locations/{location}/customClasses` + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * regional endpoint (https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + */ + // const parent = 'abc123' + /** + * Required. The ID to use for the custom class, which will become the final + * component of the custom class' resource name. + * This value should restrict to letters, numbers, and hyphens, with the first + * character a letter, the last a letter or a number, and be 4-63 characters. + */ + // const customClassId = 'abc123' + /** + * Required. The custom class to create. + */ + // const customClass = {} + + // Imports the Speech library + const {AdaptationClient} = require('@google-cloud/speech').v1p1beta1; + + // Instantiates a client + const speechClient = new AdaptationClient(); + + async function callCreateCustomClass() { + // Construct request + const request = { + parent, + customClassId, + customClass, + }; + + // Run request + const response = await speechClient.createCustomClass(request); + console.log(response); + } + + callCreateCustomClass(); + // [END speech_v1p1beta1_generated_Adaptation_CreateCustomClass_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/samples/generated/v1p1beta1/adaptation.create_phrase_set.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/samples/generated/v1p1beta1/adaptation.create_phrase_set.js new file mode 100644 index 00000000000..bd57fe02ef4 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/samples/generated/v1p1beta1/adaptation.create_phrase_set.js @@ -0,0 +1,81 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, phraseSetId, phraseSet) { + // [START speech_v1p1beta1_generated_Adaptation_CreatePhraseSet_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource where this phrase set will be created. + * Format: + * `projects/{project}/locations/{location}` + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * regional endpoint (https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + */ + // const parent = 'abc123' + /** + * Required. The ID to use for the phrase set, which will become the final + * component of the phrase set's resource name. + * This value should restrict to letters, numbers, and hyphens, with the first + * character a letter, the last a letter or a number, and be 4-63 characters. + */ + // const phraseSetId = 'abc123' + /** + * Required. The phrase set to create. + */ + // const phraseSet = {} + + // Imports the Speech library + const {AdaptationClient} = require('@google-cloud/speech').v1p1beta1; + + // Instantiates a client + const speechClient = new AdaptationClient(); + + async function callCreatePhraseSet() { + // Construct request + const request = { + parent, + phraseSetId, + phraseSet, + }; + + // Run request + const response = await speechClient.createPhraseSet(request); + console.log(response); + } + + callCreatePhraseSet(); + // [END speech_v1p1beta1_generated_Adaptation_CreatePhraseSet_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/samples/generated/v1p1beta1/adaptation.delete_custom_class.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/samples/generated/v1p1beta1/adaptation.delete_custom_class.js new file mode 100644 index 00000000000..d87b51cc5db --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/samples/generated/v1p1beta1/adaptation.delete_custom_class.js @@ -0,0 +1,67 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START speech_v1p1beta1_generated_Adaptation_DeleteCustomClass_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the custom class to delete. Format: + * `projects/{project}/locations/{location}/customClasses/{custom_class}` + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * regional endpoint (https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + */ + // const name = 'abc123' + + // Imports the Speech library + const {AdaptationClient} = require('@google-cloud/speech').v1p1beta1; + + // Instantiates a client + const speechClient = new AdaptationClient(); + + async function callDeleteCustomClass() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await speechClient.deleteCustomClass(request); + console.log(response); + } + + callDeleteCustomClass(); + // [END speech_v1p1beta1_generated_Adaptation_DeleteCustomClass_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/samples/generated/v1p1beta1/adaptation.delete_phrase_set.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/samples/generated/v1p1beta1/adaptation.delete_phrase_set.js new file mode 100644 index 00000000000..de932c57949 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/samples/generated/v1p1beta1/adaptation.delete_phrase_set.js @@ -0,0 +1,62 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START speech_v1p1beta1_generated_Adaptation_DeletePhraseSet_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the phrase set to delete. Format: + * `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + */ + // const name = 'abc123' + + // Imports the Speech library + const {AdaptationClient} = require('@google-cloud/speech').v1p1beta1; + + // Instantiates a client + const speechClient = new AdaptationClient(); + + async function callDeletePhraseSet() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await speechClient.deletePhraseSet(request); + console.log(response); + } + + callDeletePhraseSet(); + // [END speech_v1p1beta1_generated_Adaptation_DeletePhraseSet_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/samples/generated/v1p1beta1/adaptation.get_custom_class.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/samples/generated/v1p1beta1/adaptation.get_custom_class.js new file mode 100644 index 00000000000..8b4ed02d0b4 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/samples/generated/v1p1beta1/adaptation.get_custom_class.js @@ -0,0 +1,62 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START speech_v1p1beta1_generated_Adaptation_GetCustomClass_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the custom class to retrieve. Format: + * `projects/{project}/locations/{location}/customClasses/{custom_class}` + */ + // const name = 'abc123' + + // Imports the Speech library + const {AdaptationClient} = require('@google-cloud/speech').v1p1beta1; + + // Instantiates a client + const speechClient = new AdaptationClient(); + + async function callGetCustomClass() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await speechClient.getCustomClass(request); + console.log(response); + } + + callGetCustomClass(); + // [END speech_v1p1beta1_generated_Adaptation_GetCustomClass_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/samples/generated/v1p1beta1/adaptation.get_phrase_set.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/samples/generated/v1p1beta1/adaptation.get_phrase_set.js new file mode 100644 index 00000000000..ef0d6e0ac0b --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/samples/generated/v1p1beta1/adaptation.get_phrase_set.js @@ -0,0 +1,67 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START speech_v1p1beta1_generated_Adaptation_GetPhraseSet_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the phrase set to retrieve. Format: + * `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * regional endpoint (https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + */ + // const name = 'abc123' + + // Imports the Speech library + const {AdaptationClient} = require('@google-cloud/speech').v1p1beta1; + + // Instantiates a client + const speechClient = new AdaptationClient(); + + async function callGetPhraseSet() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await speechClient.getPhraseSet(request); + console.log(response); + } + + callGetPhraseSet(); + // [END speech_v1p1beta1_generated_Adaptation_GetPhraseSet_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/samples/generated/v1p1beta1/adaptation.list_custom_classes.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/samples/generated/v1p1beta1/adaptation.list_custom_classes.js new file mode 100644 index 00000000000..d02480a5b5c --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/samples/generated/v1p1beta1/adaptation.list_custom_classes.js @@ -0,0 +1,83 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START speech_v1p1beta1_generated_Adaptation_ListCustomClasses_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent, which owns this collection of custom classes. Format: + * `projects/{project}/locations/{location}/customClasses` + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * regional endpoint (https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + */ + // const parent = 'abc123' + /** + * The maximum number of custom classes to return. The service may return + * fewer than this value. If unspecified, at most 50 custom classes will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListCustomClass` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListCustomClass` must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Speech library + const {AdaptationClient} = require('@google-cloud/speech').v1p1beta1; + + // Instantiates a client + const speechClient = new AdaptationClient(); + + async function callListCustomClasses() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = speechClient.listCustomClassesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListCustomClasses(); + // [END speech_v1p1beta1_generated_Adaptation_ListCustomClasses_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/samples/generated/v1p1beta1/adaptation.list_phrase_set.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/samples/generated/v1p1beta1/adaptation.list_phrase_set.js new file mode 100644 index 00000000000..e3d6ddb46ef --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/samples/generated/v1p1beta1/adaptation.list_phrase_set.js @@ -0,0 +1,83 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START speech_v1p1beta1_generated_Adaptation_ListPhraseSet_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent, which owns this collection of phrase set. Format: + * `projects/{project}/locations/{location}` + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * regional endpoint (https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + */ + // const parent = 'abc123' + /** + * The maximum number of phrase sets to return. The service may return + * fewer than this value. If unspecified, at most 50 phrase sets will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListPhraseSet` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListPhraseSet` must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Speech library + const {AdaptationClient} = require('@google-cloud/speech').v1p1beta1; + + // Instantiates a client + const speechClient = new AdaptationClient(); + + async function callListPhraseSet() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = speechClient.listPhraseSetAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListPhraseSet(); + // [END speech_v1p1beta1_generated_Adaptation_ListPhraseSet_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/samples/generated/v1p1beta1/adaptation.update_custom_class.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/samples/generated/v1p1beta1/adaptation.update_custom_class.js new file mode 100644 index 00000000000..a76a29ded99 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/samples/generated/v1p1beta1/adaptation.update_custom_class.js @@ -0,0 +1,73 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(customClass) { + // [START speech_v1p1beta1_generated_Adaptation_UpdateCustomClass_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The custom class to update. + * The custom class's `name` field is used to identify the custom class to be + * updated. Format: + * `projects/{project}/locations/{location}/customClasses/{custom_class}` + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * regional endpoint (https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + */ + // const customClass = {} + /** + * The list of fields to be updated. + */ + // const updateMask = {} + + // Imports the Speech library + const {AdaptationClient} = require('@google-cloud/speech').v1p1beta1; + + // Instantiates a client + const speechClient = new AdaptationClient(); + + async function callUpdateCustomClass() { + // Construct request + const request = { + customClass, + }; + + // Run request + const response = await speechClient.updateCustomClass(request); + console.log(response); + } + + callUpdateCustomClass(); + // [END speech_v1p1beta1_generated_Adaptation_UpdateCustomClass_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/samples/generated/v1p1beta1/adaptation.update_phrase_set.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/samples/generated/v1p1beta1/adaptation.update_phrase_set.js new file mode 100644 index 00000000000..1c63d468db8 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/samples/generated/v1p1beta1/adaptation.update_phrase_set.js @@ -0,0 +1,73 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(phraseSet) { + // [START speech_v1p1beta1_generated_Adaptation_UpdatePhraseSet_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The phrase set to update. + * The phrase set's `name` field is used to identify the set to be + * updated. Format: + * `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * regional endpoint (https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + */ + // const phraseSet = {} + /** + * The list of fields to be updated. + */ + // const updateMask = {} + + // Imports the Speech library + const {AdaptationClient} = require('@google-cloud/speech').v1p1beta1; + + // Instantiates a client + const speechClient = new AdaptationClient(); + + async function callUpdatePhraseSet() { + // Construct request + const request = { + phraseSet, + }; + + // Run request + const response = await speechClient.updatePhraseSet(request); + console.log(response); + } + + callUpdatePhraseSet(); + // [END speech_v1p1beta1_generated_Adaptation_UpdatePhraseSet_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/samples/generated/v1p1beta1/snippet_metadata_google.cloud.speech.v1p1beta1.json b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/samples/generated/v1p1beta1/snippet_metadata_google.cloud.speech.v1p1beta1.json new file mode 100644 index 00000000000..c50b1efcefd --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/samples/generated/v1p1beta1/snippet_metadata_google.cloud.speech.v1p1beta1.json @@ -0,0 +1,591 @@ +{ + "clientLibrary": { + "name": "nodejs-speech", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.speech.v1p1beta1", + "version": "v1p1beta1" + } + ] + }, + "snippets": [ + { + "regionTag": "speech_v1p1beta1_generated_Adaptation_CreatePhraseSet_async", + "title": "Adaptation createPhraseSet Sample", + "origin": "API_DEFINITION", + "description": " Create a set of phrase hints. Each item in the set can be a single word or a multi-word phrase. The items in the PhraseSet are favored by the recognition model when you send a call that includes the PhraseSet.", + "canonical": true, + "file": "adaptation.create_phrase_set.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreatePhraseSet", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation.CreatePhraseSet", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "phrase_set_id", + "type": "TYPE_STRING" + }, + { + "name": "phrase_set", + "type": ".google.cloud.speech.v1p1beta1.PhraseSet" + } + ], + "resultType": ".google.cloud.speech.v1p1beta1.PhraseSet", + "client": { + "shortName": "AdaptationClient", + "fullName": "google.cloud.speech.v1p1beta1.AdaptationClient" + }, + "method": { + "shortName": "CreatePhraseSet", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation.CreatePhraseSet", + "service": { + "shortName": "Adaptation", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation" + } + } + } + }, + { + "regionTag": "speech_v1p1beta1_generated_Adaptation_GetPhraseSet_async", + "title": "Adaptation getPhraseSet Sample", + "origin": "API_DEFINITION", + "description": " Get a phrase set.", + "canonical": true, + "file": "adaptation.get_phrase_set.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetPhraseSet", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation.GetPhraseSet", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.speech.v1p1beta1.PhraseSet", + "client": { + "shortName": "AdaptationClient", + "fullName": "google.cloud.speech.v1p1beta1.AdaptationClient" + }, + "method": { + "shortName": "GetPhraseSet", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation.GetPhraseSet", + "service": { + "shortName": "Adaptation", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation" + } + } + } + }, + { + "regionTag": "speech_v1p1beta1_generated_Adaptation_ListPhraseSet_async", + "title": "Adaptation listPhraseSet Sample", + "origin": "API_DEFINITION", + "description": " List phrase sets.", + "canonical": true, + "file": "adaptation.list_phrase_set.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListPhraseSet", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation.ListPhraseSet", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.speech.v1p1beta1.ListPhraseSetResponse", + "client": { + "shortName": "AdaptationClient", + "fullName": "google.cloud.speech.v1p1beta1.AdaptationClient" + }, + "method": { + "shortName": "ListPhraseSet", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation.ListPhraseSet", + "service": { + "shortName": "Adaptation", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation" + } + } + } + }, + { + "regionTag": "speech_v1p1beta1_generated_Adaptation_UpdatePhraseSet_async", + "title": "Adaptation updatePhraseSet Sample", + "origin": "API_DEFINITION", + "description": " Update a phrase set.", + "canonical": true, + "file": "adaptation.update_phrase_set.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdatePhraseSet", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation.UpdatePhraseSet", + "async": true, + "parameters": [ + { + "name": "phrase_set", + "type": ".google.cloud.speech.v1p1beta1.PhraseSet" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.speech.v1p1beta1.PhraseSet", + "client": { + "shortName": "AdaptationClient", + "fullName": "google.cloud.speech.v1p1beta1.AdaptationClient" + }, + "method": { + "shortName": "UpdatePhraseSet", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation.UpdatePhraseSet", + "service": { + "shortName": "Adaptation", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation" + } + } + } + }, + { + "regionTag": "speech_v1p1beta1_generated_Adaptation_DeletePhraseSet_async", + "title": "Adaptation deletePhraseSet Sample", + "origin": "API_DEFINITION", + "description": " Delete a phrase set.", + "canonical": true, + "file": "adaptation.delete_phrase_set.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeletePhraseSet", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation.DeletePhraseSet", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AdaptationClient", + "fullName": "google.cloud.speech.v1p1beta1.AdaptationClient" + }, + "method": { + "shortName": "DeletePhraseSet", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation.DeletePhraseSet", + "service": { + "shortName": "Adaptation", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation" + } + } + } + }, + { + "regionTag": "speech_v1p1beta1_generated_Adaptation_CreateCustomClass_async", + "title": "Adaptation createCustomClass Sample", + "origin": "API_DEFINITION", + "description": " Create a custom class.", + "canonical": true, + "file": "adaptation.create_custom_class.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateCustomClass", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation.CreateCustomClass", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "custom_class_id", + "type": "TYPE_STRING" + }, + { + "name": "custom_class", + "type": ".google.cloud.speech.v1p1beta1.CustomClass" + } + ], + "resultType": ".google.cloud.speech.v1p1beta1.CustomClass", + "client": { + "shortName": "AdaptationClient", + "fullName": "google.cloud.speech.v1p1beta1.AdaptationClient" + }, + "method": { + "shortName": "CreateCustomClass", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation.CreateCustomClass", + "service": { + "shortName": "Adaptation", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation" + } + } + } + }, + { + "regionTag": "speech_v1p1beta1_generated_Adaptation_GetCustomClass_async", + "title": "Adaptation getCustomClass Sample", + "origin": "API_DEFINITION", + "description": " Get a custom class.", + "canonical": true, + "file": "adaptation.get_custom_class.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetCustomClass", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation.GetCustomClass", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.speech.v1p1beta1.CustomClass", + "client": { + "shortName": "AdaptationClient", + "fullName": "google.cloud.speech.v1p1beta1.AdaptationClient" + }, + "method": { + "shortName": "GetCustomClass", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation.GetCustomClass", + "service": { + "shortName": "Adaptation", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation" + } + } + } + }, + { + "regionTag": "speech_v1p1beta1_generated_Adaptation_ListCustomClasses_async", + "title": "Adaptation listCustomClasses Sample", + "origin": "API_DEFINITION", + "description": " List custom classes.", + "canonical": true, + "file": "adaptation.list_custom_classes.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListCustomClasses", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation.ListCustomClasses", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.speech.v1p1beta1.ListCustomClassesResponse", + "client": { + "shortName": "AdaptationClient", + "fullName": "google.cloud.speech.v1p1beta1.AdaptationClient" + }, + "method": { + "shortName": "ListCustomClasses", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation.ListCustomClasses", + "service": { + "shortName": "Adaptation", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation" + } + } + } + }, + { + "regionTag": "speech_v1p1beta1_generated_Adaptation_UpdateCustomClass_async", + "title": "Adaptation updateCustomClass Sample", + "origin": "API_DEFINITION", + "description": " Update a custom class.", + "canonical": true, + "file": "adaptation.update_custom_class.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateCustomClass", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation.UpdateCustomClass", + "async": true, + "parameters": [ + { + "name": "custom_class", + "type": ".google.cloud.speech.v1p1beta1.CustomClass" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.speech.v1p1beta1.CustomClass", + "client": { + "shortName": "AdaptationClient", + "fullName": "google.cloud.speech.v1p1beta1.AdaptationClient" + }, + "method": { + "shortName": "UpdateCustomClass", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation.UpdateCustomClass", + "service": { + "shortName": "Adaptation", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation" + } + } + } + }, + { + "regionTag": "speech_v1p1beta1_generated_Adaptation_DeleteCustomClass_async", + "title": "Adaptation deleteCustomClass Sample", + "origin": "API_DEFINITION", + "description": " Delete a custom class.", + "canonical": true, + "file": "adaptation.delete_custom_class.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteCustomClass", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation.DeleteCustomClass", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AdaptationClient", + "fullName": "google.cloud.speech.v1p1beta1.AdaptationClient" + }, + "method": { + "shortName": "DeleteCustomClass", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation.DeleteCustomClass", + "service": { + "shortName": "Adaptation", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation" + } + } + } + }, + { + "regionTag": "speech_v1p1beta1_generated_Speech_Recognize_async", + "title": "Adaptation recognize Sample", + "origin": "API_DEFINITION", + "description": " Performs synchronous speech recognition: receive results after all audio has been sent and processed.", + "canonical": true, + "file": "speech.recognize.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "Recognize", + "fullName": "google.cloud.speech.v1p1beta1.Speech.Recognize", + "async": true, + "parameters": [ + { + "name": "config", + "type": ".google.cloud.speech.v1p1beta1.RecognitionConfig" + }, + { + "name": "audio", + "type": ".google.cloud.speech.v1p1beta1.RecognitionAudio" + } + ], + "resultType": ".google.cloud.speech.v1p1beta1.RecognizeResponse", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v1p1beta1.SpeechClient" + }, + "method": { + "shortName": "Recognize", + "fullName": "google.cloud.speech.v1p1beta1.Speech.Recognize", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v1p1beta1.Speech" + } + } + } + }, + { + "regionTag": "speech_v1p1beta1_generated_Speech_LongRunningRecognize_async", + "title": "Adaptation longRunningRecognize Sample", + "origin": "API_DEFINITION", + "description": " Performs asynchronous speech recognition: receive results via the google.longrunning.Operations interface. Returns either an `Operation.error` or an `Operation.response` which contains a `LongRunningRecognizeResponse` message. For more information on asynchronous speech recognition, see the [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize).", + "canonical": true, + "file": "speech.long_running_recognize.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "LongRunningRecognize", + "fullName": "google.cloud.speech.v1p1beta1.Speech.LongRunningRecognize", + "async": true, + "parameters": [ + { + "name": "config", + "type": ".google.cloud.speech.v1p1beta1.RecognitionConfig" + }, + { + "name": "audio", + "type": ".google.cloud.speech.v1p1beta1.RecognitionAudio" + }, + { + "name": "output_config", + "type": ".google.cloud.speech.v1p1beta1.TranscriptOutputConfig" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v1p1beta1.SpeechClient" + }, + "method": { + "shortName": "LongRunningRecognize", + "fullName": "google.cloud.speech.v1p1beta1.Speech.LongRunningRecognize", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v1p1beta1.Speech" + } + } + } + }, + { + "regionTag": "speech_v1p1beta1_generated_Speech_StreamingRecognize_async", + "title": "Adaptation streamingRecognize Sample", + "origin": "API_DEFINITION", + "description": " Performs bidirectional streaming speech recognition: receive results while sending audio. This method is only available via the gRPC API (not REST).", + "canonical": true, + "file": "speech.streaming_recognize.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "StreamingRecognize", + "fullName": "google.cloud.speech.v1p1beta1.Speech.StreamingRecognize", + "async": true, + "parameters": [ + { + "name": "streaming_config", + "type": ".google.cloud.speech.v1p1beta1.StreamingRecognitionConfig" + }, + { + "name": "audio_content", + "type": "TYPE_BYTES" + } + ], + "resultType": ".google.cloud.speech.v1p1beta1.StreamingRecognizeResponse", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v1p1beta1.SpeechClient" + }, + "method": { + "shortName": "StreamingRecognize", + "fullName": "google.cloud.speech.v1p1beta1.Speech.StreamingRecognize", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v1p1beta1.Speech" + } + } + } + } + ] +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/samples/generated/v1p1beta1/speech.long_running_recognize.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/samples/generated/v1p1beta1/speech.long_running_recognize.js new file mode 100644 index 00000000000..5fe33ac00f8 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/samples/generated/v1p1beta1/speech.long_running_recognize.js @@ -0,0 +1,72 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(config, audio) { + // [START speech_v1p1beta1_generated_Speech_LongRunningRecognize_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Provides information to the recognizer that specifies how to + * process the request. + */ + // const config = {} + /** + * Required. The audio data to be recognized. + */ + // const audio = {} + /** + * Optional. Specifies an optional destination for the recognition results. + */ + // const outputConfig = {} + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v1p1beta1; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callLongRunningRecognize() { + // Construct request + const request = { + config, + audio, + }; + + // Run request + const [operation] = await speechClient.longRunningRecognize(request); + const [response] = await operation.promise(); + console.log(response); + } + + callLongRunningRecognize(); + // [END speech_v1p1beta1_generated_Speech_LongRunningRecognize_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/samples/generated/v1p1beta1/speech.recognize.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/samples/generated/v1p1beta1/speech.recognize.js new file mode 100644 index 00000000000..6c672fea3a2 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/samples/generated/v1p1beta1/speech.recognize.js @@ -0,0 +1,67 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(config, audio) { + // [START speech_v1p1beta1_generated_Speech_Recognize_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Provides information to the recognizer that specifies how to + * process the request. + */ + // const config = {} + /** + * Required. The audio data to be recognized. + */ + // const audio = {} + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v1p1beta1; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callRecognize() { + // Construct request + const request = { + config, + audio, + }; + + // Run request + const response = await speechClient.recognize(request); + console.log(response); + } + + callRecognize(); + // [END speech_v1p1beta1_generated_Speech_Recognize_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/samples/generated/v1p1beta1/speech.streaming_recognize.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/samples/generated/v1p1beta1/speech.streaming_recognize.js new file mode 100644 index 00000000000..954ef4a6dfb --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/samples/generated/v1p1beta1/speech.streaming_recognize.js @@ -0,0 +1,77 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START speech_v1p1beta1_generated_Speech_StreamingRecognize_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Provides information to the recognizer that specifies how to process the + * request. The first `StreamingRecognizeRequest` message must contain a + * `streaming_config` message. + */ + // const streamingConfig = {} + /** + * The audio data to be recognized. Sequential chunks of audio data are sent + * in sequential `StreamingRecognizeRequest` messages. The first + * `StreamingRecognizeRequest` message must not contain `audio_content` data + * and all subsequent `StreamingRecognizeRequest` messages must contain + * `audio_content` data. The audio bytes must be encoded as specified in + * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a + * pure binary representation (not base64). See + * content limits (https://cloud.google.com/speech-to-text/quotas#content). + */ + // const audioContent = Buffer.from('string') + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v1p1beta1; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callStreamingRecognize() { + // Construct request + const request = { + }; + + // Run request + const stream = await speechClient.streamingRecognize(); + stream.on('data', (response) => { console.log(response) }); + stream.on('error', (err) => { throw(err) }); + stream.on('end', () => { /* API call completed */ }); + stream.write(request); + stream.end(); + } + + callStreamingRecognize(); + // [END speech_v1p1beta1_generated_Speech_StreamingRecognize_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/src/index.ts b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/src/index.ts new file mode 100644 index 00000000000..90c1cb2ca21 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/src/index.ts @@ -0,0 +1,27 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as v1p1beta1 from './v1p1beta1'; +const AdaptationClient = v1p1beta1.AdaptationClient; +type AdaptationClient = v1p1beta1.AdaptationClient; +const SpeechClient = v1p1beta1.SpeechClient; +type SpeechClient = v1p1beta1.SpeechClient; +export {v1p1beta1, AdaptationClient, SpeechClient}; +export default {v1p1beta1, AdaptationClient, SpeechClient}; +import * as protos from '../protos/protos'; +export {protos} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/src/v1p1beta1/adaptation_client.ts b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/src/v1p1beta1/adaptation_client.ts new file mode 100644 index 00000000000..68c23341e54 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/src/v1p1beta1/adaptation_client.ts @@ -0,0 +1,1834 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1p1beta1/adaptation_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './adaptation_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service that implements Google Cloud Speech Adaptation API. + * @class + * @memberof v1p1beta1 + */ +export class AdaptationClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('speech'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + adaptationStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of AdaptationClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new AdaptationClient({fallback: true}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof AdaptationClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'speech.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + customClassPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/customClasses/{custom_class}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + phraseSetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/phraseSets/{phrase_set}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listPhraseSet: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'phraseSets'), + listCustomClasses: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'customClasses') + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.speech.v1p1beta1.Adaptation', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.adaptationStub) { + return this.adaptationStub; + } + + // Put together the "service stub" for + // google.cloud.speech.v1p1beta1.Adaptation. + this.adaptationStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.speech.v1p1beta1.Adaptation') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.speech.v1p1beta1.Adaptation, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const adaptationStubMethods = + ['createPhraseSet', 'getPhraseSet', 'listPhraseSet', 'updatePhraseSet', 'deletePhraseSet', 'createCustomClass', 'getCustomClass', 'listCustomClasses', 'updateCustomClass', 'deleteCustomClass']; + for (const methodName of adaptationStubMethods) { + const callPromise = this.adaptationStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.adaptationStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'speech.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'speech.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Create a set of phrase hints. Each item in the set can be a single word or + * a multi-word phrase. The items in the PhraseSet are favored by the + * recognition model when you send a call that includes the PhraseSet. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource where this phrase set will be created. + * Format: + * + * `projects/{project}/locations/{location}` + * + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + * @param {string} request.phraseSetId + * Required. The ID to use for the phrase set, which will become the final + * component of the phrase set's resource name. + * + * This value should restrict to letters, numbers, and hyphens, with the first + * character a letter, the last a letter or a number, and be 4-63 characters. + * @param {google.cloud.speech.v1p1beta1.PhraseSet} request.phraseSet + * Required. The phrase set to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.speech.v1p1beta1.PhraseSet|PhraseSet}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1p1beta1/adaptation.create_phrase_set.js + * region_tag:speech_v1p1beta1_generated_Adaptation_CreatePhraseSet_async + */ + createPhraseSet( + request?: protos.google.cloud.speech.v1p1beta1.ICreatePhraseSetRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.speech.v1p1beta1.IPhraseSet, + protos.google.cloud.speech.v1p1beta1.ICreatePhraseSetRequest|undefined, {}|undefined + ]>; + createPhraseSet( + request: protos.google.cloud.speech.v1p1beta1.ICreatePhraseSetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.speech.v1p1beta1.IPhraseSet, + protos.google.cloud.speech.v1p1beta1.ICreatePhraseSetRequest|null|undefined, + {}|null|undefined>): void; + createPhraseSet( + request: protos.google.cloud.speech.v1p1beta1.ICreatePhraseSetRequest, + callback: Callback< + protos.google.cloud.speech.v1p1beta1.IPhraseSet, + protos.google.cloud.speech.v1p1beta1.ICreatePhraseSetRequest|null|undefined, + {}|null|undefined>): void; + createPhraseSet( + request?: protos.google.cloud.speech.v1p1beta1.ICreatePhraseSetRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.speech.v1p1beta1.IPhraseSet, + protos.google.cloud.speech.v1p1beta1.ICreatePhraseSetRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.speech.v1p1beta1.IPhraseSet, + protos.google.cloud.speech.v1p1beta1.ICreatePhraseSetRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.speech.v1p1beta1.IPhraseSet, + protos.google.cloud.speech.v1p1beta1.ICreatePhraseSetRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createPhraseSet request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.speech.v1p1beta1.IPhraseSet, + protos.google.cloud.speech.v1p1beta1.ICreatePhraseSetRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createPhraseSet response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createPhraseSet(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.speech.v1p1beta1.IPhraseSet, + protos.google.cloud.speech.v1p1beta1.ICreatePhraseSetRequest|undefined, + {}|undefined + ]) => { + this._log.info('createPhraseSet response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Get a phrase set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the phrase set to retrieve. Format: + * + * `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + * + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.speech.v1p1beta1.PhraseSet|PhraseSet}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1p1beta1/adaptation.get_phrase_set.js + * region_tag:speech_v1p1beta1_generated_Adaptation_GetPhraseSet_async + */ + getPhraseSet( + request?: protos.google.cloud.speech.v1p1beta1.IGetPhraseSetRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.speech.v1p1beta1.IPhraseSet, + protos.google.cloud.speech.v1p1beta1.IGetPhraseSetRequest|undefined, {}|undefined + ]>; + getPhraseSet( + request: protos.google.cloud.speech.v1p1beta1.IGetPhraseSetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.speech.v1p1beta1.IPhraseSet, + protos.google.cloud.speech.v1p1beta1.IGetPhraseSetRequest|null|undefined, + {}|null|undefined>): void; + getPhraseSet( + request: protos.google.cloud.speech.v1p1beta1.IGetPhraseSetRequest, + callback: Callback< + protos.google.cloud.speech.v1p1beta1.IPhraseSet, + protos.google.cloud.speech.v1p1beta1.IGetPhraseSetRequest|null|undefined, + {}|null|undefined>): void; + getPhraseSet( + request?: protos.google.cloud.speech.v1p1beta1.IGetPhraseSetRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.speech.v1p1beta1.IPhraseSet, + protos.google.cloud.speech.v1p1beta1.IGetPhraseSetRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.speech.v1p1beta1.IPhraseSet, + protos.google.cloud.speech.v1p1beta1.IGetPhraseSetRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.speech.v1p1beta1.IPhraseSet, + protos.google.cloud.speech.v1p1beta1.IGetPhraseSetRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getPhraseSet request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.speech.v1p1beta1.IPhraseSet, + protos.google.cloud.speech.v1p1beta1.IGetPhraseSetRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getPhraseSet response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getPhraseSet(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.speech.v1p1beta1.IPhraseSet, + protos.google.cloud.speech.v1p1beta1.IGetPhraseSetRequest|undefined, + {}|undefined + ]) => { + this._log.info('getPhraseSet response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Update a phrase set. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.speech.v1p1beta1.PhraseSet} request.phraseSet + * Required. The phrase set to update. + * + * The phrase set's `name` field is used to identify the set to be + * updated. Format: + * + * `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + * + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + * @param {google.protobuf.FieldMask} request.updateMask + * The list of fields to be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.speech.v1p1beta1.PhraseSet|PhraseSet}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1p1beta1/adaptation.update_phrase_set.js + * region_tag:speech_v1p1beta1_generated_Adaptation_UpdatePhraseSet_async + */ + updatePhraseSet( + request?: protos.google.cloud.speech.v1p1beta1.IUpdatePhraseSetRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.speech.v1p1beta1.IPhraseSet, + protos.google.cloud.speech.v1p1beta1.IUpdatePhraseSetRequest|undefined, {}|undefined + ]>; + updatePhraseSet( + request: protos.google.cloud.speech.v1p1beta1.IUpdatePhraseSetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.speech.v1p1beta1.IPhraseSet, + protos.google.cloud.speech.v1p1beta1.IUpdatePhraseSetRequest|null|undefined, + {}|null|undefined>): void; + updatePhraseSet( + request: protos.google.cloud.speech.v1p1beta1.IUpdatePhraseSetRequest, + callback: Callback< + protos.google.cloud.speech.v1p1beta1.IPhraseSet, + protos.google.cloud.speech.v1p1beta1.IUpdatePhraseSetRequest|null|undefined, + {}|null|undefined>): void; + updatePhraseSet( + request?: protos.google.cloud.speech.v1p1beta1.IUpdatePhraseSetRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.speech.v1p1beta1.IPhraseSet, + protos.google.cloud.speech.v1p1beta1.IUpdatePhraseSetRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.speech.v1p1beta1.IPhraseSet, + protos.google.cloud.speech.v1p1beta1.IUpdatePhraseSetRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.speech.v1p1beta1.IPhraseSet, + protos.google.cloud.speech.v1p1beta1.IUpdatePhraseSetRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'phrase_set.name': request.phraseSet!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updatePhraseSet request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.speech.v1p1beta1.IPhraseSet, + protos.google.cloud.speech.v1p1beta1.IUpdatePhraseSetRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updatePhraseSet response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updatePhraseSet(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.speech.v1p1beta1.IPhraseSet, + protos.google.cloud.speech.v1p1beta1.IUpdatePhraseSetRequest|undefined, + {}|undefined + ]) => { + this._log.info('updatePhraseSet response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Delete a phrase set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the phrase set to delete. Format: + * + * `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1p1beta1/adaptation.delete_phrase_set.js + * region_tag:speech_v1p1beta1_generated_Adaptation_DeletePhraseSet_async + */ + deletePhraseSet( + request?: protos.google.cloud.speech.v1p1beta1.IDeletePhraseSetRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1p1beta1.IDeletePhraseSetRequest|undefined, {}|undefined + ]>; + deletePhraseSet( + request: protos.google.cloud.speech.v1p1beta1.IDeletePhraseSetRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1p1beta1.IDeletePhraseSetRequest|null|undefined, + {}|null|undefined>): void; + deletePhraseSet( + request: protos.google.cloud.speech.v1p1beta1.IDeletePhraseSetRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1p1beta1.IDeletePhraseSetRequest|null|undefined, + {}|null|undefined>): void; + deletePhraseSet( + request?: protos.google.cloud.speech.v1p1beta1.IDeletePhraseSetRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1p1beta1.IDeletePhraseSetRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1p1beta1.IDeletePhraseSetRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1p1beta1.IDeletePhraseSetRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('deletePhraseSet request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1p1beta1.IDeletePhraseSetRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deletePhraseSet response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deletePhraseSet(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1p1beta1.IDeletePhraseSetRequest|undefined, + {}|undefined + ]) => { + this._log.info('deletePhraseSet response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Create a custom class. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource where this custom class will be created. + * Format: + * + * `projects/{project}/locations/{location}/customClasses` + * + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + * @param {string} request.customClassId + * Required. The ID to use for the custom class, which will become the final + * component of the custom class' resource name. + * + * This value should restrict to letters, numbers, and hyphens, with the first + * character a letter, the last a letter or a number, and be 4-63 characters. + * @param {google.cloud.speech.v1p1beta1.CustomClass} request.customClass + * Required. The custom class to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.speech.v1p1beta1.CustomClass|CustomClass}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1p1beta1/adaptation.create_custom_class.js + * region_tag:speech_v1p1beta1_generated_Adaptation_CreateCustomClass_async + */ + createCustomClass( + request?: protos.google.cloud.speech.v1p1beta1.ICreateCustomClassRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.speech.v1p1beta1.ICustomClass, + protos.google.cloud.speech.v1p1beta1.ICreateCustomClassRequest|undefined, {}|undefined + ]>; + createCustomClass( + request: protos.google.cloud.speech.v1p1beta1.ICreateCustomClassRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.speech.v1p1beta1.ICustomClass, + protos.google.cloud.speech.v1p1beta1.ICreateCustomClassRequest|null|undefined, + {}|null|undefined>): void; + createCustomClass( + request: protos.google.cloud.speech.v1p1beta1.ICreateCustomClassRequest, + callback: Callback< + protos.google.cloud.speech.v1p1beta1.ICustomClass, + protos.google.cloud.speech.v1p1beta1.ICreateCustomClassRequest|null|undefined, + {}|null|undefined>): void; + createCustomClass( + request?: protos.google.cloud.speech.v1p1beta1.ICreateCustomClassRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.speech.v1p1beta1.ICustomClass, + protos.google.cloud.speech.v1p1beta1.ICreateCustomClassRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.speech.v1p1beta1.ICustomClass, + protos.google.cloud.speech.v1p1beta1.ICreateCustomClassRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.speech.v1p1beta1.ICustomClass, + protos.google.cloud.speech.v1p1beta1.ICreateCustomClassRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createCustomClass request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.speech.v1p1beta1.ICustomClass, + protos.google.cloud.speech.v1p1beta1.ICreateCustomClassRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createCustomClass response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createCustomClass(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.speech.v1p1beta1.ICustomClass, + protos.google.cloud.speech.v1p1beta1.ICreateCustomClassRequest|undefined, + {}|undefined + ]) => { + this._log.info('createCustomClass response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Get a custom class. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the custom class to retrieve. Format: + * + * `projects/{project}/locations/{location}/customClasses/{custom_class}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.speech.v1p1beta1.CustomClass|CustomClass}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1p1beta1/adaptation.get_custom_class.js + * region_tag:speech_v1p1beta1_generated_Adaptation_GetCustomClass_async + */ + getCustomClass( + request?: protos.google.cloud.speech.v1p1beta1.IGetCustomClassRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.speech.v1p1beta1.ICustomClass, + protos.google.cloud.speech.v1p1beta1.IGetCustomClassRequest|undefined, {}|undefined + ]>; + getCustomClass( + request: protos.google.cloud.speech.v1p1beta1.IGetCustomClassRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.speech.v1p1beta1.ICustomClass, + protos.google.cloud.speech.v1p1beta1.IGetCustomClassRequest|null|undefined, + {}|null|undefined>): void; + getCustomClass( + request: protos.google.cloud.speech.v1p1beta1.IGetCustomClassRequest, + callback: Callback< + protos.google.cloud.speech.v1p1beta1.ICustomClass, + protos.google.cloud.speech.v1p1beta1.IGetCustomClassRequest|null|undefined, + {}|null|undefined>): void; + getCustomClass( + request?: protos.google.cloud.speech.v1p1beta1.IGetCustomClassRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.speech.v1p1beta1.ICustomClass, + protos.google.cloud.speech.v1p1beta1.IGetCustomClassRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.speech.v1p1beta1.ICustomClass, + protos.google.cloud.speech.v1p1beta1.IGetCustomClassRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.speech.v1p1beta1.ICustomClass, + protos.google.cloud.speech.v1p1beta1.IGetCustomClassRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getCustomClass request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.speech.v1p1beta1.ICustomClass, + protos.google.cloud.speech.v1p1beta1.IGetCustomClassRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getCustomClass response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getCustomClass(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.speech.v1p1beta1.ICustomClass, + protos.google.cloud.speech.v1p1beta1.IGetCustomClassRequest|undefined, + {}|undefined + ]) => { + this._log.info('getCustomClass response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Update a custom class. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.speech.v1p1beta1.CustomClass} request.customClass + * Required. The custom class to update. + * + * The custom class's `name` field is used to identify the custom class to be + * updated. Format: + * + * `projects/{project}/locations/{location}/customClasses/{custom_class}` + * + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + * @param {google.protobuf.FieldMask} request.updateMask + * The list of fields to be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.speech.v1p1beta1.CustomClass|CustomClass}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1p1beta1/adaptation.update_custom_class.js + * region_tag:speech_v1p1beta1_generated_Adaptation_UpdateCustomClass_async + */ + updateCustomClass( + request?: protos.google.cloud.speech.v1p1beta1.IUpdateCustomClassRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.speech.v1p1beta1.ICustomClass, + protos.google.cloud.speech.v1p1beta1.IUpdateCustomClassRequest|undefined, {}|undefined + ]>; + updateCustomClass( + request: protos.google.cloud.speech.v1p1beta1.IUpdateCustomClassRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.speech.v1p1beta1.ICustomClass, + protos.google.cloud.speech.v1p1beta1.IUpdateCustomClassRequest|null|undefined, + {}|null|undefined>): void; + updateCustomClass( + request: protos.google.cloud.speech.v1p1beta1.IUpdateCustomClassRequest, + callback: Callback< + protos.google.cloud.speech.v1p1beta1.ICustomClass, + protos.google.cloud.speech.v1p1beta1.IUpdateCustomClassRequest|null|undefined, + {}|null|undefined>): void; + updateCustomClass( + request?: protos.google.cloud.speech.v1p1beta1.IUpdateCustomClassRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.speech.v1p1beta1.ICustomClass, + protos.google.cloud.speech.v1p1beta1.IUpdateCustomClassRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.speech.v1p1beta1.ICustomClass, + protos.google.cloud.speech.v1p1beta1.IUpdateCustomClassRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.speech.v1p1beta1.ICustomClass, + protos.google.cloud.speech.v1p1beta1.IUpdateCustomClassRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'custom_class.name': request.customClass!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateCustomClass request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.speech.v1p1beta1.ICustomClass, + protos.google.cloud.speech.v1p1beta1.IUpdateCustomClassRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateCustomClass response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateCustomClass(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.speech.v1p1beta1.ICustomClass, + protos.google.cloud.speech.v1p1beta1.IUpdateCustomClassRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateCustomClass response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Delete a custom class. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the custom class to delete. Format: + * + * `projects/{project}/locations/{location}/customClasses/{custom_class}` + * + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1p1beta1/adaptation.delete_custom_class.js + * region_tag:speech_v1p1beta1_generated_Adaptation_DeleteCustomClass_async + */ + deleteCustomClass( + request?: protos.google.cloud.speech.v1p1beta1.IDeleteCustomClassRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1p1beta1.IDeleteCustomClassRequest|undefined, {}|undefined + ]>; + deleteCustomClass( + request: protos.google.cloud.speech.v1p1beta1.IDeleteCustomClassRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1p1beta1.IDeleteCustomClassRequest|null|undefined, + {}|null|undefined>): void; + deleteCustomClass( + request: protos.google.cloud.speech.v1p1beta1.IDeleteCustomClassRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1p1beta1.IDeleteCustomClassRequest|null|undefined, + {}|null|undefined>): void; + deleteCustomClass( + request?: protos.google.cloud.speech.v1p1beta1.IDeleteCustomClassRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1p1beta1.IDeleteCustomClassRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1p1beta1.IDeleteCustomClassRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1p1beta1.IDeleteCustomClassRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('deleteCustomClass request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1p1beta1.IDeleteCustomClassRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteCustomClass response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteCustomClass(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1p1beta1.IDeleteCustomClassRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteCustomClass response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } + + /** + * List phrase sets. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of phrase set. Format: + * + * `projects/{project}/locations/{location}` + * + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + * @param {number} request.pageSize + * The maximum number of phrase sets to return. The service may return + * fewer than this value. If unspecified, at most 50 phrase sets will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListPhraseSet` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListPhraseSet` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.speech.v1p1beta1.PhraseSet|PhraseSet}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listPhraseSetAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listPhraseSet( + request?: protos.google.cloud.speech.v1p1beta1.IListPhraseSetRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.speech.v1p1beta1.IPhraseSet[], + protos.google.cloud.speech.v1p1beta1.IListPhraseSetRequest|null, + protos.google.cloud.speech.v1p1beta1.IListPhraseSetResponse + ]>; + listPhraseSet( + request: protos.google.cloud.speech.v1p1beta1.IListPhraseSetRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.speech.v1p1beta1.IListPhraseSetRequest, + protos.google.cloud.speech.v1p1beta1.IListPhraseSetResponse|null|undefined, + protos.google.cloud.speech.v1p1beta1.IPhraseSet>): void; + listPhraseSet( + request: protos.google.cloud.speech.v1p1beta1.IListPhraseSetRequest, + callback: PaginationCallback< + protos.google.cloud.speech.v1p1beta1.IListPhraseSetRequest, + protos.google.cloud.speech.v1p1beta1.IListPhraseSetResponse|null|undefined, + protos.google.cloud.speech.v1p1beta1.IPhraseSet>): void; + listPhraseSet( + request?: protos.google.cloud.speech.v1p1beta1.IListPhraseSetRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.speech.v1p1beta1.IListPhraseSetRequest, + protos.google.cloud.speech.v1p1beta1.IListPhraseSetResponse|null|undefined, + protos.google.cloud.speech.v1p1beta1.IPhraseSet>, + callback?: PaginationCallback< + protos.google.cloud.speech.v1p1beta1.IListPhraseSetRequest, + protos.google.cloud.speech.v1p1beta1.IListPhraseSetResponse|null|undefined, + protos.google.cloud.speech.v1p1beta1.IPhraseSet>): + Promise<[ + protos.google.cloud.speech.v1p1beta1.IPhraseSet[], + protos.google.cloud.speech.v1p1beta1.IListPhraseSetRequest|null, + protos.google.cloud.speech.v1p1beta1.IListPhraseSetResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.speech.v1p1beta1.IListPhraseSetRequest, + protos.google.cloud.speech.v1p1beta1.IListPhraseSetResponse|null|undefined, + protos.google.cloud.speech.v1p1beta1.IPhraseSet>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listPhraseSet values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listPhraseSet request %j', request); + return this.innerApiCalls + .listPhraseSet(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.speech.v1p1beta1.IPhraseSet[], + protos.google.cloud.speech.v1p1beta1.IListPhraseSetRequest|null, + protos.google.cloud.speech.v1p1beta1.IListPhraseSetResponse + ]) => { + this._log.info('listPhraseSet values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listPhraseSet`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of phrase set. Format: + * + * `projects/{project}/locations/{location}` + * + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + * @param {number} request.pageSize + * The maximum number of phrase sets to return. The service may return + * fewer than this value. If unspecified, at most 50 phrase sets will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListPhraseSet` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListPhraseSet` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.speech.v1p1beta1.PhraseSet|PhraseSet} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listPhraseSetAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listPhraseSetStream( + request?: protos.google.cloud.speech.v1p1beta1.IListPhraseSetRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listPhraseSet']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listPhraseSet stream %j', request); + return this.descriptors.page.listPhraseSet.createStream( + this.innerApiCalls.listPhraseSet as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listPhraseSet`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of phrase set. Format: + * + * `projects/{project}/locations/{location}` + * + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + * @param {number} request.pageSize + * The maximum number of phrase sets to return. The service may return + * fewer than this value. If unspecified, at most 50 phrase sets will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListPhraseSet` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListPhraseSet` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.speech.v1p1beta1.PhraseSet|PhraseSet}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1p1beta1/adaptation.list_phrase_set.js + * region_tag:speech_v1p1beta1_generated_Adaptation_ListPhraseSet_async + */ + listPhraseSetAsync( + request?: protos.google.cloud.speech.v1p1beta1.IListPhraseSetRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listPhraseSet']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listPhraseSet iterate %j', request); + return this.descriptors.page.listPhraseSet.asyncIterate( + this.innerApiCalls['listPhraseSet'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * List custom classes. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of custom classes. Format: + * + * `projects/{project}/locations/{location}/customClasses` + * + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + * @param {number} request.pageSize + * The maximum number of custom classes to return. The service may return + * fewer than this value. If unspecified, at most 50 custom classes will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListCustomClass` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListCustomClass` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.speech.v1p1beta1.CustomClass|CustomClass}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listCustomClassesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listCustomClasses( + request?: protos.google.cloud.speech.v1p1beta1.IListCustomClassesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.speech.v1p1beta1.ICustomClass[], + protos.google.cloud.speech.v1p1beta1.IListCustomClassesRequest|null, + protos.google.cloud.speech.v1p1beta1.IListCustomClassesResponse + ]>; + listCustomClasses( + request: protos.google.cloud.speech.v1p1beta1.IListCustomClassesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.speech.v1p1beta1.IListCustomClassesRequest, + protos.google.cloud.speech.v1p1beta1.IListCustomClassesResponse|null|undefined, + protos.google.cloud.speech.v1p1beta1.ICustomClass>): void; + listCustomClasses( + request: protos.google.cloud.speech.v1p1beta1.IListCustomClassesRequest, + callback: PaginationCallback< + protos.google.cloud.speech.v1p1beta1.IListCustomClassesRequest, + protos.google.cloud.speech.v1p1beta1.IListCustomClassesResponse|null|undefined, + protos.google.cloud.speech.v1p1beta1.ICustomClass>): void; + listCustomClasses( + request?: protos.google.cloud.speech.v1p1beta1.IListCustomClassesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.speech.v1p1beta1.IListCustomClassesRequest, + protos.google.cloud.speech.v1p1beta1.IListCustomClassesResponse|null|undefined, + protos.google.cloud.speech.v1p1beta1.ICustomClass>, + callback?: PaginationCallback< + protos.google.cloud.speech.v1p1beta1.IListCustomClassesRequest, + protos.google.cloud.speech.v1p1beta1.IListCustomClassesResponse|null|undefined, + protos.google.cloud.speech.v1p1beta1.ICustomClass>): + Promise<[ + protos.google.cloud.speech.v1p1beta1.ICustomClass[], + protos.google.cloud.speech.v1p1beta1.IListCustomClassesRequest|null, + protos.google.cloud.speech.v1p1beta1.IListCustomClassesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.speech.v1p1beta1.IListCustomClassesRequest, + protos.google.cloud.speech.v1p1beta1.IListCustomClassesResponse|null|undefined, + protos.google.cloud.speech.v1p1beta1.ICustomClass>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listCustomClasses values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listCustomClasses request %j', request); + return this.innerApiCalls + .listCustomClasses(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.speech.v1p1beta1.ICustomClass[], + protos.google.cloud.speech.v1p1beta1.IListCustomClassesRequest|null, + protos.google.cloud.speech.v1p1beta1.IListCustomClassesResponse + ]) => { + this._log.info('listCustomClasses values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listCustomClasses`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of custom classes. Format: + * + * `projects/{project}/locations/{location}/customClasses` + * + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + * @param {number} request.pageSize + * The maximum number of custom classes to return. The service may return + * fewer than this value. If unspecified, at most 50 custom classes will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListCustomClass` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListCustomClass` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.speech.v1p1beta1.CustomClass|CustomClass} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listCustomClassesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listCustomClassesStream( + request?: protos.google.cloud.speech.v1p1beta1.IListCustomClassesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listCustomClasses']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listCustomClasses stream %j', request); + return this.descriptors.page.listCustomClasses.createStream( + this.innerApiCalls.listCustomClasses as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listCustomClasses`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of custom classes. Format: + * + * `projects/{project}/locations/{location}/customClasses` + * + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + * @param {number} request.pageSize + * The maximum number of custom classes to return. The service may return + * fewer than this value. If unspecified, at most 50 custom classes will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListCustomClass` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListCustomClass` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.speech.v1p1beta1.CustomClass|CustomClass}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1p1beta1/adaptation.list_custom_classes.js + * region_tag:speech_v1p1beta1_generated_Adaptation_ListCustomClasses_async + */ + listCustomClassesAsync( + request?: protos.google.cloud.speech.v1p1beta1.IListCustomClassesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listCustomClasses']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listCustomClasses iterate %j', request); + return this.descriptors.page.listCustomClasses.asyncIterate( + this.innerApiCalls['listCustomClasses'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified customClass resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} custom_class + * @returns {string} Resource name string. + */ + customClassPath(project:string,location:string,customClass:string) { + return this.pathTemplates.customClassPathTemplate.render({ + project: project, + location: location, + custom_class: customClass, + }); + } + + /** + * Parse the project from CustomClass resource. + * + * @param {string} customClassName + * A fully-qualified path representing CustomClass resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCustomClassName(customClassName: string) { + return this.pathTemplates.customClassPathTemplate.match(customClassName).project; + } + + /** + * Parse the location from CustomClass resource. + * + * @param {string} customClassName + * A fully-qualified path representing CustomClass resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCustomClassName(customClassName: string) { + return this.pathTemplates.customClassPathTemplate.match(customClassName).location; + } + + /** + * Parse the custom_class from CustomClass resource. + * + * @param {string} customClassName + * A fully-qualified path representing CustomClass resource. + * @returns {string} A string representing the custom_class. + */ + matchCustomClassFromCustomClassName(customClassName: string) { + return this.pathTemplates.customClassPathTemplate.match(customClassName).custom_class; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified phraseSet resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} phrase_set + * @returns {string} Resource name string. + */ + phraseSetPath(project:string,location:string,phraseSet:string) { + return this.pathTemplates.phraseSetPathTemplate.render({ + project: project, + location: location, + phrase_set: phraseSet, + }); + } + + /** + * Parse the project from PhraseSet resource. + * + * @param {string} phraseSetName + * A fully-qualified path representing PhraseSet resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPhraseSetName(phraseSetName: string) { + return this.pathTemplates.phraseSetPathTemplate.match(phraseSetName).project; + } + + /** + * Parse the location from PhraseSet resource. + * + * @param {string} phraseSetName + * A fully-qualified path representing PhraseSet resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPhraseSetName(phraseSetName: string) { + return this.pathTemplates.phraseSetPathTemplate.match(phraseSetName).location; + } + + /** + * Parse the phrase_set from PhraseSet resource. + * + * @param {string} phraseSetName + * A fully-qualified path representing PhraseSet resource. + * @returns {string} A string representing the phrase_set. + */ + matchPhraseSetFromPhraseSetName(phraseSetName: string) { + return this.pathTemplates.phraseSetPathTemplate.match(phraseSetName).phrase_set; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project:string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.adaptationStub && !this._terminated) { + return this.adaptationStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/src/v1p1beta1/adaptation_client_config.json b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/src/v1p1beta1/adaptation_client_config.json new file mode 100644 index 00000000000..9de684473a2 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/src/v1p1beta1/adaptation_client_config.json @@ -0,0 +1,66 @@ +{ + "interfaces": { + "google.cloud.speech.v1p1beta1.Adaptation": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreatePhraseSet": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetPhraseSet": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListPhraseSet": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdatePhraseSet": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeletePhraseSet": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateCustomClass": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetCustomClass": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListCustomClasses": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateCustomClass": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteCustomClass": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/src/v1p1beta1/adaptation_proto_list.json b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/src/v1p1beta1/adaptation_proto_list.json new file mode 100644 index 00000000000..d05ded22dc9 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/src/v1p1beta1/adaptation_proto_list.json @@ -0,0 +1,5 @@ +[ + "../../protos/google/cloud/speech/v1p1beta1/cloud_speech.proto", + "../../protos/google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto", + "../../protos/google/cloud/speech/v1p1beta1/resource.proto" +] diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/src/v1p1beta1/gapic_metadata.json b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/src/v1p1beta1/gapic_metadata.json new file mode 100644 index 00000000000..deb25a92d68 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/src/v1p1beta1/gapic_metadata.json @@ -0,0 +1,170 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.speech.v1p1beta1", + "libraryPackage": "@google-cloud/speech", + "services": { + "Adaptation": { + "clients": { + "grpc": { + "libraryClient": "AdaptationClient", + "rpcs": { + "CreatePhraseSet": { + "methods": [ + "createPhraseSet" + ] + }, + "GetPhraseSet": { + "methods": [ + "getPhraseSet" + ] + }, + "UpdatePhraseSet": { + "methods": [ + "updatePhraseSet" + ] + }, + "DeletePhraseSet": { + "methods": [ + "deletePhraseSet" + ] + }, + "CreateCustomClass": { + "methods": [ + "createCustomClass" + ] + }, + "GetCustomClass": { + "methods": [ + "getCustomClass" + ] + }, + "UpdateCustomClass": { + "methods": [ + "updateCustomClass" + ] + }, + "DeleteCustomClass": { + "methods": [ + "deleteCustomClass" + ] + }, + "ListPhraseSet": { + "methods": [ + "listPhraseSet", + "listPhraseSetStream", + "listPhraseSetAsync" + ] + }, + "ListCustomClasses": { + "methods": [ + "listCustomClasses", + "listCustomClassesStream", + "listCustomClassesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "AdaptationClient", + "rpcs": { + "CreatePhraseSet": { + "methods": [ + "createPhraseSet" + ] + }, + "GetPhraseSet": { + "methods": [ + "getPhraseSet" + ] + }, + "UpdatePhraseSet": { + "methods": [ + "updatePhraseSet" + ] + }, + "DeletePhraseSet": { + "methods": [ + "deletePhraseSet" + ] + }, + "CreateCustomClass": { + "methods": [ + "createCustomClass" + ] + }, + "GetCustomClass": { + "methods": [ + "getCustomClass" + ] + }, + "UpdateCustomClass": { + "methods": [ + "updateCustomClass" + ] + }, + "DeleteCustomClass": { + "methods": [ + "deleteCustomClass" + ] + }, + "ListPhraseSet": { + "methods": [ + "listPhraseSet", + "listPhraseSetStream", + "listPhraseSetAsync" + ] + }, + "ListCustomClasses": { + "methods": [ + "listCustomClasses", + "listCustomClassesStream", + "listCustomClassesAsync" + ] + } + } + } + } + }, + "Speech": { + "clients": { + "grpc": { + "libraryClient": "SpeechClient", + "rpcs": { + "Recognize": { + "methods": [ + "recognize" + ] + }, + "StreamingRecognize": { + "methods": [ + "streamingRecognize" + ] + }, + "LongRunningRecognize": { + "methods": [ + "longRunningRecognize" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "SpeechClient", + "rpcs": { + "Recognize": { + "methods": [ + "recognize" + ] + }, + "LongRunningRecognize": { + "methods": [ + "longRunningRecognize" + ] + } + } + } + } + } + } +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/src/v1p1beta1/index.ts b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/src/v1p1beta1/index.ts new file mode 100644 index 00000000000..4a66bbeb5ff --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/src/v1p1beta1/index.ts @@ -0,0 +1,20 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {AdaptationClient} from './adaptation_client'; +export {SpeechClient} from './speech_client'; diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/src/v1p1beta1/speech_client.ts b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/src/v1p1beta1/speech_client.ts new file mode 100644 index 00000000000..9a9273a3f47 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/src/v1p1beta1/speech_client.ts @@ -0,0 +1,946 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation} from 'google-gax'; +import {PassThrough} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1p1beta1/speech_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './speech_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service that implements Google Cloud Speech API. + * @class + * @memberof v1p1beta1 + */ +export class SpeechClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('speech'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + speechStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of SpeechClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new SpeechClient({fallback: true}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof SpeechClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'speech.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + customClassPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/customClasses/{custom_class}' + ), + phraseSetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/phraseSets/{phrase_set}' + ), + }; + + // Some of the methods on this service provide streaming responses. + // Provide descriptors for these. + this.descriptors.stream = { + streamingRecognize: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.BIDI_STREAMING, !!opts.fallback, !!opts.gaxServerStreamingRetries) + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.longrunning.Operations.GetOperation',get: '/v1p1beta1/operations/{name=**}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v1p1beta1/operations',}]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); + const longRunningRecognizeResponse = protoFilesRoot.lookup( + '.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse') as gax.protobuf.Type; + const longRunningRecognizeMetadata = protoFilesRoot.lookup( + '.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + longRunningRecognize: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + longRunningRecognizeResponse.decode.bind(longRunningRecognizeResponse), + longRunningRecognizeMetadata.decode.bind(longRunningRecognizeMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.speech.v1p1beta1.Speech', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.speechStub) { + return this.speechStub; + } + + // Put together the "service stub" for + // google.cloud.speech.v1p1beta1.Speech. + this.speechStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.speech.v1p1beta1.Speech') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.speech.v1p1beta1.Speech, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const speechStubMethods = + ['recognize', 'longRunningRecognize', 'streamingRecognize']; + for (const methodName of speechStubMethods) { + const callPromise = this.speechStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + if (methodName in this.descriptors.stream) { + const stream = new PassThrough({objectMode: true}); + setImmediate(() => { + stream.emit('error', new this._gaxModule.GoogleError('The client has already been closed.')); + }); + return stream; + } + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.stream[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.speechStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'speech.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'speech.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Performs synchronous speech recognition: receive results after all audio + * has been sent and processed. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.speech.v1p1beta1.RecognitionConfig} request.config + * Required. Provides information to the recognizer that specifies how to + * process the request. + * @param {google.cloud.speech.v1p1beta1.RecognitionAudio} request.audio + * Required. The audio data to be recognized. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.speech.v1p1beta1.RecognizeResponse|RecognizeResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1p1beta1/speech.recognize.js + * region_tag:speech_v1p1beta1_generated_Speech_Recognize_async + */ + recognize( + request?: protos.google.cloud.speech.v1p1beta1.IRecognizeRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.speech.v1p1beta1.IRecognizeResponse, + protos.google.cloud.speech.v1p1beta1.IRecognizeRequest|undefined, {}|undefined + ]>; + recognize( + request: protos.google.cloud.speech.v1p1beta1.IRecognizeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.speech.v1p1beta1.IRecognizeResponse, + protos.google.cloud.speech.v1p1beta1.IRecognizeRequest|null|undefined, + {}|null|undefined>): void; + recognize( + request: protos.google.cloud.speech.v1p1beta1.IRecognizeRequest, + callback: Callback< + protos.google.cloud.speech.v1p1beta1.IRecognizeResponse, + protos.google.cloud.speech.v1p1beta1.IRecognizeRequest|null|undefined, + {}|null|undefined>): void; + recognize( + request?: protos.google.cloud.speech.v1p1beta1.IRecognizeRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.speech.v1p1beta1.IRecognizeResponse, + protos.google.cloud.speech.v1p1beta1.IRecognizeRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.speech.v1p1beta1.IRecognizeResponse, + protos.google.cloud.speech.v1p1beta1.IRecognizeRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.speech.v1p1beta1.IRecognizeResponse, + protos.google.cloud.speech.v1p1beta1.IRecognizeRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + this.initialize().catch(err => {throw err}); + this._log.info('recognize request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.speech.v1p1beta1.IRecognizeResponse, + protos.google.cloud.speech.v1p1beta1.IRecognizeRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('recognize response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.recognize(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.speech.v1p1beta1.IRecognizeResponse, + protos.google.cloud.speech.v1p1beta1.IRecognizeRequest|undefined, + {}|undefined + ]) => { + this._log.info('recognize response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } + +/** + * Performs bidirectional streaming speech recognition: receive results while + * sending audio. This method is only available via the gRPC API (not REST). + * + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which is both readable and writable. It accepts objects + * representing {@link protos.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest|StreamingRecognizeRequest} for write() method, and + * will emit objects representing {@link protos.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse|StreamingRecognizeResponse} on 'data' event asynchronously. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#bi-directional-streaming | documentation } + * for more details and examples. + * @example include:samples/generated/v1p1beta1/speech.streaming_recognize.js + * region_tag:speech_v1p1beta1_generated_Speech_StreamingRecognize_async + */ + streamingRecognize( + options?: CallOptions): + gax.CancellableStream { + this.initialize().catch(err => {throw err}); + this._log.info('streamingRecognize stream %j', options); + return this.innerApiCalls.streamingRecognize(null, options); + } + +/** + * Performs asynchronous speech recognition: receive results via the + * google.longrunning.Operations interface. Returns either an + * `Operation.error` or an `Operation.response` which contains + * a `LongRunningRecognizeResponse` message. + * For more information on asynchronous speech recognition, see the + * [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.speech.v1p1beta1.RecognitionConfig} request.config + * Required. Provides information to the recognizer that specifies how to + * process the request. + * @param {google.cloud.speech.v1p1beta1.RecognitionAudio} request.audio + * Required. The audio data to be recognized. + * @param {google.cloud.speech.v1p1beta1.TranscriptOutputConfig} [request.outputConfig] + * Optional. Specifies an optional destination for the recognition results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1p1beta1/speech.long_running_recognize.js + * region_tag:speech_v1p1beta1_generated_Speech_LongRunningRecognize_async + */ + longRunningRecognize( + request?: protos.google.cloud.speech.v1p1beta1.ILongRunningRecognizeRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + longRunningRecognize( + request: protos.google.cloud.speech.v1p1beta1.ILongRunningRecognizeRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + longRunningRecognize( + request: protos.google.cloud.speech.v1p1beta1.ILongRunningRecognizeRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + longRunningRecognize( + request?: protos.google.cloud.speech.v1p1beta1.ILongRunningRecognizeRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('longRunningRecognize response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('longRunningRecognize request %j', request); + return this.innerApiCalls.longRunningRecognize(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('longRunningRecognize response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `longRunningRecognize()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1p1beta1/speech.long_running_recognize.js + * region_tag:speech_v1p1beta1_generated_Speech_LongRunningRecognize_async + */ + async checkLongRunningRecognizeProgress(name: string): Promise>{ + this._log.info('longRunningRecognize long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.longRunningRecognize, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified customClass resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} custom_class + * @returns {string} Resource name string. + */ + customClassPath(project:string,location:string,customClass:string) { + return this.pathTemplates.customClassPathTemplate.render({ + project: project, + location: location, + custom_class: customClass, + }); + } + + /** + * Parse the project from CustomClass resource. + * + * @param {string} customClassName + * A fully-qualified path representing CustomClass resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCustomClassName(customClassName: string) { + return this.pathTemplates.customClassPathTemplate.match(customClassName).project; + } + + /** + * Parse the location from CustomClass resource. + * + * @param {string} customClassName + * A fully-qualified path representing CustomClass resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCustomClassName(customClassName: string) { + return this.pathTemplates.customClassPathTemplate.match(customClassName).location; + } + + /** + * Parse the custom_class from CustomClass resource. + * + * @param {string} customClassName + * A fully-qualified path representing CustomClass resource. + * @returns {string} A string representing the custom_class. + */ + matchCustomClassFromCustomClassName(customClassName: string) { + return this.pathTemplates.customClassPathTemplate.match(customClassName).custom_class; + } + + /** + * Return a fully-qualified phraseSet resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} phrase_set + * @returns {string} Resource name string. + */ + phraseSetPath(project:string,location:string,phraseSet:string) { + return this.pathTemplates.phraseSetPathTemplate.render({ + project: project, + location: location, + phrase_set: phraseSet, + }); + } + + /** + * Parse the project from PhraseSet resource. + * + * @param {string} phraseSetName + * A fully-qualified path representing PhraseSet resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPhraseSetName(phraseSetName: string) { + return this.pathTemplates.phraseSetPathTemplate.match(phraseSetName).project; + } + + /** + * Parse the location from PhraseSet resource. + * + * @param {string} phraseSetName + * A fully-qualified path representing PhraseSet resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPhraseSetName(phraseSetName: string) { + return this.pathTemplates.phraseSetPathTemplate.match(phraseSetName).location; + } + + /** + * Parse the phrase_set from PhraseSet resource. + * + * @param {string} phraseSetName + * A fully-qualified path representing PhraseSet resource. + * @returns {string} A string representing the phrase_set. + */ + matchPhraseSetFromPhraseSetName(phraseSetName: string) { + return this.pathTemplates.phraseSetPathTemplate.match(phraseSetName).phrase_set; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.speechStub && !this._terminated) { + return this.speechStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/src/v1p1beta1/speech_client_config.json b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/src/v1p1beta1/speech_client_config.json new file mode 100644 index 00000000000..c5e1b104db1 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/src/v1p1beta1/speech_client_config.json @@ -0,0 +1,41 @@ +{ + "interfaces": { + "google.cloud.speech.v1p1beta1.Speech": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "Recognize": { + "timeout_millis": 5000000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "LongRunningRecognize": { + "timeout_millis": 5000000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "StreamingRecognize": { + "timeout_millis": 5000000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/src/v1p1beta1/speech_proto_list.json b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/src/v1p1beta1/speech_proto_list.json new file mode 100644 index 00000000000..d05ded22dc9 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/src/v1p1beta1/speech_proto_list.json @@ -0,0 +1,5 @@ +[ + "../../protos/google/cloud/speech/v1p1beta1/cloud_speech.proto", + "../../protos/google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto", + "../../protos/google/cloud/speech/v1p1beta1/resource.proto" +] diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/system-test/fixtures/sample/src/index.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..96a3a1b3b8e --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/system-test/fixtures/sample/src/index.js @@ -0,0 +1,28 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const speech = require('@google-cloud/speech'); + +function main() { + const adaptationClient = new speech.AdaptationClient(); + const speechClient = new speech.SpeechClient(); +} + +main(); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/system-test/fixtures/sample/src/index.ts b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..3f61a9c89c4 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,38 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {AdaptationClient, SpeechClient} from '@google-cloud/speech'; + +// check that the client class type name can be used +function doStuffWithAdaptationClient(client: AdaptationClient) { + client.close(); +} +function doStuffWithSpeechClient(client: SpeechClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const adaptationClient = new AdaptationClient(); + doStuffWithAdaptationClient(adaptationClient); + // check that the client instance can be created + const speechClient = new SpeechClient(); + doStuffWithSpeechClient(speechClient); +} + +main(); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/system-test/install.ts b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/system-test/install.ts new file mode 100644 index 00000000000..2a505d6df0c --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/system-test/install.ts @@ -0,0 +1,49 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + + it('TypeScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() + } + }; + await packNTest(options); + }); + + it('JavaScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() + } + }; + await packNTest(options); + }); + +}); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/test/gapic_adaptation_v1p1beta1.ts b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/test/gapic_adaptation_v1p1beta1.ts new file mode 100644 index 00000000000..7a3233960e6 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/test/gapic_adaptation_v1p1beta1.ts @@ -0,0 +1,1786 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as adaptationModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1p1beta1.AdaptationClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'speech.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = adaptationModule.v1p1beta1.AdaptationClient.servicePath; + assert.strictEqual(servicePath, 'speech.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = adaptationModule.v1p1beta1.AdaptationClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'speech.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'speech.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'speech.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new adaptationModule.v1p1beta1.AdaptationClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'speech.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new adaptationModule.v1p1beta1.AdaptationClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'speech.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new adaptationModule.v1p1beta1.AdaptationClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = adaptationModule.v1p1beta1.AdaptationClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.adaptationStub, undefined); + await client.initialize(); + assert(client.adaptationStub); + }); + + it('has close method for the initialized client', done => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.adaptationStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.adaptationStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('createPhraseSet', () => { + it('invokes createPhraseSet without error', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.PhraseSet() + ); + client.innerApiCalls.createPhraseSet = stubSimpleCall(expectedResponse); + const [response] = await client.createPhraseSet(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createPhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createPhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPhraseSet without error using callback', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.PhraseSet() + ); + client.innerApiCalls.createPhraseSet = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createPhraseSet( + request, + (err?: Error|null, result?: protos.google.cloud.speech.v1p1beta1.IPhraseSet|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createPhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createPhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPhraseSet with error', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createPhraseSet = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createPhraseSet(request), expectedError); + const actualRequest = (client.innerApiCalls.createPhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createPhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPhraseSet with closed client', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createPhraseSet(request), expectedError); + }); + }); + + describe('getPhraseSet', () => { + it('invokes getPhraseSet without error', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.GetPhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.GetPhraseSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.PhraseSet() + ); + client.innerApiCalls.getPhraseSet = stubSimpleCall(expectedResponse); + const [response] = await client.getPhraseSet(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getPhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getPhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPhraseSet without error using callback', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.GetPhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.GetPhraseSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.PhraseSet() + ); + client.innerApiCalls.getPhraseSet = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getPhraseSet( + request, + (err?: Error|null, result?: protos.google.cloud.speech.v1p1beta1.IPhraseSet|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getPhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getPhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPhraseSet with error', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.GetPhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.GetPhraseSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getPhraseSet = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getPhraseSet(request), expectedError); + const actualRequest = (client.innerApiCalls.getPhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getPhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPhraseSet with closed client', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.GetPhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.GetPhraseSetRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getPhraseSet(request), expectedError); + }); + }); + + describe('updatePhraseSet', () => { + it('invokes updatePhraseSet without error', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest() + ); + request.phraseSet ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest', ['phraseSet', 'name']); + request.phraseSet.name = defaultValue1; + const expectedHeaderRequestParams = `phrase_set.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.PhraseSet() + ); + client.innerApiCalls.updatePhraseSet = stubSimpleCall(expectedResponse); + const [response] = await client.updatePhraseSet(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updatePhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updatePhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updatePhraseSet without error using callback', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest() + ); + request.phraseSet ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest', ['phraseSet', 'name']); + request.phraseSet.name = defaultValue1; + const expectedHeaderRequestParams = `phrase_set.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.PhraseSet() + ); + client.innerApiCalls.updatePhraseSet = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updatePhraseSet( + request, + (err?: Error|null, result?: protos.google.cloud.speech.v1p1beta1.IPhraseSet|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updatePhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updatePhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updatePhraseSet with error', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest() + ); + request.phraseSet ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest', ['phraseSet', 'name']); + request.phraseSet.name = defaultValue1; + const expectedHeaderRequestParams = `phrase_set.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updatePhraseSet = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updatePhraseSet(request), expectedError); + const actualRequest = (client.innerApiCalls.updatePhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updatePhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updatePhraseSet with closed client', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest() + ); + request.phraseSet ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest', ['phraseSet', 'name']); + request.phraseSet.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updatePhraseSet(request), expectedError); + }); + }); + + describe('deletePhraseSet', () => { + it('invokes deletePhraseSet without error', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deletePhraseSet = stubSimpleCall(expectedResponse); + const [response] = await client.deletePhraseSet(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deletePhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deletePhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePhraseSet without error using callback', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deletePhraseSet = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deletePhraseSet( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deletePhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deletePhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePhraseSet with error', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deletePhraseSet = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deletePhraseSet(request), expectedError); + const actualRequest = (client.innerApiCalls.deletePhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deletePhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePhraseSet with closed client', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deletePhraseSet(request), expectedError); + }); + }); + + describe('createCustomClass', () => { + it('invokes createCustomClass without error', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.CreateCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.CreateCustomClassRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.CustomClass() + ); + client.innerApiCalls.createCustomClass = stubSimpleCall(expectedResponse); + const [response] = await client.createCustomClass(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCustomClass without error using callback', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.CreateCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.CreateCustomClassRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.CustomClass() + ); + client.innerApiCalls.createCustomClass = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createCustomClass( + request, + (err?: Error|null, result?: protos.google.cloud.speech.v1p1beta1.ICustomClass|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCustomClass with error', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.CreateCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.CreateCustomClassRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCustomClass = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createCustomClass(request), expectedError); + const actualRequest = (client.innerApiCalls.createCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCustomClass with closed client', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.CreateCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.CreateCustomClassRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createCustomClass(request), expectedError); + }); + }); + + describe('getCustomClass', () => { + it('invokes getCustomClass without error', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.GetCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.GetCustomClassRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.CustomClass() + ); + client.innerApiCalls.getCustomClass = stubSimpleCall(expectedResponse); + const [response] = await client.getCustomClass(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCustomClass without error using callback', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.GetCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.GetCustomClassRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.CustomClass() + ); + client.innerApiCalls.getCustomClass = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getCustomClass( + request, + (err?: Error|null, result?: protos.google.cloud.speech.v1p1beta1.ICustomClass|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCustomClass with error', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.GetCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.GetCustomClassRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getCustomClass = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getCustomClass(request), expectedError); + const actualRequest = (client.innerApiCalls.getCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCustomClass with closed client', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.GetCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.GetCustomClassRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getCustomClass(request), expectedError); + }); + }); + + describe('updateCustomClass', () => { + it('invokes updateCustomClass without error', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest() + ); + request.customClass ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest', ['customClass', 'name']); + request.customClass.name = defaultValue1; + const expectedHeaderRequestParams = `custom_class.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.CustomClass() + ); + client.innerApiCalls.updateCustomClass = stubSimpleCall(expectedResponse); + const [response] = await client.updateCustomClass(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCustomClass without error using callback', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest() + ); + request.customClass ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest', ['customClass', 'name']); + request.customClass.name = defaultValue1; + const expectedHeaderRequestParams = `custom_class.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.CustomClass() + ); + client.innerApiCalls.updateCustomClass = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateCustomClass( + request, + (err?: Error|null, result?: protos.google.cloud.speech.v1p1beta1.ICustomClass|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCustomClass with error', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest() + ); + request.customClass ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest', ['customClass', 'name']); + request.customClass.name = defaultValue1; + const expectedHeaderRequestParams = `custom_class.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCustomClass = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateCustomClass(request), expectedError); + const actualRequest = (client.innerApiCalls.updateCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCustomClass with closed client', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest() + ); + request.customClass ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest', ['customClass', 'name']); + request.customClass.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateCustomClass(request), expectedError); + }); + }); + + describe('deleteCustomClass', () => { + it('invokes deleteCustomClass without error', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteCustomClass = stubSimpleCall(expectedResponse); + const [response] = await client.deleteCustomClass(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCustomClass without error using callback', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteCustomClass = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteCustomClass( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCustomClass with error', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCustomClass = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteCustomClass(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCustomClass with closed client', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteCustomClass(request), expectedError); + }); + }); + + describe('listPhraseSet', () => { + it('invokes listPhraseSet without error', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.ListPhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.ListPhraseSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.speech.v1p1beta1.PhraseSet()), + generateSampleMessage(new protos.google.cloud.speech.v1p1beta1.PhraseSet()), + generateSampleMessage(new protos.google.cloud.speech.v1p1beta1.PhraseSet()), + ]; + client.innerApiCalls.listPhraseSet = stubSimpleCall(expectedResponse); + const [response] = await client.listPhraseSet(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listPhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listPhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPhraseSet without error using callback', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.ListPhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.ListPhraseSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.speech.v1p1beta1.PhraseSet()), + generateSampleMessage(new protos.google.cloud.speech.v1p1beta1.PhraseSet()), + generateSampleMessage(new protos.google.cloud.speech.v1p1beta1.PhraseSet()), + ]; + client.innerApiCalls.listPhraseSet = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listPhraseSet( + request, + (err?: Error|null, result?: protos.google.cloud.speech.v1p1beta1.IPhraseSet[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listPhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listPhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPhraseSet with error', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.ListPhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.ListPhraseSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listPhraseSet = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listPhraseSet(request), expectedError); + const actualRequest = (client.innerApiCalls.listPhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listPhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPhraseSetStream without error', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.ListPhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.ListPhraseSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.speech.v1p1beta1.PhraseSet()), + generateSampleMessage(new protos.google.cloud.speech.v1p1beta1.PhraseSet()), + generateSampleMessage(new protos.google.cloud.speech.v1p1beta1.PhraseSet()), + ]; + client.descriptors.page.listPhraseSet.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listPhraseSetStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.speech.v1p1beta1.PhraseSet[] = []; + stream.on('data', (response: protos.google.cloud.speech.v1p1beta1.PhraseSet) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listPhraseSet.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listPhraseSet, request)); + assert( + (client.descriptors.page.listPhraseSet.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listPhraseSetStream with error', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.ListPhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.ListPhraseSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listPhraseSet.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listPhraseSetStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.speech.v1p1beta1.PhraseSet[] = []; + stream.on('data', (response: protos.google.cloud.speech.v1p1beta1.PhraseSet) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listPhraseSet.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listPhraseSet, request)); + assert( + (client.descriptors.page.listPhraseSet.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listPhraseSet without error', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.ListPhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.ListPhraseSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.speech.v1p1beta1.PhraseSet()), + generateSampleMessage(new protos.google.cloud.speech.v1p1beta1.PhraseSet()), + generateSampleMessage(new protos.google.cloud.speech.v1p1beta1.PhraseSet()), + ]; + client.descriptors.page.listPhraseSet.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.speech.v1p1beta1.IPhraseSet[] = []; + const iterable = client.listPhraseSetAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listPhraseSet.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listPhraseSet.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listPhraseSet with error', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.ListPhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.ListPhraseSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listPhraseSet.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listPhraseSetAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.speech.v1p1beta1.IPhraseSet[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listPhraseSet.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listPhraseSet.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listCustomClasses', () => { + it('invokes listCustomClasses without error', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.ListCustomClassesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.ListCustomClassesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.speech.v1p1beta1.CustomClass()), + generateSampleMessage(new protos.google.cloud.speech.v1p1beta1.CustomClass()), + generateSampleMessage(new protos.google.cloud.speech.v1p1beta1.CustomClass()), + ]; + client.innerApiCalls.listCustomClasses = stubSimpleCall(expectedResponse); + const [response] = await client.listCustomClasses(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listCustomClasses as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listCustomClasses as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCustomClasses without error using callback', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.ListCustomClassesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.ListCustomClassesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.speech.v1p1beta1.CustomClass()), + generateSampleMessage(new protos.google.cloud.speech.v1p1beta1.CustomClass()), + generateSampleMessage(new protos.google.cloud.speech.v1p1beta1.CustomClass()), + ]; + client.innerApiCalls.listCustomClasses = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listCustomClasses( + request, + (err?: Error|null, result?: protos.google.cloud.speech.v1p1beta1.ICustomClass[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listCustomClasses as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listCustomClasses as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCustomClasses with error', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.ListCustomClassesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.ListCustomClassesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listCustomClasses = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listCustomClasses(request), expectedError); + const actualRequest = (client.innerApiCalls.listCustomClasses as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listCustomClasses as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCustomClassesStream without error', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.ListCustomClassesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.ListCustomClassesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.speech.v1p1beta1.CustomClass()), + generateSampleMessage(new protos.google.cloud.speech.v1p1beta1.CustomClass()), + generateSampleMessage(new protos.google.cloud.speech.v1p1beta1.CustomClass()), + ]; + client.descriptors.page.listCustomClasses.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listCustomClassesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.speech.v1p1beta1.CustomClass[] = []; + stream.on('data', (response: protos.google.cloud.speech.v1p1beta1.CustomClass) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listCustomClasses.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listCustomClasses, request)); + assert( + (client.descriptors.page.listCustomClasses.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listCustomClassesStream with error', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.ListCustomClassesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.ListCustomClassesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listCustomClasses.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listCustomClassesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.speech.v1p1beta1.CustomClass[] = []; + stream.on('data', (response: protos.google.cloud.speech.v1p1beta1.CustomClass) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listCustomClasses.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listCustomClasses, request)); + assert( + (client.descriptors.page.listCustomClasses.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listCustomClasses without error', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.ListCustomClassesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.ListCustomClassesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.speech.v1p1beta1.CustomClass()), + generateSampleMessage(new protos.google.cloud.speech.v1p1beta1.CustomClass()), + generateSampleMessage(new protos.google.cloud.speech.v1p1beta1.CustomClass()), + ]; + client.descriptors.page.listCustomClasses.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.speech.v1p1beta1.ICustomClass[] = []; + const iterable = client.listCustomClassesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listCustomClasses.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listCustomClasses.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listCustomClasses with error', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.ListCustomClassesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.ListCustomClassesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listCustomClasses.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listCustomClassesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.speech.v1p1beta1.ICustomClass[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listCustomClasses.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listCustomClasses.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + + describe('customClass', async () => { + const fakePath = "/rendered/path/customClass"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + custom_class: "customClassValue", + }; + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.customClassPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.customClassPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('customClassPath', () => { + const result = client.customClassPath("projectValue", "locationValue", "customClassValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.customClassPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromCustomClassName', () => { + const result = client.matchProjectFromCustomClassName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.customClassPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromCustomClassName', () => { + const result = client.matchLocationFromCustomClassName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.customClassPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCustomClassFromCustomClassName', () => { + const result = client.matchCustomClassFromCustomClassName(fakePath); + assert.strictEqual(result, "customClassValue"); + assert((client.pathTemplates.customClassPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', async () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('phraseSet', async () => { + const fakePath = "/rendered/path/phraseSet"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + phrase_set: "phraseSetValue", + }; + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.phraseSetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.phraseSetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('phraseSetPath', () => { + const result = client.phraseSetPath("projectValue", "locationValue", "phraseSetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.phraseSetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromPhraseSetName', () => { + const result = client.matchProjectFromPhraseSetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.phraseSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromPhraseSetName', () => { + const result = client.matchLocationFromPhraseSetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.phraseSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPhraseSetFromPhraseSetName', () => { + const result = client.matchPhraseSetFromPhraseSetName(fakePath); + assert.strictEqual(result, "phraseSetValue"); + assert((client.pathTemplates.phraseSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('project', async () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/test/gapic_speech_v1p1beta1.ts b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/test/gapic_speech_v1p1beta1.ts new file mode 100644 index 00000000000..2f06d475be1 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/test/gapic_speech_v1p1beta1.ts @@ -0,0 +1,864 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as speechModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubBidiStreamingCall(response?: ResponseType, error?: Error) { + const transformStub = error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + return sinon.stub().returns(mockStream); +} + +function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1p1beta1.SpeechClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new speechModule.v1p1beta1.SpeechClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'speech.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new speechModule.v1p1beta1.SpeechClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = speechModule.v1p1beta1.SpeechClient.servicePath; + assert.strictEqual(servicePath, 'speech.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = speechModule.v1p1beta1.SpeechClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'speech.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new speechModule.v1p1beta1.SpeechClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'speech.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new speechModule.v1p1beta1.SpeechClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'speech.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new speechModule.v1p1beta1.SpeechClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'speech.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new speechModule.v1p1beta1.SpeechClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'speech.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new speechModule.v1p1beta1.SpeechClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = speechModule.v1p1beta1.SpeechClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new speechModule.v1p1beta1.SpeechClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new speechModule.v1p1beta1.SpeechClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.speechStub, undefined); + await client.initialize(); + assert(client.speechStub); + }); + + it('has close method for the initialized client', done => { + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.speechStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.speechStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('recognize', () => { + it('invokes recognize without error', async () => { + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.RecognizeRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.RecognizeResponse() + ); + client.innerApiCalls.recognize = stubSimpleCall(expectedResponse); + const [response] = await client.recognize(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes recognize without error using callback', async () => { + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.RecognizeRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.RecognizeResponse() + ); + client.innerApiCalls.recognize = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.recognize( + request, + (err?: Error|null, result?: protos.google.cloud.speech.v1p1beta1.IRecognizeResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes recognize with error', async () => { + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.RecognizeRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.recognize = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.recognize(request), expectedError); + }); + + it('invokes recognize with closed client', async () => { + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.RecognizeRequest() + ); + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.recognize(request), expectedError); + }); + }); + + describe('longRunningRecognize', () => { + it('invokes longRunningRecognize without error', async () => { + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.longRunningRecognize = stubLongRunningCall(expectedResponse); + const [operation] = await client.longRunningRecognize(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes longRunningRecognize without error using callback', async () => { + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.longRunningRecognize = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.longRunningRecognize( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes longRunningRecognize with call error', async () => { + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.longRunningRecognize = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.longRunningRecognize(request), expectedError); + }); + + it('invokes longRunningRecognize with LRO error', async () => { + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.longRunningRecognize = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.longRunningRecognize(request); + await assert.rejects(operation.promise(), expectedError); + }); + + it('invokes checkLongRunningRecognizeProgress without error', async () => { + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkLongRunningRecognizeProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkLongRunningRecognizeProgress with error', async () => { + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkLongRunningRecognizeProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('streamingRecognize', () => { + it('invokes streamingRecognize without error', async () => { + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest() + ); + + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse() + ); + client.innerApiCalls.streamingRecognize = stubBidiStreamingCall(expectedResponse); + const stream = client.streamingRecognize(); + const promise = new Promise((resolve, reject) => { + stream.on('data', (response: protos.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse) => { + resolve(response); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + stream.write(request); + stream.end(); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.streamingRecognize as SinonStub) + .getCall(0).calledWith(null)); + assert.deepStrictEqual(((stream as unknown as PassThrough) + ._transform as SinonStub).getCall(0).args[0], request); + }); + + it('invokes streamingRecognize with error', async () => { + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.streamingRecognize = stubBidiStreamingCall(undefined, expectedError); + const stream = client.streamingRecognize(); + const promise = new Promise((resolve, reject) => { + stream.on('data', (response: protos.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse) => { + resolve(response); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + stream.write(request); + stream.end(); + }); + await assert.rejects(promise, expectedError); + assert((client.innerApiCalls.streamingRecognize as SinonStub) + .getCall(0).calledWith(null)); + assert.deepStrictEqual(((stream as unknown as PassThrough) + ._transform as SinonStub).getCall(0).args[0], request); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.IOperation[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.IOperation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + describe('Path templates', () => { + + describe('customClass', async () => { + const fakePath = "/rendered/path/customClass"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + custom_class: "customClassValue", + }; + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.customClassPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.customClassPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('customClassPath', () => { + const result = client.customClassPath("projectValue", "locationValue", "customClassValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.customClassPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromCustomClassName', () => { + const result = client.matchProjectFromCustomClassName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.customClassPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromCustomClassName', () => { + const result = client.matchLocationFromCustomClassName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.customClassPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCustomClassFromCustomClassName', () => { + const result = client.matchCustomClassFromCustomClassName(fakePath); + assert.strictEqual(result, "customClassValue"); + assert((client.pathTemplates.customClassPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('phraseSet', async () => { + const fakePath = "/rendered/path/phraseSet"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + phrase_set: "phraseSetValue", + }; + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.phraseSetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.phraseSetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('phraseSetPath', () => { + const result = client.phraseSetPath("projectValue", "locationValue", "phraseSetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.phraseSetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromPhraseSetName', () => { + const result = client.matchProjectFromPhraseSetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.phraseSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromPhraseSetName', () => { + const result = client.matchLocationFromPhraseSetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.phraseSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPhraseSetFromPhraseSetName', () => { + const result = client.matchPhraseSetFromPhraseSetName(fakePath); + assert.strictEqual(result, "phraseSetValue"); + assert((client.pathTemplates.phraseSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/tsconfig.json b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/tsconfig.json new file mode 100644 index 00000000000..ca73e7bfc82 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/tsconfig.json @@ -0,0 +1,22 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2023", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts", + "src/**/*.json", + "samples/**/*.json", + "protos/protos.json" + ] +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/webpack.config.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/webpack.config.js new file mode 100644 index 00000000000..50273cca41c --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v1p1beta1-nodejs/webpack.config.js @@ -0,0 +1,64 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: 'Adaptation', + filename: './adaptation.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/ + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader' + }, + ], + }, + mode: 'production', +}; diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/.eslintignore b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/.eslintignore new file mode 100644 index 00000000000..cfc348ec4d1 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/.eslintrc.json b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/.gitignore b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/.gitignore new file mode 100644 index 00000000000..d4f03a0df2e --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/.gitignore @@ -0,0 +1,14 @@ +**/*.log +**/node_modules +/.coverage +/coverage +/.nyc_output +/docs/ +/out/ +/build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +package-lock.json +__pycache__ diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/.jsdoc.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/.jsdoc.js new file mode 100644 index 00000000000..51d12943d53 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/.jsdoc.js @@ -0,0 +1,55 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2025 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/speech', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/.mocharc.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/.mocharc.js new file mode 100644 index 00000000000..24e9d15257f --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/.mocharc.js @@ -0,0 +1,33 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/.prettierrc.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/.prettierrc.js new file mode 100644 index 00000000000..d89a632f90b --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/.prettierrc.js @@ -0,0 +1,22 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/README.md b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/README.md new file mode 100644 index 00000000000..061c4f74c8d --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/README.md @@ -0,0 +1,107 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "The comments you see below are used to generate those parts of the template in later states." +Google Cloud Platform logo + +[homepage]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-speech + +# [Speech: Nodejs Client][homepage] + +[//]: # "releaseLevel" + +[![npm version](https://img.shields.io/npm/v/@google-cloud/speech.svg)](https://www.npmjs.org/package/@google-cloud/speech) + +Speech client for Node.js + +[//]: # "partials.introduction" + +A comprehensive list of changes in each version may be found in +[the CHANGELOG]([homepage]/CHANGELOG.md). + +* [Speech Nodejs Client API Reference](https://cloud.google.com/nodejs/docs/reference/speech/latest) + + +Read more about the client libraries for Cloud APIs, including the older +Google APIs Client Libraries, in [Client Libraries Explained][explained]. + +[explained]: https://cloud.google.com/apis/docs/client-libraries-explained + +**Table of contents:** + +* [Quickstart](#quickstart) + * [Before you begin](#before-you-begin) + * [Installing the client library](#installing-the-client-library) + +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) + +## Quickstart +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Speech API][enable_api]. +1. [Set up authentication][auth] so you can access the + API from your local workstation. +### Installing the client library + +```bash +npm install @google-cloud/speech +``` + +[//]: # "partials.body" + +## Samples + +Samples are in the [`samples/`]([homepage]/samples) directory. Each sample's `README.md` has instructions for running its sample. + +[//]: # "samples" + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://github.com/nodejs/release#release-schedule). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. +If you are using an end-of-life version of Node.js, we recommend that you update +as soon as possible to an actively supported LTS version. + +Google's client libraries support legacy versions of Node.js runtimes on a +best-efforts basis with the following warnings: + +* Legacy versions are not tested in continuous integration. +* Some security patches and features cannot be backported. +* Dependencies cannot be kept up-to-date. + +Client libraries targeting some end-of-life versions of Node.js are available, and +can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. +For example, `npm install @google-cloud/speech@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide]([homepage]/CONTRIBUTING.md). + +Please note that this `README.md` +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. + +## License + +Apache Version 2.0 + +See [LICENSE]([homepage]/LICENSE) + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=speech.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local \ No newline at end of file diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/package.json b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/package.json new file mode 100644 index 00000000000..a3df9c6b5f7 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/package.json @@ -0,0 +1,58 @@ +{ + "name": "@google-cloud/speech", + "version": "0.1.0", + "description": "Speech client for Node.js", + "repository": "googleapis/nodejs-speech", + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google speech", + "speech", + "speech" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test" + }, + "dependencies": { + "google-gax": "^5.1.1-rc.1" + }, + "devDependencies": { + "@types/mocha": "^10.0.10", + "@types/node": "^22.16.2", + "@types/sinon": "^17.0.4", + "c8": "^10.1.3", + "gapic-tools": "^1.0.2", + "gts": "^6.0.2", + "jsdoc": "^4.0.4", + "jsdoc-fresh": "^4.0.0", + "jsdoc-region-tag": "^3.0.0", + "mocha": "^11.7.1", + "pack-n-play": "^3.0.0", + "typescript": "5.8.3", + "sinon": "^21.0.0" + }, + "engines": { + "node": ">=v18" + } +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/protos/google/cloud/speech/v2/cloud_speech.proto b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/protos/google/cloud/speech/v2/cloud_speech.proto new file mode 100644 index 00000000000..cf4b28c3afb --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/protos/google/cloud/speech/v2/cloud_speech.proto @@ -0,0 +1,2232 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.speech.v2; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option go_package = "cloud.google.com/go/speech/apiv2/speechpb;speechpb"; +option java_multiple_files = true; +option java_outer_classname = "CloudSpeechProto"; +option java_package = "com.google.cloud.speech.v2"; +option (google.api.resource_definition) = { + type: "cloudkms.googleapis.com/CryptoKey" + pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}" +}; +option (google.api.resource_definition) = { + type: "cloudkms.googleapis.com/CryptoKeyVersion" + pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}" +}; + +// Enables speech transcription and resource management. +service Speech { + option (google.api.default_host) = "speech.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a [Recognizer][google.cloud.speech.v2.Recognizer]. + rpc CreateRecognizer(CreateRecognizerRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{parent=projects/*/locations/*}/recognizers" + body: "recognizer" + }; + option (google.api.method_signature) = "parent,recognizer,recognizer_id"; + option (google.longrunning.operation_info) = { + response_type: "Recognizer" + metadata_type: "OperationMetadata" + }; + } + + // Lists Recognizers. + rpc ListRecognizers(ListRecognizersRequest) + returns (ListRecognizersResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*/locations/*}/recognizers" + }; + option (google.api.method_signature) = "parent"; + } + + // Returns the requested + // [Recognizer][google.cloud.speech.v2.Recognizer]. Fails with + // [NOT_FOUND][google.rpc.Code.NOT_FOUND] if the requested Recognizer doesn't + // exist. + rpc GetRecognizer(GetRecognizerRequest) returns (Recognizer) { + option (google.api.http) = { + get: "/v2/{name=projects/*/locations/*/recognizers/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates the [Recognizer][google.cloud.speech.v2.Recognizer]. + rpc UpdateRecognizer(UpdateRecognizerRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v2/{recognizer.name=projects/*/locations/*/recognizers/*}" + body: "recognizer" + }; + option (google.api.method_signature) = "recognizer,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Recognizer" + metadata_type: "OperationMetadata" + }; + } + + // Deletes the [Recognizer][google.cloud.speech.v2.Recognizer]. + rpc DeleteRecognizer(DeleteRecognizerRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v2/{name=projects/*/locations/*/recognizers/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Recognizer" + metadata_type: "OperationMetadata" + }; + } + + // Undeletes the [Recognizer][google.cloud.speech.v2.Recognizer]. + rpc UndeleteRecognizer(UndeleteRecognizerRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{name=projects/*/locations/*/recognizers/*}:undelete" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Recognizer" + metadata_type: "OperationMetadata" + }; + } + + // Performs synchronous Speech recognition: receive results after all audio + // has been sent and processed. + rpc Recognize(RecognizeRequest) returns (RecognizeResponse) { + option (google.api.http) = { + post: "/v2/{recognizer=projects/*/locations/*/recognizers/*}:recognize" + body: "*" + }; + option (google.api.method_signature) = + "recognizer,config,config_mask,content"; + option (google.api.method_signature) = "recognizer,config,config_mask,uri"; + } + + // Performs bidirectional streaming speech recognition: receive results while + // sending audio. This method is only available via the gRPC API (not REST). + rpc StreamingRecognize(stream StreamingRecognizeRequest) + returns (stream StreamingRecognizeResponse) {} + + // Performs batch asynchronous speech recognition: send a request with N + // audio files and receive a long running operation that can be polled to see + // when the transcriptions are finished. + rpc BatchRecognize(BatchRecognizeRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{recognizer=projects/*/locations/*/recognizers/*}:batchRecognize" + body: "*" + }; + option (google.api.method_signature) = + "recognizer,config,config_mask,files"; + option (google.longrunning.operation_info) = { + response_type: "BatchRecognizeResponse" + metadata_type: "OperationMetadata" + }; + } + + // Returns the requested [Config][google.cloud.speech.v2.Config]. + rpc GetConfig(GetConfigRequest) returns (Config) { + option (google.api.http) = { + get: "/v2/{name=projects/*/locations/*/config}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates the [Config][google.cloud.speech.v2.Config]. + rpc UpdateConfig(UpdateConfigRequest) returns (Config) { + option (google.api.http) = { + patch: "/v2/{config.name=projects/*/locations/*/config}" + body: "config" + }; + option (google.api.method_signature) = "config,update_mask"; + } + + // Creates a [CustomClass][google.cloud.speech.v2.CustomClass]. + rpc CreateCustomClass(CreateCustomClassRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{parent=projects/*/locations/*}/customClasses" + body: "custom_class" + }; + option (google.api.method_signature) = + "parent,custom_class,custom_class_id"; + option (google.longrunning.operation_info) = { + response_type: "CustomClass" + metadata_type: "OperationMetadata" + }; + } + + // Lists CustomClasses. + rpc ListCustomClasses(ListCustomClassesRequest) + returns (ListCustomClassesResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*/locations/*}/customClasses" + }; + option (google.api.method_signature) = "parent"; + } + + // Returns the requested + // [CustomClass][google.cloud.speech.v2.CustomClass]. + rpc GetCustomClass(GetCustomClassRequest) returns (CustomClass) { + option (google.api.http) = { + get: "/v2/{name=projects/*/locations/*/customClasses/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates the [CustomClass][google.cloud.speech.v2.CustomClass]. + rpc UpdateCustomClass(UpdateCustomClassRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v2/{custom_class.name=projects/*/locations/*/customClasses/*}" + body: "custom_class" + }; + option (google.api.method_signature) = "custom_class,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "CustomClass" + metadata_type: "OperationMetadata" + }; + } + + // Deletes the [CustomClass][google.cloud.speech.v2.CustomClass]. + rpc DeleteCustomClass(DeleteCustomClassRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v2/{name=projects/*/locations/*/customClasses/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "CustomClass" + metadata_type: "OperationMetadata" + }; + } + + // Undeletes the [CustomClass][google.cloud.speech.v2.CustomClass]. + rpc UndeleteCustomClass(UndeleteCustomClassRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{name=projects/*/locations/*/customClasses/*}:undelete" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "CustomClass" + metadata_type: "OperationMetadata" + }; + } + + // Creates a [PhraseSet][google.cloud.speech.v2.PhraseSet]. + rpc CreatePhraseSet(CreatePhraseSetRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{parent=projects/*/locations/*}/phraseSets" + body: "phrase_set" + }; + option (google.api.method_signature) = "parent,phrase_set,phrase_set_id"; + option (google.longrunning.operation_info) = { + response_type: "PhraseSet" + metadata_type: "OperationMetadata" + }; + } + + // Lists PhraseSets. + rpc ListPhraseSets(ListPhraseSetsRequest) returns (ListPhraseSetsResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*/locations/*}/phraseSets" + }; + option (google.api.method_signature) = "parent"; + } + + // Returns the requested + // [PhraseSet][google.cloud.speech.v2.PhraseSet]. + rpc GetPhraseSet(GetPhraseSetRequest) returns (PhraseSet) { + option (google.api.http) = { + get: "/v2/{name=projects/*/locations/*/phraseSets/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates the [PhraseSet][google.cloud.speech.v2.PhraseSet]. + rpc UpdatePhraseSet(UpdatePhraseSetRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v2/{phrase_set.name=projects/*/locations/*/phraseSets/*}" + body: "phrase_set" + }; + option (google.api.method_signature) = "phrase_set,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "PhraseSet" + metadata_type: "OperationMetadata" + }; + } + + // Deletes the [PhraseSet][google.cloud.speech.v2.PhraseSet]. + rpc DeletePhraseSet(DeletePhraseSetRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v2/{name=projects/*/locations/*/phraseSets/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "PhraseSet" + metadata_type: "OperationMetadata" + }; + } + + // Undeletes the [PhraseSet][google.cloud.speech.v2.PhraseSet]. + rpc UndeletePhraseSet(UndeletePhraseSetRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{name=projects/*/locations/*/phraseSets/*}:undelete" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "PhraseSet" + metadata_type: "OperationMetadata" + }; + } +} + +// Request message for the +// [CreateRecognizer][google.cloud.speech.v2.Speech.CreateRecognizer] method. +message CreateRecognizerRequest { + // Required. The Recognizer to create. + Recognizer recognizer = 1 [(google.api.field_behavior) = REQUIRED]; + + // If set, validate the request and preview the Recognizer, but do not + // actually create it. + bool validate_only = 2; + + // The ID to use for the Recognizer, which will become the final component of + // the Recognizer's resource name. + // + // This value should be 4-63 characters, and valid characters + // are /[a-z][0-9]-/. + string recognizer_id = 3; + + // Required. The project and location where this Recognizer will be created. + // The expected format is `projects/{project}/locations/{location}`. + string parent = 4 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "speech.googleapis.com/Recognizer" + } + ]; +} + +// Represents the metadata of a long-running operation. +message OperationMetadata { + // The time the operation was created. + google.protobuf.Timestamp create_time = 1; + + // The time the operation was last updated. + google.protobuf.Timestamp update_time = 2; + + // The resource path for the target of the operation. + string resource = 3; + + // The method that triggered the operation. + string method = 4; + + // The [KMS key + // name](https://cloud.google.com/kms/docs/resource-hierarchy#keys) with which + // the content of the Operation is encrypted. The expected format is + // `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`. + string kms_key_name = 6 [(google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + }]; + + // The [KMS key version + // name](https://cloud.google.com/kms/docs/resource-hierarchy#key_versions) + // with which content of the Operation is encrypted. The expected format is + // `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}`. + string kms_key_version_name = 7 [(google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKeyVersion" + }]; + + // The request that spawned the Operation. + oneof request { + // The BatchRecognizeRequest that spawned the Operation. + BatchRecognizeRequest batch_recognize_request = 8; + + // The CreateRecognizerRequest that spawned the Operation. + CreateRecognizerRequest create_recognizer_request = 9; + + // The UpdateRecognizerRequest that spawned the Operation. + UpdateRecognizerRequest update_recognizer_request = 10; + + // The DeleteRecognizerRequest that spawned the Operation. + DeleteRecognizerRequest delete_recognizer_request = 11; + + // The UndeleteRecognizerRequest that spawned the Operation. + UndeleteRecognizerRequest undelete_recognizer_request = 12; + + // The CreateCustomClassRequest that spawned the Operation. + CreateCustomClassRequest create_custom_class_request = 13; + + // The UpdateCustomClassRequest that spawned the Operation. + UpdateCustomClassRequest update_custom_class_request = 14; + + // The DeleteCustomClassRequest that spawned the Operation. + DeleteCustomClassRequest delete_custom_class_request = 15; + + // The UndeleteCustomClassRequest that spawned the Operation. + UndeleteCustomClassRequest undelete_custom_class_request = 16; + + // The CreatePhraseSetRequest that spawned the Operation. + CreatePhraseSetRequest create_phrase_set_request = 17; + + // The UpdatePhraseSetRequest that spawned the Operation. + UpdatePhraseSetRequest update_phrase_set_request = 18; + + // The DeletePhraseSetRequest that spawned the Operation. + DeletePhraseSetRequest delete_phrase_set_request = 19; + + // The UndeletePhraseSetRequest that spawned the Operation. + UndeletePhraseSetRequest undelete_phrase_set_request = 20; + + // The UpdateConfigRequest that spawned the Operation. + UpdateConfigRequest update_config_request = 21 [deprecated = true]; + } + + // The percent progress of the Operation. Values can range from 0-100. If the + // value is 100, then the operation is finished. + int32 progress_percent = 22; + + // Specific metadata per RPC. + oneof metadata { + // Metadata specific to the BatchRecognize method. + BatchRecognizeMetadata batch_recognize_metadata = 23; + } +} + +// Request message for the +// [ListRecognizers][google.cloud.speech.v2.Speech.ListRecognizers] method. +message ListRecognizersRequest { + // Required. The project and location of Recognizers to list. The expected + // format is `projects/{project}/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // The maximum number of Recognizers to return. The service may return fewer + // than this value. If unspecified, at most 5 Recognizers will be returned. + // The maximum value is 100; values above 100 will be coerced to 100. + int32 page_size = 2; + + // A page token, received from a previous + // [ListRecognizers][google.cloud.speech.v2.Speech.ListRecognizers] call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // [ListRecognizers][google.cloud.speech.v2.Speech.ListRecognizers] must match + // the call that provided the page token. + string page_token = 3; + + // Whether, or not, to show resources that have been deleted. + bool show_deleted = 4; +} + +// Response message for the +// [ListRecognizers][google.cloud.speech.v2.Speech.ListRecognizers] method. +message ListRecognizersResponse { + // The list of requested Recognizers. + repeated Recognizer recognizers = 1; + + // A token, which can be sent as + // [page_token][google.cloud.speech.v2.ListRecognizersRequest.page_token] to + // retrieve the next page. If this field is omitted, there are no subsequent + // pages. This token expires after 72 hours. + string next_page_token = 2; +} + +// Request message for the +// [GetRecognizer][google.cloud.speech.v2.Speech.GetRecognizer] method. +message GetRecognizerRequest { + // Required. The name of the Recognizer to retrieve. The expected format is + // `projects/{project}/locations/{location}/recognizers/{recognizer}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "speech.googleapis.com/Recognizer" + } + ]; +} + +// Request message for the +// [UpdateRecognizer][google.cloud.speech.v2.Speech.UpdateRecognizer] method. +message UpdateRecognizerRequest { + // Required. The Recognizer to update. + // + // The Recognizer's `name` field is used to identify the Recognizer to update. + // Format: `projects/{project}/locations/{location}/recognizers/{recognizer}`. + Recognizer recognizer = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to update. If empty, all non-default valued fields are + // considered for update. Use `*` to update the entire Recognizer resource. + google.protobuf.FieldMask update_mask = 2; + + // If set, validate the request and preview the updated Recognizer, but do not + // actually update it. + bool validate_only = 4; +} + +// Request message for the +// [DeleteRecognizer][google.cloud.speech.v2.Speech.DeleteRecognizer] method. +message DeleteRecognizerRequest { + // Required. The name of the Recognizer to delete. + // Format: `projects/{project}/locations/{location}/recognizers/{recognizer}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "speech.googleapis.com/Recognizer" + } + ]; + + // If set, validate the request and preview the deleted Recognizer, but do not + // actually delete it. + bool validate_only = 2; + + // If set to true, and the Recognizer is not found, the request will succeed + // and be a no-op (no Operation is recorded in this case). + bool allow_missing = 4; + + // This checksum is computed by the server based on the value of other + // fields. This may be sent on update, undelete, and delete requests to ensure + // the client has an up-to-date value before proceeding. + string etag = 3; +} + +// Request message for the +// [UndeleteRecognizer][google.cloud.speech.v2.Speech.UndeleteRecognizer] +// method. +message UndeleteRecognizerRequest { + // Required. The name of the Recognizer to undelete. + // Format: `projects/{project}/locations/{location}/recognizers/{recognizer}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "speech.googleapis.com/Recognizer" + } + ]; + + // If set, validate the request and preview the undeleted Recognizer, but do + // not actually undelete it. + bool validate_only = 3; + + // This checksum is computed by the server based on the value of other + // fields. This may be sent on update, undelete, and delete requests to ensure + // the client has an up-to-date value before proceeding. + string etag = 4; +} + +// A Recognizer message. Stores recognition configuration and metadata. +message Recognizer { + option (google.api.resource) = { + type: "speech.googleapis.com/Recognizer" + pattern: "projects/{project}/locations/{location}/recognizers/{recognizer}" + style: DECLARATIVE_FRIENDLY + }; + + // Set of states that define the lifecycle of a Recognizer. + enum State { + // The default value. This value is used if the state is omitted. + STATE_UNSPECIFIED = 0; + + // The Recognizer is active and ready for use. + ACTIVE = 2; + + // This Recognizer has been deleted. + DELETED = 4; + } + + // Output only. Identifier. The resource name of the Recognizer. + // Format: `projects/{project}/locations/{location}/recognizers/{recognizer}`. + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = IDENTIFIER + ]; + + // Output only. System-assigned unique identifier for the Recognizer. + string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // User-settable, human-readable name for the Recognizer. Must be 63 + // characters or less. + string display_name = 3; + + // Optional. This field is now deprecated. Prefer the + // [`model`][google.cloud.speech.v2.RecognitionConfig.model] field in the + // [`RecognitionConfig`][google.cloud.speech.v2.RecognitionConfig] message. + // + // Which model to use for recognition requests. Select the model best suited + // to your domain to get best results. + // + // Guidance for choosing which model to use can be found in the [Transcription + // Models + // Documentation](https://cloud.google.com/speech-to-text/v2/docs/transcription-model) + // and the models supported in each region can be found in the [Table Of + // Supported + // Models](https://cloud.google.com/speech-to-text/v2/docs/speech-to-text-supported-languages). + string model = 4 [deprecated = true, (google.api.field_behavior) = OPTIONAL]; + + // Optional. This field is now deprecated. Prefer the + // [`language_codes`][google.cloud.speech.v2.RecognitionConfig.language_codes] + // field in the + // [`RecognitionConfig`][google.cloud.speech.v2.RecognitionConfig] message. + // + // The language of the supplied audio as a + // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. + // + // Supported languages for each model are listed in the [Table of Supported + // Models](https://cloud.google.com/speech-to-text/v2/docs/speech-to-text-supported-languages). + // + // If additional languages are provided, recognition result will contain + // recognition in the most likely language detected. The recognition result + // will include the language tag of the language detected in the audio. + // When you create or update a Recognizer, these values are + // stored in normalized BCP-47 form. For example, "en-us" is stored as + // "en-US". + repeated string language_codes = 17 + [deprecated = true, (google.api.field_behavior) = OPTIONAL]; + + // Default configuration to use for requests with this Recognizer. + // This can be overwritten by inline configuration in the + // [RecognizeRequest.config][google.cloud.speech.v2.RecognizeRequest.config] + // field. + RecognitionConfig default_recognition_config = 6; + + // Allows users to store small amounts of arbitrary data. + // Both the key and the value must be 63 characters or less each. + // At most 100 annotations. + map annotations = 7; + + // Output only. The Recognizer lifecycle state. + State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Creation time. + google.protobuf.Timestamp create_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The most recent time this Recognizer was modified. + google.protobuf.Timestamp update_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which this Recognizer was requested for deletion. + google.protobuf.Timestamp delete_time = 11 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which this Recognizer will be purged. + google.protobuf.Timestamp expire_time = 14 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. This checksum is computed by the server based on the value of + // other fields. This may be sent on update, undelete, and delete requests to + // ensure the client has an up-to-date value before proceeding. + string etag = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Whether or not this Recognizer is in the process of being + // updated. + bool reconciling = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The [KMS key + // name](https://cloud.google.com/kms/docs/resource-hierarchy#keys) with which + // the Recognizer is encrypted. The expected format is + // `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`. + string kms_key_name = 15 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + } + ]; + + // Output only. The [KMS key version + // name](https://cloud.google.com/kms/docs/resource-hierarchy#key_versions) + // with which the Recognizer is encrypted. The expected format is + // `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}`. + string kms_key_version_name = 16 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKeyVersion" + } + ]; +} + +// Automatically detected decoding parameters. +// Supported for the following encodings: +// +// * WAV_LINEAR16: 16-bit signed little-endian PCM samples in a WAV container. +// +// * WAV_MULAW: 8-bit companded mulaw samples in a WAV container. +// +// * WAV_ALAW: 8-bit companded alaw samples in a WAV container. +// +// * RFC4867_5_AMR: AMR frames with an rfc4867.5 header. +// +// * RFC4867_5_AMRWB: AMR-WB frames with an rfc4867.5 header. +// +// * FLAC: FLAC frames in the "native FLAC" container format. +// +// * MP3: MPEG audio frames with optional (ignored) ID3 metadata. +// +// * OGG_OPUS: Opus audio frames in an Ogg container. +// +// * WEBM_OPUS: Opus audio frames in a WebM container. +// +// * MP4_AAC: AAC audio frames in an MP4 container. +// +// * M4A_AAC: AAC audio frames in an M4A container. +// +// * MOV_AAC: AAC audio frames in an MOV container. +message AutoDetectDecodingConfig {} + +// Explicitly specified decoding parameters. +message ExplicitDecodingConfig { + // Supported audio data encodings. + enum AudioEncoding { + // Default value. This value is unused. + AUDIO_ENCODING_UNSPECIFIED = 0; + + // Headerless 16-bit signed little-endian PCM samples. + LINEAR16 = 1; + + // Headerless 8-bit companded mulaw samples. + MULAW = 2; + + // Headerless 8-bit companded alaw samples. + ALAW = 3; + + // AMR frames with an rfc4867.5 header. + AMR = 4; + + // AMR-WB frames with an rfc4867.5 header. + AMR_WB = 5; + + // FLAC frames in the "native FLAC" container format. + FLAC = 6; + + // MPEG audio frames with optional (ignored) ID3 metadata. + MP3 = 7; + + // Opus audio frames in an Ogg container. + OGG_OPUS = 8; + + // Opus audio frames in a WebM container. + WEBM_OPUS = 9; + + // AAC audio frames in an MP4 container. + MP4_AAC = 10; + + // AAC audio frames in an M4A container. + M4A_AAC = 11; + + // AAC audio frames in an MOV container. + MOV_AAC = 12; + } + + // Required. Encoding of the audio data sent for recognition. + AudioEncoding encoding = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Sample rate in Hertz of the audio data sent for recognition. + // Valid values are: 8000-48000. 16000 is optimal. For best results, set the + // sampling rate of the audio source to 16000 Hz. If that's not possible, use + // the native sample rate of the audio source (instead of re-sampling). + // Note that this field is marked as OPTIONAL for backward compatibility + // reasons. It is (and has always been) effectively REQUIRED. + int32 sample_rate_hertz = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Number of channels present in the audio data sent for + // recognition. Note that this field is marked as OPTIONAL for backward + // compatibility reasons. It is (and has always been) effectively REQUIRED. + // + // The maximum allowed value is 8. + int32 audio_channel_count = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Configuration to enable speaker diarization. +message SpeakerDiarizationConfig { + // Required. Minimum number of speakers in the conversation. This range gives + // you more flexibility by allowing the system to automatically determine the + // correct number of speakers. + // + // To fix the number of speakers detected in the audio, set + // `min_speaker_count` = `max_speaker_count`. + int32 min_speaker_count = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Maximum number of speakers in the conversation. Valid values are: + // 1-6. Must be >= `min_speaker_count`. This range gives you more flexibility + // by allowing the system to automatically determine the correct number of + // speakers. + int32 max_speaker_count = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Available recognition features. +message RecognitionFeatures { + // Options for how to recognize multi-channel audio. + enum MultiChannelMode { + // Default value for the multi-channel mode. If the audio contains + // multiple channels, only the first channel will be transcribed; other + // channels will be ignored. + MULTI_CHANNEL_MODE_UNSPECIFIED = 0; + + // If selected, each channel in the provided audio is transcribed + // independently. This cannot be selected if the selected + // [model][google.cloud.speech.v2.Recognizer.model] is `latest_short`. + SEPARATE_RECOGNITION_PER_CHANNEL = 1; + } + + // If set to `true`, the server will attempt to filter out profanities, + // replacing all but the initial character in each filtered word with + // asterisks, for instance, "f***". If set to `false` or omitted, profanities + // won't be filtered out. + bool profanity_filter = 1; + + // If `true`, the top result includes a list of words and the start and end + // time offsets (timestamps) for those words. If `false`, no word-level time + // offset information is returned. The default is `false`. + bool enable_word_time_offsets = 2; + + // If `true`, the top result includes a list of words and the confidence for + // those words. If `false`, no word-level confidence information is returned. + // The default is `false`. + bool enable_word_confidence = 3; + + // If `true`, adds punctuation to recognition result hypotheses. This feature + // is only available in select languages. The default `false` value does not + // add punctuation to result hypotheses. + bool enable_automatic_punctuation = 4; + + // The spoken punctuation behavior for the call. If `true`, replaces spoken + // punctuation with the corresponding symbols in the request. For example, + // "how are you question mark" becomes "how are you?". See + // https://cloud.google.com/speech-to-text/docs/spoken-punctuation for + // support. If `false`, spoken punctuation is not replaced. + bool enable_spoken_punctuation = 14; + + // The spoken emoji behavior for the call. If `true`, adds spoken emoji + // formatting for the request. This will replace spoken emojis with the + // corresponding Unicode symbols in the final transcript. If `false`, spoken + // emojis are not replaced. + bool enable_spoken_emojis = 15; + + // Mode for recognizing multi-channel audio. + MultiChannelMode multi_channel_mode = 17; + + // Configuration to enable speaker diarization and set additional + // parameters to make diarization better suited for your application. + // When this is enabled, we send all the words from the beginning of the + // audio for the top alternative in every consecutive STREAMING responses. + // This is done in order to improve our speaker tags as our models learn to + // identify the speakers in the conversation over time. + // For non-streaming requests, the diarization results will be provided only + // in the top alternative of the FINAL SpeechRecognitionResult. + SpeakerDiarizationConfig diarization_config = 9; + + // Maximum number of recognition hypotheses to be returned. + // The server may return fewer than `max_alternatives`. + // Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of + // one. If omitted, will return a maximum of one. + int32 max_alternatives = 16; +} + +// Transcription normalization configuration. Use transcription normalization +// to automatically replace parts of the transcript with phrases of your +// choosing. For StreamingRecognize, this normalization only applies to stable +// partial transcripts (stability > 0.8) and final transcripts. +message TranscriptNormalization { + // A single replacement configuration. + message Entry { + // What to replace. Max length is 100 characters. + string search = 1; + + // What to replace with. Max length is 100 characters. + string replace = 2; + + // Whether the search is case sensitive. + bool case_sensitive = 3; + } + + // A list of replacement entries. We will perform replacement with one entry + // at a time. For example, the second entry in ["cat" => "dog", "mountain cat" + // => "mountain dog"] will never be applied because we will always process the + // first entry before it. At most 100 entries. + repeated Entry entries = 1; +} + +// Translation configuration. Use to translate the given audio into text for the +// desired language. +message TranslationConfig { + // Required. The language code to translate to. + string target_language = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Provides "hints" to the speech recognizer to favor specific words and phrases +// in the results. PhraseSets can be specified as an inline resource, or a +// reference to an existing PhraseSet resource. +message SpeechAdaptation { + // A biasing PhraseSet, which can be either a string referencing the name of + // an existing PhraseSets resource, or an inline definition of a PhraseSet. + message AdaptationPhraseSet { + oneof value { + // The name of an existing PhraseSet resource. The user must have read + // access to the resource and it must not be deleted. + string phrase_set = 1 [(google.api.resource_reference) = { + type: "speech.googleapis.com/PhraseSet" + }]; + + // An inline defined PhraseSet. + PhraseSet inline_phrase_set = 2; + } + } + + // A list of inline or referenced PhraseSets. + repeated AdaptationPhraseSet phrase_sets = 1; + + // A list of inline CustomClasses. Existing CustomClass resources can be + // referenced directly in a PhraseSet. + repeated CustomClass custom_classes = 2; +} + +// Provides information to the Recognizer that specifies how to process the +// recognition request. +message RecognitionConfig { + // Decoding parameters for audio being sent for recognition. + oneof decoding_config { + // Automatically detect decoding parameters. + // Preferred for supported formats. + AutoDetectDecodingConfig auto_decoding_config = 7; + + // Explicitly specified decoding parameters. + // Required if using headerless PCM audio (linear16, mulaw, alaw). + ExplicitDecodingConfig explicit_decoding_config = 8; + } + + // Optional. Which model to use for recognition requests. Select the model + // best suited to your domain to get best results. + // + // Guidance for choosing which model to use can be found in the [Transcription + // Models + // Documentation](https://cloud.google.com/speech-to-text/v2/docs/transcription-model) + // and the models supported in each region can be found in the [Table Of + // Supported + // Models](https://cloud.google.com/speech-to-text/v2/docs/speech-to-text-supported-languages). + string model = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The language of the supplied audio as a + // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. + // Language tags are normalized to BCP-47 before they are used eg "en-us" + // becomes "en-US". + // + // Supported languages for each model are listed in the [Table of Supported + // Models](https://cloud.google.com/speech-to-text/v2/docs/speech-to-text-supported-languages). + // + // If additional languages are provided, recognition result will contain + // recognition in the most likely language detected. The recognition result + // will include the language tag of the language detected in the audio. + repeated string language_codes = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Speech recognition features to enable. + RecognitionFeatures features = 2; + + // Speech adaptation context that weights recognizer predictions for specific + // words and phrases. + SpeechAdaptation adaptation = 6; + + // Optional. Use transcription normalization to automatically replace parts of + // the transcript with phrases of your choosing. For StreamingRecognize, this + // normalization only applies to stable partial transcripts (stability > 0.8) + // and final transcripts. + TranscriptNormalization transcript_normalization = 11 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Optional configuration used to automatically run translation on + // the given audio to the desired language for supported models. + TranslationConfig translation_config = 15 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for the +// [Recognize][google.cloud.speech.v2.Speech.Recognize] method. Either +// `content` or `uri` must be supplied. Supplying both or neither returns +// [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. See [content +// limits](https://cloud.google.com/speech-to-text/quotas#content). +message RecognizeRequest { + // Required. The name of the Recognizer to use during recognition. The + // expected format is + // `projects/{project}/locations/{location}/recognizers/{recognizer}`. The + // {recognizer} segment may be set to `_` to use an empty implicit Recognizer. + string recognizer = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "speech.googleapis.com/Recognizer" + } + ]; + + // Features and audio metadata to use for the Automatic Speech Recognition. + // This field in combination with the + // [config_mask][google.cloud.speech.v2.RecognizeRequest.config_mask] field + // can be used to override parts of the + // [default_recognition_config][google.cloud.speech.v2.Recognizer.default_recognition_config] + // of the Recognizer resource. + RecognitionConfig config = 1; + + // The list of fields in + // [config][google.cloud.speech.v2.RecognizeRequest.config] that override the + // values in the + // [default_recognition_config][google.cloud.speech.v2.Recognizer.default_recognition_config] + // of the recognizer during this recognition request. If no mask is provided, + // all non-default valued fields in + // [config][google.cloud.speech.v2.RecognizeRequest.config] override the + // values in the recognizer for this recognition request. If a mask is + // provided, only the fields listed in the mask override the config in the + // recognizer for this recognition request. If a wildcard (`*`) is provided, + // [config][google.cloud.speech.v2.RecognizeRequest.config] completely + // overrides and replaces the config in the recognizer for this recognition + // request. + google.protobuf.FieldMask config_mask = 8; + + // The audio source, which is either inline content or a Google Cloud + // Storage URI. + oneof audio_source { + // The audio data bytes encoded as specified in + // [RecognitionConfig][google.cloud.speech.v2.RecognitionConfig]. As + // with all bytes fields, proto buffers use a pure binary representation, + // whereas JSON representations use base64. + bytes content = 5; + + // URI that points to a file that contains audio data bytes as specified in + // [RecognitionConfig][google.cloud.speech.v2.RecognitionConfig]. The file + // must not be compressed (for example, gzip). Currently, only Google Cloud + // Storage URIs are supported, which must be specified in the following + // format: `gs://bucket_name/object_name` (other URI formats return + // [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more + // information, see [Request + // URIs](https://cloud.google.com/storage/docs/reference-uris). + string uri = 6; + } +} + +// Metadata about the recognition request and response. +message RecognitionResponseMetadata { + // Global request identifier auto-generated by the API. + string request_id = 9 [(google.api.field_info).format = UUID4]; + + // When available, billed audio seconds for the corresponding request. + google.protobuf.Duration total_billed_duration = 6; +} + +// Alternative hypotheses (a.k.a. n-best list). +message SpeechRecognitionAlternative { + // Transcript text representing the words that the user spoke. + string transcript = 1; + + // The confidence estimate between 0.0 and 1.0. A higher number + // indicates an estimated greater likelihood that the recognized words are + // correct. This field is set only for the top alternative of a non-streaming + // result or, of a streaming result where + // [is_final][google.cloud.speech.v2.StreamingRecognitionResult.is_final] is + // set to `true`. This field is not guaranteed to be accurate and users should + // not rely on it to be always provided. The default of 0.0 is a sentinel + // value indicating `confidence` was not set. + float confidence = 2; + + // A list of word-specific information for each recognized word. + // When the + // [SpeakerDiarizationConfig][google.cloud.speech.v2.SpeakerDiarizationConfig] + // is set, you will see all the words from the beginning of the audio. + repeated WordInfo words = 3; +} + +// Word-specific information for recognized words. +message WordInfo { + // Time offset relative to the beginning of the audio, + // and corresponding to the start of the spoken word. + // This field is only set if + // [enable_word_time_offsets][google.cloud.speech.v2.RecognitionFeatures.enable_word_time_offsets] + // is `true` and only in the top hypothesis. This is an experimental feature + // and the accuracy of the time offset can vary. + google.protobuf.Duration start_offset = 1; + + // Time offset relative to the beginning of the audio, + // and corresponding to the end of the spoken word. + // This field is only set if + // [enable_word_time_offsets][google.cloud.speech.v2.RecognitionFeatures.enable_word_time_offsets] + // is `true` and only in the top hypothesis. This is an experimental feature + // and the accuracy of the time offset can vary. + google.protobuf.Duration end_offset = 2; + + // The word corresponding to this set of information. + string word = 3; + + // The confidence estimate between 0.0 and 1.0. A higher number + // indicates an estimated greater likelihood that the recognized words are + // correct. This field is set only for the top alternative of a non-streaming + // result or, of a streaming result where + // [is_final][google.cloud.speech.v2.StreamingRecognitionResult.is_final] is + // set to `true`. This field is not guaranteed to be accurate and users should + // not rely on it to be always provided. The default of 0.0 is a sentinel + // value indicating `confidence` was not set. + float confidence = 4; + + // A distinct label is assigned for every speaker within the audio. This field + // specifies which one of those speakers was detected to have spoken this + // word. `speaker_label` is set if + // [SpeakerDiarizationConfig][google.cloud.speech.v2.SpeakerDiarizationConfig] + // is given and only in the top alternative. + string speaker_label = 6; +} + +// A speech recognition result corresponding to a portion of the audio. +message SpeechRecognitionResult { + // May contain one or more recognition hypotheses. These alternatives are + // ordered in terms of accuracy, with the top (first) alternative being the + // most probable, as ranked by the recognizer. + repeated SpeechRecognitionAlternative alternatives = 1; + + // For multi-channel audio, this is the channel number corresponding to the + // recognized result for the audio from that channel. + // For `audio_channel_count` = `N`, its output values can range from `1` to + // `N`. + int32 channel_tag = 2; + + // Time offset of the end of this result relative to the beginning of the + // audio. + google.protobuf.Duration result_end_offset = 4; + + // Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + // language tag of the language in this result. This language code was + // detected to have the most likelihood of being spoken in the audio. + string language_code = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Response message for the +// [Recognize][google.cloud.speech.v2.Speech.Recognize] method. +message RecognizeResponse { + // Sequential list of transcription results corresponding to sequential + // portions of audio. + repeated SpeechRecognitionResult results = 3; + + // Metadata about the recognition. + RecognitionResponseMetadata metadata = 2; +} + +// Available recognition features specific to streaming recognition requests. +message StreamingRecognitionFeatures { + // Events that a timeout can be set on for voice activity. + message VoiceActivityTimeout { + // Duration to timeout the stream if no speech begins. If this is set and + // no speech is detected in this duration at the start of the stream, the + // server will close the stream. + google.protobuf.Duration speech_start_timeout = 1; + + // Duration to timeout the stream after speech ends. If this is set and no + // speech is detected in this duration after speech was detected, the server + // will close the stream. + google.protobuf.Duration speech_end_timeout = 2; + } + + // If `true`, responses with voice activity speech events will be returned as + // they are detected. + bool enable_voice_activity_events = 1; + + // Whether or not to stream interim results to the client. If set to true, + // interim results will be streamed to the client. Otherwise, only the final + // response will be streamed back. + bool interim_results = 2; + + // If set, the server will automatically close the stream after the specified + // duration has elapsed after the last VOICE_ACTIVITY speech event has been + // sent. The field `voice_activity_events` must also be set to true. + VoiceActivityTimeout voice_activity_timeout = 3; +} + +// Provides configuration information for the StreamingRecognize request. +message StreamingRecognitionConfig { + // Required. Features and audio metadata to use for the Automatic Speech + // Recognition. This field in combination with the + // [config_mask][google.cloud.speech.v2.StreamingRecognitionConfig.config_mask] + // field can be used to override parts of the + // [default_recognition_config][google.cloud.speech.v2.Recognizer.default_recognition_config] + // of the Recognizer resource. + RecognitionConfig config = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields in + // [config][google.cloud.speech.v2.StreamingRecognitionConfig.config] that + // override the values in the + // [default_recognition_config][google.cloud.speech.v2.Recognizer.default_recognition_config] + // of the recognizer during this recognition request. If no mask is provided, + // all non-default valued fields in + // [config][google.cloud.speech.v2.StreamingRecognitionConfig.config] override + // the values in the Recognizer for this recognition request. If a mask is + // provided, only the fields listed in the mask override the config in the + // Recognizer for this recognition request. If a wildcard (`*`) is provided, + // [config][google.cloud.speech.v2.StreamingRecognitionConfig.config] + // completely overrides and replaces the config in the recognizer for this + // recognition request. + google.protobuf.FieldMask config_mask = 3; + + // Speech recognition features to enable specific to streaming audio + // recognition requests. + StreamingRecognitionFeatures streaming_features = 2; +} + +// Request message for the +// [StreamingRecognize][google.cloud.speech.v2.Speech.StreamingRecognize] +// method. Multiple +// [StreamingRecognizeRequest][google.cloud.speech.v2.StreamingRecognizeRequest] +// messages are sent in one call. +// +// If the [Recognizer][google.cloud.speech.v2.Recognizer] referenced by +// [recognizer][google.cloud.speech.v2.StreamingRecognizeRequest.recognizer] +// contains a fully specified request configuration then the stream may only +// contain messages with only +// [audio][google.cloud.speech.v2.StreamingRecognizeRequest.audio] set. +// +// Otherwise the first message must contain a +// [recognizer][google.cloud.speech.v2.StreamingRecognizeRequest.recognizer] and +// a +// [streaming_config][google.cloud.speech.v2.StreamingRecognizeRequest.streaming_config] +// message that together fully specify the request configuration and must not +// contain [audio][google.cloud.speech.v2.StreamingRecognizeRequest.audio]. All +// subsequent messages must only have +// [audio][google.cloud.speech.v2.StreamingRecognizeRequest.audio] set. +message StreamingRecognizeRequest { + // Required. The name of the Recognizer to use during recognition. The + // expected format is + // `projects/{project}/locations/{location}/recognizers/{recognizer}`. The + // {recognizer} segment may be set to `_` to use an empty implicit Recognizer. + string recognizer = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "speech.googleapis.com/Recognizer" + } + ]; + + oneof streaming_request { + // StreamingRecognitionConfig to be used in this recognition attempt. + // If provided, it will override the default RecognitionConfig stored in the + // Recognizer. + StreamingRecognitionConfig streaming_config = 6; + + // Inline audio bytes to be Recognized. + // Maximum size for this field is 15 KB per request. + bytes audio = 5; + } +} + +// Request message for the +// [BatchRecognize][google.cloud.speech.v2.Speech.BatchRecognize] +// method. +message BatchRecognizeRequest { + // Possible processing strategies for batch requests. + enum ProcessingStrategy { + // Default value for the processing strategy. The request is processed as + // soon as its received. + PROCESSING_STRATEGY_UNSPECIFIED = 0; + + // If selected, processes the request during lower utilization periods for a + // price discount. The request is fulfilled within 24 hours. + DYNAMIC_BATCHING = 1; + } + + // Required. The name of the Recognizer to use during recognition. The + // expected format is + // `projects/{project}/locations/{location}/recognizers/{recognizer}`. The + // {recognizer} segment may be set to `_` to use an empty implicit Recognizer. + string recognizer = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "speech.googleapis.com/Recognizer" + } + ]; + + // Features and audio metadata to use for the Automatic Speech Recognition. + // This field in combination with the + // [config_mask][google.cloud.speech.v2.BatchRecognizeRequest.config_mask] + // field can be used to override parts of the + // [default_recognition_config][google.cloud.speech.v2.Recognizer.default_recognition_config] + // of the Recognizer resource. + RecognitionConfig config = 4; + + // The list of fields in + // [config][google.cloud.speech.v2.BatchRecognizeRequest.config] that override + // the values in the + // [default_recognition_config][google.cloud.speech.v2.Recognizer.default_recognition_config] + // of the recognizer during this recognition request. If no mask is provided, + // all given fields in + // [config][google.cloud.speech.v2.BatchRecognizeRequest.config] override the + // values in the recognizer for this recognition request. If a mask is + // provided, only the fields listed in the mask override the config in the + // recognizer for this recognition request. If a wildcard (`*`) is provided, + // [config][google.cloud.speech.v2.BatchRecognizeRequest.config] completely + // overrides and replaces the config in the recognizer for this recognition + // request. + google.protobuf.FieldMask config_mask = 5; + + // Audio files with file metadata for ASR. + // The maximum number of files allowed to be specified is 15. + repeated BatchRecognizeFileMetadata files = 3; + + // Configuration options for where to output the transcripts of each file. + RecognitionOutputConfig recognition_output_config = 6; + + // Processing strategy to use for this request. + ProcessingStrategy processing_strategy = 7; +} + +// Output configurations for Cloud Storage. +message GcsOutputConfig { + // The Cloud Storage URI prefix with which recognition results will be + // written. + string uri = 1; +} + +// Output configurations for inline response. +message InlineOutputConfig {} + +// Output configurations for serialized `BatchRecognizeResults` protos. +message NativeOutputFileFormatConfig {} + +// Output configurations for [WebVTT](https://www.w3.org/TR/webvtt1/) formatted +// subtitle file. +message VttOutputFileFormatConfig {} + +// Output configurations [SubRip +// Text](https://www.matroska.org/technical/subtitles.html#srt-subtitles) +// formatted subtitle file. +message SrtOutputFileFormatConfig {} + +// Configuration for the format of the results stored to `output`. +message OutputFormatConfig { + // Configuration for the native output format. If this field is set or if no + // other output format field is set, then transcripts will be written to the + // sink in the native format. + NativeOutputFileFormatConfig native = 1; + + // Configuration for the VTT output format. If this field is set, then + // transcripts will be written to the sink in the VTT format. + VttOutputFileFormatConfig vtt = 2; + + // Configuration for the SRT output format. If this field is set, then + // transcripts will be written to the sink in the SRT format. + SrtOutputFileFormatConfig srt = 3; +} + +// Configuration options for the output(s) of recognition. +message RecognitionOutputConfig { + oneof output { + // If this message is populated, recognition results are written to the + // provided Google Cloud Storage URI. + GcsOutputConfig gcs_output_config = 1; + + // If this message is populated, recognition results are provided in the + // [BatchRecognizeResponse][google.cloud.speech.v2.BatchRecognizeResponse] + // message of the Operation when completed. This is only supported when + // calling [BatchRecognize][google.cloud.speech.v2.Speech.BatchRecognize] + // with just one audio file. + InlineOutputConfig inline_response_config = 2; + } + + // Optional. Configuration for the format of the results stored to `output`. + // If unspecified transcripts will be written in the `NATIVE` format only. + OutputFormatConfig output_format_config = 3 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [BatchRecognize][google.cloud.speech.v2.Speech.BatchRecognize] that is +// packaged into a longrunning [Operation][google.longrunning.Operation]. +message BatchRecognizeResponse { + // Map from filename to the final result for that file. + map results = 1; + + // When available, billed audio seconds for the corresponding request. + google.protobuf.Duration total_billed_duration = 2; +} + +// Output type for Cloud Storage of BatchRecognize transcripts. Though this +// proto isn't returned in this API anywhere, the Cloud Storage transcripts will +// be this proto serialized and should be parsed as such. +message BatchRecognizeResults { + // Sequential list of transcription results corresponding to sequential + // portions of audio. + repeated SpeechRecognitionResult results = 1; + + // Metadata about the recognition. + RecognitionResponseMetadata metadata = 2; +} + +// Final results written to Cloud Storage. +message CloudStorageResult { + // The Cloud Storage URI to which recognition results were written. + string uri = 1; + + // The Cloud Storage URI to which recognition results were written as VTT + // formatted captions. This is populated only when `VTT` output is requested. + string vtt_format_uri = 2; + + // The Cloud Storage URI to which recognition results were written as SRT + // formatted captions. This is populated only when `SRT` output is requested. + string srt_format_uri = 3; +} + +// Final results returned inline in the recognition response. +message InlineResult { + // The transcript for the audio file. + BatchRecognizeResults transcript = 1; + + // The transcript for the audio file as VTT formatted captions. This is + // populated only when `VTT` output is requested. + string vtt_captions = 2; + + // The transcript for the audio file as SRT formatted captions. This is + // populated only when `SRT` output is requested. + string srt_captions = 3; +} + +// Final results for a single file. +message BatchRecognizeFileResult { + // Error if one was encountered. + google.rpc.Status error = 2; + + RecognitionResponseMetadata metadata = 3; + + oneof result { + // Recognition results written to Cloud Storage. This is + // populated only when + // [GcsOutputConfig][google.cloud.speech.v2.GcsOutputConfig] is set in + // the + // [RecognitionOutputConfig][[google.cloud.speech.v2.RecognitionOutputConfig]. + CloudStorageResult cloud_storage_result = 5; + + // Recognition results. This is populated only when + // [InlineOutputConfig][google.cloud.speech.v2.InlineOutputConfig] is set in + // the + // [RecognitionOutputConfig][[google.cloud.speech.v2.RecognitionOutputConfig]. + InlineResult inline_result = 6; + } + + // Deprecated. Use `cloud_storage_result.native_format_uri` instead. + string uri = 1 [deprecated = true]; + + // Deprecated. Use `inline_result.transcript` instead. + BatchRecognizeResults transcript = 4 [deprecated = true]; +} + +// Metadata about transcription for a single file (for example, progress +// percent). +message BatchRecognizeTranscriptionMetadata { + // How much of the file has been transcribed so far. + int32 progress_percent = 1; + + // Error if one was encountered. + google.rpc.Status error = 2; + + // The Cloud Storage URI to which recognition results will be written. + string uri = 3; +} + +// Operation metadata for +// [BatchRecognize][google.cloud.speech.v2.Speech.BatchRecognize]. +message BatchRecognizeMetadata { + // Map from provided filename to the transcription metadata for that file. + map transcription_metadata = 1; +} + +// Metadata about a single file in a batch for BatchRecognize. +message BatchRecognizeFileMetadata { + // The audio source, which is a Google Cloud Storage URI. + oneof audio_source { + // Cloud Storage URI for the audio file. + string uri = 1; + } + + // Features and audio metadata to use for the Automatic Speech Recognition. + // This field in combination with the + // [config_mask][google.cloud.speech.v2.BatchRecognizeFileMetadata.config_mask] + // field can be used to override parts of the + // [default_recognition_config][google.cloud.speech.v2.Recognizer.default_recognition_config] + // of the Recognizer resource as well as the + // [config][google.cloud.speech.v2.BatchRecognizeRequest.config] at the + // request level. + RecognitionConfig config = 4; + + // The list of fields in + // [config][google.cloud.speech.v2.BatchRecognizeFileMetadata.config] that + // override the values in the + // [default_recognition_config][google.cloud.speech.v2.Recognizer.default_recognition_config] + // of the recognizer during this recognition request. If no mask is provided, + // all non-default valued fields in + // [config][google.cloud.speech.v2.BatchRecognizeFileMetadata.config] override + // the values in the recognizer for this recognition request. If a mask is + // provided, only the fields listed in the mask override the config in the + // recognizer for this recognition request. If a wildcard (`*`) is provided, + // [config][google.cloud.speech.v2.BatchRecognizeFileMetadata.config] + // completely overrides and replaces the config in the recognizer for this + // recognition request. + google.protobuf.FieldMask config_mask = 5; +} + +// A streaming speech recognition result corresponding to a portion of the audio +// that is currently being processed. +message StreamingRecognitionResult { + // May contain one or more recognition hypotheses. These alternatives are + // ordered in terms of accuracy, with the top (first) alternative being the + // most probable, as ranked by the recognizer. + repeated SpeechRecognitionAlternative alternatives = 1; + + // If `false`, this + // [StreamingRecognitionResult][google.cloud.speech.v2.StreamingRecognitionResult] + // represents an interim result that may change. If `true`, this is the final + // time the speech service will return this particular + // [StreamingRecognitionResult][google.cloud.speech.v2.StreamingRecognitionResult], + // the recognizer will not return any further hypotheses for this portion of + // the transcript and corresponding audio. + bool is_final = 2; + + // An estimate of the likelihood that the recognizer will not change its guess + // about this interim result. Values range from 0.0 (completely unstable) + // to 1.0 (completely stable). This field is only provided for interim results + // ([is_final][google.cloud.speech.v2.StreamingRecognitionResult.is_final]=`false`). + // The default of 0.0 is a sentinel value indicating `stability` was not set. + float stability = 3; + + // Time offset of the end of this result relative to the beginning of the + // audio. + google.protobuf.Duration result_end_offset = 4; + + // For multi-channel audio, this is the channel number corresponding to the + // recognized result for the audio from that channel. + // For + // `audio_channel_count` = `N`, its output values can range from `1` to `N`. + int32 channel_tag = 5; + + // Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + // language tag of the language in this result. This language code was + // detected to have the most likelihood of being spoken in the audio. + string language_code = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// `StreamingRecognizeResponse` is the only message returned to the client by +// `StreamingRecognize`. A series of zero or more `StreamingRecognizeResponse` +// messages are streamed back to the client. If there is no recognizable +// audio then no messages are streamed back to the client. +// +// Here are some examples of `StreamingRecognizeResponse`s that might +// be returned while processing audio: +// +// 1. results { alternatives { transcript: "tube" } stability: 0.01 } +// +// 2. results { alternatives { transcript: "to be a" } stability: 0.01 } +// +// 3. results { alternatives { transcript: "to be" } stability: 0.9 } +// results { alternatives { transcript: " or not to be" } stability: 0.01 } +// +// 4. results { alternatives { transcript: "to be or not to be" +// confidence: 0.92 } +// alternatives { transcript: "to bee or not to bee" } +// is_final: true } +// +// 5. results { alternatives { transcript: " that's" } stability: 0.01 } +// +// 6. results { alternatives { transcript: " that is" } stability: 0.9 } +// results { alternatives { transcript: " the question" } stability: 0.01 } +// +// 7. results { alternatives { transcript: " that is the question" +// confidence: 0.98 } +// alternatives { transcript: " that was the question" } +// is_final: true } +// +// Notes: +// +// - Only two of the above responses #4 and #7 contain final results; they are +// indicated by `is_final: true`. Concatenating these together generates the +// full transcript: "to be or not to be that is the question". +// +// - The others contain interim `results`. #3 and #6 contain two interim +// `results`: the first portion has a high stability and is less likely to +// change; the second portion has a low stability and is very likely to +// change. A UI designer might choose to show only high stability `results`. +// +// - The specific `stability` and `confidence` values shown above are only for +// illustrative purposes. Actual values may vary. +// +// - In each response, only one of these fields will be set: +// `error`, +// `speech_event_type`, or +// one or more (repeated) `results`. +message StreamingRecognizeResponse { + // Indicates the type of speech event. + enum SpeechEventType { + // No speech event specified. + SPEECH_EVENT_TYPE_UNSPECIFIED = 0; + + // This event indicates that the server has detected the end of the user's + // speech utterance and expects no additional speech. Therefore, the server + // will not process additional audio and will close the gRPC bidirectional + // stream. This event is only sent if there was a force cutoff due to + // silence being detected early. This event is only available through the + // `latest_short` [model][google.cloud.speech.v2.Recognizer.model]. + END_OF_SINGLE_UTTERANCE = 1; + + // This event indicates that the server has detected the beginning of human + // voice activity in the stream. This event can be returned multiple times + // if speech starts and stops repeatedly throughout the stream. This event + // is only sent if `voice_activity_events` is set to true. + SPEECH_ACTIVITY_BEGIN = 2; + + // This event indicates that the server has detected the end of human voice + // activity in the stream. This event can be returned multiple times if + // speech starts and stops repeatedly throughout the stream. This event is + // only sent if `voice_activity_events` is set to true. + SPEECH_ACTIVITY_END = 3; + } + + // This repeated list contains zero or more results that + // correspond to consecutive portions of the audio currently being processed. + // It contains zero or one + // [is_final][google.cloud.speech.v2.StreamingRecognitionResult.is_final]=`true` + // result (the newly settled portion), followed by zero or more + // [is_final][google.cloud.speech.v2.StreamingRecognitionResult.is_final]=`false` + // results (the interim results). + repeated StreamingRecognitionResult results = 6; + + // Indicates the type of speech event. + SpeechEventType speech_event_type = 3; + + // Time offset between the beginning of the audio and event emission. + google.protobuf.Duration speech_event_offset = 7; + + // Metadata about the recognition. + RecognitionResponseMetadata metadata = 5; +} + +// Message representing the config for the Speech-to-Text API. This includes an +// optional [KMS key](https://cloud.google.com/kms/docs/resource-hierarchy#keys) +// with which incoming data will be encrypted. +message Config { + option (google.api.resource) = { + type: "speech.googleapis.com/Config" + pattern: "projects/{project}/locations/{location}/config" + }; + + // Output only. Identifier. The name of the config resource. There is exactly + // one config resource per project per location. The expected format is + // `projects/{project}/locations/{location}/config`. + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = IDENTIFIER + ]; + + // Optional. An optional [KMS key + // name](https://cloud.google.com/kms/docs/resource-hierarchy#keys) that if + // present, will be used to encrypt Speech-to-Text resources at-rest. Updating + // this key will not encrypt existing resources using this key; only new + // resources will be encrypted using this key. The expected format is + // `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`. + string kms_key_name = 2 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + } + ]; + + // Output only. The most recent time this resource was modified. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for the +// [GetConfig][google.cloud.speech.v2.Speech.GetConfig] method. +message GetConfigRequest { + // Required. The name of the config to retrieve. There is exactly one config + // resource per project per location. The expected format is + // `projects/{project}/locations/{location}/config`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "speech.googleapis.com/Config" } + ]; +} + +// Request message for the +// [UpdateConfig][google.cloud.speech.v2.Speech.UpdateConfig] method. +message UpdateConfigRequest { + // Required. The config to update. + // + // The config's `name` field is used to identify the config to be updated. + // The expected format is `projects/{project}/locations/{location}/config`. + Config config = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// CustomClass for biasing in speech recognition. Used to define a set of words +// or phrases that represents a common concept or theme likely to appear in your +// audio, for example a list of passenger ship names. +message CustomClass { + option (google.api.resource) = { + type: "speech.googleapis.com/CustomClass" + pattern: "projects/{project}/locations/{location}/customClasses/{custom_class}" + style: DECLARATIVE_FRIENDLY + }; + + // An item of the class. + message ClassItem { + // The class item's value. + string value = 1; + } + + // Set of states that define the lifecycle of a CustomClass. + enum State { + // Unspecified state. This is only used/useful for distinguishing + // unset values. + STATE_UNSPECIFIED = 0; + + // The normal and active state. + ACTIVE = 2; + + // This CustomClass has been deleted. + DELETED = 4; + } + + // Output only. Identifier. The resource name of the CustomClass. + // Format: + // `projects/{project}/locations/{location}/customClasses/{custom_class}`. + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = IDENTIFIER + ]; + + // Output only. System-assigned unique identifier for the CustomClass. + string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. User-settable, human-readable name for the CustomClass. Must be + // 63 characters or less. + string display_name = 4 [(google.api.field_behavior) = OPTIONAL]; + + // A collection of class items. + repeated ClassItem items = 5; + + // Output only. The CustomClass lifecycle state. + State state = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Creation time. + google.protobuf.Timestamp create_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The most recent time this resource was modified. + google.protobuf.Timestamp update_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which this resource was requested for deletion. + google.protobuf.Timestamp delete_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which this resource will be purged. + google.protobuf.Timestamp expire_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Allows users to store small amounts of arbitrary data. + // Both the key and the value must be 63 characters or less each. + // At most 100 annotations. + map annotations = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. This checksum is computed by the server based on the value of + // other fields. This may be sent on update, undelete, and delete requests to + // ensure the client has an up-to-date value before proceeding. + string etag = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Whether or not this CustomClass is in the process of being + // updated. + bool reconciling = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The [KMS key + // name](https://cloud.google.com/kms/docs/resource-hierarchy#keys) with which + // the CustomClass is encrypted. The expected format is + // `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`. + string kms_key_name = 13 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + } + ]; + + // Output only. The [KMS key version + // name](https://cloud.google.com/kms/docs/resource-hierarchy#key_versions) + // with which the CustomClass is encrypted. The expected format is + // `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}`. + string kms_key_version_name = 14 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKeyVersion" + } + ]; +} + +// PhraseSet for biasing in speech recognition. A PhraseSet is used to provide +// "hints" to the speech recognizer to favor specific words and phrases in the +// results. +message PhraseSet { + option (google.api.resource) = { + type: "speech.googleapis.com/PhraseSet" + pattern: "projects/{project}/locations/{location}/phraseSets/{phrase_set}" + style: DECLARATIVE_FRIENDLY + }; + + // A Phrase contains words and phrase "hints" so that the speech recognition + // is more likely to recognize them. This can be used to improve the accuracy + // for specific words and phrases, for example, if specific commands are + // typically spoken by the user. This can also be used to add additional words + // to the vocabulary of the recognizer. + // + // List items can also include CustomClass references containing groups of + // words that represent common concepts that occur in natural language. + message Phrase { + // The phrase itself. + string value = 1; + + // Hint Boost. Overrides the boost set at the phrase set level. + // Positive value will increase the probability that a specific phrase will + // be recognized over other similar sounding phrases. The higher the boost, + // the higher the chance of false positive recognition as well. Negative + // boost values would correspond to anti-biasing. Anti-biasing is not + // enabled, so negative boost values will return an error. Boost values must + // be between 0 and 20. Any values outside that range will return an error. + // We recommend using a binary search approach to finding the optimal value + // for your use case as well as adding phrases both with and without boost + // to your requests. + float boost = 2; + } + + // Set of states that define the lifecycle of a PhraseSet. + enum State { + // Unspecified state. This is only used/useful for distinguishing + // unset values. + STATE_UNSPECIFIED = 0; + + // The normal and active state. + ACTIVE = 2; + + // This PhraseSet has been deleted. + DELETED = 4; + } + + // Output only. Identifier. The resource name of the PhraseSet. + // Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}`. + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = IDENTIFIER + ]; + + // Output only. System-assigned unique identifier for the PhraseSet. + string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // A list of word and phrases. + repeated Phrase phrases = 3; + + // Hint Boost. Positive value will increase the probability that a specific + // phrase will be recognized over other similar sounding phrases. The higher + // the boost, the higher the chance of false positive recognition as well. + // Valid `boost` values are between 0 (exclusive) and 20. We recommend using a + // binary search approach to finding the optimal value for your use case as + // well as adding phrases both with and without boost to your requests. + float boost = 4; + + // User-settable, human-readable name for the PhraseSet. Must be 63 + // characters or less. + string display_name = 5; + + // Output only. The PhraseSet lifecycle state. + State state = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Creation time. + google.protobuf.Timestamp create_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The most recent time this resource was modified. + google.protobuf.Timestamp update_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which this resource was requested for deletion. + google.protobuf.Timestamp delete_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which this resource will be purged. + google.protobuf.Timestamp expire_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Allows users to store small amounts of arbitrary data. + // Both the key and the value must be 63 characters or less each. + // At most 100 annotations. + map annotations = 10; + + // Output only. This checksum is computed by the server based on the value of + // other fields. This may be sent on update, undelete, and delete requests to + // ensure the client has an up-to-date value before proceeding. + string etag = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Whether or not this PhraseSet is in the process of being + // updated. + bool reconciling = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The [KMS key + // name](https://cloud.google.com/kms/docs/resource-hierarchy#keys) with which + // the PhraseSet is encrypted. The expected format is + // `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`. + string kms_key_name = 13 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + } + ]; + + // Output only. The [KMS key version + // name](https://cloud.google.com/kms/docs/resource-hierarchy#key_versions) + // with which the PhraseSet is encrypted. The expected format is + // `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}`. + string kms_key_version_name = 14 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKeyVersion" + } + ]; +} + +// Request message for the +// [CreateCustomClass][google.cloud.speech.v2.Speech.CreateCustomClass] method. +message CreateCustomClassRequest { + // Required. The CustomClass to create. + CustomClass custom_class = 1 [(google.api.field_behavior) = REQUIRED]; + + // If set, validate the request and preview the CustomClass, but do not + // actually create it. + bool validate_only = 2; + + // The ID to use for the CustomClass, which will become the final component of + // the CustomClass's resource name. + // + // This value should be 4-63 characters, and valid characters + // are /[a-z][0-9]-/. + string custom_class_id = 3; + + // Required. The project and location where this CustomClass will be created. + // The expected format is `projects/{project}/locations/{location}`. + string parent = 4 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "speech.googleapis.com/CustomClass" + } + ]; +} + +// Request message for the +// [ListCustomClasses][google.cloud.speech.v2.Speech.ListCustomClasses] method. +message ListCustomClassesRequest { + // Required. The project and location of CustomClass resources to list. The + // expected format is `projects/{project}/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Number of results per requests. A valid page_size ranges from 0 to 100 + // inclusive. If the page_size is zero or unspecified, a page size of 5 will + // be chosen. If the page size exceeds 100, it will be coerced down to 100. + // Note that a call might return fewer results than the requested page size. + int32 page_size = 2; + + // A page token, received from a previous + // [ListCustomClasses][google.cloud.speech.v2.Speech.ListCustomClasses] call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // [ListCustomClasses][google.cloud.speech.v2.Speech.ListCustomClasses] must + // match the call that provided the page token. + string page_token = 3; + + // Whether, or not, to show resources that have been deleted. + bool show_deleted = 4; +} + +// Response message for the +// [ListCustomClasses][google.cloud.speech.v2.Speech.ListCustomClasses] method. +message ListCustomClassesResponse { + // The list of requested CustomClasses. + repeated CustomClass custom_classes = 1; + + // A token, which can be sent as + // [page_token][google.cloud.speech.v2.ListCustomClassesRequest.page_token] to + // retrieve the next page. If this field is omitted, there are no subsequent + // pages. This token expires after 72 hours. + string next_page_token = 2; +} + +// Request message for the +// [GetCustomClass][google.cloud.speech.v2.Speech.GetCustomClass] method. +message GetCustomClassRequest { + // Required. The name of the CustomClass to retrieve. The expected format is + // `projects/{project}/locations/{location}/customClasses/{custom_class}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "speech.googleapis.com/CustomClass" + } + ]; +} + +// Request message for the +// [UpdateCustomClass][google.cloud.speech.v2.Speech.UpdateCustomClass] method. +message UpdateCustomClassRequest { + // Required. The CustomClass to update. + // + // The CustomClass's `name` field is used to identify the CustomClass to + // update. Format: + // `projects/{project}/locations/{location}/customClasses/{custom_class}`. + CustomClass custom_class = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to be updated. If empty, all fields are considered for + // update. + google.protobuf.FieldMask update_mask = 2; + + // If set, validate the request and preview the updated CustomClass, but do + // not actually update it. + bool validate_only = 4; +} + +// Request message for the +// [DeleteCustomClass][google.cloud.speech.v2.Speech.DeleteCustomClass] method. +message DeleteCustomClassRequest { + // Required. The name of the CustomClass to delete. + // Format: + // `projects/{project}/locations/{location}/customClasses/{custom_class}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "speech.googleapis.com/CustomClass" + } + ]; + + // If set, validate the request and preview the deleted CustomClass, but do + // not actually delete it. + bool validate_only = 2; + + // If set to true, and the CustomClass is not found, the request will succeed + // and be a no-op (no Operation is recorded in this case). + bool allow_missing = 4; + + // This checksum is computed by the server based on the value of other + // fields. This may be sent on update, undelete, and delete requests to ensure + // the client has an up-to-date value before proceeding. + string etag = 3; +} + +// Request message for the +// [UndeleteCustomClass][google.cloud.speech.v2.Speech.UndeleteCustomClass] +// method. +message UndeleteCustomClassRequest { + // Required. The name of the CustomClass to undelete. + // Format: + // `projects/{project}/locations/{location}/customClasses/{custom_class}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "speech.googleapis.com/CustomClass" + } + ]; + + // If set, validate the request and preview the undeleted CustomClass, but do + // not actually undelete it. + bool validate_only = 3; + + // This checksum is computed by the server based on the value of other + // fields. This may be sent on update, undelete, and delete requests to ensure + // the client has an up-to-date value before proceeding. + string etag = 4; +} + +// Request message for the +// [CreatePhraseSet][google.cloud.speech.v2.Speech.CreatePhraseSet] method. +message CreatePhraseSetRequest { + // Required. The PhraseSet to create. + PhraseSet phrase_set = 1 [(google.api.field_behavior) = REQUIRED]; + + // If set, validate the request and preview the PhraseSet, but do not + // actually create it. + bool validate_only = 2; + + // The ID to use for the PhraseSet, which will become the final component of + // the PhraseSet's resource name. + // + // This value should be 4-63 characters, and valid characters + // are /[a-z][0-9]-/. + string phrase_set_id = 3; + + // Required. The project and location where this PhraseSet will be created. + // The expected format is `projects/{project}/locations/{location}`. + string parent = 4 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "speech.googleapis.com/PhraseSet" + } + ]; +} + +// Request message for the +// [ListPhraseSets][google.cloud.speech.v2.Speech.ListPhraseSets] method. +message ListPhraseSetsRequest { + // Required. The project and location of PhraseSet resources to list. The + // expected format is `projects/{project}/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // The maximum number of PhraseSets to return. The service may return fewer + // than this value. If unspecified, at most 5 PhraseSets will be returned. + // The maximum value is 100; values above 100 will be coerced to 100. + int32 page_size = 2; + + // A page token, received from a previous + // [ListPhraseSets][google.cloud.speech.v2.Speech.ListPhraseSets] call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // [ListPhraseSets][google.cloud.speech.v2.Speech.ListPhraseSets] must match + // the call that provided the page token. + string page_token = 3; + + // Whether, or not, to show resources that have been deleted. + bool show_deleted = 4; +} + +// Response message for the +// [ListPhraseSets][google.cloud.speech.v2.Speech.ListPhraseSets] method. +message ListPhraseSetsResponse { + // The list of requested PhraseSets. + repeated PhraseSet phrase_sets = 1; + + // A token, which can be sent as + // [page_token][google.cloud.speech.v2.ListPhraseSetsRequest.page_token] to + // retrieve the next page. If this field is omitted, there are no subsequent + // pages. This token expires after 72 hours. + string next_page_token = 2; +} + +// Request message for the +// [GetPhraseSet][google.cloud.speech.v2.Speech.GetPhraseSet] method. +message GetPhraseSetRequest { + // Required. The name of the PhraseSet to retrieve. The expected format is + // `projects/{project}/locations/{location}/phraseSets/{phrase_set}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "speech.googleapis.com/PhraseSet" + } + ]; +} + +// Request message for the +// [UpdatePhraseSet][google.cloud.speech.v2.Speech.UpdatePhraseSet] method. +message UpdatePhraseSetRequest { + // Required. The PhraseSet to update. + // + // The PhraseSet's `name` field is used to identify the PhraseSet to update. + // Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}`. + PhraseSet phrase_set = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to update. If empty, all non-default valued fields are + // considered for update. Use `*` to update the entire PhraseSet resource. + google.protobuf.FieldMask update_mask = 2; + + // If set, validate the request and preview the updated PhraseSet, but do not + // actually update it. + bool validate_only = 4; +} + +// Request message for the +// [DeletePhraseSet][google.cloud.speech.v2.Speech.DeletePhraseSet] method. +message DeletePhraseSetRequest { + // Required. The name of the PhraseSet to delete. + // Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "speech.googleapis.com/PhraseSet" + } + ]; + + // If set, validate the request and preview the deleted PhraseSet, but do not + // actually delete it. + bool validate_only = 2; + + // If set to true, and the PhraseSet is not found, the request will succeed + // and be a no-op (no Operation is recorded in this case). + bool allow_missing = 4; + + // This checksum is computed by the server based on the value of other + // fields. This may be sent on update, undelete, and delete requests to ensure + // the client has an up-to-date value before proceeding. + string etag = 3; +} + +// Request message for the +// [UndeletePhraseSet][google.cloud.speech.v2.Speech.UndeletePhraseSet] +// method. +message UndeletePhraseSetRequest { + // Required. The name of the PhraseSet to undelete. + // Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "speech.googleapis.com/PhraseSet" + } + ]; + + // If set, validate the request and preview the undeleted PhraseSet, but do + // not actually undelete it. + bool validate_only = 3; + + // This checksum is computed by the server based on the value of other + // fields. This may be sent on update, undelete, and delete requests to ensure + // the client has an up-to-date value before proceeding. + string etag = 4; +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/protos/google/cloud/speech/v2/locations_metadata.proto b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/protos/google/cloud/speech/v2/locations_metadata.proto new file mode 100644 index 00000000000..f747b76e733 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/protos/google/cloud/speech/v2/locations_metadata.proto @@ -0,0 +1,80 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.speech.v2; + +option go_package = "cloud.google.com/go/speech/apiv2/speechpb;speechpb"; +option java_multiple_files = true; +option java_outer_classname = "LocationsMetadataProto"; +option java_package = "com.google.cloud.speech.v2"; + +// Representes a singular feature of a model. If the feature is `recognizer`, +// the release_state of the feature represents the release_state of the model +message ModelFeature { + // The name of the feature (Note: the feature can be `recognizer`) + string feature = 1; + + // The release state of the feature + string release_state = 2; +} + +// Represents the collection of features belonging to a model +message ModelFeatures { + // Repeated field that contains all features of the model + repeated ModelFeature model_feature = 1; +} + +// The metadata about the models in a given region for a specific locale. +// Currently this is just the features of the model +message ModelMetadata { + // Map of the model name -> features of that model + map model_features = 1; +} + +// The metadata about locales available in a given region. Currently this is +// just the models that are available for each locale +message LanguageMetadata { + // Map of locale (language code) -> models + map models = 1; +} + +// The access metadata for a particular region. This can be applied if the org +// policy for the given project disallows a particular region. +message AccessMetadata { + // Describes the different types of constraints that can be applied on a + // region. + enum ConstraintType { + // Unspecified constraint applied. + CONSTRAINT_TYPE_UNSPECIFIED = 0; + + // The project's org policy disallows the given region. + RESOURCE_LOCATIONS_ORG_POLICY_CREATE_CONSTRAINT = 1; + } + + // Describes the different types of constraints that are applied. + ConstraintType constraint_type = 1; +} + +// Main metadata for the Locations API for STT V2. Currently this is just the +// metadata about locales, models, and features +message LocationsMetadata { + // Information about available locales, models, and features represented in + // the hierarchical structure of locales -> models -> features + LanguageMetadata languages = 1; + + // Information about access metadata for the region and given project. + AccessMetadata access_metadata = 2; +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/protos/protos.d.ts b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/protos/protos.d.ts new file mode 100644 index 00000000000..0d7d5d390d2 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/protos/protos.d.ts @@ -0,0 +1,16860 @@ +// 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. + +import type {protobuf as $protobuf} from "google-gax"; +import Long = require("long"); +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace speech. */ + namespace speech { + + /** Namespace v2. */ + namespace v2 { + + /** Represents a Speech */ + class Speech extends $protobuf.rpc.Service { + + /** + * Constructs a new Speech service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Speech service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Speech; + + /** + * Calls CreateRecognizer. + * @param request CreateRecognizerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createRecognizer(request: google.cloud.speech.v2.ICreateRecognizerRequest, callback: google.cloud.speech.v2.Speech.CreateRecognizerCallback): void; + + /** + * Calls CreateRecognizer. + * @param request CreateRecognizerRequest message or plain object + * @returns Promise + */ + public createRecognizer(request: google.cloud.speech.v2.ICreateRecognizerRequest): Promise; + + /** + * Calls ListRecognizers. + * @param request ListRecognizersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListRecognizersResponse + */ + public listRecognizers(request: google.cloud.speech.v2.IListRecognizersRequest, callback: google.cloud.speech.v2.Speech.ListRecognizersCallback): void; + + /** + * Calls ListRecognizers. + * @param request ListRecognizersRequest message or plain object + * @returns Promise + */ + public listRecognizers(request: google.cloud.speech.v2.IListRecognizersRequest): Promise; + + /** + * Calls GetRecognizer. + * @param request GetRecognizerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Recognizer + */ + public getRecognizer(request: google.cloud.speech.v2.IGetRecognizerRequest, callback: google.cloud.speech.v2.Speech.GetRecognizerCallback): void; + + /** + * Calls GetRecognizer. + * @param request GetRecognizerRequest message or plain object + * @returns Promise + */ + public getRecognizer(request: google.cloud.speech.v2.IGetRecognizerRequest): Promise; + + /** + * Calls UpdateRecognizer. + * @param request UpdateRecognizerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateRecognizer(request: google.cloud.speech.v2.IUpdateRecognizerRequest, callback: google.cloud.speech.v2.Speech.UpdateRecognizerCallback): void; + + /** + * Calls UpdateRecognizer. + * @param request UpdateRecognizerRequest message or plain object + * @returns Promise + */ + public updateRecognizer(request: google.cloud.speech.v2.IUpdateRecognizerRequest): Promise; + + /** + * Calls DeleteRecognizer. + * @param request DeleteRecognizerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteRecognizer(request: google.cloud.speech.v2.IDeleteRecognizerRequest, callback: google.cloud.speech.v2.Speech.DeleteRecognizerCallback): void; + + /** + * Calls DeleteRecognizer. + * @param request DeleteRecognizerRequest message or plain object + * @returns Promise + */ + public deleteRecognizer(request: google.cloud.speech.v2.IDeleteRecognizerRequest): Promise; + + /** + * Calls UndeleteRecognizer. + * @param request UndeleteRecognizerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public undeleteRecognizer(request: google.cloud.speech.v2.IUndeleteRecognizerRequest, callback: google.cloud.speech.v2.Speech.UndeleteRecognizerCallback): void; + + /** + * Calls UndeleteRecognizer. + * @param request UndeleteRecognizerRequest message or plain object + * @returns Promise + */ + public undeleteRecognizer(request: google.cloud.speech.v2.IUndeleteRecognizerRequest): Promise; + + /** + * Calls Recognize. + * @param request RecognizeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RecognizeResponse + */ + public recognize(request: google.cloud.speech.v2.IRecognizeRequest, callback: google.cloud.speech.v2.Speech.RecognizeCallback): void; + + /** + * Calls Recognize. + * @param request RecognizeRequest message or plain object + * @returns Promise + */ + public recognize(request: google.cloud.speech.v2.IRecognizeRequest): Promise; + + /** + * Calls StreamingRecognize. + * @param request StreamingRecognizeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and StreamingRecognizeResponse + */ + public streamingRecognize(request: google.cloud.speech.v2.IStreamingRecognizeRequest, callback: google.cloud.speech.v2.Speech.StreamingRecognizeCallback): void; + + /** + * Calls StreamingRecognize. + * @param request StreamingRecognizeRequest message or plain object + * @returns Promise + */ + public streamingRecognize(request: google.cloud.speech.v2.IStreamingRecognizeRequest): Promise; + + /** + * Calls BatchRecognize. + * @param request BatchRecognizeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public batchRecognize(request: google.cloud.speech.v2.IBatchRecognizeRequest, callback: google.cloud.speech.v2.Speech.BatchRecognizeCallback): void; + + /** + * Calls BatchRecognize. + * @param request BatchRecognizeRequest message or plain object + * @returns Promise + */ + public batchRecognize(request: google.cloud.speech.v2.IBatchRecognizeRequest): Promise; + + /** + * Calls GetConfig. + * @param request GetConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Config + */ + public getConfig(request: google.cloud.speech.v2.IGetConfigRequest, callback: google.cloud.speech.v2.Speech.GetConfigCallback): void; + + /** + * Calls GetConfig. + * @param request GetConfigRequest message or plain object + * @returns Promise + */ + public getConfig(request: google.cloud.speech.v2.IGetConfigRequest): Promise; + + /** + * Calls UpdateConfig. + * @param request UpdateConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Config + */ + public updateConfig(request: google.cloud.speech.v2.IUpdateConfigRequest, callback: google.cloud.speech.v2.Speech.UpdateConfigCallback): void; + + /** + * Calls UpdateConfig. + * @param request UpdateConfigRequest message or plain object + * @returns Promise + */ + public updateConfig(request: google.cloud.speech.v2.IUpdateConfigRequest): Promise; + + /** + * Calls CreateCustomClass. + * @param request CreateCustomClassRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createCustomClass(request: google.cloud.speech.v2.ICreateCustomClassRequest, callback: google.cloud.speech.v2.Speech.CreateCustomClassCallback): void; + + /** + * Calls CreateCustomClass. + * @param request CreateCustomClassRequest message or plain object + * @returns Promise + */ + public createCustomClass(request: google.cloud.speech.v2.ICreateCustomClassRequest): Promise; + + /** + * Calls ListCustomClasses. + * @param request ListCustomClassesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListCustomClassesResponse + */ + public listCustomClasses(request: google.cloud.speech.v2.IListCustomClassesRequest, callback: google.cloud.speech.v2.Speech.ListCustomClassesCallback): void; + + /** + * Calls ListCustomClasses. + * @param request ListCustomClassesRequest message or plain object + * @returns Promise + */ + public listCustomClasses(request: google.cloud.speech.v2.IListCustomClassesRequest): Promise; + + /** + * Calls GetCustomClass. + * @param request GetCustomClassRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CustomClass + */ + public getCustomClass(request: google.cloud.speech.v2.IGetCustomClassRequest, callback: google.cloud.speech.v2.Speech.GetCustomClassCallback): void; + + /** + * Calls GetCustomClass. + * @param request GetCustomClassRequest message or plain object + * @returns Promise + */ + public getCustomClass(request: google.cloud.speech.v2.IGetCustomClassRequest): Promise; + + /** + * Calls UpdateCustomClass. + * @param request UpdateCustomClassRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateCustomClass(request: google.cloud.speech.v2.IUpdateCustomClassRequest, callback: google.cloud.speech.v2.Speech.UpdateCustomClassCallback): void; + + /** + * Calls UpdateCustomClass. + * @param request UpdateCustomClassRequest message or plain object + * @returns Promise + */ + public updateCustomClass(request: google.cloud.speech.v2.IUpdateCustomClassRequest): Promise; + + /** + * Calls DeleteCustomClass. + * @param request DeleteCustomClassRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteCustomClass(request: google.cloud.speech.v2.IDeleteCustomClassRequest, callback: google.cloud.speech.v2.Speech.DeleteCustomClassCallback): void; + + /** + * Calls DeleteCustomClass. + * @param request DeleteCustomClassRequest message or plain object + * @returns Promise + */ + public deleteCustomClass(request: google.cloud.speech.v2.IDeleteCustomClassRequest): Promise; + + /** + * Calls UndeleteCustomClass. + * @param request UndeleteCustomClassRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public undeleteCustomClass(request: google.cloud.speech.v2.IUndeleteCustomClassRequest, callback: google.cloud.speech.v2.Speech.UndeleteCustomClassCallback): void; + + /** + * Calls UndeleteCustomClass. + * @param request UndeleteCustomClassRequest message or plain object + * @returns Promise + */ + public undeleteCustomClass(request: google.cloud.speech.v2.IUndeleteCustomClassRequest): Promise; + + /** + * Calls CreatePhraseSet. + * @param request CreatePhraseSetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createPhraseSet(request: google.cloud.speech.v2.ICreatePhraseSetRequest, callback: google.cloud.speech.v2.Speech.CreatePhraseSetCallback): void; + + /** + * Calls CreatePhraseSet. + * @param request CreatePhraseSetRequest message or plain object + * @returns Promise + */ + public createPhraseSet(request: google.cloud.speech.v2.ICreatePhraseSetRequest): Promise; + + /** + * Calls ListPhraseSets. + * @param request ListPhraseSetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListPhraseSetsResponse + */ + public listPhraseSets(request: google.cloud.speech.v2.IListPhraseSetsRequest, callback: google.cloud.speech.v2.Speech.ListPhraseSetsCallback): void; + + /** + * Calls ListPhraseSets. + * @param request ListPhraseSetsRequest message or plain object + * @returns Promise + */ + public listPhraseSets(request: google.cloud.speech.v2.IListPhraseSetsRequest): Promise; + + /** + * Calls GetPhraseSet. + * @param request GetPhraseSetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PhraseSet + */ + public getPhraseSet(request: google.cloud.speech.v2.IGetPhraseSetRequest, callback: google.cloud.speech.v2.Speech.GetPhraseSetCallback): void; + + /** + * Calls GetPhraseSet. + * @param request GetPhraseSetRequest message or plain object + * @returns Promise + */ + public getPhraseSet(request: google.cloud.speech.v2.IGetPhraseSetRequest): Promise; + + /** + * Calls UpdatePhraseSet. + * @param request UpdatePhraseSetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updatePhraseSet(request: google.cloud.speech.v2.IUpdatePhraseSetRequest, callback: google.cloud.speech.v2.Speech.UpdatePhraseSetCallback): void; + + /** + * Calls UpdatePhraseSet. + * @param request UpdatePhraseSetRequest message or plain object + * @returns Promise + */ + public updatePhraseSet(request: google.cloud.speech.v2.IUpdatePhraseSetRequest): Promise; + + /** + * Calls DeletePhraseSet. + * @param request DeletePhraseSetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deletePhraseSet(request: google.cloud.speech.v2.IDeletePhraseSetRequest, callback: google.cloud.speech.v2.Speech.DeletePhraseSetCallback): void; + + /** + * Calls DeletePhraseSet. + * @param request DeletePhraseSetRequest message or plain object + * @returns Promise + */ + public deletePhraseSet(request: google.cloud.speech.v2.IDeletePhraseSetRequest): Promise; + + /** + * Calls UndeletePhraseSet. + * @param request UndeletePhraseSetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public undeletePhraseSet(request: google.cloud.speech.v2.IUndeletePhraseSetRequest, callback: google.cloud.speech.v2.Speech.UndeletePhraseSetCallback): void; + + /** + * Calls UndeletePhraseSet. + * @param request UndeletePhraseSetRequest message or plain object + * @returns Promise + */ + public undeletePhraseSet(request: google.cloud.speech.v2.IUndeletePhraseSetRequest): Promise; + } + + namespace Speech { + + /** + * Callback as used by {@link google.cloud.speech.v2.Speech|createRecognizer}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateRecognizerCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.speech.v2.Speech|listRecognizers}. + * @param error Error, if any + * @param [response] ListRecognizersResponse + */ + type ListRecognizersCallback = (error: (Error|null), response?: google.cloud.speech.v2.ListRecognizersResponse) => void; + + /** + * Callback as used by {@link google.cloud.speech.v2.Speech|getRecognizer}. + * @param error Error, if any + * @param [response] Recognizer + */ + type GetRecognizerCallback = (error: (Error|null), response?: google.cloud.speech.v2.Recognizer) => void; + + /** + * Callback as used by {@link google.cloud.speech.v2.Speech|updateRecognizer}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateRecognizerCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.speech.v2.Speech|deleteRecognizer}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteRecognizerCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.speech.v2.Speech|undeleteRecognizer}. + * @param error Error, if any + * @param [response] Operation + */ + type UndeleteRecognizerCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.speech.v2.Speech|recognize}. + * @param error Error, if any + * @param [response] RecognizeResponse + */ + type RecognizeCallback = (error: (Error|null), response?: google.cloud.speech.v2.RecognizeResponse) => void; + + /** + * Callback as used by {@link google.cloud.speech.v2.Speech|streamingRecognize}. + * @param error Error, if any + * @param [response] StreamingRecognizeResponse + */ + type StreamingRecognizeCallback = (error: (Error|null), response?: google.cloud.speech.v2.StreamingRecognizeResponse) => void; + + /** + * Callback as used by {@link google.cloud.speech.v2.Speech|batchRecognize}. + * @param error Error, if any + * @param [response] Operation + */ + type BatchRecognizeCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.speech.v2.Speech|getConfig}. + * @param error Error, if any + * @param [response] Config + */ + type GetConfigCallback = (error: (Error|null), response?: google.cloud.speech.v2.Config) => void; + + /** + * Callback as used by {@link google.cloud.speech.v2.Speech|updateConfig}. + * @param error Error, if any + * @param [response] Config + */ + type UpdateConfigCallback = (error: (Error|null), response?: google.cloud.speech.v2.Config) => void; + + /** + * Callback as used by {@link google.cloud.speech.v2.Speech|createCustomClass}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateCustomClassCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.speech.v2.Speech|listCustomClasses}. + * @param error Error, if any + * @param [response] ListCustomClassesResponse + */ + type ListCustomClassesCallback = (error: (Error|null), response?: google.cloud.speech.v2.ListCustomClassesResponse) => void; + + /** + * Callback as used by {@link google.cloud.speech.v2.Speech|getCustomClass}. + * @param error Error, if any + * @param [response] CustomClass + */ + type GetCustomClassCallback = (error: (Error|null), response?: google.cloud.speech.v2.CustomClass) => void; + + /** + * Callback as used by {@link google.cloud.speech.v2.Speech|updateCustomClass}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateCustomClassCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.speech.v2.Speech|deleteCustomClass}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCustomClassCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.speech.v2.Speech|undeleteCustomClass}. + * @param error Error, if any + * @param [response] Operation + */ + type UndeleteCustomClassCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.speech.v2.Speech|createPhraseSet}. + * @param error Error, if any + * @param [response] Operation + */ + type CreatePhraseSetCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.speech.v2.Speech|listPhraseSets}. + * @param error Error, if any + * @param [response] ListPhraseSetsResponse + */ + type ListPhraseSetsCallback = (error: (Error|null), response?: google.cloud.speech.v2.ListPhraseSetsResponse) => void; + + /** + * Callback as used by {@link google.cloud.speech.v2.Speech|getPhraseSet}. + * @param error Error, if any + * @param [response] PhraseSet + */ + type GetPhraseSetCallback = (error: (Error|null), response?: google.cloud.speech.v2.PhraseSet) => void; + + /** + * Callback as used by {@link google.cloud.speech.v2.Speech|updatePhraseSet}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdatePhraseSetCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.speech.v2.Speech|deletePhraseSet}. + * @param error Error, if any + * @param [response] Operation + */ + type DeletePhraseSetCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.speech.v2.Speech|undeletePhraseSet}. + * @param error Error, if any + * @param [response] Operation + */ + type UndeletePhraseSetCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a CreateRecognizerRequest. */ + interface ICreateRecognizerRequest { + + /** CreateRecognizerRequest recognizer */ + recognizer?: (google.cloud.speech.v2.IRecognizer|null); + + /** CreateRecognizerRequest validateOnly */ + validateOnly?: (boolean|null); + + /** CreateRecognizerRequest recognizerId */ + recognizerId?: (string|null); + + /** CreateRecognizerRequest parent */ + parent?: (string|null); + } + + /** Represents a CreateRecognizerRequest. */ + class CreateRecognizerRequest implements ICreateRecognizerRequest { + + /** + * Constructs a new CreateRecognizerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.ICreateRecognizerRequest); + + /** CreateRecognizerRequest recognizer. */ + public recognizer?: (google.cloud.speech.v2.IRecognizer|null); + + /** CreateRecognizerRequest validateOnly. */ + public validateOnly: boolean; + + /** CreateRecognizerRequest recognizerId. */ + public recognizerId: string; + + /** CreateRecognizerRequest parent. */ + public parent: string; + + /** + * Creates a new CreateRecognizerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateRecognizerRequest instance + */ + public static create(properties?: google.cloud.speech.v2.ICreateRecognizerRequest): google.cloud.speech.v2.CreateRecognizerRequest; + + /** + * Encodes the specified CreateRecognizerRequest message. Does not implicitly {@link google.cloud.speech.v2.CreateRecognizerRequest.verify|verify} messages. + * @param message CreateRecognizerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.ICreateRecognizerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateRecognizerRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v2.CreateRecognizerRequest.verify|verify} messages. + * @param message CreateRecognizerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.ICreateRecognizerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateRecognizerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateRecognizerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.CreateRecognizerRequest; + + /** + * Decodes a CreateRecognizerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateRecognizerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.CreateRecognizerRequest; + + /** + * Verifies a CreateRecognizerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateRecognizerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateRecognizerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.CreateRecognizerRequest; + + /** + * Creates a plain object from a CreateRecognizerRequest message. Also converts values to other types if specified. + * @param message CreateRecognizerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.CreateRecognizerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateRecognizerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateRecognizerRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationMetadata. */ + interface IOperationMetadata { + + /** OperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata resource */ + resource?: (string|null); + + /** OperationMetadata method */ + method?: (string|null); + + /** OperationMetadata kmsKeyName */ + kmsKeyName?: (string|null); + + /** OperationMetadata kmsKeyVersionName */ + kmsKeyVersionName?: (string|null); + + /** OperationMetadata batchRecognizeRequest */ + batchRecognizeRequest?: (google.cloud.speech.v2.IBatchRecognizeRequest|null); + + /** OperationMetadata createRecognizerRequest */ + createRecognizerRequest?: (google.cloud.speech.v2.ICreateRecognizerRequest|null); + + /** OperationMetadata updateRecognizerRequest */ + updateRecognizerRequest?: (google.cloud.speech.v2.IUpdateRecognizerRequest|null); + + /** OperationMetadata deleteRecognizerRequest */ + deleteRecognizerRequest?: (google.cloud.speech.v2.IDeleteRecognizerRequest|null); + + /** OperationMetadata undeleteRecognizerRequest */ + undeleteRecognizerRequest?: (google.cloud.speech.v2.IUndeleteRecognizerRequest|null); + + /** OperationMetadata createCustomClassRequest */ + createCustomClassRequest?: (google.cloud.speech.v2.ICreateCustomClassRequest|null); + + /** OperationMetadata updateCustomClassRequest */ + updateCustomClassRequest?: (google.cloud.speech.v2.IUpdateCustomClassRequest|null); + + /** OperationMetadata deleteCustomClassRequest */ + deleteCustomClassRequest?: (google.cloud.speech.v2.IDeleteCustomClassRequest|null); + + /** OperationMetadata undeleteCustomClassRequest */ + undeleteCustomClassRequest?: (google.cloud.speech.v2.IUndeleteCustomClassRequest|null); + + /** OperationMetadata createPhraseSetRequest */ + createPhraseSetRequest?: (google.cloud.speech.v2.ICreatePhraseSetRequest|null); + + /** OperationMetadata updatePhraseSetRequest */ + updatePhraseSetRequest?: (google.cloud.speech.v2.IUpdatePhraseSetRequest|null); + + /** OperationMetadata deletePhraseSetRequest */ + deletePhraseSetRequest?: (google.cloud.speech.v2.IDeletePhraseSetRequest|null); + + /** OperationMetadata undeletePhraseSetRequest */ + undeletePhraseSetRequest?: (google.cloud.speech.v2.IUndeletePhraseSetRequest|null); + + /** OperationMetadata updateConfigRequest */ + updateConfigRequest?: (google.cloud.speech.v2.IUpdateConfigRequest|null); + + /** OperationMetadata progressPercent */ + progressPercent?: (number|null); + + /** OperationMetadata batchRecognizeMetadata */ + batchRecognizeMetadata?: (google.cloud.speech.v2.IBatchRecognizeMetadata|null); + } + + /** Represents an OperationMetadata. */ + class OperationMetadata implements IOperationMetadata { + + /** + * Constructs a new OperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.IOperationMetadata); + + /** OperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata resource. */ + public resource: string; + + /** OperationMetadata method. */ + public method: string; + + /** OperationMetadata kmsKeyName. */ + public kmsKeyName: string; + + /** OperationMetadata kmsKeyVersionName. */ + public kmsKeyVersionName: string; + + /** OperationMetadata batchRecognizeRequest. */ + public batchRecognizeRequest?: (google.cloud.speech.v2.IBatchRecognizeRequest|null); + + /** OperationMetadata createRecognizerRequest. */ + public createRecognizerRequest?: (google.cloud.speech.v2.ICreateRecognizerRequest|null); + + /** OperationMetadata updateRecognizerRequest. */ + public updateRecognizerRequest?: (google.cloud.speech.v2.IUpdateRecognizerRequest|null); + + /** OperationMetadata deleteRecognizerRequest. */ + public deleteRecognizerRequest?: (google.cloud.speech.v2.IDeleteRecognizerRequest|null); + + /** OperationMetadata undeleteRecognizerRequest. */ + public undeleteRecognizerRequest?: (google.cloud.speech.v2.IUndeleteRecognizerRequest|null); + + /** OperationMetadata createCustomClassRequest. */ + public createCustomClassRequest?: (google.cloud.speech.v2.ICreateCustomClassRequest|null); + + /** OperationMetadata updateCustomClassRequest. */ + public updateCustomClassRequest?: (google.cloud.speech.v2.IUpdateCustomClassRequest|null); + + /** OperationMetadata deleteCustomClassRequest. */ + public deleteCustomClassRequest?: (google.cloud.speech.v2.IDeleteCustomClassRequest|null); + + /** OperationMetadata undeleteCustomClassRequest. */ + public undeleteCustomClassRequest?: (google.cloud.speech.v2.IUndeleteCustomClassRequest|null); + + /** OperationMetadata createPhraseSetRequest. */ + public createPhraseSetRequest?: (google.cloud.speech.v2.ICreatePhraseSetRequest|null); + + /** OperationMetadata updatePhraseSetRequest. */ + public updatePhraseSetRequest?: (google.cloud.speech.v2.IUpdatePhraseSetRequest|null); + + /** OperationMetadata deletePhraseSetRequest. */ + public deletePhraseSetRequest?: (google.cloud.speech.v2.IDeletePhraseSetRequest|null); + + /** OperationMetadata undeletePhraseSetRequest. */ + public undeletePhraseSetRequest?: (google.cloud.speech.v2.IUndeletePhraseSetRequest|null); + + /** OperationMetadata updateConfigRequest. */ + public updateConfigRequest?: (google.cloud.speech.v2.IUpdateConfigRequest|null); + + /** OperationMetadata progressPercent. */ + public progressPercent: number; + + /** OperationMetadata batchRecognizeMetadata. */ + public batchRecognizeMetadata?: (google.cloud.speech.v2.IBatchRecognizeMetadata|null); + + /** OperationMetadata request. */ + public request?: ("batchRecognizeRequest"|"createRecognizerRequest"|"updateRecognizerRequest"|"deleteRecognizerRequest"|"undeleteRecognizerRequest"|"createCustomClassRequest"|"updateCustomClassRequest"|"deleteCustomClassRequest"|"undeleteCustomClassRequest"|"createPhraseSetRequest"|"updatePhraseSetRequest"|"deletePhraseSetRequest"|"undeletePhraseSetRequest"|"updateConfigRequest"); + + /** OperationMetadata metadata. */ + public metadata?: "batchRecognizeMetadata"; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationMetadata instance + */ + public static create(properties?: google.cloud.speech.v2.IOperationMetadata): google.cloud.speech.v2.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.speech.v2.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.speech.v2.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.OperationMetadata; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.OperationMetadata; + + /** + * Verifies an OperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.OperationMetadata; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @param message OperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListRecognizersRequest. */ + interface IListRecognizersRequest { + + /** ListRecognizersRequest parent */ + parent?: (string|null); + + /** ListRecognizersRequest pageSize */ + pageSize?: (number|null); + + /** ListRecognizersRequest pageToken */ + pageToken?: (string|null); + + /** ListRecognizersRequest showDeleted */ + showDeleted?: (boolean|null); + } + + /** Represents a ListRecognizersRequest. */ + class ListRecognizersRequest implements IListRecognizersRequest { + + /** + * Constructs a new ListRecognizersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.IListRecognizersRequest); + + /** ListRecognizersRequest parent. */ + public parent: string; + + /** ListRecognizersRequest pageSize. */ + public pageSize: number; + + /** ListRecognizersRequest pageToken. */ + public pageToken: string; + + /** ListRecognizersRequest showDeleted. */ + public showDeleted: boolean; + + /** + * Creates a new ListRecognizersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRecognizersRequest instance + */ + public static create(properties?: google.cloud.speech.v2.IListRecognizersRequest): google.cloud.speech.v2.ListRecognizersRequest; + + /** + * Encodes the specified ListRecognizersRequest message. Does not implicitly {@link google.cloud.speech.v2.ListRecognizersRequest.verify|verify} messages. + * @param message ListRecognizersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.IListRecognizersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRecognizersRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v2.ListRecognizersRequest.verify|verify} messages. + * @param message ListRecognizersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.IListRecognizersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRecognizersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRecognizersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.ListRecognizersRequest; + + /** + * Decodes a ListRecognizersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRecognizersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.ListRecognizersRequest; + + /** + * Verifies a ListRecognizersRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListRecognizersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRecognizersRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.ListRecognizersRequest; + + /** + * Creates a plain object from a ListRecognizersRequest message. Also converts values to other types if specified. + * @param message ListRecognizersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.ListRecognizersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRecognizersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListRecognizersRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListRecognizersResponse. */ + interface IListRecognizersResponse { + + /** ListRecognizersResponse recognizers */ + recognizers?: (google.cloud.speech.v2.IRecognizer[]|null); + + /** ListRecognizersResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListRecognizersResponse. */ + class ListRecognizersResponse implements IListRecognizersResponse { + + /** + * Constructs a new ListRecognizersResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.IListRecognizersResponse); + + /** ListRecognizersResponse recognizers. */ + public recognizers: google.cloud.speech.v2.IRecognizer[]; + + /** ListRecognizersResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListRecognizersResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRecognizersResponse instance + */ + public static create(properties?: google.cloud.speech.v2.IListRecognizersResponse): google.cloud.speech.v2.ListRecognizersResponse; + + /** + * Encodes the specified ListRecognizersResponse message. Does not implicitly {@link google.cloud.speech.v2.ListRecognizersResponse.verify|verify} messages. + * @param message ListRecognizersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.IListRecognizersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRecognizersResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v2.ListRecognizersResponse.verify|verify} messages. + * @param message ListRecognizersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.IListRecognizersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRecognizersResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRecognizersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.ListRecognizersResponse; + + /** + * Decodes a ListRecognizersResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRecognizersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.ListRecognizersResponse; + + /** + * Verifies a ListRecognizersResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListRecognizersResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRecognizersResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.ListRecognizersResponse; + + /** + * Creates a plain object from a ListRecognizersResponse message. Also converts values to other types if specified. + * @param message ListRecognizersResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.ListRecognizersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRecognizersResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListRecognizersResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetRecognizerRequest. */ + interface IGetRecognizerRequest { + + /** GetRecognizerRequest name */ + name?: (string|null); + } + + /** Represents a GetRecognizerRequest. */ + class GetRecognizerRequest implements IGetRecognizerRequest { + + /** + * Constructs a new GetRecognizerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.IGetRecognizerRequest); + + /** GetRecognizerRequest name. */ + public name: string; + + /** + * Creates a new GetRecognizerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetRecognizerRequest instance + */ + public static create(properties?: google.cloud.speech.v2.IGetRecognizerRequest): google.cloud.speech.v2.GetRecognizerRequest; + + /** + * Encodes the specified GetRecognizerRequest message. Does not implicitly {@link google.cloud.speech.v2.GetRecognizerRequest.verify|verify} messages. + * @param message GetRecognizerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.IGetRecognizerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetRecognizerRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v2.GetRecognizerRequest.verify|verify} messages. + * @param message GetRecognizerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.IGetRecognizerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetRecognizerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetRecognizerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.GetRecognizerRequest; + + /** + * Decodes a GetRecognizerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetRecognizerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.GetRecognizerRequest; + + /** + * Verifies a GetRecognizerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetRecognizerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetRecognizerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.GetRecognizerRequest; + + /** + * Creates a plain object from a GetRecognizerRequest message. Also converts values to other types if specified. + * @param message GetRecognizerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.GetRecognizerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetRecognizerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetRecognizerRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateRecognizerRequest. */ + interface IUpdateRecognizerRequest { + + /** UpdateRecognizerRequest recognizer */ + recognizer?: (google.cloud.speech.v2.IRecognizer|null); + + /** UpdateRecognizerRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateRecognizerRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents an UpdateRecognizerRequest. */ + class UpdateRecognizerRequest implements IUpdateRecognizerRequest { + + /** + * Constructs a new UpdateRecognizerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.IUpdateRecognizerRequest); + + /** UpdateRecognizerRequest recognizer. */ + public recognizer?: (google.cloud.speech.v2.IRecognizer|null); + + /** UpdateRecognizerRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateRecognizerRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new UpdateRecognizerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateRecognizerRequest instance + */ + public static create(properties?: google.cloud.speech.v2.IUpdateRecognizerRequest): google.cloud.speech.v2.UpdateRecognizerRequest; + + /** + * Encodes the specified UpdateRecognizerRequest message. Does not implicitly {@link google.cloud.speech.v2.UpdateRecognizerRequest.verify|verify} messages. + * @param message UpdateRecognizerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.IUpdateRecognizerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateRecognizerRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v2.UpdateRecognizerRequest.verify|verify} messages. + * @param message UpdateRecognizerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.IUpdateRecognizerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateRecognizerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateRecognizerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.UpdateRecognizerRequest; + + /** + * Decodes an UpdateRecognizerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateRecognizerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.UpdateRecognizerRequest; + + /** + * Verifies an UpdateRecognizerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateRecognizerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateRecognizerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.UpdateRecognizerRequest; + + /** + * Creates a plain object from an UpdateRecognizerRequest message. Also converts values to other types if specified. + * @param message UpdateRecognizerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.UpdateRecognizerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateRecognizerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateRecognizerRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteRecognizerRequest. */ + interface IDeleteRecognizerRequest { + + /** DeleteRecognizerRequest name */ + name?: (string|null); + + /** DeleteRecognizerRequest validateOnly */ + validateOnly?: (boolean|null); + + /** DeleteRecognizerRequest allowMissing */ + allowMissing?: (boolean|null); + + /** DeleteRecognizerRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteRecognizerRequest. */ + class DeleteRecognizerRequest implements IDeleteRecognizerRequest { + + /** + * Constructs a new DeleteRecognizerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.IDeleteRecognizerRequest); + + /** DeleteRecognizerRequest name. */ + public name: string; + + /** DeleteRecognizerRequest validateOnly. */ + public validateOnly: boolean; + + /** DeleteRecognizerRequest allowMissing. */ + public allowMissing: boolean; + + /** DeleteRecognizerRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteRecognizerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteRecognizerRequest instance + */ + public static create(properties?: google.cloud.speech.v2.IDeleteRecognizerRequest): google.cloud.speech.v2.DeleteRecognizerRequest; + + /** + * Encodes the specified DeleteRecognizerRequest message. Does not implicitly {@link google.cloud.speech.v2.DeleteRecognizerRequest.verify|verify} messages. + * @param message DeleteRecognizerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.IDeleteRecognizerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteRecognizerRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v2.DeleteRecognizerRequest.verify|verify} messages. + * @param message DeleteRecognizerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.IDeleteRecognizerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteRecognizerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteRecognizerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.DeleteRecognizerRequest; + + /** + * Decodes a DeleteRecognizerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteRecognizerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.DeleteRecognizerRequest; + + /** + * Verifies a DeleteRecognizerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteRecognizerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteRecognizerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.DeleteRecognizerRequest; + + /** + * Creates a plain object from a DeleteRecognizerRequest message. Also converts values to other types if specified. + * @param message DeleteRecognizerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.DeleteRecognizerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteRecognizerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteRecognizerRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UndeleteRecognizerRequest. */ + interface IUndeleteRecognizerRequest { + + /** UndeleteRecognizerRequest name */ + name?: (string|null); + + /** UndeleteRecognizerRequest validateOnly */ + validateOnly?: (boolean|null); + + /** UndeleteRecognizerRequest etag */ + etag?: (string|null); + } + + /** Represents an UndeleteRecognizerRequest. */ + class UndeleteRecognizerRequest implements IUndeleteRecognizerRequest { + + /** + * Constructs a new UndeleteRecognizerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.IUndeleteRecognizerRequest); + + /** UndeleteRecognizerRequest name. */ + public name: string; + + /** UndeleteRecognizerRequest validateOnly. */ + public validateOnly: boolean; + + /** UndeleteRecognizerRequest etag. */ + public etag: string; + + /** + * Creates a new UndeleteRecognizerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UndeleteRecognizerRequest instance + */ + public static create(properties?: google.cloud.speech.v2.IUndeleteRecognizerRequest): google.cloud.speech.v2.UndeleteRecognizerRequest; + + /** + * Encodes the specified UndeleteRecognizerRequest message. Does not implicitly {@link google.cloud.speech.v2.UndeleteRecognizerRequest.verify|verify} messages. + * @param message UndeleteRecognizerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.IUndeleteRecognizerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UndeleteRecognizerRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v2.UndeleteRecognizerRequest.verify|verify} messages. + * @param message UndeleteRecognizerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.IUndeleteRecognizerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UndeleteRecognizerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UndeleteRecognizerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.UndeleteRecognizerRequest; + + /** + * Decodes an UndeleteRecognizerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UndeleteRecognizerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.UndeleteRecognizerRequest; + + /** + * Verifies an UndeleteRecognizerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UndeleteRecognizerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UndeleteRecognizerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.UndeleteRecognizerRequest; + + /** + * Creates a plain object from an UndeleteRecognizerRequest message. Also converts values to other types if specified. + * @param message UndeleteRecognizerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.UndeleteRecognizerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UndeleteRecognizerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UndeleteRecognizerRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Recognizer. */ + interface IRecognizer { + + /** Recognizer name */ + name?: (string|null); + + /** Recognizer uid */ + uid?: (string|null); + + /** Recognizer displayName */ + displayName?: (string|null); + + /** Recognizer model */ + model?: (string|null); + + /** Recognizer languageCodes */ + languageCodes?: (string[]|null); + + /** Recognizer defaultRecognitionConfig */ + defaultRecognitionConfig?: (google.cloud.speech.v2.IRecognitionConfig|null); + + /** Recognizer annotations */ + annotations?: ({ [k: string]: string }|null); + + /** Recognizer state */ + state?: (google.cloud.speech.v2.Recognizer.State|keyof typeof google.cloud.speech.v2.Recognizer.State|null); + + /** Recognizer createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Recognizer updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Recognizer deleteTime */ + deleteTime?: (google.protobuf.ITimestamp|null); + + /** Recognizer expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + + /** Recognizer etag */ + etag?: (string|null); + + /** Recognizer reconciling */ + reconciling?: (boolean|null); + + /** Recognizer kmsKeyName */ + kmsKeyName?: (string|null); + + /** Recognizer kmsKeyVersionName */ + kmsKeyVersionName?: (string|null); + } + + /** Represents a Recognizer. */ + class Recognizer implements IRecognizer { + + /** + * Constructs a new Recognizer. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.IRecognizer); + + /** Recognizer name. */ + public name: string; + + /** Recognizer uid. */ + public uid: string; + + /** Recognizer displayName. */ + public displayName: string; + + /** Recognizer model. */ + public model: string; + + /** Recognizer languageCodes. */ + public languageCodes: string[]; + + /** Recognizer defaultRecognitionConfig. */ + public defaultRecognitionConfig?: (google.cloud.speech.v2.IRecognitionConfig|null); + + /** Recognizer annotations. */ + public annotations: { [k: string]: string }; + + /** Recognizer state. */ + public state: (google.cloud.speech.v2.Recognizer.State|keyof typeof google.cloud.speech.v2.Recognizer.State); + + /** Recognizer createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Recognizer updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Recognizer deleteTime. */ + public deleteTime?: (google.protobuf.ITimestamp|null); + + /** Recognizer expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** Recognizer etag. */ + public etag: string; + + /** Recognizer reconciling. */ + public reconciling: boolean; + + /** Recognizer kmsKeyName. */ + public kmsKeyName: string; + + /** Recognizer kmsKeyVersionName. */ + public kmsKeyVersionName: string; + + /** + * Creates a new Recognizer instance using the specified properties. + * @param [properties] Properties to set + * @returns Recognizer instance + */ + public static create(properties?: google.cloud.speech.v2.IRecognizer): google.cloud.speech.v2.Recognizer; + + /** + * Encodes the specified Recognizer message. Does not implicitly {@link google.cloud.speech.v2.Recognizer.verify|verify} messages. + * @param message Recognizer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.IRecognizer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Recognizer message, length delimited. Does not implicitly {@link google.cloud.speech.v2.Recognizer.verify|verify} messages. + * @param message Recognizer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.IRecognizer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Recognizer message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Recognizer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.Recognizer; + + /** + * Decodes a Recognizer message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Recognizer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.Recognizer; + + /** + * Verifies a Recognizer message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Recognizer message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Recognizer + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.Recognizer; + + /** + * Creates a plain object from a Recognizer message. Also converts values to other types if specified. + * @param message Recognizer + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.Recognizer, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Recognizer to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Recognizer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Recognizer { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 2, + DELETED = 4 + } + } + + /** Properties of an AutoDetectDecodingConfig. */ + interface IAutoDetectDecodingConfig { + } + + /** Represents an AutoDetectDecodingConfig. */ + class AutoDetectDecodingConfig implements IAutoDetectDecodingConfig { + + /** + * Constructs a new AutoDetectDecodingConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.IAutoDetectDecodingConfig); + + /** + * Creates a new AutoDetectDecodingConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AutoDetectDecodingConfig instance + */ + public static create(properties?: google.cloud.speech.v2.IAutoDetectDecodingConfig): google.cloud.speech.v2.AutoDetectDecodingConfig; + + /** + * Encodes the specified AutoDetectDecodingConfig message. Does not implicitly {@link google.cloud.speech.v2.AutoDetectDecodingConfig.verify|verify} messages. + * @param message AutoDetectDecodingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.IAutoDetectDecodingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutoDetectDecodingConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v2.AutoDetectDecodingConfig.verify|verify} messages. + * @param message AutoDetectDecodingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.IAutoDetectDecodingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutoDetectDecodingConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutoDetectDecodingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.AutoDetectDecodingConfig; + + /** + * Decodes an AutoDetectDecodingConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutoDetectDecodingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.AutoDetectDecodingConfig; + + /** + * Verifies an AutoDetectDecodingConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AutoDetectDecodingConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutoDetectDecodingConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.AutoDetectDecodingConfig; + + /** + * Creates a plain object from an AutoDetectDecodingConfig message. Also converts values to other types if specified. + * @param message AutoDetectDecodingConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.AutoDetectDecodingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutoDetectDecodingConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AutoDetectDecodingConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExplicitDecodingConfig. */ + interface IExplicitDecodingConfig { + + /** ExplicitDecodingConfig encoding */ + encoding?: (google.cloud.speech.v2.ExplicitDecodingConfig.AudioEncoding|keyof typeof google.cloud.speech.v2.ExplicitDecodingConfig.AudioEncoding|null); + + /** ExplicitDecodingConfig sampleRateHertz */ + sampleRateHertz?: (number|null); + + /** ExplicitDecodingConfig audioChannelCount */ + audioChannelCount?: (number|null); + } + + /** Represents an ExplicitDecodingConfig. */ + class ExplicitDecodingConfig implements IExplicitDecodingConfig { + + /** + * Constructs a new ExplicitDecodingConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.IExplicitDecodingConfig); + + /** ExplicitDecodingConfig encoding. */ + public encoding: (google.cloud.speech.v2.ExplicitDecodingConfig.AudioEncoding|keyof typeof google.cloud.speech.v2.ExplicitDecodingConfig.AudioEncoding); + + /** ExplicitDecodingConfig sampleRateHertz. */ + public sampleRateHertz: number; + + /** ExplicitDecodingConfig audioChannelCount. */ + public audioChannelCount: number; + + /** + * Creates a new ExplicitDecodingConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ExplicitDecodingConfig instance + */ + public static create(properties?: google.cloud.speech.v2.IExplicitDecodingConfig): google.cloud.speech.v2.ExplicitDecodingConfig; + + /** + * Encodes the specified ExplicitDecodingConfig message. Does not implicitly {@link google.cloud.speech.v2.ExplicitDecodingConfig.verify|verify} messages. + * @param message ExplicitDecodingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.IExplicitDecodingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExplicitDecodingConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v2.ExplicitDecodingConfig.verify|verify} messages. + * @param message ExplicitDecodingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.IExplicitDecodingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExplicitDecodingConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExplicitDecodingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.ExplicitDecodingConfig; + + /** + * Decodes an ExplicitDecodingConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExplicitDecodingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.ExplicitDecodingConfig; + + /** + * Verifies an ExplicitDecodingConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExplicitDecodingConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExplicitDecodingConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.ExplicitDecodingConfig; + + /** + * Creates a plain object from an ExplicitDecodingConfig message. Also converts values to other types if specified. + * @param message ExplicitDecodingConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.ExplicitDecodingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExplicitDecodingConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExplicitDecodingConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExplicitDecodingConfig { + + /** AudioEncoding enum. */ + enum AudioEncoding { + AUDIO_ENCODING_UNSPECIFIED = 0, + LINEAR16 = 1, + MULAW = 2, + ALAW = 3, + AMR = 4, + AMR_WB = 5, + FLAC = 6, + MP3 = 7, + OGG_OPUS = 8, + WEBM_OPUS = 9, + MP4_AAC = 10, + M4A_AAC = 11, + MOV_AAC = 12 + } + } + + /** Properties of a SpeakerDiarizationConfig. */ + interface ISpeakerDiarizationConfig { + + /** SpeakerDiarizationConfig minSpeakerCount */ + minSpeakerCount?: (number|null); + + /** SpeakerDiarizationConfig maxSpeakerCount */ + maxSpeakerCount?: (number|null); + } + + /** Represents a SpeakerDiarizationConfig. */ + class SpeakerDiarizationConfig implements ISpeakerDiarizationConfig { + + /** + * Constructs a new SpeakerDiarizationConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.ISpeakerDiarizationConfig); + + /** SpeakerDiarizationConfig minSpeakerCount. */ + public minSpeakerCount: number; + + /** SpeakerDiarizationConfig maxSpeakerCount. */ + public maxSpeakerCount: number; + + /** + * Creates a new SpeakerDiarizationConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SpeakerDiarizationConfig instance + */ + public static create(properties?: google.cloud.speech.v2.ISpeakerDiarizationConfig): google.cloud.speech.v2.SpeakerDiarizationConfig; + + /** + * Encodes the specified SpeakerDiarizationConfig message. Does not implicitly {@link google.cloud.speech.v2.SpeakerDiarizationConfig.verify|verify} messages. + * @param message SpeakerDiarizationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.ISpeakerDiarizationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpeakerDiarizationConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v2.SpeakerDiarizationConfig.verify|verify} messages. + * @param message SpeakerDiarizationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.ISpeakerDiarizationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpeakerDiarizationConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpeakerDiarizationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.SpeakerDiarizationConfig; + + /** + * Decodes a SpeakerDiarizationConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpeakerDiarizationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.SpeakerDiarizationConfig; + + /** + * Verifies a SpeakerDiarizationConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpeakerDiarizationConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpeakerDiarizationConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.SpeakerDiarizationConfig; + + /** + * Creates a plain object from a SpeakerDiarizationConfig message. Also converts values to other types if specified. + * @param message SpeakerDiarizationConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.SpeakerDiarizationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpeakerDiarizationConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpeakerDiarizationConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RecognitionFeatures. */ + interface IRecognitionFeatures { + + /** RecognitionFeatures profanityFilter */ + profanityFilter?: (boolean|null); + + /** RecognitionFeatures enableWordTimeOffsets */ + enableWordTimeOffsets?: (boolean|null); + + /** RecognitionFeatures enableWordConfidence */ + enableWordConfidence?: (boolean|null); + + /** RecognitionFeatures enableAutomaticPunctuation */ + enableAutomaticPunctuation?: (boolean|null); + + /** RecognitionFeatures enableSpokenPunctuation */ + enableSpokenPunctuation?: (boolean|null); + + /** RecognitionFeatures enableSpokenEmojis */ + enableSpokenEmojis?: (boolean|null); + + /** RecognitionFeatures multiChannelMode */ + multiChannelMode?: (google.cloud.speech.v2.RecognitionFeatures.MultiChannelMode|keyof typeof google.cloud.speech.v2.RecognitionFeatures.MultiChannelMode|null); + + /** RecognitionFeatures diarizationConfig */ + diarizationConfig?: (google.cloud.speech.v2.ISpeakerDiarizationConfig|null); + + /** RecognitionFeatures maxAlternatives */ + maxAlternatives?: (number|null); + } + + /** Represents a RecognitionFeatures. */ + class RecognitionFeatures implements IRecognitionFeatures { + + /** + * Constructs a new RecognitionFeatures. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.IRecognitionFeatures); + + /** RecognitionFeatures profanityFilter. */ + public profanityFilter: boolean; + + /** RecognitionFeatures enableWordTimeOffsets. */ + public enableWordTimeOffsets: boolean; + + /** RecognitionFeatures enableWordConfidence. */ + public enableWordConfidence: boolean; + + /** RecognitionFeatures enableAutomaticPunctuation. */ + public enableAutomaticPunctuation: boolean; + + /** RecognitionFeatures enableSpokenPunctuation. */ + public enableSpokenPunctuation: boolean; + + /** RecognitionFeatures enableSpokenEmojis. */ + public enableSpokenEmojis: boolean; + + /** RecognitionFeatures multiChannelMode. */ + public multiChannelMode: (google.cloud.speech.v2.RecognitionFeatures.MultiChannelMode|keyof typeof google.cloud.speech.v2.RecognitionFeatures.MultiChannelMode); + + /** RecognitionFeatures diarizationConfig. */ + public diarizationConfig?: (google.cloud.speech.v2.ISpeakerDiarizationConfig|null); + + /** RecognitionFeatures maxAlternatives. */ + public maxAlternatives: number; + + /** + * Creates a new RecognitionFeatures instance using the specified properties. + * @param [properties] Properties to set + * @returns RecognitionFeatures instance + */ + public static create(properties?: google.cloud.speech.v2.IRecognitionFeatures): google.cloud.speech.v2.RecognitionFeatures; + + /** + * Encodes the specified RecognitionFeatures message. Does not implicitly {@link google.cloud.speech.v2.RecognitionFeatures.verify|verify} messages. + * @param message RecognitionFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.IRecognitionFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RecognitionFeatures message, length delimited. Does not implicitly {@link google.cloud.speech.v2.RecognitionFeatures.verify|verify} messages. + * @param message RecognitionFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.IRecognitionFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RecognitionFeatures message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RecognitionFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.RecognitionFeatures; + + /** + * Decodes a RecognitionFeatures message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RecognitionFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.RecognitionFeatures; + + /** + * Verifies a RecognitionFeatures message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RecognitionFeatures message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RecognitionFeatures + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.RecognitionFeatures; + + /** + * Creates a plain object from a RecognitionFeatures message. Also converts values to other types if specified. + * @param message RecognitionFeatures + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.RecognitionFeatures, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RecognitionFeatures to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RecognitionFeatures + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RecognitionFeatures { + + /** MultiChannelMode enum. */ + enum MultiChannelMode { + MULTI_CHANNEL_MODE_UNSPECIFIED = 0, + SEPARATE_RECOGNITION_PER_CHANNEL = 1 + } + } + + /** Properties of a TranscriptNormalization. */ + interface ITranscriptNormalization { + + /** TranscriptNormalization entries */ + entries?: (google.cloud.speech.v2.TranscriptNormalization.IEntry[]|null); + } + + /** Represents a TranscriptNormalization. */ + class TranscriptNormalization implements ITranscriptNormalization { + + /** + * Constructs a new TranscriptNormalization. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.ITranscriptNormalization); + + /** TranscriptNormalization entries. */ + public entries: google.cloud.speech.v2.TranscriptNormalization.IEntry[]; + + /** + * Creates a new TranscriptNormalization instance using the specified properties. + * @param [properties] Properties to set + * @returns TranscriptNormalization instance + */ + public static create(properties?: google.cloud.speech.v2.ITranscriptNormalization): google.cloud.speech.v2.TranscriptNormalization; + + /** + * Encodes the specified TranscriptNormalization message. Does not implicitly {@link google.cloud.speech.v2.TranscriptNormalization.verify|verify} messages. + * @param message TranscriptNormalization message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.ITranscriptNormalization, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TranscriptNormalization message, length delimited. Does not implicitly {@link google.cloud.speech.v2.TranscriptNormalization.verify|verify} messages. + * @param message TranscriptNormalization message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.ITranscriptNormalization, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TranscriptNormalization message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TranscriptNormalization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.TranscriptNormalization; + + /** + * Decodes a TranscriptNormalization message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TranscriptNormalization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.TranscriptNormalization; + + /** + * Verifies a TranscriptNormalization message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TranscriptNormalization message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TranscriptNormalization + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.TranscriptNormalization; + + /** + * Creates a plain object from a TranscriptNormalization message. Also converts values to other types if specified. + * @param message TranscriptNormalization + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.TranscriptNormalization, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TranscriptNormalization to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TranscriptNormalization + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TranscriptNormalization { + + /** Properties of an Entry. */ + interface IEntry { + + /** Entry search */ + search?: (string|null); + + /** Entry replace */ + replace?: (string|null); + + /** Entry caseSensitive */ + caseSensitive?: (boolean|null); + } + + /** Represents an Entry. */ + class Entry implements IEntry { + + /** + * Constructs a new Entry. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.TranscriptNormalization.IEntry); + + /** Entry search. */ + public search: string; + + /** Entry replace. */ + public replace: string; + + /** Entry caseSensitive. */ + public caseSensitive: boolean; + + /** + * Creates a new Entry instance using the specified properties. + * @param [properties] Properties to set + * @returns Entry instance + */ + public static create(properties?: google.cloud.speech.v2.TranscriptNormalization.IEntry): google.cloud.speech.v2.TranscriptNormalization.Entry; + + /** + * Encodes the specified Entry message. Does not implicitly {@link google.cloud.speech.v2.TranscriptNormalization.Entry.verify|verify} messages. + * @param message Entry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.TranscriptNormalization.IEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Entry message, length delimited. Does not implicitly {@link google.cloud.speech.v2.TranscriptNormalization.Entry.verify|verify} messages. + * @param message Entry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.TranscriptNormalization.IEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Entry message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Entry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.TranscriptNormalization.Entry; + + /** + * Decodes an Entry message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Entry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.TranscriptNormalization.Entry; + + /** + * Verifies an Entry message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Entry message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Entry + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.TranscriptNormalization.Entry; + + /** + * Creates a plain object from an Entry message. Also converts values to other types if specified. + * @param message Entry + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.TranscriptNormalization.Entry, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Entry to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Entry + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a TranslationConfig. */ + interface ITranslationConfig { + + /** TranslationConfig targetLanguage */ + targetLanguage?: (string|null); + } + + /** Represents a TranslationConfig. */ + class TranslationConfig implements ITranslationConfig { + + /** + * Constructs a new TranslationConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.ITranslationConfig); + + /** TranslationConfig targetLanguage. */ + public targetLanguage: string; + + /** + * Creates a new TranslationConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns TranslationConfig instance + */ + public static create(properties?: google.cloud.speech.v2.ITranslationConfig): google.cloud.speech.v2.TranslationConfig; + + /** + * Encodes the specified TranslationConfig message. Does not implicitly {@link google.cloud.speech.v2.TranslationConfig.verify|verify} messages. + * @param message TranslationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.ITranslationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TranslationConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v2.TranslationConfig.verify|verify} messages. + * @param message TranslationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.ITranslationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TranslationConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TranslationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.TranslationConfig; + + /** + * Decodes a TranslationConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TranslationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.TranslationConfig; + + /** + * Verifies a TranslationConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TranslationConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TranslationConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.TranslationConfig; + + /** + * Creates a plain object from a TranslationConfig message. Also converts values to other types if specified. + * @param message TranslationConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.TranslationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TranslationConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TranslationConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpeechAdaptation. */ + interface ISpeechAdaptation { + + /** SpeechAdaptation phraseSets */ + phraseSets?: (google.cloud.speech.v2.SpeechAdaptation.IAdaptationPhraseSet[]|null); + + /** SpeechAdaptation customClasses */ + customClasses?: (google.cloud.speech.v2.ICustomClass[]|null); + } + + /** Represents a SpeechAdaptation. */ + class SpeechAdaptation implements ISpeechAdaptation { + + /** + * Constructs a new SpeechAdaptation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.ISpeechAdaptation); + + /** SpeechAdaptation phraseSets. */ + public phraseSets: google.cloud.speech.v2.SpeechAdaptation.IAdaptationPhraseSet[]; + + /** SpeechAdaptation customClasses. */ + public customClasses: google.cloud.speech.v2.ICustomClass[]; + + /** + * Creates a new SpeechAdaptation instance using the specified properties. + * @param [properties] Properties to set + * @returns SpeechAdaptation instance + */ + public static create(properties?: google.cloud.speech.v2.ISpeechAdaptation): google.cloud.speech.v2.SpeechAdaptation; + + /** + * Encodes the specified SpeechAdaptation message. Does not implicitly {@link google.cloud.speech.v2.SpeechAdaptation.verify|verify} messages. + * @param message SpeechAdaptation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.ISpeechAdaptation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpeechAdaptation message, length delimited. Does not implicitly {@link google.cloud.speech.v2.SpeechAdaptation.verify|verify} messages. + * @param message SpeechAdaptation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.ISpeechAdaptation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpeechAdaptation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpeechAdaptation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.SpeechAdaptation; + + /** + * Decodes a SpeechAdaptation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpeechAdaptation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.SpeechAdaptation; + + /** + * Verifies a SpeechAdaptation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpeechAdaptation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpeechAdaptation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.SpeechAdaptation; + + /** + * Creates a plain object from a SpeechAdaptation message. Also converts values to other types if specified. + * @param message SpeechAdaptation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.SpeechAdaptation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpeechAdaptation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpeechAdaptation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SpeechAdaptation { + + /** Properties of an AdaptationPhraseSet. */ + interface IAdaptationPhraseSet { + + /** AdaptationPhraseSet phraseSet */ + phraseSet?: (string|null); + + /** AdaptationPhraseSet inlinePhraseSet */ + inlinePhraseSet?: (google.cloud.speech.v2.IPhraseSet|null); + } + + /** Represents an AdaptationPhraseSet. */ + class AdaptationPhraseSet implements IAdaptationPhraseSet { + + /** + * Constructs a new AdaptationPhraseSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.SpeechAdaptation.IAdaptationPhraseSet); + + /** AdaptationPhraseSet phraseSet. */ + public phraseSet?: (string|null); + + /** AdaptationPhraseSet inlinePhraseSet. */ + public inlinePhraseSet?: (google.cloud.speech.v2.IPhraseSet|null); + + /** AdaptationPhraseSet value. */ + public value?: ("phraseSet"|"inlinePhraseSet"); + + /** + * Creates a new AdaptationPhraseSet instance using the specified properties. + * @param [properties] Properties to set + * @returns AdaptationPhraseSet instance + */ + public static create(properties?: google.cloud.speech.v2.SpeechAdaptation.IAdaptationPhraseSet): google.cloud.speech.v2.SpeechAdaptation.AdaptationPhraseSet; + + /** + * Encodes the specified AdaptationPhraseSet message. Does not implicitly {@link google.cloud.speech.v2.SpeechAdaptation.AdaptationPhraseSet.verify|verify} messages. + * @param message AdaptationPhraseSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.SpeechAdaptation.IAdaptationPhraseSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AdaptationPhraseSet message, length delimited. Does not implicitly {@link google.cloud.speech.v2.SpeechAdaptation.AdaptationPhraseSet.verify|verify} messages. + * @param message AdaptationPhraseSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.SpeechAdaptation.IAdaptationPhraseSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AdaptationPhraseSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AdaptationPhraseSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.SpeechAdaptation.AdaptationPhraseSet; + + /** + * Decodes an AdaptationPhraseSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AdaptationPhraseSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.SpeechAdaptation.AdaptationPhraseSet; + + /** + * Verifies an AdaptationPhraseSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AdaptationPhraseSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AdaptationPhraseSet + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.SpeechAdaptation.AdaptationPhraseSet; + + /** + * Creates a plain object from an AdaptationPhraseSet message. Also converts values to other types if specified. + * @param message AdaptationPhraseSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.SpeechAdaptation.AdaptationPhraseSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AdaptationPhraseSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AdaptationPhraseSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a RecognitionConfig. */ + interface IRecognitionConfig { + + /** RecognitionConfig autoDecodingConfig */ + autoDecodingConfig?: (google.cloud.speech.v2.IAutoDetectDecodingConfig|null); + + /** RecognitionConfig explicitDecodingConfig */ + explicitDecodingConfig?: (google.cloud.speech.v2.IExplicitDecodingConfig|null); + + /** RecognitionConfig model */ + model?: (string|null); + + /** RecognitionConfig languageCodes */ + languageCodes?: (string[]|null); + + /** RecognitionConfig features */ + features?: (google.cloud.speech.v2.IRecognitionFeatures|null); + + /** RecognitionConfig adaptation */ + adaptation?: (google.cloud.speech.v2.ISpeechAdaptation|null); + + /** RecognitionConfig transcriptNormalization */ + transcriptNormalization?: (google.cloud.speech.v2.ITranscriptNormalization|null); + + /** RecognitionConfig translationConfig */ + translationConfig?: (google.cloud.speech.v2.ITranslationConfig|null); + } + + /** Represents a RecognitionConfig. */ + class RecognitionConfig implements IRecognitionConfig { + + /** + * Constructs a new RecognitionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.IRecognitionConfig); + + /** RecognitionConfig autoDecodingConfig. */ + public autoDecodingConfig?: (google.cloud.speech.v2.IAutoDetectDecodingConfig|null); + + /** RecognitionConfig explicitDecodingConfig. */ + public explicitDecodingConfig?: (google.cloud.speech.v2.IExplicitDecodingConfig|null); + + /** RecognitionConfig model. */ + public model: string; + + /** RecognitionConfig languageCodes. */ + public languageCodes: string[]; + + /** RecognitionConfig features. */ + public features?: (google.cloud.speech.v2.IRecognitionFeatures|null); + + /** RecognitionConfig adaptation. */ + public adaptation?: (google.cloud.speech.v2.ISpeechAdaptation|null); + + /** RecognitionConfig transcriptNormalization. */ + public transcriptNormalization?: (google.cloud.speech.v2.ITranscriptNormalization|null); + + /** RecognitionConfig translationConfig. */ + public translationConfig?: (google.cloud.speech.v2.ITranslationConfig|null); + + /** RecognitionConfig decodingConfig. */ + public decodingConfig?: ("autoDecodingConfig"|"explicitDecodingConfig"); + + /** + * Creates a new RecognitionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns RecognitionConfig instance + */ + public static create(properties?: google.cloud.speech.v2.IRecognitionConfig): google.cloud.speech.v2.RecognitionConfig; + + /** + * Encodes the specified RecognitionConfig message. Does not implicitly {@link google.cloud.speech.v2.RecognitionConfig.verify|verify} messages. + * @param message RecognitionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.IRecognitionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RecognitionConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v2.RecognitionConfig.verify|verify} messages. + * @param message RecognitionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.IRecognitionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RecognitionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RecognitionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.RecognitionConfig; + + /** + * Decodes a RecognitionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RecognitionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.RecognitionConfig; + + /** + * Verifies a RecognitionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RecognitionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RecognitionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.RecognitionConfig; + + /** + * Creates a plain object from a RecognitionConfig message. Also converts values to other types if specified. + * @param message RecognitionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.RecognitionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RecognitionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RecognitionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RecognizeRequest. */ + interface IRecognizeRequest { + + /** RecognizeRequest recognizer */ + recognizer?: (string|null); + + /** RecognizeRequest config */ + config?: (google.cloud.speech.v2.IRecognitionConfig|null); + + /** RecognizeRequest configMask */ + configMask?: (google.protobuf.IFieldMask|null); + + /** RecognizeRequest content */ + content?: (Uint8Array|Buffer|string|null); + + /** RecognizeRequest uri */ + uri?: (string|null); + } + + /** Represents a RecognizeRequest. */ + class RecognizeRequest implements IRecognizeRequest { + + /** + * Constructs a new RecognizeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.IRecognizeRequest); + + /** RecognizeRequest recognizer. */ + public recognizer: string; + + /** RecognizeRequest config. */ + public config?: (google.cloud.speech.v2.IRecognitionConfig|null); + + /** RecognizeRequest configMask. */ + public configMask?: (google.protobuf.IFieldMask|null); + + /** RecognizeRequest content. */ + public content?: (Uint8Array|Buffer|string|null); + + /** RecognizeRequest uri. */ + public uri?: (string|null); + + /** RecognizeRequest audioSource. */ + public audioSource?: ("content"|"uri"); + + /** + * Creates a new RecognizeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RecognizeRequest instance + */ + public static create(properties?: google.cloud.speech.v2.IRecognizeRequest): google.cloud.speech.v2.RecognizeRequest; + + /** + * Encodes the specified RecognizeRequest message. Does not implicitly {@link google.cloud.speech.v2.RecognizeRequest.verify|verify} messages. + * @param message RecognizeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.IRecognizeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RecognizeRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v2.RecognizeRequest.verify|verify} messages. + * @param message RecognizeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.IRecognizeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RecognizeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RecognizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.RecognizeRequest; + + /** + * Decodes a RecognizeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RecognizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.RecognizeRequest; + + /** + * Verifies a RecognizeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RecognizeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RecognizeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.RecognizeRequest; + + /** + * Creates a plain object from a RecognizeRequest message. Also converts values to other types if specified. + * @param message RecognizeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.RecognizeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RecognizeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RecognizeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RecognitionResponseMetadata. */ + interface IRecognitionResponseMetadata { + + /** RecognitionResponseMetadata requestId */ + requestId?: (string|null); + + /** RecognitionResponseMetadata totalBilledDuration */ + totalBilledDuration?: (google.protobuf.IDuration|null); + } + + /** Represents a RecognitionResponseMetadata. */ + class RecognitionResponseMetadata implements IRecognitionResponseMetadata { + + /** + * Constructs a new RecognitionResponseMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.IRecognitionResponseMetadata); + + /** RecognitionResponseMetadata requestId. */ + public requestId: string; + + /** RecognitionResponseMetadata totalBilledDuration. */ + public totalBilledDuration?: (google.protobuf.IDuration|null); + + /** + * Creates a new RecognitionResponseMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns RecognitionResponseMetadata instance + */ + public static create(properties?: google.cloud.speech.v2.IRecognitionResponseMetadata): google.cloud.speech.v2.RecognitionResponseMetadata; + + /** + * Encodes the specified RecognitionResponseMetadata message. Does not implicitly {@link google.cloud.speech.v2.RecognitionResponseMetadata.verify|verify} messages. + * @param message RecognitionResponseMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.IRecognitionResponseMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RecognitionResponseMetadata message, length delimited. Does not implicitly {@link google.cloud.speech.v2.RecognitionResponseMetadata.verify|verify} messages. + * @param message RecognitionResponseMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.IRecognitionResponseMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RecognitionResponseMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RecognitionResponseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.RecognitionResponseMetadata; + + /** + * Decodes a RecognitionResponseMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RecognitionResponseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.RecognitionResponseMetadata; + + /** + * Verifies a RecognitionResponseMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RecognitionResponseMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RecognitionResponseMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.RecognitionResponseMetadata; + + /** + * Creates a plain object from a RecognitionResponseMetadata message. Also converts values to other types if specified. + * @param message RecognitionResponseMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.RecognitionResponseMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RecognitionResponseMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RecognitionResponseMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpeechRecognitionAlternative. */ + interface ISpeechRecognitionAlternative { + + /** SpeechRecognitionAlternative transcript */ + transcript?: (string|null); + + /** SpeechRecognitionAlternative confidence */ + confidence?: (number|null); + + /** SpeechRecognitionAlternative words */ + words?: (google.cloud.speech.v2.IWordInfo[]|null); + } + + /** Represents a SpeechRecognitionAlternative. */ + class SpeechRecognitionAlternative implements ISpeechRecognitionAlternative { + + /** + * Constructs a new SpeechRecognitionAlternative. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.ISpeechRecognitionAlternative); + + /** SpeechRecognitionAlternative transcript. */ + public transcript: string; + + /** SpeechRecognitionAlternative confidence. */ + public confidence: number; + + /** SpeechRecognitionAlternative words. */ + public words: google.cloud.speech.v2.IWordInfo[]; + + /** + * Creates a new SpeechRecognitionAlternative instance using the specified properties. + * @param [properties] Properties to set + * @returns SpeechRecognitionAlternative instance + */ + public static create(properties?: google.cloud.speech.v2.ISpeechRecognitionAlternative): google.cloud.speech.v2.SpeechRecognitionAlternative; + + /** + * Encodes the specified SpeechRecognitionAlternative message. Does not implicitly {@link google.cloud.speech.v2.SpeechRecognitionAlternative.verify|verify} messages. + * @param message SpeechRecognitionAlternative message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.ISpeechRecognitionAlternative, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpeechRecognitionAlternative message, length delimited. Does not implicitly {@link google.cloud.speech.v2.SpeechRecognitionAlternative.verify|verify} messages. + * @param message SpeechRecognitionAlternative message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.ISpeechRecognitionAlternative, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpeechRecognitionAlternative message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpeechRecognitionAlternative + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.SpeechRecognitionAlternative; + + /** + * Decodes a SpeechRecognitionAlternative message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpeechRecognitionAlternative + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.SpeechRecognitionAlternative; + + /** + * Verifies a SpeechRecognitionAlternative message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpeechRecognitionAlternative message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpeechRecognitionAlternative + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.SpeechRecognitionAlternative; + + /** + * Creates a plain object from a SpeechRecognitionAlternative message. Also converts values to other types if specified. + * @param message SpeechRecognitionAlternative + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.SpeechRecognitionAlternative, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpeechRecognitionAlternative to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpeechRecognitionAlternative + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WordInfo. */ + interface IWordInfo { + + /** WordInfo startOffset */ + startOffset?: (google.protobuf.IDuration|null); + + /** WordInfo endOffset */ + endOffset?: (google.protobuf.IDuration|null); + + /** WordInfo word */ + word?: (string|null); + + /** WordInfo confidence */ + confidence?: (number|null); + + /** WordInfo speakerLabel */ + speakerLabel?: (string|null); + } + + /** Represents a WordInfo. */ + class WordInfo implements IWordInfo { + + /** + * Constructs a new WordInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.IWordInfo); + + /** WordInfo startOffset. */ + public startOffset?: (google.protobuf.IDuration|null); + + /** WordInfo endOffset. */ + public endOffset?: (google.protobuf.IDuration|null); + + /** WordInfo word. */ + public word: string; + + /** WordInfo confidence. */ + public confidence: number; + + /** WordInfo speakerLabel. */ + public speakerLabel: string; + + /** + * Creates a new WordInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns WordInfo instance + */ + public static create(properties?: google.cloud.speech.v2.IWordInfo): google.cloud.speech.v2.WordInfo; + + /** + * Encodes the specified WordInfo message. Does not implicitly {@link google.cloud.speech.v2.WordInfo.verify|verify} messages. + * @param message WordInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.IWordInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WordInfo message, length delimited. Does not implicitly {@link google.cloud.speech.v2.WordInfo.verify|verify} messages. + * @param message WordInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.IWordInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WordInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WordInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.WordInfo; + + /** + * Decodes a WordInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WordInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.WordInfo; + + /** + * Verifies a WordInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WordInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WordInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.WordInfo; + + /** + * Creates a plain object from a WordInfo message. Also converts values to other types if specified. + * @param message WordInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.WordInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WordInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WordInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpeechRecognitionResult. */ + interface ISpeechRecognitionResult { + + /** SpeechRecognitionResult alternatives */ + alternatives?: (google.cloud.speech.v2.ISpeechRecognitionAlternative[]|null); + + /** SpeechRecognitionResult channelTag */ + channelTag?: (number|null); + + /** SpeechRecognitionResult resultEndOffset */ + resultEndOffset?: (google.protobuf.IDuration|null); + + /** SpeechRecognitionResult languageCode */ + languageCode?: (string|null); + } + + /** Represents a SpeechRecognitionResult. */ + class SpeechRecognitionResult implements ISpeechRecognitionResult { + + /** + * Constructs a new SpeechRecognitionResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.ISpeechRecognitionResult); + + /** SpeechRecognitionResult alternatives. */ + public alternatives: google.cloud.speech.v2.ISpeechRecognitionAlternative[]; + + /** SpeechRecognitionResult channelTag. */ + public channelTag: number; + + /** SpeechRecognitionResult resultEndOffset. */ + public resultEndOffset?: (google.protobuf.IDuration|null); + + /** SpeechRecognitionResult languageCode. */ + public languageCode: string; + + /** + * Creates a new SpeechRecognitionResult instance using the specified properties. + * @param [properties] Properties to set + * @returns SpeechRecognitionResult instance + */ + public static create(properties?: google.cloud.speech.v2.ISpeechRecognitionResult): google.cloud.speech.v2.SpeechRecognitionResult; + + /** + * Encodes the specified SpeechRecognitionResult message. Does not implicitly {@link google.cloud.speech.v2.SpeechRecognitionResult.verify|verify} messages. + * @param message SpeechRecognitionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.ISpeechRecognitionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpeechRecognitionResult message, length delimited. Does not implicitly {@link google.cloud.speech.v2.SpeechRecognitionResult.verify|verify} messages. + * @param message SpeechRecognitionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.ISpeechRecognitionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpeechRecognitionResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpeechRecognitionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.SpeechRecognitionResult; + + /** + * Decodes a SpeechRecognitionResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpeechRecognitionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.SpeechRecognitionResult; + + /** + * Verifies a SpeechRecognitionResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpeechRecognitionResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpeechRecognitionResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.SpeechRecognitionResult; + + /** + * Creates a plain object from a SpeechRecognitionResult message. Also converts values to other types if specified. + * @param message SpeechRecognitionResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.SpeechRecognitionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpeechRecognitionResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpeechRecognitionResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RecognizeResponse. */ + interface IRecognizeResponse { + + /** RecognizeResponse results */ + results?: (google.cloud.speech.v2.ISpeechRecognitionResult[]|null); + + /** RecognizeResponse metadata */ + metadata?: (google.cloud.speech.v2.IRecognitionResponseMetadata|null); + } + + /** Represents a RecognizeResponse. */ + class RecognizeResponse implements IRecognizeResponse { + + /** + * Constructs a new RecognizeResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.IRecognizeResponse); + + /** RecognizeResponse results. */ + public results: google.cloud.speech.v2.ISpeechRecognitionResult[]; + + /** RecognizeResponse metadata. */ + public metadata?: (google.cloud.speech.v2.IRecognitionResponseMetadata|null); + + /** + * Creates a new RecognizeResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RecognizeResponse instance + */ + public static create(properties?: google.cloud.speech.v2.IRecognizeResponse): google.cloud.speech.v2.RecognizeResponse; + + /** + * Encodes the specified RecognizeResponse message. Does not implicitly {@link google.cloud.speech.v2.RecognizeResponse.verify|verify} messages. + * @param message RecognizeResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.IRecognizeResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RecognizeResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v2.RecognizeResponse.verify|verify} messages. + * @param message RecognizeResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.IRecognizeResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RecognizeResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RecognizeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.RecognizeResponse; + + /** + * Decodes a RecognizeResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RecognizeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.RecognizeResponse; + + /** + * Verifies a RecognizeResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RecognizeResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RecognizeResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.RecognizeResponse; + + /** + * Creates a plain object from a RecognizeResponse message. Also converts values to other types if specified. + * @param message RecognizeResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.RecognizeResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RecognizeResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RecognizeResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StreamingRecognitionFeatures. */ + interface IStreamingRecognitionFeatures { + + /** StreamingRecognitionFeatures enableVoiceActivityEvents */ + enableVoiceActivityEvents?: (boolean|null); + + /** StreamingRecognitionFeatures interimResults */ + interimResults?: (boolean|null); + + /** StreamingRecognitionFeatures voiceActivityTimeout */ + voiceActivityTimeout?: (google.cloud.speech.v2.StreamingRecognitionFeatures.IVoiceActivityTimeout|null); + } + + /** Represents a StreamingRecognitionFeatures. */ + class StreamingRecognitionFeatures implements IStreamingRecognitionFeatures { + + /** + * Constructs a new StreamingRecognitionFeatures. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.IStreamingRecognitionFeatures); + + /** StreamingRecognitionFeatures enableVoiceActivityEvents. */ + public enableVoiceActivityEvents: boolean; + + /** StreamingRecognitionFeatures interimResults. */ + public interimResults: boolean; + + /** StreamingRecognitionFeatures voiceActivityTimeout. */ + public voiceActivityTimeout?: (google.cloud.speech.v2.StreamingRecognitionFeatures.IVoiceActivityTimeout|null); + + /** + * Creates a new StreamingRecognitionFeatures instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingRecognitionFeatures instance + */ + public static create(properties?: google.cloud.speech.v2.IStreamingRecognitionFeatures): google.cloud.speech.v2.StreamingRecognitionFeatures; + + /** + * Encodes the specified StreamingRecognitionFeatures message. Does not implicitly {@link google.cloud.speech.v2.StreamingRecognitionFeatures.verify|verify} messages. + * @param message StreamingRecognitionFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.IStreamingRecognitionFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamingRecognitionFeatures message, length delimited. Does not implicitly {@link google.cloud.speech.v2.StreamingRecognitionFeatures.verify|verify} messages. + * @param message StreamingRecognitionFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.IStreamingRecognitionFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamingRecognitionFeatures message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingRecognitionFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.StreamingRecognitionFeatures; + + /** + * Decodes a StreamingRecognitionFeatures message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingRecognitionFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.StreamingRecognitionFeatures; + + /** + * Verifies a StreamingRecognitionFeatures message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamingRecognitionFeatures message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingRecognitionFeatures + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.StreamingRecognitionFeatures; + + /** + * Creates a plain object from a StreamingRecognitionFeatures message. Also converts values to other types if specified. + * @param message StreamingRecognitionFeatures + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.StreamingRecognitionFeatures, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamingRecognitionFeatures to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamingRecognitionFeatures + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace StreamingRecognitionFeatures { + + /** Properties of a VoiceActivityTimeout. */ + interface IVoiceActivityTimeout { + + /** VoiceActivityTimeout speechStartTimeout */ + speechStartTimeout?: (google.protobuf.IDuration|null); + + /** VoiceActivityTimeout speechEndTimeout */ + speechEndTimeout?: (google.protobuf.IDuration|null); + } + + /** Represents a VoiceActivityTimeout. */ + class VoiceActivityTimeout implements IVoiceActivityTimeout { + + /** + * Constructs a new VoiceActivityTimeout. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.StreamingRecognitionFeatures.IVoiceActivityTimeout); + + /** VoiceActivityTimeout speechStartTimeout. */ + public speechStartTimeout?: (google.protobuf.IDuration|null); + + /** VoiceActivityTimeout speechEndTimeout. */ + public speechEndTimeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new VoiceActivityTimeout instance using the specified properties. + * @param [properties] Properties to set + * @returns VoiceActivityTimeout instance + */ + public static create(properties?: google.cloud.speech.v2.StreamingRecognitionFeatures.IVoiceActivityTimeout): google.cloud.speech.v2.StreamingRecognitionFeatures.VoiceActivityTimeout; + + /** + * Encodes the specified VoiceActivityTimeout message. Does not implicitly {@link google.cloud.speech.v2.StreamingRecognitionFeatures.VoiceActivityTimeout.verify|verify} messages. + * @param message VoiceActivityTimeout message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.StreamingRecognitionFeatures.IVoiceActivityTimeout, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VoiceActivityTimeout message, length delimited. Does not implicitly {@link google.cloud.speech.v2.StreamingRecognitionFeatures.VoiceActivityTimeout.verify|verify} messages. + * @param message VoiceActivityTimeout message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.StreamingRecognitionFeatures.IVoiceActivityTimeout, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VoiceActivityTimeout message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VoiceActivityTimeout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.StreamingRecognitionFeatures.VoiceActivityTimeout; + + /** + * Decodes a VoiceActivityTimeout message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VoiceActivityTimeout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.StreamingRecognitionFeatures.VoiceActivityTimeout; + + /** + * Verifies a VoiceActivityTimeout message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VoiceActivityTimeout message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VoiceActivityTimeout + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.StreamingRecognitionFeatures.VoiceActivityTimeout; + + /** + * Creates a plain object from a VoiceActivityTimeout message. Also converts values to other types if specified. + * @param message VoiceActivityTimeout + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.StreamingRecognitionFeatures.VoiceActivityTimeout, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VoiceActivityTimeout to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VoiceActivityTimeout + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a StreamingRecognitionConfig. */ + interface IStreamingRecognitionConfig { + + /** StreamingRecognitionConfig config */ + config?: (google.cloud.speech.v2.IRecognitionConfig|null); + + /** StreamingRecognitionConfig configMask */ + configMask?: (google.protobuf.IFieldMask|null); + + /** StreamingRecognitionConfig streamingFeatures */ + streamingFeatures?: (google.cloud.speech.v2.IStreamingRecognitionFeatures|null); + } + + /** Represents a StreamingRecognitionConfig. */ + class StreamingRecognitionConfig implements IStreamingRecognitionConfig { + + /** + * Constructs a new StreamingRecognitionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.IStreamingRecognitionConfig); + + /** StreamingRecognitionConfig config. */ + public config?: (google.cloud.speech.v2.IRecognitionConfig|null); + + /** StreamingRecognitionConfig configMask. */ + public configMask?: (google.protobuf.IFieldMask|null); + + /** StreamingRecognitionConfig streamingFeatures. */ + public streamingFeatures?: (google.cloud.speech.v2.IStreamingRecognitionFeatures|null); + + /** + * Creates a new StreamingRecognitionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingRecognitionConfig instance + */ + public static create(properties?: google.cloud.speech.v2.IStreamingRecognitionConfig): google.cloud.speech.v2.StreamingRecognitionConfig; + + /** + * Encodes the specified StreamingRecognitionConfig message. Does not implicitly {@link google.cloud.speech.v2.StreamingRecognitionConfig.verify|verify} messages. + * @param message StreamingRecognitionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.IStreamingRecognitionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamingRecognitionConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v2.StreamingRecognitionConfig.verify|verify} messages. + * @param message StreamingRecognitionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.IStreamingRecognitionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamingRecognitionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingRecognitionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.StreamingRecognitionConfig; + + /** + * Decodes a StreamingRecognitionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingRecognitionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.StreamingRecognitionConfig; + + /** + * Verifies a StreamingRecognitionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamingRecognitionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingRecognitionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.StreamingRecognitionConfig; + + /** + * Creates a plain object from a StreamingRecognitionConfig message. Also converts values to other types if specified. + * @param message StreamingRecognitionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.StreamingRecognitionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamingRecognitionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamingRecognitionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StreamingRecognizeRequest. */ + interface IStreamingRecognizeRequest { + + /** StreamingRecognizeRequest recognizer */ + recognizer?: (string|null); + + /** StreamingRecognizeRequest streamingConfig */ + streamingConfig?: (google.cloud.speech.v2.IStreamingRecognitionConfig|null); + + /** StreamingRecognizeRequest audio */ + audio?: (Uint8Array|Buffer|string|null); + } + + /** Represents a StreamingRecognizeRequest. */ + class StreamingRecognizeRequest implements IStreamingRecognizeRequest { + + /** + * Constructs a new StreamingRecognizeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.IStreamingRecognizeRequest); + + /** StreamingRecognizeRequest recognizer. */ + public recognizer: string; + + /** StreamingRecognizeRequest streamingConfig. */ + public streamingConfig?: (google.cloud.speech.v2.IStreamingRecognitionConfig|null); + + /** StreamingRecognizeRequest audio. */ + public audio?: (Uint8Array|Buffer|string|null); + + /** StreamingRecognizeRequest streamingRequest. */ + public streamingRequest?: ("streamingConfig"|"audio"); + + /** + * Creates a new StreamingRecognizeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingRecognizeRequest instance + */ + public static create(properties?: google.cloud.speech.v2.IStreamingRecognizeRequest): google.cloud.speech.v2.StreamingRecognizeRequest; + + /** + * Encodes the specified StreamingRecognizeRequest message. Does not implicitly {@link google.cloud.speech.v2.StreamingRecognizeRequest.verify|verify} messages. + * @param message StreamingRecognizeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.IStreamingRecognizeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamingRecognizeRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v2.StreamingRecognizeRequest.verify|verify} messages. + * @param message StreamingRecognizeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.IStreamingRecognizeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamingRecognizeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingRecognizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.StreamingRecognizeRequest; + + /** + * Decodes a StreamingRecognizeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingRecognizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.StreamingRecognizeRequest; + + /** + * Verifies a StreamingRecognizeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamingRecognizeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingRecognizeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.StreamingRecognizeRequest; + + /** + * Creates a plain object from a StreamingRecognizeRequest message. Also converts values to other types if specified. + * @param message StreamingRecognizeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.StreamingRecognizeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamingRecognizeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamingRecognizeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchRecognizeRequest. */ + interface IBatchRecognizeRequest { + + /** BatchRecognizeRequest recognizer */ + recognizer?: (string|null); + + /** BatchRecognizeRequest config */ + config?: (google.cloud.speech.v2.IRecognitionConfig|null); + + /** BatchRecognizeRequest configMask */ + configMask?: (google.protobuf.IFieldMask|null); + + /** BatchRecognizeRequest files */ + files?: (google.cloud.speech.v2.IBatchRecognizeFileMetadata[]|null); + + /** BatchRecognizeRequest recognitionOutputConfig */ + recognitionOutputConfig?: (google.cloud.speech.v2.IRecognitionOutputConfig|null); + + /** BatchRecognizeRequest processingStrategy */ + processingStrategy?: (google.cloud.speech.v2.BatchRecognizeRequest.ProcessingStrategy|keyof typeof google.cloud.speech.v2.BatchRecognizeRequest.ProcessingStrategy|null); + } + + /** Represents a BatchRecognizeRequest. */ + class BatchRecognizeRequest implements IBatchRecognizeRequest { + + /** + * Constructs a new BatchRecognizeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.IBatchRecognizeRequest); + + /** BatchRecognizeRequest recognizer. */ + public recognizer: string; + + /** BatchRecognizeRequest config. */ + public config?: (google.cloud.speech.v2.IRecognitionConfig|null); + + /** BatchRecognizeRequest configMask. */ + public configMask?: (google.protobuf.IFieldMask|null); + + /** BatchRecognizeRequest files. */ + public files: google.cloud.speech.v2.IBatchRecognizeFileMetadata[]; + + /** BatchRecognizeRequest recognitionOutputConfig. */ + public recognitionOutputConfig?: (google.cloud.speech.v2.IRecognitionOutputConfig|null); + + /** BatchRecognizeRequest processingStrategy. */ + public processingStrategy: (google.cloud.speech.v2.BatchRecognizeRequest.ProcessingStrategy|keyof typeof google.cloud.speech.v2.BatchRecognizeRequest.ProcessingStrategy); + + /** + * Creates a new BatchRecognizeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchRecognizeRequest instance + */ + public static create(properties?: google.cloud.speech.v2.IBatchRecognizeRequest): google.cloud.speech.v2.BatchRecognizeRequest; + + /** + * Encodes the specified BatchRecognizeRequest message. Does not implicitly {@link google.cloud.speech.v2.BatchRecognizeRequest.verify|verify} messages. + * @param message BatchRecognizeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.IBatchRecognizeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchRecognizeRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v2.BatchRecognizeRequest.verify|verify} messages. + * @param message BatchRecognizeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.IBatchRecognizeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchRecognizeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchRecognizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.BatchRecognizeRequest; + + /** + * Decodes a BatchRecognizeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchRecognizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.BatchRecognizeRequest; + + /** + * Verifies a BatchRecognizeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchRecognizeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchRecognizeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.BatchRecognizeRequest; + + /** + * Creates a plain object from a BatchRecognizeRequest message. Also converts values to other types if specified. + * @param message BatchRecognizeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.BatchRecognizeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchRecognizeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchRecognizeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BatchRecognizeRequest { + + /** ProcessingStrategy enum. */ + enum ProcessingStrategy { + PROCESSING_STRATEGY_UNSPECIFIED = 0, + DYNAMIC_BATCHING = 1 + } + } + + /** Properties of a GcsOutputConfig. */ + interface IGcsOutputConfig { + + /** GcsOutputConfig uri */ + uri?: (string|null); + } + + /** Represents a GcsOutputConfig. */ + class GcsOutputConfig implements IGcsOutputConfig { + + /** + * Constructs a new GcsOutputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.IGcsOutputConfig); + + /** GcsOutputConfig uri. */ + public uri: string; + + /** + * Creates a new GcsOutputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsOutputConfig instance + */ + public static create(properties?: google.cloud.speech.v2.IGcsOutputConfig): google.cloud.speech.v2.GcsOutputConfig; + + /** + * Encodes the specified GcsOutputConfig message. Does not implicitly {@link google.cloud.speech.v2.GcsOutputConfig.verify|verify} messages. + * @param message GcsOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.IGcsOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsOutputConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v2.GcsOutputConfig.verify|verify} messages. + * @param message GcsOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.IGcsOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcsOutputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcsOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.GcsOutputConfig; + + /** + * Decodes a GcsOutputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcsOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.GcsOutputConfig; + + /** + * Verifies a GcsOutputConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GcsOutputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcsOutputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.GcsOutputConfig; + + /** + * Creates a plain object from a GcsOutputConfig message. Also converts values to other types if specified. + * @param message GcsOutputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.GcsOutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsOutputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcsOutputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InlineOutputConfig. */ + interface IInlineOutputConfig { + } + + /** Represents an InlineOutputConfig. */ + class InlineOutputConfig implements IInlineOutputConfig { + + /** + * Constructs a new InlineOutputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.IInlineOutputConfig); + + /** + * Creates a new InlineOutputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns InlineOutputConfig instance + */ + public static create(properties?: google.cloud.speech.v2.IInlineOutputConfig): google.cloud.speech.v2.InlineOutputConfig; + + /** + * Encodes the specified InlineOutputConfig message. Does not implicitly {@link google.cloud.speech.v2.InlineOutputConfig.verify|verify} messages. + * @param message InlineOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.IInlineOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InlineOutputConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v2.InlineOutputConfig.verify|verify} messages. + * @param message InlineOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.IInlineOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InlineOutputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InlineOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.InlineOutputConfig; + + /** + * Decodes an InlineOutputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InlineOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.InlineOutputConfig; + + /** + * Verifies an InlineOutputConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InlineOutputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InlineOutputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.InlineOutputConfig; + + /** + * Creates a plain object from an InlineOutputConfig message. Also converts values to other types if specified. + * @param message InlineOutputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.InlineOutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InlineOutputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InlineOutputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NativeOutputFileFormatConfig. */ + interface INativeOutputFileFormatConfig { + } + + /** Represents a NativeOutputFileFormatConfig. */ + class NativeOutputFileFormatConfig implements INativeOutputFileFormatConfig { + + /** + * Constructs a new NativeOutputFileFormatConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.INativeOutputFileFormatConfig); + + /** + * Creates a new NativeOutputFileFormatConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns NativeOutputFileFormatConfig instance + */ + public static create(properties?: google.cloud.speech.v2.INativeOutputFileFormatConfig): google.cloud.speech.v2.NativeOutputFileFormatConfig; + + /** + * Encodes the specified NativeOutputFileFormatConfig message. Does not implicitly {@link google.cloud.speech.v2.NativeOutputFileFormatConfig.verify|verify} messages. + * @param message NativeOutputFileFormatConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.INativeOutputFileFormatConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NativeOutputFileFormatConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v2.NativeOutputFileFormatConfig.verify|verify} messages. + * @param message NativeOutputFileFormatConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.INativeOutputFileFormatConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NativeOutputFileFormatConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NativeOutputFileFormatConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.NativeOutputFileFormatConfig; + + /** + * Decodes a NativeOutputFileFormatConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NativeOutputFileFormatConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.NativeOutputFileFormatConfig; + + /** + * Verifies a NativeOutputFileFormatConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NativeOutputFileFormatConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NativeOutputFileFormatConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.NativeOutputFileFormatConfig; + + /** + * Creates a plain object from a NativeOutputFileFormatConfig message. Also converts values to other types if specified. + * @param message NativeOutputFileFormatConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.NativeOutputFileFormatConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NativeOutputFileFormatConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NativeOutputFileFormatConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VttOutputFileFormatConfig. */ + interface IVttOutputFileFormatConfig { + } + + /** Represents a VttOutputFileFormatConfig. */ + class VttOutputFileFormatConfig implements IVttOutputFileFormatConfig { + + /** + * Constructs a new VttOutputFileFormatConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.IVttOutputFileFormatConfig); + + /** + * Creates a new VttOutputFileFormatConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns VttOutputFileFormatConfig instance + */ + public static create(properties?: google.cloud.speech.v2.IVttOutputFileFormatConfig): google.cloud.speech.v2.VttOutputFileFormatConfig; + + /** + * Encodes the specified VttOutputFileFormatConfig message. Does not implicitly {@link google.cloud.speech.v2.VttOutputFileFormatConfig.verify|verify} messages. + * @param message VttOutputFileFormatConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.IVttOutputFileFormatConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VttOutputFileFormatConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v2.VttOutputFileFormatConfig.verify|verify} messages. + * @param message VttOutputFileFormatConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.IVttOutputFileFormatConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VttOutputFileFormatConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VttOutputFileFormatConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.VttOutputFileFormatConfig; + + /** + * Decodes a VttOutputFileFormatConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VttOutputFileFormatConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.VttOutputFileFormatConfig; + + /** + * Verifies a VttOutputFileFormatConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VttOutputFileFormatConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VttOutputFileFormatConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.VttOutputFileFormatConfig; + + /** + * Creates a plain object from a VttOutputFileFormatConfig message. Also converts values to other types if specified. + * @param message VttOutputFileFormatConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.VttOutputFileFormatConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VttOutputFileFormatConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VttOutputFileFormatConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SrtOutputFileFormatConfig. */ + interface ISrtOutputFileFormatConfig { + } + + /** Represents a SrtOutputFileFormatConfig. */ + class SrtOutputFileFormatConfig implements ISrtOutputFileFormatConfig { + + /** + * Constructs a new SrtOutputFileFormatConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.ISrtOutputFileFormatConfig); + + /** + * Creates a new SrtOutputFileFormatConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SrtOutputFileFormatConfig instance + */ + public static create(properties?: google.cloud.speech.v2.ISrtOutputFileFormatConfig): google.cloud.speech.v2.SrtOutputFileFormatConfig; + + /** + * Encodes the specified SrtOutputFileFormatConfig message. Does not implicitly {@link google.cloud.speech.v2.SrtOutputFileFormatConfig.verify|verify} messages. + * @param message SrtOutputFileFormatConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.ISrtOutputFileFormatConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SrtOutputFileFormatConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v2.SrtOutputFileFormatConfig.verify|verify} messages. + * @param message SrtOutputFileFormatConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.ISrtOutputFileFormatConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SrtOutputFileFormatConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SrtOutputFileFormatConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.SrtOutputFileFormatConfig; + + /** + * Decodes a SrtOutputFileFormatConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SrtOutputFileFormatConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.SrtOutputFileFormatConfig; + + /** + * Verifies a SrtOutputFileFormatConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SrtOutputFileFormatConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SrtOutputFileFormatConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.SrtOutputFileFormatConfig; + + /** + * Creates a plain object from a SrtOutputFileFormatConfig message. Also converts values to other types if specified. + * @param message SrtOutputFileFormatConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.SrtOutputFileFormatConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SrtOutputFileFormatConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SrtOutputFileFormatConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OutputFormatConfig. */ + interface IOutputFormatConfig { + + /** OutputFormatConfig native */ + native?: (google.cloud.speech.v2.INativeOutputFileFormatConfig|null); + + /** OutputFormatConfig vtt */ + vtt?: (google.cloud.speech.v2.IVttOutputFileFormatConfig|null); + + /** OutputFormatConfig srt */ + srt?: (google.cloud.speech.v2.ISrtOutputFileFormatConfig|null); + } + + /** Represents an OutputFormatConfig. */ + class OutputFormatConfig implements IOutputFormatConfig { + + /** + * Constructs a new OutputFormatConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.IOutputFormatConfig); + + /** OutputFormatConfig native. */ + public native?: (google.cloud.speech.v2.INativeOutputFileFormatConfig|null); + + /** OutputFormatConfig vtt. */ + public vtt?: (google.cloud.speech.v2.IVttOutputFileFormatConfig|null); + + /** OutputFormatConfig srt. */ + public srt?: (google.cloud.speech.v2.ISrtOutputFileFormatConfig|null); + + /** + * Creates a new OutputFormatConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns OutputFormatConfig instance + */ + public static create(properties?: google.cloud.speech.v2.IOutputFormatConfig): google.cloud.speech.v2.OutputFormatConfig; + + /** + * Encodes the specified OutputFormatConfig message. Does not implicitly {@link google.cloud.speech.v2.OutputFormatConfig.verify|verify} messages. + * @param message OutputFormatConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.IOutputFormatConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OutputFormatConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v2.OutputFormatConfig.verify|verify} messages. + * @param message OutputFormatConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.IOutputFormatConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OutputFormatConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OutputFormatConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.OutputFormatConfig; + + /** + * Decodes an OutputFormatConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OutputFormatConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.OutputFormatConfig; + + /** + * Verifies an OutputFormatConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OutputFormatConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OutputFormatConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.OutputFormatConfig; + + /** + * Creates a plain object from an OutputFormatConfig message. Also converts values to other types if specified. + * @param message OutputFormatConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.OutputFormatConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OutputFormatConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OutputFormatConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RecognitionOutputConfig. */ + interface IRecognitionOutputConfig { + + /** RecognitionOutputConfig gcsOutputConfig */ + gcsOutputConfig?: (google.cloud.speech.v2.IGcsOutputConfig|null); + + /** RecognitionOutputConfig inlineResponseConfig */ + inlineResponseConfig?: (google.cloud.speech.v2.IInlineOutputConfig|null); + + /** RecognitionOutputConfig outputFormatConfig */ + outputFormatConfig?: (google.cloud.speech.v2.IOutputFormatConfig|null); + } + + /** Represents a RecognitionOutputConfig. */ + class RecognitionOutputConfig implements IRecognitionOutputConfig { + + /** + * Constructs a new RecognitionOutputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.IRecognitionOutputConfig); + + /** RecognitionOutputConfig gcsOutputConfig. */ + public gcsOutputConfig?: (google.cloud.speech.v2.IGcsOutputConfig|null); + + /** RecognitionOutputConfig inlineResponseConfig. */ + public inlineResponseConfig?: (google.cloud.speech.v2.IInlineOutputConfig|null); + + /** RecognitionOutputConfig outputFormatConfig. */ + public outputFormatConfig?: (google.cloud.speech.v2.IOutputFormatConfig|null); + + /** RecognitionOutputConfig output. */ + public output?: ("gcsOutputConfig"|"inlineResponseConfig"); + + /** + * Creates a new RecognitionOutputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns RecognitionOutputConfig instance + */ + public static create(properties?: google.cloud.speech.v2.IRecognitionOutputConfig): google.cloud.speech.v2.RecognitionOutputConfig; + + /** + * Encodes the specified RecognitionOutputConfig message. Does not implicitly {@link google.cloud.speech.v2.RecognitionOutputConfig.verify|verify} messages. + * @param message RecognitionOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.IRecognitionOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RecognitionOutputConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v2.RecognitionOutputConfig.verify|verify} messages. + * @param message RecognitionOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.IRecognitionOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RecognitionOutputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RecognitionOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.RecognitionOutputConfig; + + /** + * Decodes a RecognitionOutputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RecognitionOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.RecognitionOutputConfig; + + /** + * Verifies a RecognitionOutputConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RecognitionOutputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RecognitionOutputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.RecognitionOutputConfig; + + /** + * Creates a plain object from a RecognitionOutputConfig message. Also converts values to other types if specified. + * @param message RecognitionOutputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.RecognitionOutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RecognitionOutputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RecognitionOutputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchRecognizeResponse. */ + interface IBatchRecognizeResponse { + + /** BatchRecognizeResponse results */ + results?: ({ [k: string]: google.cloud.speech.v2.IBatchRecognizeFileResult }|null); + + /** BatchRecognizeResponse totalBilledDuration */ + totalBilledDuration?: (google.protobuf.IDuration|null); + } + + /** Represents a BatchRecognizeResponse. */ + class BatchRecognizeResponse implements IBatchRecognizeResponse { + + /** + * Constructs a new BatchRecognizeResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.IBatchRecognizeResponse); + + /** BatchRecognizeResponse results. */ + public results: { [k: string]: google.cloud.speech.v2.IBatchRecognizeFileResult }; + + /** BatchRecognizeResponse totalBilledDuration. */ + public totalBilledDuration?: (google.protobuf.IDuration|null); + + /** + * Creates a new BatchRecognizeResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchRecognizeResponse instance + */ + public static create(properties?: google.cloud.speech.v2.IBatchRecognizeResponse): google.cloud.speech.v2.BatchRecognizeResponse; + + /** + * Encodes the specified BatchRecognizeResponse message. Does not implicitly {@link google.cloud.speech.v2.BatchRecognizeResponse.verify|verify} messages. + * @param message BatchRecognizeResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.IBatchRecognizeResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchRecognizeResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v2.BatchRecognizeResponse.verify|verify} messages. + * @param message BatchRecognizeResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.IBatchRecognizeResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchRecognizeResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchRecognizeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.BatchRecognizeResponse; + + /** + * Decodes a BatchRecognizeResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchRecognizeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.BatchRecognizeResponse; + + /** + * Verifies a BatchRecognizeResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchRecognizeResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchRecognizeResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.BatchRecognizeResponse; + + /** + * Creates a plain object from a BatchRecognizeResponse message. Also converts values to other types if specified. + * @param message BatchRecognizeResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.BatchRecognizeResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchRecognizeResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchRecognizeResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchRecognizeResults. */ + interface IBatchRecognizeResults { + + /** BatchRecognizeResults results */ + results?: (google.cloud.speech.v2.ISpeechRecognitionResult[]|null); + + /** BatchRecognizeResults metadata */ + metadata?: (google.cloud.speech.v2.IRecognitionResponseMetadata|null); + } + + /** Represents a BatchRecognizeResults. */ + class BatchRecognizeResults implements IBatchRecognizeResults { + + /** + * Constructs a new BatchRecognizeResults. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.IBatchRecognizeResults); + + /** BatchRecognizeResults results. */ + public results: google.cloud.speech.v2.ISpeechRecognitionResult[]; + + /** BatchRecognizeResults metadata. */ + public metadata?: (google.cloud.speech.v2.IRecognitionResponseMetadata|null); + + /** + * Creates a new BatchRecognizeResults instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchRecognizeResults instance + */ + public static create(properties?: google.cloud.speech.v2.IBatchRecognizeResults): google.cloud.speech.v2.BatchRecognizeResults; + + /** + * Encodes the specified BatchRecognizeResults message. Does not implicitly {@link google.cloud.speech.v2.BatchRecognizeResults.verify|verify} messages. + * @param message BatchRecognizeResults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.IBatchRecognizeResults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchRecognizeResults message, length delimited. Does not implicitly {@link google.cloud.speech.v2.BatchRecognizeResults.verify|verify} messages. + * @param message BatchRecognizeResults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.IBatchRecognizeResults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchRecognizeResults message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchRecognizeResults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.BatchRecognizeResults; + + /** + * Decodes a BatchRecognizeResults message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchRecognizeResults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.BatchRecognizeResults; + + /** + * Verifies a BatchRecognizeResults message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchRecognizeResults message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchRecognizeResults + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.BatchRecognizeResults; + + /** + * Creates a plain object from a BatchRecognizeResults message. Also converts values to other types if specified. + * @param message BatchRecognizeResults + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.BatchRecognizeResults, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchRecognizeResults to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchRecognizeResults + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CloudStorageResult. */ + interface ICloudStorageResult { + + /** CloudStorageResult uri */ + uri?: (string|null); + + /** CloudStorageResult vttFormatUri */ + vttFormatUri?: (string|null); + + /** CloudStorageResult srtFormatUri */ + srtFormatUri?: (string|null); + } + + /** Represents a CloudStorageResult. */ + class CloudStorageResult implements ICloudStorageResult { + + /** + * Constructs a new CloudStorageResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.ICloudStorageResult); + + /** CloudStorageResult uri. */ + public uri: string; + + /** CloudStorageResult vttFormatUri. */ + public vttFormatUri: string; + + /** CloudStorageResult srtFormatUri. */ + public srtFormatUri: string; + + /** + * Creates a new CloudStorageResult instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudStorageResult instance + */ + public static create(properties?: google.cloud.speech.v2.ICloudStorageResult): google.cloud.speech.v2.CloudStorageResult; + + /** + * Encodes the specified CloudStorageResult message. Does not implicitly {@link google.cloud.speech.v2.CloudStorageResult.verify|verify} messages. + * @param message CloudStorageResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.ICloudStorageResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudStorageResult message, length delimited. Does not implicitly {@link google.cloud.speech.v2.CloudStorageResult.verify|verify} messages. + * @param message CloudStorageResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.ICloudStorageResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudStorageResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudStorageResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.CloudStorageResult; + + /** + * Decodes a CloudStorageResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudStorageResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.CloudStorageResult; + + /** + * Verifies a CloudStorageResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloudStorageResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudStorageResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.CloudStorageResult; + + /** + * Creates a plain object from a CloudStorageResult message. Also converts values to other types if specified. + * @param message CloudStorageResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.CloudStorageResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudStorageResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudStorageResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InlineResult. */ + interface IInlineResult { + + /** InlineResult transcript */ + transcript?: (google.cloud.speech.v2.IBatchRecognizeResults|null); + + /** InlineResult vttCaptions */ + vttCaptions?: (string|null); + + /** InlineResult srtCaptions */ + srtCaptions?: (string|null); + } + + /** Represents an InlineResult. */ + class InlineResult implements IInlineResult { + + /** + * Constructs a new InlineResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.IInlineResult); + + /** InlineResult transcript. */ + public transcript?: (google.cloud.speech.v2.IBatchRecognizeResults|null); + + /** InlineResult vttCaptions. */ + public vttCaptions: string; + + /** InlineResult srtCaptions. */ + public srtCaptions: string; + + /** + * Creates a new InlineResult instance using the specified properties. + * @param [properties] Properties to set + * @returns InlineResult instance + */ + public static create(properties?: google.cloud.speech.v2.IInlineResult): google.cloud.speech.v2.InlineResult; + + /** + * Encodes the specified InlineResult message. Does not implicitly {@link google.cloud.speech.v2.InlineResult.verify|verify} messages. + * @param message InlineResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.IInlineResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InlineResult message, length delimited. Does not implicitly {@link google.cloud.speech.v2.InlineResult.verify|verify} messages. + * @param message InlineResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.IInlineResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InlineResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InlineResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.InlineResult; + + /** + * Decodes an InlineResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InlineResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.InlineResult; + + /** + * Verifies an InlineResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InlineResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InlineResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.InlineResult; + + /** + * Creates a plain object from an InlineResult message. Also converts values to other types if specified. + * @param message InlineResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.InlineResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InlineResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InlineResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchRecognizeFileResult. */ + interface IBatchRecognizeFileResult { + + /** BatchRecognizeFileResult error */ + error?: (google.rpc.IStatus|null); + + /** BatchRecognizeFileResult metadata */ + metadata?: (google.cloud.speech.v2.IRecognitionResponseMetadata|null); + + /** BatchRecognizeFileResult cloudStorageResult */ + cloudStorageResult?: (google.cloud.speech.v2.ICloudStorageResult|null); + + /** BatchRecognizeFileResult inlineResult */ + inlineResult?: (google.cloud.speech.v2.IInlineResult|null); + + /** BatchRecognizeFileResult uri */ + uri?: (string|null); + + /** BatchRecognizeFileResult transcript */ + transcript?: (google.cloud.speech.v2.IBatchRecognizeResults|null); + } + + /** Represents a BatchRecognizeFileResult. */ + class BatchRecognizeFileResult implements IBatchRecognizeFileResult { + + /** + * Constructs a new BatchRecognizeFileResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.IBatchRecognizeFileResult); + + /** BatchRecognizeFileResult error. */ + public error?: (google.rpc.IStatus|null); + + /** BatchRecognizeFileResult metadata. */ + public metadata?: (google.cloud.speech.v2.IRecognitionResponseMetadata|null); + + /** BatchRecognizeFileResult cloudStorageResult. */ + public cloudStorageResult?: (google.cloud.speech.v2.ICloudStorageResult|null); + + /** BatchRecognizeFileResult inlineResult. */ + public inlineResult?: (google.cloud.speech.v2.IInlineResult|null); + + /** BatchRecognizeFileResult uri. */ + public uri: string; + + /** BatchRecognizeFileResult transcript. */ + public transcript?: (google.cloud.speech.v2.IBatchRecognizeResults|null); + + /** BatchRecognizeFileResult result. */ + public result?: ("cloudStorageResult"|"inlineResult"); + + /** + * Creates a new BatchRecognizeFileResult instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchRecognizeFileResult instance + */ + public static create(properties?: google.cloud.speech.v2.IBatchRecognizeFileResult): google.cloud.speech.v2.BatchRecognizeFileResult; + + /** + * Encodes the specified BatchRecognizeFileResult message. Does not implicitly {@link google.cloud.speech.v2.BatchRecognizeFileResult.verify|verify} messages. + * @param message BatchRecognizeFileResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.IBatchRecognizeFileResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchRecognizeFileResult message, length delimited. Does not implicitly {@link google.cloud.speech.v2.BatchRecognizeFileResult.verify|verify} messages. + * @param message BatchRecognizeFileResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.IBatchRecognizeFileResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchRecognizeFileResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchRecognizeFileResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.BatchRecognizeFileResult; + + /** + * Decodes a BatchRecognizeFileResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchRecognizeFileResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.BatchRecognizeFileResult; + + /** + * Verifies a BatchRecognizeFileResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchRecognizeFileResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchRecognizeFileResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.BatchRecognizeFileResult; + + /** + * Creates a plain object from a BatchRecognizeFileResult message. Also converts values to other types if specified. + * @param message BatchRecognizeFileResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.BatchRecognizeFileResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchRecognizeFileResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchRecognizeFileResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchRecognizeTranscriptionMetadata. */ + interface IBatchRecognizeTranscriptionMetadata { + + /** BatchRecognizeTranscriptionMetadata progressPercent */ + progressPercent?: (number|null); + + /** BatchRecognizeTranscriptionMetadata error */ + error?: (google.rpc.IStatus|null); + + /** BatchRecognizeTranscriptionMetadata uri */ + uri?: (string|null); + } + + /** Represents a BatchRecognizeTranscriptionMetadata. */ + class BatchRecognizeTranscriptionMetadata implements IBatchRecognizeTranscriptionMetadata { + + /** + * Constructs a new BatchRecognizeTranscriptionMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.IBatchRecognizeTranscriptionMetadata); + + /** BatchRecognizeTranscriptionMetadata progressPercent. */ + public progressPercent: number; + + /** BatchRecognizeTranscriptionMetadata error. */ + public error?: (google.rpc.IStatus|null); + + /** BatchRecognizeTranscriptionMetadata uri. */ + public uri: string; + + /** + * Creates a new BatchRecognizeTranscriptionMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchRecognizeTranscriptionMetadata instance + */ + public static create(properties?: google.cloud.speech.v2.IBatchRecognizeTranscriptionMetadata): google.cloud.speech.v2.BatchRecognizeTranscriptionMetadata; + + /** + * Encodes the specified BatchRecognizeTranscriptionMetadata message. Does not implicitly {@link google.cloud.speech.v2.BatchRecognizeTranscriptionMetadata.verify|verify} messages. + * @param message BatchRecognizeTranscriptionMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.IBatchRecognizeTranscriptionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchRecognizeTranscriptionMetadata message, length delimited. Does not implicitly {@link google.cloud.speech.v2.BatchRecognizeTranscriptionMetadata.verify|verify} messages. + * @param message BatchRecognizeTranscriptionMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.IBatchRecognizeTranscriptionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchRecognizeTranscriptionMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchRecognizeTranscriptionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.BatchRecognizeTranscriptionMetadata; + + /** + * Decodes a BatchRecognizeTranscriptionMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchRecognizeTranscriptionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.BatchRecognizeTranscriptionMetadata; + + /** + * Verifies a BatchRecognizeTranscriptionMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchRecognizeTranscriptionMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchRecognizeTranscriptionMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.BatchRecognizeTranscriptionMetadata; + + /** + * Creates a plain object from a BatchRecognizeTranscriptionMetadata message. Also converts values to other types if specified. + * @param message BatchRecognizeTranscriptionMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.BatchRecognizeTranscriptionMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchRecognizeTranscriptionMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchRecognizeTranscriptionMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchRecognizeMetadata. */ + interface IBatchRecognizeMetadata { + + /** BatchRecognizeMetadata transcriptionMetadata */ + transcriptionMetadata?: ({ [k: string]: google.cloud.speech.v2.IBatchRecognizeTranscriptionMetadata }|null); + } + + /** Represents a BatchRecognizeMetadata. */ + class BatchRecognizeMetadata implements IBatchRecognizeMetadata { + + /** + * Constructs a new BatchRecognizeMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.IBatchRecognizeMetadata); + + /** BatchRecognizeMetadata transcriptionMetadata. */ + public transcriptionMetadata: { [k: string]: google.cloud.speech.v2.IBatchRecognizeTranscriptionMetadata }; + + /** + * Creates a new BatchRecognizeMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchRecognizeMetadata instance + */ + public static create(properties?: google.cloud.speech.v2.IBatchRecognizeMetadata): google.cloud.speech.v2.BatchRecognizeMetadata; + + /** + * Encodes the specified BatchRecognizeMetadata message. Does not implicitly {@link google.cloud.speech.v2.BatchRecognizeMetadata.verify|verify} messages. + * @param message BatchRecognizeMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.IBatchRecognizeMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchRecognizeMetadata message, length delimited. Does not implicitly {@link google.cloud.speech.v2.BatchRecognizeMetadata.verify|verify} messages. + * @param message BatchRecognizeMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.IBatchRecognizeMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchRecognizeMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchRecognizeMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.BatchRecognizeMetadata; + + /** + * Decodes a BatchRecognizeMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchRecognizeMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.BatchRecognizeMetadata; + + /** + * Verifies a BatchRecognizeMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchRecognizeMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchRecognizeMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.BatchRecognizeMetadata; + + /** + * Creates a plain object from a BatchRecognizeMetadata message. Also converts values to other types if specified. + * @param message BatchRecognizeMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.BatchRecognizeMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchRecognizeMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchRecognizeMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchRecognizeFileMetadata. */ + interface IBatchRecognizeFileMetadata { + + /** BatchRecognizeFileMetadata uri */ + uri?: (string|null); + + /** BatchRecognizeFileMetadata config */ + config?: (google.cloud.speech.v2.IRecognitionConfig|null); + + /** BatchRecognizeFileMetadata configMask */ + configMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents a BatchRecognizeFileMetadata. */ + class BatchRecognizeFileMetadata implements IBatchRecognizeFileMetadata { + + /** + * Constructs a new BatchRecognizeFileMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.IBatchRecognizeFileMetadata); + + /** BatchRecognizeFileMetadata uri. */ + public uri?: (string|null); + + /** BatchRecognizeFileMetadata config. */ + public config?: (google.cloud.speech.v2.IRecognitionConfig|null); + + /** BatchRecognizeFileMetadata configMask. */ + public configMask?: (google.protobuf.IFieldMask|null); + + /** BatchRecognizeFileMetadata audioSource. */ + public audioSource?: "uri"; + + /** + * Creates a new BatchRecognizeFileMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchRecognizeFileMetadata instance + */ + public static create(properties?: google.cloud.speech.v2.IBatchRecognizeFileMetadata): google.cloud.speech.v2.BatchRecognizeFileMetadata; + + /** + * Encodes the specified BatchRecognizeFileMetadata message. Does not implicitly {@link google.cloud.speech.v2.BatchRecognizeFileMetadata.verify|verify} messages. + * @param message BatchRecognizeFileMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.IBatchRecognizeFileMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchRecognizeFileMetadata message, length delimited. Does not implicitly {@link google.cloud.speech.v2.BatchRecognizeFileMetadata.verify|verify} messages. + * @param message BatchRecognizeFileMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.IBatchRecognizeFileMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchRecognizeFileMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchRecognizeFileMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.BatchRecognizeFileMetadata; + + /** + * Decodes a BatchRecognizeFileMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchRecognizeFileMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.BatchRecognizeFileMetadata; + + /** + * Verifies a BatchRecognizeFileMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchRecognizeFileMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchRecognizeFileMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.BatchRecognizeFileMetadata; + + /** + * Creates a plain object from a BatchRecognizeFileMetadata message. Also converts values to other types if specified. + * @param message BatchRecognizeFileMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.BatchRecognizeFileMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchRecognizeFileMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchRecognizeFileMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StreamingRecognitionResult. */ + interface IStreamingRecognitionResult { + + /** StreamingRecognitionResult alternatives */ + alternatives?: (google.cloud.speech.v2.ISpeechRecognitionAlternative[]|null); + + /** StreamingRecognitionResult isFinal */ + isFinal?: (boolean|null); + + /** StreamingRecognitionResult stability */ + stability?: (number|null); + + /** StreamingRecognitionResult resultEndOffset */ + resultEndOffset?: (google.protobuf.IDuration|null); + + /** StreamingRecognitionResult channelTag */ + channelTag?: (number|null); + + /** StreamingRecognitionResult languageCode */ + languageCode?: (string|null); + } + + /** Represents a StreamingRecognitionResult. */ + class StreamingRecognitionResult implements IStreamingRecognitionResult { + + /** + * Constructs a new StreamingRecognitionResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.IStreamingRecognitionResult); + + /** StreamingRecognitionResult alternatives. */ + public alternatives: google.cloud.speech.v2.ISpeechRecognitionAlternative[]; + + /** StreamingRecognitionResult isFinal. */ + public isFinal: boolean; + + /** StreamingRecognitionResult stability. */ + public stability: number; + + /** StreamingRecognitionResult resultEndOffset. */ + public resultEndOffset?: (google.protobuf.IDuration|null); + + /** StreamingRecognitionResult channelTag. */ + public channelTag: number; + + /** StreamingRecognitionResult languageCode. */ + public languageCode: string; + + /** + * Creates a new StreamingRecognitionResult instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingRecognitionResult instance + */ + public static create(properties?: google.cloud.speech.v2.IStreamingRecognitionResult): google.cloud.speech.v2.StreamingRecognitionResult; + + /** + * Encodes the specified StreamingRecognitionResult message. Does not implicitly {@link google.cloud.speech.v2.StreamingRecognitionResult.verify|verify} messages. + * @param message StreamingRecognitionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.IStreamingRecognitionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamingRecognitionResult message, length delimited. Does not implicitly {@link google.cloud.speech.v2.StreamingRecognitionResult.verify|verify} messages. + * @param message StreamingRecognitionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.IStreamingRecognitionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamingRecognitionResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingRecognitionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.StreamingRecognitionResult; + + /** + * Decodes a StreamingRecognitionResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingRecognitionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.StreamingRecognitionResult; + + /** + * Verifies a StreamingRecognitionResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamingRecognitionResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingRecognitionResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.StreamingRecognitionResult; + + /** + * Creates a plain object from a StreamingRecognitionResult message. Also converts values to other types if specified. + * @param message StreamingRecognitionResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.StreamingRecognitionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamingRecognitionResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamingRecognitionResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StreamingRecognizeResponse. */ + interface IStreamingRecognizeResponse { + + /** StreamingRecognizeResponse results */ + results?: (google.cloud.speech.v2.IStreamingRecognitionResult[]|null); + + /** StreamingRecognizeResponse speechEventType */ + speechEventType?: (google.cloud.speech.v2.StreamingRecognizeResponse.SpeechEventType|keyof typeof google.cloud.speech.v2.StreamingRecognizeResponse.SpeechEventType|null); + + /** StreamingRecognizeResponse speechEventOffset */ + speechEventOffset?: (google.protobuf.IDuration|null); + + /** StreamingRecognizeResponse metadata */ + metadata?: (google.cloud.speech.v2.IRecognitionResponseMetadata|null); + } + + /** Represents a StreamingRecognizeResponse. */ + class StreamingRecognizeResponse implements IStreamingRecognizeResponse { + + /** + * Constructs a new StreamingRecognizeResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.IStreamingRecognizeResponse); + + /** StreamingRecognizeResponse results. */ + public results: google.cloud.speech.v2.IStreamingRecognitionResult[]; + + /** StreamingRecognizeResponse speechEventType. */ + public speechEventType: (google.cloud.speech.v2.StreamingRecognizeResponse.SpeechEventType|keyof typeof google.cloud.speech.v2.StreamingRecognizeResponse.SpeechEventType); + + /** StreamingRecognizeResponse speechEventOffset. */ + public speechEventOffset?: (google.protobuf.IDuration|null); + + /** StreamingRecognizeResponse metadata. */ + public metadata?: (google.cloud.speech.v2.IRecognitionResponseMetadata|null); + + /** + * Creates a new StreamingRecognizeResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingRecognizeResponse instance + */ + public static create(properties?: google.cloud.speech.v2.IStreamingRecognizeResponse): google.cloud.speech.v2.StreamingRecognizeResponse; + + /** + * Encodes the specified StreamingRecognizeResponse message. Does not implicitly {@link google.cloud.speech.v2.StreamingRecognizeResponse.verify|verify} messages. + * @param message StreamingRecognizeResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.IStreamingRecognizeResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamingRecognizeResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v2.StreamingRecognizeResponse.verify|verify} messages. + * @param message StreamingRecognizeResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.IStreamingRecognizeResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamingRecognizeResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingRecognizeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.StreamingRecognizeResponse; + + /** + * Decodes a StreamingRecognizeResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingRecognizeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.StreamingRecognizeResponse; + + /** + * Verifies a StreamingRecognizeResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamingRecognizeResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingRecognizeResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.StreamingRecognizeResponse; + + /** + * Creates a plain object from a StreamingRecognizeResponse message. Also converts values to other types if specified. + * @param message StreamingRecognizeResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.StreamingRecognizeResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamingRecognizeResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamingRecognizeResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace StreamingRecognizeResponse { + + /** SpeechEventType enum. */ + enum SpeechEventType { + SPEECH_EVENT_TYPE_UNSPECIFIED = 0, + END_OF_SINGLE_UTTERANCE = 1, + SPEECH_ACTIVITY_BEGIN = 2, + SPEECH_ACTIVITY_END = 3 + } + } + + /** Properties of a Config. */ + interface IConfig { + + /** Config name */ + name?: (string|null); + + /** Config kmsKeyName */ + kmsKeyName?: (string|null); + + /** Config updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a Config. */ + class Config implements IConfig { + + /** + * Constructs a new Config. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.IConfig); + + /** Config name. */ + public name: string; + + /** Config kmsKeyName. */ + public kmsKeyName: string; + + /** Config updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new Config instance using the specified properties. + * @param [properties] Properties to set + * @returns Config instance + */ + public static create(properties?: google.cloud.speech.v2.IConfig): google.cloud.speech.v2.Config; + + /** + * Encodes the specified Config message. Does not implicitly {@link google.cloud.speech.v2.Config.verify|verify} messages. + * @param message Config message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.IConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Config message, length delimited. Does not implicitly {@link google.cloud.speech.v2.Config.verify|verify} messages. + * @param message Config message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.IConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Config message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Config + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.Config; + + /** + * Decodes a Config message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Config + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.Config; + + /** + * Verifies a Config message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Config message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Config + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.Config; + + /** + * Creates a plain object from a Config message. Also converts values to other types if specified. + * @param message Config + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.Config, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Config to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Config + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetConfigRequest. */ + interface IGetConfigRequest { + + /** GetConfigRequest name */ + name?: (string|null); + } + + /** Represents a GetConfigRequest. */ + class GetConfigRequest implements IGetConfigRequest { + + /** + * Constructs a new GetConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.IGetConfigRequest); + + /** GetConfigRequest name. */ + public name: string; + + /** + * Creates a new GetConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetConfigRequest instance + */ + public static create(properties?: google.cloud.speech.v2.IGetConfigRequest): google.cloud.speech.v2.GetConfigRequest; + + /** + * Encodes the specified GetConfigRequest message. Does not implicitly {@link google.cloud.speech.v2.GetConfigRequest.verify|verify} messages. + * @param message GetConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.IGetConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetConfigRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v2.GetConfigRequest.verify|verify} messages. + * @param message GetConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.IGetConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.GetConfigRequest; + + /** + * Decodes a GetConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.GetConfigRequest; + + /** + * Verifies a GetConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.GetConfigRequest; + + /** + * Creates a plain object from a GetConfigRequest message. Also converts values to other types if specified. + * @param message GetConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.GetConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateConfigRequest. */ + interface IUpdateConfigRequest { + + /** UpdateConfigRequest config */ + config?: (google.cloud.speech.v2.IConfig|null); + + /** UpdateConfigRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateConfigRequest. */ + class UpdateConfigRequest implements IUpdateConfigRequest { + + /** + * Constructs a new UpdateConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.IUpdateConfigRequest); + + /** UpdateConfigRequest config. */ + public config?: (google.cloud.speech.v2.IConfig|null); + + /** UpdateConfigRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateConfigRequest instance + */ + public static create(properties?: google.cloud.speech.v2.IUpdateConfigRequest): google.cloud.speech.v2.UpdateConfigRequest; + + /** + * Encodes the specified UpdateConfigRequest message. Does not implicitly {@link google.cloud.speech.v2.UpdateConfigRequest.verify|verify} messages. + * @param message UpdateConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.IUpdateConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateConfigRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v2.UpdateConfigRequest.verify|verify} messages. + * @param message UpdateConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.IUpdateConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.UpdateConfigRequest; + + /** + * Decodes an UpdateConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.UpdateConfigRequest; + + /** + * Verifies an UpdateConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.UpdateConfigRequest; + + /** + * Creates a plain object from an UpdateConfigRequest message. Also converts values to other types if specified. + * @param message UpdateConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.UpdateConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomClass. */ + interface ICustomClass { + + /** CustomClass name */ + name?: (string|null); + + /** CustomClass uid */ + uid?: (string|null); + + /** CustomClass displayName */ + displayName?: (string|null); + + /** CustomClass items */ + items?: (google.cloud.speech.v2.CustomClass.IClassItem[]|null); + + /** CustomClass state */ + state?: (google.cloud.speech.v2.CustomClass.State|keyof typeof google.cloud.speech.v2.CustomClass.State|null); + + /** CustomClass createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** CustomClass updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** CustomClass deleteTime */ + deleteTime?: (google.protobuf.ITimestamp|null); + + /** CustomClass expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + + /** CustomClass annotations */ + annotations?: ({ [k: string]: string }|null); + + /** CustomClass etag */ + etag?: (string|null); + + /** CustomClass reconciling */ + reconciling?: (boolean|null); + + /** CustomClass kmsKeyName */ + kmsKeyName?: (string|null); + + /** CustomClass kmsKeyVersionName */ + kmsKeyVersionName?: (string|null); + } + + /** Represents a CustomClass. */ + class CustomClass implements ICustomClass { + + /** + * Constructs a new CustomClass. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.ICustomClass); + + /** CustomClass name. */ + public name: string; + + /** CustomClass uid. */ + public uid: string; + + /** CustomClass displayName. */ + public displayName: string; + + /** CustomClass items. */ + public items: google.cloud.speech.v2.CustomClass.IClassItem[]; + + /** CustomClass state. */ + public state: (google.cloud.speech.v2.CustomClass.State|keyof typeof google.cloud.speech.v2.CustomClass.State); + + /** CustomClass createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** CustomClass updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** CustomClass deleteTime. */ + public deleteTime?: (google.protobuf.ITimestamp|null); + + /** CustomClass expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** CustomClass annotations. */ + public annotations: { [k: string]: string }; + + /** CustomClass etag. */ + public etag: string; + + /** CustomClass reconciling. */ + public reconciling: boolean; + + /** CustomClass kmsKeyName. */ + public kmsKeyName: string; + + /** CustomClass kmsKeyVersionName. */ + public kmsKeyVersionName: string; + + /** + * Creates a new CustomClass instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomClass instance + */ + public static create(properties?: google.cloud.speech.v2.ICustomClass): google.cloud.speech.v2.CustomClass; + + /** + * Encodes the specified CustomClass message. Does not implicitly {@link google.cloud.speech.v2.CustomClass.verify|verify} messages. + * @param message CustomClass message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.ICustomClass, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomClass message, length delimited. Does not implicitly {@link google.cloud.speech.v2.CustomClass.verify|verify} messages. + * @param message CustomClass message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.ICustomClass, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomClass message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomClass + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.CustomClass; + + /** + * Decodes a CustomClass message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomClass + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.CustomClass; + + /** + * Verifies a CustomClass message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomClass message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomClass + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.CustomClass; + + /** + * Creates a plain object from a CustomClass message. Also converts values to other types if specified. + * @param message CustomClass + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.CustomClass, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomClass to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomClass + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CustomClass { + + /** Properties of a ClassItem. */ + interface IClassItem { + + /** ClassItem value */ + value?: (string|null); + } + + /** Represents a ClassItem. */ + class ClassItem implements IClassItem { + + /** + * Constructs a new ClassItem. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.CustomClass.IClassItem); + + /** ClassItem value. */ + public value: string; + + /** + * Creates a new ClassItem instance using the specified properties. + * @param [properties] Properties to set + * @returns ClassItem instance + */ + public static create(properties?: google.cloud.speech.v2.CustomClass.IClassItem): google.cloud.speech.v2.CustomClass.ClassItem; + + /** + * Encodes the specified ClassItem message. Does not implicitly {@link google.cloud.speech.v2.CustomClass.ClassItem.verify|verify} messages. + * @param message ClassItem message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.CustomClass.IClassItem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClassItem message, length delimited. Does not implicitly {@link google.cloud.speech.v2.CustomClass.ClassItem.verify|verify} messages. + * @param message ClassItem message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.CustomClass.IClassItem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClassItem message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClassItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.CustomClass.ClassItem; + + /** + * Decodes a ClassItem message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClassItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.CustomClass.ClassItem; + + /** + * Verifies a ClassItem message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClassItem message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClassItem + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.CustomClass.ClassItem; + + /** + * Creates a plain object from a ClassItem message. Also converts values to other types if specified. + * @param message ClassItem + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.CustomClass.ClassItem, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClassItem to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClassItem + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 2, + DELETED = 4 + } + } + + /** Properties of a PhraseSet. */ + interface IPhraseSet { + + /** PhraseSet name */ + name?: (string|null); + + /** PhraseSet uid */ + uid?: (string|null); + + /** PhraseSet phrases */ + phrases?: (google.cloud.speech.v2.PhraseSet.IPhrase[]|null); + + /** PhraseSet boost */ + boost?: (number|null); + + /** PhraseSet displayName */ + displayName?: (string|null); + + /** PhraseSet state */ + state?: (google.cloud.speech.v2.PhraseSet.State|keyof typeof google.cloud.speech.v2.PhraseSet.State|null); + + /** PhraseSet createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** PhraseSet updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** PhraseSet deleteTime */ + deleteTime?: (google.protobuf.ITimestamp|null); + + /** PhraseSet expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + + /** PhraseSet annotations */ + annotations?: ({ [k: string]: string }|null); + + /** PhraseSet etag */ + etag?: (string|null); + + /** PhraseSet reconciling */ + reconciling?: (boolean|null); + + /** PhraseSet kmsKeyName */ + kmsKeyName?: (string|null); + + /** PhraseSet kmsKeyVersionName */ + kmsKeyVersionName?: (string|null); + } + + /** Represents a PhraseSet. */ + class PhraseSet implements IPhraseSet { + + /** + * Constructs a new PhraseSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.IPhraseSet); + + /** PhraseSet name. */ + public name: string; + + /** PhraseSet uid. */ + public uid: string; + + /** PhraseSet phrases. */ + public phrases: google.cloud.speech.v2.PhraseSet.IPhrase[]; + + /** PhraseSet boost. */ + public boost: number; + + /** PhraseSet displayName. */ + public displayName: string; + + /** PhraseSet state. */ + public state: (google.cloud.speech.v2.PhraseSet.State|keyof typeof google.cloud.speech.v2.PhraseSet.State); + + /** PhraseSet createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** PhraseSet updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** PhraseSet deleteTime. */ + public deleteTime?: (google.protobuf.ITimestamp|null); + + /** PhraseSet expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** PhraseSet annotations. */ + public annotations: { [k: string]: string }; + + /** PhraseSet etag. */ + public etag: string; + + /** PhraseSet reconciling. */ + public reconciling: boolean; + + /** PhraseSet kmsKeyName. */ + public kmsKeyName: string; + + /** PhraseSet kmsKeyVersionName. */ + public kmsKeyVersionName: string; + + /** + * Creates a new PhraseSet instance using the specified properties. + * @param [properties] Properties to set + * @returns PhraseSet instance + */ + public static create(properties?: google.cloud.speech.v2.IPhraseSet): google.cloud.speech.v2.PhraseSet; + + /** + * Encodes the specified PhraseSet message. Does not implicitly {@link google.cloud.speech.v2.PhraseSet.verify|verify} messages. + * @param message PhraseSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.IPhraseSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PhraseSet message, length delimited. Does not implicitly {@link google.cloud.speech.v2.PhraseSet.verify|verify} messages. + * @param message PhraseSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.IPhraseSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PhraseSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PhraseSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.PhraseSet; + + /** + * Decodes a PhraseSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PhraseSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.PhraseSet; + + /** + * Verifies a PhraseSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PhraseSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PhraseSet + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.PhraseSet; + + /** + * Creates a plain object from a PhraseSet message. Also converts values to other types if specified. + * @param message PhraseSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.PhraseSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PhraseSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PhraseSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PhraseSet { + + /** Properties of a Phrase. */ + interface IPhrase { + + /** Phrase value */ + value?: (string|null); + + /** Phrase boost */ + boost?: (number|null); + } + + /** Represents a Phrase. */ + class Phrase implements IPhrase { + + /** + * Constructs a new Phrase. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.PhraseSet.IPhrase); + + /** Phrase value. */ + public value: string; + + /** Phrase boost. */ + public boost: number; + + /** + * Creates a new Phrase instance using the specified properties. + * @param [properties] Properties to set + * @returns Phrase instance + */ + public static create(properties?: google.cloud.speech.v2.PhraseSet.IPhrase): google.cloud.speech.v2.PhraseSet.Phrase; + + /** + * Encodes the specified Phrase message. Does not implicitly {@link google.cloud.speech.v2.PhraseSet.Phrase.verify|verify} messages. + * @param message Phrase message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.PhraseSet.IPhrase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Phrase message, length delimited. Does not implicitly {@link google.cloud.speech.v2.PhraseSet.Phrase.verify|verify} messages. + * @param message Phrase message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.PhraseSet.IPhrase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Phrase message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Phrase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.PhraseSet.Phrase; + + /** + * Decodes a Phrase message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Phrase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.PhraseSet.Phrase; + + /** + * Verifies a Phrase message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Phrase message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Phrase + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.PhraseSet.Phrase; + + /** + * Creates a plain object from a Phrase message. Also converts values to other types if specified. + * @param message Phrase + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.PhraseSet.Phrase, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Phrase to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Phrase + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 2, + DELETED = 4 + } + } + + /** Properties of a CreateCustomClassRequest. */ + interface ICreateCustomClassRequest { + + /** CreateCustomClassRequest customClass */ + customClass?: (google.cloud.speech.v2.ICustomClass|null); + + /** CreateCustomClassRequest validateOnly */ + validateOnly?: (boolean|null); + + /** CreateCustomClassRequest customClassId */ + customClassId?: (string|null); + + /** CreateCustomClassRequest parent */ + parent?: (string|null); + } + + /** Represents a CreateCustomClassRequest. */ + class CreateCustomClassRequest implements ICreateCustomClassRequest { + + /** + * Constructs a new CreateCustomClassRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.ICreateCustomClassRequest); + + /** CreateCustomClassRequest customClass. */ + public customClass?: (google.cloud.speech.v2.ICustomClass|null); + + /** CreateCustomClassRequest validateOnly. */ + public validateOnly: boolean; + + /** CreateCustomClassRequest customClassId. */ + public customClassId: string; + + /** CreateCustomClassRequest parent. */ + public parent: string; + + /** + * Creates a new CreateCustomClassRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateCustomClassRequest instance + */ + public static create(properties?: google.cloud.speech.v2.ICreateCustomClassRequest): google.cloud.speech.v2.CreateCustomClassRequest; + + /** + * Encodes the specified CreateCustomClassRequest message. Does not implicitly {@link google.cloud.speech.v2.CreateCustomClassRequest.verify|verify} messages. + * @param message CreateCustomClassRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.ICreateCustomClassRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateCustomClassRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v2.CreateCustomClassRequest.verify|verify} messages. + * @param message CreateCustomClassRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.ICreateCustomClassRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateCustomClassRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.CreateCustomClassRequest; + + /** + * Decodes a CreateCustomClassRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.CreateCustomClassRequest; + + /** + * Verifies a CreateCustomClassRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateCustomClassRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateCustomClassRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.CreateCustomClassRequest; + + /** + * Creates a plain object from a CreateCustomClassRequest message. Also converts values to other types if specified. + * @param message CreateCustomClassRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.CreateCustomClassRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateCustomClassRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateCustomClassRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCustomClassesRequest. */ + interface IListCustomClassesRequest { + + /** ListCustomClassesRequest parent */ + parent?: (string|null); + + /** ListCustomClassesRequest pageSize */ + pageSize?: (number|null); + + /** ListCustomClassesRequest pageToken */ + pageToken?: (string|null); + + /** ListCustomClassesRequest showDeleted */ + showDeleted?: (boolean|null); + } + + /** Represents a ListCustomClassesRequest. */ + class ListCustomClassesRequest implements IListCustomClassesRequest { + + /** + * Constructs a new ListCustomClassesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.IListCustomClassesRequest); + + /** ListCustomClassesRequest parent. */ + public parent: string; + + /** ListCustomClassesRequest pageSize. */ + public pageSize: number; + + /** ListCustomClassesRequest pageToken. */ + public pageToken: string; + + /** ListCustomClassesRequest showDeleted. */ + public showDeleted: boolean; + + /** + * Creates a new ListCustomClassesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCustomClassesRequest instance + */ + public static create(properties?: google.cloud.speech.v2.IListCustomClassesRequest): google.cloud.speech.v2.ListCustomClassesRequest; + + /** + * Encodes the specified ListCustomClassesRequest message. Does not implicitly {@link google.cloud.speech.v2.ListCustomClassesRequest.verify|verify} messages. + * @param message ListCustomClassesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.IListCustomClassesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCustomClassesRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v2.ListCustomClassesRequest.verify|verify} messages. + * @param message ListCustomClassesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.IListCustomClassesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCustomClassesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCustomClassesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.ListCustomClassesRequest; + + /** + * Decodes a ListCustomClassesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCustomClassesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.ListCustomClassesRequest; + + /** + * Verifies a ListCustomClassesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCustomClassesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCustomClassesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.ListCustomClassesRequest; + + /** + * Creates a plain object from a ListCustomClassesRequest message. Also converts values to other types if specified. + * @param message ListCustomClassesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.ListCustomClassesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCustomClassesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCustomClassesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCustomClassesResponse. */ + interface IListCustomClassesResponse { + + /** ListCustomClassesResponse customClasses */ + customClasses?: (google.cloud.speech.v2.ICustomClass[]|null); + + /** ListCustomClassesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListCustomClassesResponse. */ + class ListCustomClassesResponse implements IListCustomClassesResponse { + + /** + * Constructs a new ListCustomClassesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.IListCustomClassesResponse); + + /** ListCustomClassesResponse customClasses. */ + public customClasses: google.cloud.speech.v2.ICustomClass[]; + + /** ListCustomClassesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListCustomClassesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCustomClassesResponse instance + */ + public static create(properties?: google.cloud.speech.v2.IListCustomClassesResponse): google.cloud.speech.v2.ListCustomClassesResponse; + + /** + * Encodes the specified ListCustomClassesResponse message. Does not implicitly {@link google.cloud.speech.v2.ListCustomClassesResponse.verify|verify} messages. + * @param message ListCustomClassesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.IListCustomClassesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCustomClassesResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v2.ListCustomClassesResponse.verify|verify} messages. + * @param message ListCustomClassesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.IListCustomClassesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCustomClassesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCustomClassesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.ListCustomClassesResponse; + + /** + * Decodes a ListCustomClassesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCustomClassesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.ListCustomClassesResponse; + + /** + * Verifies a ListCustomClassesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCustomClassesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCustomClassesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.ListCustomClassesResponse; + + /** + * Creates a plain object from a ListCustomClassesResponse message. Also converts values to other types if specified. + * @param message ListCustomClassesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.ListCustomClassesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCustomClassesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCustomClassesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetCustomClassRequest. */ + interface IGetCustomClassRequest { + + /** GetCustomClassRequest name */ + name?: (string|null); + } + + /** Represents a GetCustomClassRequest. */ + class GetCustomClassRequest implements IGetCustomClassRequest { + + /** + * Constructs a new GetCustomClassRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.IGetCustomClassRequest); + + /** GetCustomClassRequest name. */ + public name: string; + + /** + * Creates a new GetCustomClassRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetCustomClassRequest instance + */ + public static create(properties?: google.cloud.speech.v2.IGetCustomClassRequest): google.cloud.speech.v2.GetCustomClassRequest; + + /** + * Encodes the specified GetCustomClassRequest message. Does not implicitly {@link google.cloud.speech.v2.GetCustomClassRequest.verify|verify} messages. + * @param message GetCustomClassRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.IGetCustomClassRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetCustomClassRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v2.GetCustomClassRequest.verify|verify} messages. + * @param message GetCustomClassRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.IGetCustomClassRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetCustomClassRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.GetCustomClassRequest; + + /** + * Decodes a GetCustomClassRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.GetCustomClassRequest; + + /** + * Verifies a GetCustomClassRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetCustomClassRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetCustomClassRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.GetCustomClassRequest; + + /** + * Creates a plain object from a GetCustomClassRequest message. Also converts values to other types if specified. + * @param message GetCustomClassRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.GetCustomClassRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetCustomClassRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetCustomClassRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateCustomClassRequest. */ + interface IUpdateCustomClassRequest { + + /** UpdateCustomClassRequest customClass */ + customClass?: (google.cloud.speech.v2.ICustomClass|null); + + /** UpdateCustomClassRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateCustomClassRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents an UpdateCustomClassRequest. */ + class UpdateCustomClassRequest implements IUpdateCustomClassRequest { + + /** + * Constructs a new UpdateCustomClassRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.IUpdateCustomClassRequest); + + /** UpdateCustomClassRequest customClass. */ + public customClass?: (google.cloud.speech.v2.ICustomClass|null); + + /** UpdateCustomClassRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateCustomClassRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new UpdateCustomClassRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateCustomClassRequest instance + */ + public static create(properties?: google.cloud.speech.v2.IUpdateCustomClassRequest): google.cloud.speech.v2.UpdateCustomClassRequest; + + /** + * Encodes the specified UpdateCustomClassRequest message. Does not implicitly {@link google.cloud.speech.v2.UpdateCustomClassRequest.verify|verify} messages. + * @param message UpdateCustomClassRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.IUpdateCustomClassRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateCustomClassRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v2.UpdateCustomClassRequest.verify|verify} messages. + * @param message UpdateCustomClassRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.IUpdateCustomClassRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateCustomClassRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.UpdateCustomClassRequest; + + /** + * Decodes an UpdateCustomClassRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.UpdateCustomClassRequest; + + /** + * Verifies an UpdateCustomClassRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateCustomClassRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateCustomClassRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.UpdateCustomClassRequest; + + /** + * Creates a plain object from an UpdateCustomClassRequest message. Also converts values to other types if specified. + * @param message UpdateCustomClassRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.UpdateCustomClassRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateCustomClassRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateCustomClassRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteCustomClassRequest. */ + interface IDeleteCustomClassRequest { + + /** DeleteCustomClassRequest name */ + name?: (string|null); + + /** DeleteCustomClassRequest validateOnly */ + validateOnly?: (boolean|null); + + /** DeleteCustomClassRequest allowMissing */ + allowMissing?: (boolean|null); + + /** DeleteCustomClassRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteCustomClassRequest. */ + class DeleteCustomClassRequest implements IDeleteCustomClassRequest { + + /** + * Constructs a new DeleteCustomClassRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.IDeleteCustomClassRequest); + + /** DeleteCustomClassRequest name. */ + public name: string; + + /** DeleteCustomClassRequest validateOnly. */ + public validateOnly: boolean; + + /** DeleteCustomClassRequest allowMissing. */ + public allowMissing: boolean; + + /** DeleteCustomClassRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteCustomClassRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteCustomClassRequest instance + */ + public static create(properties?: google.cloud.speech.v2.IDeleteCustomClassRequest): google.cloud.speech.v2.DeleteCustomClassRequest; + + /** + * Encodes the specified DeleteCustomClassRequest message. Does not implicitly {@link google.cloud.speech.v2.DeleteCustomClassRequest.verify|verify} messages. + * @param message DeleteCustomClassRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.IDeleteCustomClassRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteCustomClassRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v2.DeleteCustomClassRequest.verify|verify} messages. + * @param message DeleteCustomClassRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.IDeleteCustomClassRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteCustomClassRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.DeleteCustomClassRequest; + + /** + * Decodes a DeleteCustomClassRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.DeleteCustomClassRequest; + + /** + * Verifies a DeleteCustomClassRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteCustomClassRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteCustomClassRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.DeleteCustomClassRequest; + + /** + * Creates a plain object from a DeleteCustomClassRequest message. Also converts values to other types if specified. + * @param message DeleteCustomClassRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.DeleteCustomClassRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteCustomClassRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteCustomClassRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UndeleteCustomClassRequest. */ + interface IUndeleteCustomClassRequest { + + /** UndeleteCustomClassRequest name */ + name?: (string|null); + + /** UndeleteCustomClassRequest validateOnly */ + validateOnly?: (boolean|null); + + /** UndeleteCustomClassRequest etag */ + etag?: (string|null); + } + + /** Represents an UndeleteCustomClassRequest. */ + class UndeleteCustomClassRequest implements IUndeleteCustomClassRequest { + + /** + * Constructs a new UndeleteCustomClassRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.IUndeleteCustomClassRequest); + + /** UndeleteCustomClassRequest name. */ + public name: string; + + /** UndeleteCustomClassRequest validateOnly. */ + public validateOnly: boolean; + + /** UndeleteCustomClassRequest etag. */ + public etag: string; + + /** + * Creates a new UndeleteCustomClassRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UndeleteCustomClassRequest instance + */ + public static create(properties?: google.cloud.speech.v2.IUndeleteCustomClassRequest): google.cloud.speech.v2.UndeleteCustomClassRequest; + + /** + * Encodes the specified UndeleteCustomClassRequest message. Does not implicitly {@link google.cloud.speech.v2.UndeleteCustomClassRequest.verify|verify} messages. + * @param message UndeleteCustomClassRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.IUndeleteCustomClassRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UndeleteCustomClassRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v2.UndeleteCustomClassRequest.verify|verify} messages. + * @param message UndeleteCustomClassRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.IUndeleteCustomClassRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UndeleteCustomClassRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UndeleteCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.UndeleteCustomClassRequest; + + /** + * Decodes an UndeleteCustomClassRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UndeleteCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.UndeleteCustomClassRequest; + + /** + * Verifies an UndeleteCustomClassRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UndeleteCustomClassRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UndeleteCustomClassRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.UndeleteCustomClassRequest; + + /** + * Creates a plain object from an UndeleteCustomClassRequest message. Also converts values to other types if specified. + * @param message UndeleteCustomClassRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.UndeleteCustomClassRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UndeleteCustomClassRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UndeleteCustomClassRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreatePhraseSetRequest. */ + interface ICreatePhraseSetRequest { + + /** CreatePhraseSetRequest phraseSet */ + phraseSet?: (google.cloud.speech.v2.IPhraseSet|null); + + /** CreatePhraseSetRequest validateOnly */ + validateOnly?: (boolean|null); + + /** CreatePhraseSetRequest phraseSetId */ + phraseSetId?: (string|null); + + /** CreatePhraseSetRequest parent */ + parent?: (string|null); + } + + /** Represents a CreatePhraseSetRequest. */ + class CreatePhraseSetRequest implements ICreatePhraseSetRequest { + + /** + * Constructs a new CreatePhraseSetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.ICreatePhraseSetRequest); + + /** CreatePhraseSetRequest phraseSet. */ + public phraseSet?: (google.cloud.speech.v2.IPhraseSet|null); + + /** CreatePhraseSetRequest validateOnly. */ + public validateOnly: boolean; + + /** CreatePhraseSetRequest phraseSetId. */ + public phraseSetId: string; + + /** CreatePhraseSetRequest parent. */ + public parent: string; + + /** + * Creates a new CreatePhraseSetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreatePhraseSetRequest instance + */ + public static create(properties?: google.cloud.speech.v2.ICreatePhraseSetRequest): google.cloud.speech.v2.CreatePhraseSetRequest; + + /** + * Encodes the specified CreatePhraseSetRequest message. Does not implicitly {@link google.cloud.speech.v2.CreatePhraseSetRequest.verify|verify} messages. + * @param message CreatePhraseSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.ICreatePhraseSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreatePhraseSetRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v2.CreatePhraseSetRequest.verify|verify} messages. + * @param message CreatePhraseSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.ICreatePhraseSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreatePhraseSetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreatePhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.CreatePhraseSetRequest; + + /** + * Decodes a CreatePhraseSetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreatePhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.CreatePhraseSetRequest; + + /** + * Verifies a CreatePhraseSetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreatePhraseSetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreatePhraseSetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.CreatePhraseSetRequest; + + /** + * Creates a plain object from a CreatePhraseSetRequest message. Also converts values to other types if specified. + * @param message CreatePhraseSetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.CreatePhraseSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreatePhraseSetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreatePhraseSetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListPhraseSetsRequest. */ + interface IListPhraseSetsRequest { + + /** ListPhraseSetsRequest parent */ + parent?: (string|null); + + /** ListPhraseSetsRequest pageSize */ + pageSize?: (number|null); + + /** ListPhraseSetsRequest pageToken */ + pageToken?: (string|null); + + /** ListPhraseSetsRequest showDeleted */ + showDeleted?: (boolean|null); + } + + /** Represents a ListPhraseSetsRequest. */ + class ListPhraseSetsRequest implements IListPhraseSetsRequest { + + /** + * Constructs a new ListPhraseSetsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.IListPhraseSetsRequest); + + /** ListPhraseSetsRequest parent. */ + public parent: string; + + /** ListPhraseSetsRequest pageSize. */ + public pageSize: number; + + /** ListPhraseSetsRequest pageToken. */ + public pageToken: string; + + /** ListPhraseSetsRequest showDeleted. */ + public showDeleted: boolean; + + /** + * Creates a new ListPhraseSetsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPhraseSetsRequest instance + */ + public static create(properties?: google.cloud.speech.v2.IListPhraseSetsRequest): google.cloud.speech.v2.ListPhraseSetsRequest; + + /** + * Encodes the specified ListPhraseSetsRequest message. Does not implicitly {@link google.cloud.speech.v2.ListPhraseSetsRequest.verify|verify} messages. + * @param message ListPhraseSetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.IListPhraseSetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPhraseSetsRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v2.ListPhraseSetsRequest.verify|verify} messages. + * @param message ListPhraseSetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.IListPhraseSetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPhraseSetsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPhraseSetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.ListPhraseSetsRequest; + + /** + * Decodes a ListPhraseSetsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPhraseSetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.ListPhraseSetsRequest; + + /** + * Verifies a ListPhraseSetsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListPhraseSetsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPhraseSetsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.ListPhraseSetsRequest; + + /** + * Creates a plain object from a ListPhraseSetsRequest message. Also converts values to other types if specified. + * @param message ListPhraseSetsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.ListPhraseSetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPhraseSetsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListPhraseSetsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListPhraseSetsResponse. */ + interface IListPhraseSetsResponse { + + /** ListPhraseSetsResponse phraseSets */ + phraseSets?: (google.cloud.speech.v2.IPhraseSet[]|null); + + /** ListPhraseSetsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListPhraseSetsResponse. */ + class ListPhraseSetsResponse implements IListPhraseSetsResponse { + + /** + * Constructs a new ListPhraseSetsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.IListPhraseSetsResponse); + + /** ListPhraseSetsResponse phraseSets. */ + public phraseSets: google.cloud.speech.v2.IPhraseSet[]; + + /** ListPhraseSetsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListPhraseSetsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPhraseSetsResponse instance + */ + public static create(properties?: google.cloud.speech.v2.IListPhraseSetsResponse): google.cloud.speech.v2.ListPhraseSetsResponse; + + /** + * Encodes the specified ListPhraseSetsResponse message. Does not implicitly {@link google.cloud.speech.v2.ListPhraseSetsResponse.verify|verify} messages. + * @param message ListPhraseSetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.IListPhraseSetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPhraseSetsResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v2.ListPhraseSetsResponse.verify|verify} messages. + * @param message ListPhraseSetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.IListPhraseSetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPhraseSetsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPhraseSetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.ListPhraseSetsResponse; + + /** + * Decodes a ListPhraseSetsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPhraseSetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.ListPhraseSetsResponse; + + /** + * Verifies a ListPhraseSetsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListPhraseSetsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPhraseSetsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.ListPhraseSetsResponse; + + /** + * Creates a plain object from a ListPhraseSetsResponse message. Also converts values to other types if specified. + * @param message ListPhraseSetsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.ListPhraseSetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPhraseSetsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListPhraseSetsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetPhraseSetRequest. */ + interface IGetPhraseSetRequest { + + /** GetPhraseSetRequest name */ + name?: (string|null); + } + + /** Represents a GetPhraseSetRequest. */ + class GetPhraseSetRequest implements IGetPhraseSetRequest { + + /** + * Constructs a new GetPhraseSetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.IGetPhraseSetRequest); + + /** GetPhraseSetRequest name. */ + public name: string; + + /** + * Creates a new GetPhraseSetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetPhraseSetRequest instance + */ + public static create(properties?: google.cloud.speech.v2.IGetPhraseSetRequest): google.cloud.speech.v2.GetPhraseSetRequest; + + /** + * Encodes the specified GetPhraseSetRequest message. Does not implicitly {@link google.cloud.speech.v2.GetPhraseSetRequest.verify|verify} messages. + * @param message GetPhraseSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.IGetPhraseSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetPhraseSetRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v2.GetPhraseSetRequest.verify|verify} messages. + * @param message GetPhraseSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.IGetPhraseSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetPhraseSetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetPhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.GetPhraseSetRequest; + + /** + * Decodes a GetPhraseSetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetPhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.GetPhraseSetRequest; + + /** + * Verifies a GetPhraseSetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetPhraseSetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetPhraseSetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.GetPhraseSetRequest; + + /** + * Creates a plain object from a GetPhraseSetRequest message. Also converts values to other types if specified. + * @param message GetPhraseSetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.GetPhraseSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetPhraseSetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetPhraseSetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdatePhraseSetRequest. */ + interface IUpdatePhraseSetRequest { + + /** UpdatePhraseSetRequest phraseSet */ + phraseSet?: (google.cloud.speech.v2.IPhraseSet|null); + + /** UpdatePhraseSetRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdatePhraseSetRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents an UpdatePhraseSetRequest. */ + class UpdatePhraseSetRequest implements IUpdatePhraseSetRequest { + + /** + * Constructs a new UpdatePhraseSetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.IUpdatePhraseSetRequest); + + /** UpdatePhraseSetRequest phraseSet. */ + public phraseSet?: (google.cloud.speech.v2.IPhraseSet|null); + + /** UpdatePhraseSetRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdatePhraseSetRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new UpdatePhraseSetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdatePhraseSetRequest instance + */ + public static create(properties?: google.cloud.speech.v2.IUpdatePhraseSetRequest): google.cloud.speech.v2.UpdatePhraseSetRequest; + + /** + * Encodes the specified UpdatePhraseSetRequest message. Does not implicitly {@link google.cloud.speech.v2.UpdatePhraseSetRequest.verify|verify} messages. + * @param message UpdatePhraseSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.IUpdatePhraseSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdatePhraseSetRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v2.UpdatePhraseSetRequest.verify|verify} messages. + * @param message UpdatePhraseSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.IUpdatePhraseSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdatePhraseSetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdatePhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.UpdatePhraseSetRequest; + + /** + * Decodes an UpdatePhraseSetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdatePhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.UpdatePhraseSetRequest; + + /** + * Verifies an UpdatePhraseSetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdatePhraseSetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdatePhraseSetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.UpdatePhraseSetRequest; + + /** + * Creates a plain object from an UpdatePhraseSetRequest message. Also converts values to other types if specified. + * @param message UpdatePhraseSetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.UpdatePhraseSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdatePhraseSetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdatePhraseSetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeletePhraseSetRequest. */ + interface IDeletePhraseSetRequest { + + /** DeletePhraseSetRequest name */ + name?: (string|null); + + /** DeletePhraseSetRequest validateOnly */ + validateOnly?: (boolean|null); + + /** DeletePhraseSetRequest allowMissing */ + allowMissing?: (boolean|null); + + /** DeletePhraseSetRequest etag */ + etag?: (string|null); + } + + /** Represents a DeletePhraseSetRequest. */ + class DeletePhraseSetRequest implements IDeletePhraseSetRequest { + + /** + * Constructs a new DeletePhraseSetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.IDeletePhraseSetRequest); + + /** DeletePhraseSetRequest name. */ + public name: string; + + /** DeletePhraseSetRequest validateOnly. */ + public validateOnly: boolean; + + /** DeletePhraseSetRequest allowMissing. */ + public allowMissing: boolean; + + /** DeletePhraseSetRequest etag. */ + public etag: string; + + /** + * Creates a new DeletePhraseSetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeletePhraseSetRequest instance + */ + public static create(properties?: google.cloud.speech.v2.IDeletePhraseSetRequest): google.cloud.speech.v2.DeletePhraseSetRequest; + + /** + * Encodes the specified DeletePhraseSetRequest message. Does not implicitly {@link google.cloud.speech.v2.DeletePhraseSetRequest.verify|verify} messages. + * @param message DeletePhraseSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.IDeletePhraseSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeletePhraseSetRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v2.DeletePhraseSetRequest.verify|verify} messages. + * @param message DeletePhraseSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.IDeletePhraseSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeletePhraseSetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeletePhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.DeletePhraseSetRequest; + + /** + * Decodes a DeletePhraseSetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeletePhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.DeletePhraseSetRequest; + + /** + * Verifies a DeletePhraseSetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeletePhraseSetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeletePhraseSetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.DeletePhraseSetRequest; + + /** + * Creates a plain object from a DeletePhraseSetRequest message. Also converts values to other types if specified. + * @param message DeletePhraseSetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.DeletePhraseSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeletePhraseSetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeletePhraseSetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UndeletePhraseSetRequest. */ + interface IUndeletePhraseSetRequest { + + /** UndeletePhraseSetRequest name */ + name?: (string|null); + + /** UndeletePhraseSetRequest validateOnly */ + validateOnly?: (boolean|null); + + /** UndeletePhraseSetRequest etag */ + etag?: (string|null); + } + + /** Represents an UndeletePhraseSetRequest. */ + class UndeletePhraseSetRequest implements IUndeletePhraseSetRequest { + + /** + * Constructs a new UndeletePhraseSetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.IUndeletePhraseSetRequest); + + /** UndeletePhraseSetRequest name. */ + public name: string; + + /** UndeletePhraseSetRequest validateOnly. */ + public validateOnly: boolean; + + /** UndeletePhraseSetRequest etag. */ + public etag: string; + + /** + * Creates a new UndeletePhraseSetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UndeletePhraseSetRequest instance + */ + public static create(properties?: google.cloud.speech.v2.IUndeletePhraseSetRequest): google.cloud.speech.v2.UndeletePhraseSetRequest; + + /** + * Encodes the specified UndeletePhraseSetRequest message. Does not implicitly {@link google.cloud.speech.v2.UndeletePhraseSetRequest.verify|verify} messages. + * @param message UndeletePhraseSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.IUndeletePhraseSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UndeletePhraseSetRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v2.UndeletePhraseSetRequest.verify|verify} messages. + * @param message UndeletePhraseSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.IUndeletePhraseSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UndeletePhraseSetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UndeletePhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.UndeletePhraseSetRequest; + + /** + * Decodes an UndeletePhraseSetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UndeletePhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.UndeletePhraseSetRequest; + + /** + * Verifies an UndeletePhraseSetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UndeletePhraseSetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UndeletePhraseSetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.UndeletePhraseSetRequest; + + /** + * Creates a plain object from an UndeletePhraseSetRequest message. Also converts values to other types if specified. + * @param message UndeletePhraseSetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.UndeletePhraseSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UndeletePhraseSetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UndeletePhraseSetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ModelFeature. */ + interface IModelFeature { + + /** ModelFeature feature */ + feature?: (string|null); + + /** ModelFeature releaseState */ + releaseState?: (string|null); + } + + /** Represents a ModelFeature. */ + class ModelFeature implements IModelFeature { + + /** + * Constructs a new ModelFeature. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.IModelFeature); + + /** ModelFeature feature. */ + public feature: string; + + /** ModelFeature releaseState. */ + public releaseState: string; + + /** + * Creates a new ModelFeature instance using the specified properties. + * @param [properties] Properties to set + * @returns ModelFeature instance + */ + public static create(properties?: google.cloud.speech.v2.IModelFeature): google.cloud.speech.v2.ModelFeature; + + /** + * Encodes the specified ModelFeature message. Does not implicitly {@link google.cloud.speech.v2.ModelFeature.verify|verify} messages. + * @param message ModelFeature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.IModelFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ModelFeature message, length delimited. Does not implicitly {@link google.cloud.speech.v2.ModelFeature.verify|verify} messages. + * @param message ModelFeature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.IModelFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ModelFeature message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ModelFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.ModelFeature; + + /** + * Decodes a ModelFeature message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ModelFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.ModelFeature; + + /** + * Verifies a ModelFeature message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ModelFeature message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ModelFeature + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.ModelFeature; + + /** + * Creates a plain object from a ModelFeature message. Also converts values to other types if specified. + * @param message ModelFeature + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.ModelFeature, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ModelFeature to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ModelFeature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ModelFeatures. */ + interface IModelFeatures { + + /** ModelFeatures modelFeature */ + modelFeature?: (google.cloud.speech.v2.IModelFeature[]|null); + } + + /** Represents a ModelFeatures. */ + class ModelFeatures implements IModelFeatures { + + /** + * Constructs a new ModelFeatures. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.IModelFeatures); + + /** ModelFeatures modelFeature. */ + public modelFeature: google.cloud.speech.v2.IModelFeature[]; + + /** + * Creates a new ModelFeatures instance using the specified properties. + * @param [properties] Properties to set + * @returns ModelFeatures instance + */ + public static create(properties?: google.cloud.speech.v2.IModelFeatures): google.cloud.speech.v2.ModelFeatures; + + /** + * Encodes the specified ModelFeatures message. Does not implicitly {@link google.cloud.speech.v2.ModelFeatures.verify|verify} messages. + * @param message ModelFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.IModelFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ModelFeatures message, length delimited. Does not implicitly {@link google.cloud.speech.v2.ModelFeatures.verify|verify} messages. + * @param message ModelFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.IModelFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ModelFeatures message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ModelFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.ModelFeatures; + + /** + * Decodes a ModelFeatures message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ModelFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.ModelFeatures; + + /** + * Verifies a ModelFeatures message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ModelFeatures message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ModelFeatures + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.ModelFeatures; + + /** + * Creates a plain object from a ModelFeatures message. Also converts values to other types if specified. + * @param message ModelFeatures + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.ModelFeatures, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ModelFeatures to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ModelFeatures + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ModelMetadata. */ + interface IModelMetadata { + + /** ModelMetadata modelFeatures */ + modelFeatures?: ({ [k: string]: google.cloud.speech.v2.IModelFeatures }|null); + } + + /** Represents a ModelMetadata. */ + class ModelMetadata implements IModelMetadata { + + /** + * Constructs a new ModelMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.IModelMetadata); + + /** ModelMetadata modelFeatures. */ + public modelFeatures: { [k: string]: google.cloud.speech.v2.IModelFeatures }; + + /** + * Creates a new ModelMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ModelMetadata instance + */ + public static create(properties?: google.cloud.speech.v2.IModelMetadata): google.cloud.speech.v2.ModelMetadata; + + /** + * Encodes the specified ModelMetadata message. Does not implicitly {@link google.cloud.speech.v2.ModelMetadata.verify|verify} messages. + * @param message ModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.IModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ModelMetadata message, length delimited. Does not implicitly {@link google.cloud.speech.v2.ModelMetadata.verify|verify} messages. + * @param message ModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.IModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ModelMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.ModelMetadata; + + /** + * Decodes a ModelMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.ModelMetadata; + + /** + * Verifies a ModelMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ModelMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ModelMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.ModelMetadata; + + /** + * Creates a plain object from a ModelMetadata message. Also converts values to other types if specified. + * @param message ModelMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.ModelMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ModelMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ModelMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LanguageMetadata. */ + interface ILanguageMetadata { + + /** LanguageMetadata models */ + models?: ({ [k: string]: google.cloud.speech.v2.IModelMetadata }|null); + } + + /** Represents a LanguageMetadata. */ + class LanguageMetadata implements ILanguageMetadata { + + /** + * Constructs a new LanguageMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.ILanguageMetadata); + + /** LanguageMetadata models. */ + public models: { [k: string]: google.cloud.speech.v2.IModelMetadata }; + + /** + * Creates a new LanguageMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns LanguageMetadata instance + */ + public static create(properties?: google.cloud.speech.v2.ILanguageMetadata): google.cloud.speech.v2.LanguageMetadata; + + /** + * Encodes the specified LanguageMetadata message. Does not implicitly {@link google.cloud.speech.v2.LanguageMetadata.verify|verify} messages. + * @param message LanguageMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.ILanguageMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LanguageMetadata message, length delimited. Does not implicitly {@link google.cloud.speech.v2.LanguageMetadata.verify|verify} messages. + * @param message LanguageMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.ILanguageMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LanguageMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LanguageMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.LanguageMetadata; + + /** + * Decodes a LanguageMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LanguageMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.LanguageMetadata; + + /** + * Verifies a LanguageMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LanguageMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LanguageMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.LanguageMetadata; + + /** + * Creates a plain object from a LanguageMetadata message. Also converts values to other types if specified. + * @param message LanguageMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.LanguageMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LanguageMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LanguageMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccessMetadata. */ + interface IAccessMetadata { + + /** AccessMetadata constraintType */ + constraintType?: (google.cloud.speech.v2.AccessMetadata.ConstraintType|keyof typeof google.cloud.speech.v2.AccessMetadata.ConstraintType|null); + } + + /** Represents an AccessMetadata. */ + class AccessMetadata implements IAccessMetadata { + + /** + * Constructs a new AccessMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.IAccessMetadata); + + /** AccessMetadata constraintType. */ + public constraintType: (google.cloud.speech.v2.AccessMetadata.ConstraintType|keyof typeof google.cloud.speech.v2.AccessMetadata.ConstraintType); + + /** + * Creates a new AccessMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns AccessMetadata instance + */ + public static create(properties?: google.cloud.speech.v2.IAccessMetadata): google.cloud.speech.v2.AccessMetadata; + + /** + * Encodes the specified AccessMetadata message. Does not implicitly {@link google.cloud.speech.v2.AccessMetadata.verify|verify} messages. + * @param message AccessMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.IAccessMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AccessMetadata message, length delimited. Does not implicitly {@link google.cloud.speech.v2.AccessMetadata.verify|verify} messages. + * @param message AccessMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.IAccessMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccessMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AccessMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.AccessMetadata; + + /** + * Decodes an AccessMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AccessMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.AccessMetadata; + + /** + * Verifies an AccessMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AccessMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AccessMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.AccessMetadata; + + /** + * Creates a plain object from an AccessMetadata message. Also converts values to other types if specified. + * @param message AccessMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.AccessMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AccessMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AccessMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AccessMetadata { + + /** ConstraintType enum. */ + enum ConstraintType { + CONSTRAINT_TYPE_UNSPECIFIED = 0, + RESOURCE_LOCATIONS_ORG_POLICY_CREATE_CONSTRAINT = 1 + } + } + + /** Properties of a LocationsMetadata. */ + interface ILocationsMetadata { + + /** LocationsMetadata languages */ + languages?: (google.cloud.speech.v2.ILanguageMetadata|null); + + /** LocationsMetadata accessMetadata */ + accessMetadata?: (google.cloud.speech.v2.IAccessMetadata|null); + } + + /** Represents a LocationsMetadata. */ + class LocationsMetadata implements ILocationsMetadata { + + /** + * Constructs a new LocationsMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v2.ILocationsMetadata); + + /** LocationsMetadata languages. */ + public languages?: (google.cloud.speech.v2.ILanguageMetadata|null); + + /** LocationsMetadata accessMetadata. */ + public accessMetadata?: (google.cloud.speech.v2.IAccessMetadata|null); + + /** + * Creates a new LocationsMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns LocationsMetadata instance + */ + public static create(properties?: google.cloud.speech.v2.ILocationsMetadata): google.cloud.speech.v2.LocationsMetadata; + + /** + * Encodes the specified LocationsMetadata message. Does not implicitly {@link google.cloud.speech.v2.LocationsMetadata.verify|verify} messages. + * @param message LocationsMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v2.ILocationsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LocationsMetadata message, length delimited. Does not implicitly {@link google.cloud.speech.v2.LocationsMetadata.verify|verify} messages. + * @param message LocationsMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v2.ILocationsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LocationsMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LocationsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v2.LocationsMetadata; + + /** + * Decodes a LocationsMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LocationsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v2.LocationsMetadata; + + /** + * Verifies a LocationsMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LocationsMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LocationsMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v2.LocationsMetadata; + + /** + * Creates a plain object from a LocationsMetadata message. Also converts values to other types if specified. + * @param message LocationsMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v2.LocationsMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LocationsMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LocationsMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Http message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + + /** + * Verifies a Http message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Http + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HttpRule. */ + interface IHttpRule { + + /** HttpRule selector */ + selector?: (string|null); + + /** HttpRule get */ + get?: (string|null); + + /** HttpRule put */ + put?: (string|null); + + /** HttpRule post */ + post?: (string|null); + + /** HttpRule delete */ + "delete"?: (string|null); + + /** HttpRule patch */ + patch?: (string|null); + + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body */ + body?: (string|null); + + /** HttpRule responseBody */ + responseBody?: (string|null); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } + + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { + + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); + + /** HttpRule selector. */ + public selector: string; + + /** HttpRule get. */ + public get?: (string|null); + + /** HttpRule put. */ + public put?: (string|null); + + /** HttpRule post. */ + public post?: (string|null); + + /** HttpRule delete. */ + public delete?: (string|null); + + /** HttpRule patch. */ + public patch?: (string|null); + + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body. */ + public body: string; + + /** HttpRule responseBody. */ + public responseBody: string; + + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; + + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + + /** + * Creates a new HttpRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRule instance + */ + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; + + /** + * Verifies a HttpRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRule + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @param message HttpRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { + + /** CustomHttpPattern kind */ + kind?: (string|null); + + /** CustomHttpPattern path */ + path?: (string|null); + } + + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { + + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); + + /** CustomHttpPattern kind. */ + public kind: string; + + /** CustomHttpPattern path. */ + public path: string; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHttpPattern instance + */ + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; + + /** + * Verifies a CustomHttpPattern message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomHttpPattern + */ + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @param message CustomHttpPattern + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomHttpPattern + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CommonLanguageSettings. */ + interface ICommonLanguageSettings { + + /** CommonLanguageSettings referenceDocsUri */ + referenceDocsUri?: (string|null); + + /** CommonLanguageSettings destinations */ + destinations?: (google.api.ClientLibraryDestination[]|null); + } + + /** Represents a CommonLanguageSettings. */ + class CommonLanguageSettings implements ICommonLanguageSettings { + + /** + * Constructs a new CommonLanguageSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICommonLanguageSettings); + + /** CommonLanguageSettings referenceDocsUri. */ + public referenceDocsUri: string; + + /** CommonLanguageSettings destinations. */ + public destinations: google.api.ClientLibraryDestination[]; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CommonLanguageSettings instance + */ + public static create(properties?: google.api.ICommonLanguageSettings): google.api.CommonLanguageSettings; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CommonLanguageSettings; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CommonLanguageSettings; + + /** + * Verifies a CommonLanguageSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommonLanguageSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CommonLanguageSettings; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @param message CommonLanguageSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CommonLanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CommonLanguageSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClientLibrarySettings. */ + interface IClientLibrarySettings { + + /** ClientLibrarySettings version */ + version?: (string|null); + + /** ClientLibrarySettings launchStage */ + launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); + + /** ClientLibrarySettings restNumericEnums */ + restNumericEnums?: (boolean|null); + + /** ClientLibrarySettings javaSettings */ + javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings */ + cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings */ + phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings */ + pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings */ + nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings */ + dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings */ + rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings */ + goSettings?: (google.api.IGoSettings|null); + } + + /** Represents a ClientLibrarySettings. */ + class ClientLibrarySettings implements IClientLibrarySettings { + + /** + * Constructs a new ClientLibrarySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IClientLibrarySettings); + + /** ClientLibrarySettings version. */ + public version: string; + + /** ClientLibrarySettings launchStage. */ + public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); + + /** ClientLibrarySettings restNumericEnums. */ + public restNumericEnums: boolean; + + /** ClientLibrarySettings javaSettings. */ + public javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings. */ + public cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings. */ + public phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings. */ + public pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings. */ + public nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings. */ + public dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings. */ + public rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings. */ + public goSettings?: (google.api.IGoSettings|null); + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientLibrarySettings instance + */ + public static create(properties?: google.api.IClientLibrarySettings): google.api.ClientLibrarySettings; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ClientLibrarySettings; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ClientLibrarySettings; + + /** + * Verifies a ClientLibrarySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClientLibrarySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.ClientLibrarySettings; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @param message ClientLibrarySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ClientLibrarySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClientLibrarySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Publishing. */ + interface IPublishing { + + /** Publishing methodSettings */ + methodSettings?: (google.api.IMethodSettings[]|null); + + /** Publishing newIssueUri */ + newIssueUri?: (string|null); + + /** Publishing documentationUri */ + documentationUri?: (string|null); + + /** Publishing apiShortName */ + apiShortName?: (string|null); + + /** Publishing githubLabel */ + githubLabel?: (string|null); + + /** Publishing codeownerGithubTeams */ + codeownerGithubTeams?: (string[]|null); + + /** Publishing docTagPrefix */ + docTagPrefix?: (string|null); + + /** Publishing organization */ + organization?: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization|null); + + /** Publishing librarySettings */ + librarySettings?: (google.api.IClientLibrarySettings[]|null); + + /** Publishing protoReferenceDocumentationUri */ + protoReferenceDocumentationUri?: (string|null); + + /** Publishing restReferenceDocumentationUri */ + restReferenceDocumentationUri?: (string|null); + } + + /** Represents a Publishing. */ + class Publishing implements IPublishing { + + /** + * Constructs a new Publishing. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPublishing); + + /** Publishing methodSettings. */ + public methodSettings: google.api.IMethodSettings[]; + + /** Publishing newIssueUri. */ + public newIssueUri: string; + + /** Publishing documentationUri. */ + public documentationUri: string; + + /** Publishing apiShortName. */ + public apiShortName: string; + + /** Publishing githubLabel. */ + public githubLabel: string; + + /** Publishing codeownerGithubTeams. */ + public codeownerGithubTeams: string[]; + + /** Publishing docTagPrefix. */ + public docTagPrefix: string; + + /** Publishing organization. */ + public organization: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization); + + /** Publishing librarySettings. */ + public librarySettings: google.api.IClientLibrarySettings[]; + + /** Publishing protoReferenceDocumentationUri. */ + public protoReferenceDocumentationUri: string; + + /** Publishing restReferenceDocumentationUri. */ + public restReferenceDocumentationUri: string; + + /** + * Creates a new Publishing instance using the specified properties. + * @param [properties] Properties to set + * @returns Publishing instance + */ + public static create(properties?: google.api.IPublishing): google.api.Publishing; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Publishing; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Publishing; + + /** + * Verifies a Publishing message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Publishing + */ + public static fromObject(object: { [k: string]: any }): google.api.Publishing; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @param message Publishing + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Publishing, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Publishing to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Publishing + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JavaSettings. */ + interface IJavaSettings { + + /** JavaSettings libraryPackage */ + libraryPackage?: (string|null); + + /** JavaSettings serviceClassNames */ + serviceClassNames?: ({ [k: string]: string }|null); + + /** JavaSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a JavaSettings. */ + class JavaSettings implements IJavaSettings { + + /** + * Constructs a new JavaSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IJavaSettings); + + /** JavaSettings libraryPackage. */ + public libraryPackage: string; + + /** JavaSettings serviceClassNames. */ + public serviceClassNames: { [k: string]: string }; + + /** JavaSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new JavaSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns JavaSettings instance + */ + public static create(properties?: google.api.IJavaSettings): google.api.JavaSettings; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.JavaSettings; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.JavaSettings; + + /** + * Verifies a JavaSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JavaSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.JavaSettings; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @param message JavaSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.JavaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JavaSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JavaSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CppSettings. */ + interface ICppSettings { + + /** CppSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a CppSettings. */ + class CppSettings implements ICppSettings { + + /** + * Constructs a new CppSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICppSettings); + + /** CppSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new CppSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CppSettings instance + */ + public static create(properties?: google.api.ICppSettings): google.api.CppSettings; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CppSettings; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CppSettings; + + /** + * Verifies a CppSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CppSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CppSettings; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @param message CppSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CppSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CppSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CppSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PhpSettings. */ + interface IPhpSettings { + + /** PhpSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PhpSettings. */ + class PhpSettings implements IPhpSettings { + + /** + * Constructs a new PhpSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPhpSettings); + + /** PhpSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PhpSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PhpSettings instance + */ + public static create(properties?: google.api.IPhpSettings): google.api.PhpSettings; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PhpSettings; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PhpSettings; + + /** + * Verifies a PhpSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PhpSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PhpSettings; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @param message PhpSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PhpSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PhpSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PhpSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PythonSettings. */ + interface IPythonSettings { + + /** PythonSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PythonSettings. */ + class PythonSettings implements IPythonSettings { + + /** + * Constructs a new PythonSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPythonSettings); + + /** PythonSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PythonSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PythonSettings instance + */ + public static create(properties?: google.api.IPythonSettings): google.api.PythonSettings; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings; + + /** + * Verifies a PythonSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PythonSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @param message PythonSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PythonSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PythonSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeSettings. */ + interface INodeSettings { + + /** NodeSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a NodeSettings. */ + class NodeSettings implements INodeSettings { + + /** + * Constructs a new NodeSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.INodeSettings); + + /** NodeSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new NodeSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeSettings instance + */ + public static create(properties?: google.api.INodeSettings): google.api.NodeSettings; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.NodeSettings; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.NodeSettings; + + /** + * Verifies a NodeSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.NodeSettings; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @param message NodeSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.NodeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodeSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DotnetSettings. */ + interface IDotnetSettings { + + /** DotnetSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|null); + + /** DotnetSettings renamedResources */ + renamedResources?: ({ [k: string]: string }|null); + + /** DotnetSettings ignoredResources */ + ignoredResources?: (string[]|null); + + /** DotnetSettings forcedNamespaceAliases */ + forcedNamespaceAliases?: (string[]|null); + + /** DotnetSettings handwrittenSignatures */ + handwrittenSignatures?: (string[]|null); + } + + /** Represents a DotnetSettings. */ + class DotnetSettings implements IDotnetSettings { + + /** + * Constructs a new DotnetSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IDotnetSettings); + + /** DotnetSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + + /** DotnetSettings renamedResources. */ + public renamedResources: { [k: string]: string }; + + /** DotnetSettings ignoredResources. */ + public ignoredResources: string[]; + + /** DotnetSettings forcedNamespaceAliases. */ + public forcedNamespaceAliases: string[]; + + /** DotnetSettings handwrittenSignatures. */ + public handwrittenSignatures: string[]; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns DotnetSettings instance + */ + public static create(properties?: google.api.IDotnetSettings): google.api.DotnetSettings; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.DotnetSettings; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.DotnetSettings; + + /** + * Verifies a DotnetSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DotnetSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @param message DotnetSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DotnetSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DotnetSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RubySettings. */ + interface IRubySettings { + + /** RubySettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a RubySettings. */ + class RubySettings implements IRubySettings { + + /** + * Constructs a new RubySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IRubySettings); + + /** RubySettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new RubySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns RubySettings instance + */ + public static create(properties?: google.api.IRubySettings): google.api.RubySettings; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.RubySettings; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.RubySettings; + + /** + * Verifies a RubySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RubySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.RubySettings; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @param message RubySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.RubySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RubySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RubySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GoSettings. */ + interface IGoSettings { + + /** GoSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a GoSettings. */ + class GoSettings implements IGoSettings { + + /** + * Constructs a new GoSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IGoSettings); + + /** GoSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new GoSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns GoSettings instance + */ + public static create(properties?: google.api.IGoSettings): google.api.GoSettings; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.GoSettings; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.GoSettings; + + /** + * Verifies a GoSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.GoSettings; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @param message GoSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodSettings. */ + interface IMethodSettings { + + /** MethodSettings selector */ + selector?: (string|null); + + /** MethodSettings longRunning */ + longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields */ + autoPopulatedFields?: (string[]|null); + } + + /** Represents a MethodSettings. */ + class MethodSettings implements IMethodSettings { + + /** + * Constructs a new MethodSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IMethodSettings); + + /** MethodSettings selector. */ + public selector: string; + + /** MethodSettings longRunning. */ + public longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields. */ + public autoPopulatedFields: string[]; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodSettings instance + */ + public static create(properties?: google.api.IMethodSettings): google.api.MethodSettings; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings; + + /** + * Verifies a MethodSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @param message MethodSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodSettings { + + /** Properties of a LongRunning. */ + interface ILongRunning { + + /** LongRunning initialPollDelay */ + initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier */ + pollDelayMultiplier?: (number|null); + + /** LongRunning maxPollDelay */ + maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout */ + totalPollTimeout?: (google.protobuf.IDuration|null); + } + + /** Represents a LongRunning. */ + class LongRunning implements ILongRunning { + + /** + * Constructs a new LongRunning. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.MethodSettings.ILongRunning); + + /** LongRunning initialPollDelay. */ + public initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier. */ + public pollDelayMultiplier: number; + + /** LongRunning maxPollDelay. */ + public maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout. */ + public totalPollTimeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new LongRunning instance using the specified properties. + * @param [properties] Properties to set + * @returns LongRunning instance + */ + public static create(properties?: google.api.MethodSettings.ILongRunning): google.api.MethodSettings.LongRunning; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings.LongRunning; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings.LongRunning; + + /** + * Verifies a LongRunning message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LongRunning + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings.LongRunning; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @param message LongRunning + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings.LongRunning, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LongRunning to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LongRunning + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** ClientLibraryOrganization enum. */ + enum ClientLibraryOrganization { + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, + CLOUD = 1, + ADS = 2, + PHOTOS = 3, + STREET_VIEW = 4, + SHOPPING = 5, + GEO = 6, + GENERATIVE_AI = 7 + } + + /** ClientLibraryDestination enum. */ + enum ClientLibraryDestination { + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, + GITHUB = 10, + PACKAGE_MANAGER = 20 + } + + /** LaunchStage enum. */ + enum LaunchStage { + LAUNCH_STAGE_UNSPECIFIED = 0, + UNIMPLEMENTED = 6, + PRELAUNCH = 7, + EARLY_ACCESS = 1, + ALPHA = 2, + BETA = 3, + GA = 4, + DEPRECATED = 5 + } + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7, + IDENTIFIER = 8 + } + + /** Properties of a FieldInfo. */ + interface IFieldInfo { + + /** FieldInfo format */ + format?: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format|null); + } + + /** Represents a FieldInfo. */ + class FieldInfo implements IFieldInfo { + + /** + * Constructs a new FieldInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IFieldInfo); + + /** FieldInfo format. */ + public format: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format); + + /** + * Creates a new FieldInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldInfo instance + */ + public static create(properties?: google.api.IFieldInfo): google.api.FieldInfo; + + /** + * Encodes the specified FieldInfo message. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @param message FieldInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IFieldInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldInfo message, length delimited. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @param message FieldInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IFieldInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.FieldInfo; + + /** + * Decodes a FieldInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.FieldInfo; + + /** + * Verifies a FieldInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldInfo + */ + public static fromObject(object: { [k: string]: any }): google.api.FieldInfo; + + /** + * Creates a plain object from a FieldInfo message. Also converts values to other types if specified. + * @param message FieldInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.FieldInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldInfo { + + /** Format enum. */ + enum Format { + FORMAT_UNSPECIFIED = 0, + UUID4 = 1, + IPV4 = 2, + IPV6 = 3, + IPV4_OR_IPV6 = 4 + } + } + + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { + + /** ResourceDescriptor type */ + type?: (string|null); + + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); + } + + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { + + /** + * Constructs a new ResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceDescriptor); + + /** ResourceDescriptor type. */ + public type: string; + + /** ResourceDescriptor pattern. */ + public pattern: string[]; + + /** ResourceDescriptor nameField. */ + public nameField: string; + + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceDescriptor instance + */ + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; + + /** + * Verifies a ResourceDescriptor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @param message ResourceDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } + } + + /** Properties of a ResourceReference. */ + interface IResourceReference { + + /** ResourceReference type */ + type?: (string|null); + + /** ResourceReference childType */ + childType?: (string|null); + } + + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { + + /** + * Constructs a new ResourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceReference); + + /** ResourceReference type. */ + public type: string; + + /** ResourceReference childType. */ + public childType: string; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceReference instance + */ + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; + + /** + * Verifies a ResourceReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceReference + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @param message ResourceReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { + + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } + + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { + + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); + + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorSet instance + */ + public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; + + /** + * Verifies a FileDescriptorSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @param message FileDescriptorSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Edition enum. */ + enum Edition { + EDITION_UNKNOWN = 0, + EDITION_PROTO2 = 998, + EDITION_PROTO3 = 999, + EDITION_2023 = 1000, + EDITION_2024 = 1001, + EDITION_1_TEST_ONLY = 1, + EDITION_2_TEST_ONLY = 2, + EDITION_99997_TEST_ONLY = 99997, + EDITION_99998_TEST_ONLY = 99998, + EDITION_99999_TEST_ONLY = 99999, + EDITION_MAX = 2147483647 + } + + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { + + /** FileDescriptorProto name */ + name?: (string|null); + + /** FileDescriptorProto package */ + "package"?: (string|null); + + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); + + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); + + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); + + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); + + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); + + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax */ + syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { + + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); + + /** FileDescriptorProto name. */ + public name: string; + + /** FileDescriptorProto package. */ + public package: string; + + /** FileDescriptorProto dependency. */ + public dependency: string[]; + + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; + + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; + + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; + + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; + + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax. */ + public syntax: string; + + /** FileDescriptorProto edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; + + /** + * Verifies a FileDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @param message FileDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { + + /** DescriptorProto name */ + name?: (string|null); + + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); + + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { + + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); + + /** DescriptorProto name. */ + public name: string; + + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; + + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + + /** DescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DescriptorProto instance + */ + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; + + /** + * Verifies a DescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @param message DescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DescriptorProto { + + /** Properties of an ExtensionRange. */ + interface IExtensionRange { + + /** ExtensionRange start */ + start?: (number|null); + + /** ExtensionRange end */ + end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } + + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { + + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + + /** ExtensionRange start. */ + public start: number; + + /** ExtensionRange end. */ + public end: number; + + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Verifies an ExtensionRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @param message ExtensionRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReservedRange. */ + interface IReservedRange { + + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); + } + + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { + + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + + /** ReservedRange start. */ + public start: number; + + /** ReservedRange end. */ + public end: number; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservedRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Verifies a ReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @param message ReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ExtensionRangeOptions declaration */ + declaration?: (google.protobuf.ExtensionRangeOptions.IDeclaration[]|null); + + /** ExtensionRangeOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification */ + verification?: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState|null); + } + + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { + + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); + + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** ExtensionRangeOptions declaration. */ + public declaration: google.protobuf.ExtensionRangeOptions.IDeclaration[]; + + /** ExtensionRangeOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification. */ + public verification: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState); + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRangeOptions instance + */ + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; + + /** + * Verifies an ExtensionRangeOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRangeOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @param message ExtensionRangeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExtensionRangeOptions { + + /** Properties of a Declaration. */ + interface IDeclaration { + + /** Declaration number */ + number?: (number|null); + + /** Declaration fullName */ + fullName?: (string|null); + + /** Declaration type */ + type?: (string|null); + + /** Declaration reserved */ + reserved?: (boolean|null); + + /** Declaration repeated */ + repeated?: (boolean|null); + } + + /** Represents a Declaration. */ + class Declaration implements IDeclaration { + + /** + * Constructs a new Declaration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration); + + /** Declaration number. */ + public number: number; + + /** Declaration fullName. */ + public fullName: string; + + /** Declaration type. */ + public type: string; + + /** Declaration reserved. */ + public reserved: boolean; + + /** Declaration repeated. */ + public repeated: boolean; + + /** + * Creates a new Declaration instance using the specified properties. + * @param [properties] Properties to set + * @returns Declaration instance + */ + public static create(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Verifies a Declaration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Declaration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @param message Declaration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions.Declaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Declaration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Declaration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** VerificationState enum. */ + enum VerificationState { + DECLARATION = 0, + UNVERIFIED = 1 + } + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldDescriptorProto { + + /** Type enum. */ + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } + + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REPEATED = 3, + LABEL_REQUIRED = 2 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Verifies an EnumReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; + + /** + * Verifies an EnumValueDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; + + /** + * Verifies a ServiceDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; + + /** + * Verifies a MethodDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions deprecated */ + deprecated?: (boolean|null); + + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); + + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); + + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); + + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); + + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); + + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); + + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); + + /** FileOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); + } + + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { + + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); + + /** FileOptions javaPackage. */ + public javaPackage: string; + + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; + + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; + + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions deprecated. */ + public deprecated: boolean; + + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; + + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; + + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; + + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; + + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; + + /** FileOptions phpNamespace. */ + public phpNamespace: string; + + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; + + /** FileOptions rubyPackage. */ + public rubyPackage: string; + + /** FileOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FileOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOptions instance + */ + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; + + /** + * Verifies a FileOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @param message FileOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FileOptions { + + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } + + /** Properties of a MessageOptions. */ + interface IMessageOptions { + + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); + + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); + + /** MessageOptions deprecated */ + deprecated?: (boolean|null); + + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); + + /** MessageOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** MessageOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); + } + + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { + + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); + + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** MessageOptions mapEntry. */ + public mapEntry: boolean; + + /** MessageOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** MessageOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageOptions instance + */ + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; + + /** + * Verifies a MessageOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @param message MessageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MessageOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldOptions. */ + interface IFieldOptions { + + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + + /** FieldOptions lazy */ + lazy?: (boolean|null); + + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions debugRedact */ + debugRedact?: (boolean|null); + + /** FieldOptions retention */ + retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); + + /** FieldOptions targets */ + targets?: (google.protobuf.FieldOptions.OptionTargetType[]|null); + + /** FieldOptions editionDefaults */ + editionDefaults?: (google.protobuf.FieldOptions.IEditionDefault[]|null); + + /** FieldOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.fieldInfo */ + ".google.api.fieldInfo"?: (google.api.IFieldInfo|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions debugRedact. */ + public debugRedact: boolean; + + /** FieldOptions retention. */ + public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); + + /** FieldOptions targets. */ + public targets: google.protobuf.FieldOptions.OptionTargetType[]; + + /** FieldOptions editionDefaults. */ + public editionDefaults: google.protobuf.FieldOptions.IEditionDefault[]; + + /** FieldOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldOptions instance + */ + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; + + /** + * Verifies a FieldOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @param message FieldOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + + /** OptionRetention enum. */ + enum OptionRetention { + RETENTION_UNKNOWN = 0, + RETENTION_RUNTIME = 1, + RETENTION_SOURCE = 2 + } + + /** OptionTargetType enum. */ + enum OptionTargetType { + TARGET_TYPE_UNKNOWN = 0, + TARGET_TYPE_FILE = 1, + TARGET_TYPE_EXTENSION_RANGE = 2, + TARGET_TYPE_MESSAGE = 3, + TARGET_TYPE_FIELD = 4, + TARGET_TYPE_ONEOF = 5, + TARGET_TYPE_ENUM = 6, + TARGET_TYPE_ENUM_ENTRY = 7, + TARGET_TYPE_SERVICE = 8, + TARGET_TYPE_METHOD = 9 + } + + /** Properties of an EditionDefault. */ + interface IEditionDefault { + + /** EditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** EditionDefault value */ + value?: (string|null); + } + + /** Represents an EditionDefault. */ + class EditionDefault implements IEditionDefault { + + /** + * Constructs a new EditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IEditionDefault); + + /** EditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** EditionDefault value. */ + public value: string; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns EditionDefault instance + */ + public static create(properties?: google.protobuf.FieldOptions.IEditionDefault): google.protobuf.FieldOptions.EditionDefault; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.EditionDefault; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.EditionDefault; + + /** + * Verifies an EditionDefault message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.EditionDefault; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @param message EditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.EditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { + + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); + + /** OneofOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofOptions instance + */ + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; + + /** + * Verifies an OneofOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @param message OneofOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** EnumOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { + + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); + + /** EnumOptions allowAlias. */ + public allowAlias: boolean; + + /** EnumOptions deprecated. */ + public deprecated: boolean; + + /** EnumOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** EnumOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; + + /** + * Verifies an EnumOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact */ + debugRedact?: (boolean|null); + + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { + + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); + + /** EnumValueOptions deprecated. */ + public deprecated: boolean; + + /** EnumValueOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact. */ + public debugRedact: boolean; + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; + + /** + * Verifies an EnumValueOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + + /** ServiceOptions .google.api.apiVersion */ + ".google.api.apiVersion"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|Buffer|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|Buffer|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a FeatureSet. */ + interface IFeatureSet { + + /** FeatureSet fieldPresence */ + fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); + + /** FeatureSet enumType */ + enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); + + /** FeatureSet repeatedFieldEncoding */ + repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); + + /** FeatureSet utf8Validation */ + utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); + + /** FeatureSet messageEncoding */ + messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); + + /** FeatureSet jsonFormat */ + jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); + } + + /** Represents a FeatureSet. */ + class FeatureSet implements IFeatureSet { + + /** + * Constructs a new FeatureSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSet); + + /** FeatureSet fieldPresence. */ + public fieldPresence: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence); + + /** FeatureSet enumType. */ + public enumType: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType); + + /** FeatureSet repeatedFieldEncoding. */ + public repeatedFieldEncoding: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding); + + /** FeatureSet utf8Validation. */ + public utf8Validation: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation); + + /** FeatureSet messageEncoding. */ + public messageEncoding: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding); + + /** FeatureSet jsonFormat. */ + public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); + + /** + * Creates a new FeatureSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSet instance + */ + public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet; + + /** + * Verifies a FeatureSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @param message FeatureSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSet { + + /** FieldPresence enum. */ + enum FieldPresence { + FIELD_PRESENCE_UNKNOWN = 0, + EXPLICIT = 1, + IMPLICIT = 2, + LEGACY_REQUIRED = 3 + } + + /** EnumType enum. */ + enum EnumType { + ENUM_TYPE_UNKNOWN = 0, + OPEN = 1, + CLOSED = 2 + } + + /** RepeatedFieldEncoding enum. */ + enum RepeatedFieldEncoding { + REPEATED_FIELD_ENCODING_UNKNOWN = 0, + PACKED = 1, + EXPANDED = 2 + } + + /** Utf8Validation enum. */ + enum Utf8Validation { + UTF8_VALIDATION_UNKNOWN = 0, + VERIFY = 2, + NONE = 3 + } + + /** MessageEncoding enum. */ + enum MessageEncoding { + MESSAGE_ENCODING_UNKNOWN = 0, + LENGTH_PREFIXED = 1, + DELIMITED = 2 + } + + /** JsonFormat enum. */ + enum JsonFormat { + JSON_FORMAT_UNKNOWN = 0, + ALLOW = 1, + LEGACY_BEST_EFFORT = 2 + } + } + + /** Properties of a FeatureSetDefaults. */ + interface IFeatureSetDefaults { + + /** FeatureSetDefaults defaults */ + defaults?: (google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]|null); + + /** FeatureSetDefaults minimumEdition */ + minimumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetDefaults maximumEdition */ + maximumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSetDefaults. */ + class FeatureSetDefaults implements IFeatureSetDefaults { + + /** + * Constructs a new FeatureSetDefaults. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSetDefaults); + + /** FeatureSetDefaults defaults. */ + public defaults: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]; + + /** FeatureSetDefaults minimumEdition. */ + public minimumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetDefaults maximumEdition. */ + public maximumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetDefaults instance + */ + public static create(properties?: google.protobuf.IFeatureSetDefaults): google.protobuf.FeatureSetDefaults; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults; + + /** + * Verifies a FeatureSetDefaults message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetDefaults + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @param message FeatureSetDefaults + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetDefaults + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSetDefaults { + + /** Properties of a FeatureSetEditionDefault. */ + interface IFeatureSetEditionDefault { + + /** FeatureSetEditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetEditionDefault features */ + features?: (google.protobuf.IFeatureSet|null); + } + + /** Represents a FeatureSetEditionDefault. */ + class FeatureSetEditionDefault implements IFeatureSetEditionDefault { + + /** + * Constructs a new FeatureSetEditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault); + + /** FeatureSetEditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetEditionDefault features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetEditionDefault instance + */ + public static create(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Verifies a FeatureSetEditionDefault message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetEditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @param message FeatureSetEditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } + } + } + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long|string); + + /** Duration nanos. */ + public nanos: number; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; + + /** + * Verifies a Duration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Duration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|Buffer|string|null); + } + + /** Represents an Any. */ + class Any implements IAny { + + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); + + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: (Uint8Array|Buffer|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; + + /** + * Verifies an Any message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); + + /** + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance + */ + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; + + /** + * Verifies an Empty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Empty + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Empty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldMask. */ + interface IFieldMask { + + /** FieldMask paths */ + paths?: (string[]|null); + } + + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { + + /** + * Constructs a new FieldMask. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldMask); + + /** FieldMask paths. */ + public paths: string[]; + + /** + * Creates a new FieldMask instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldMask instance + */ + public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; + + /** + * Verifies a FieldMask message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldMask + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @param message FieldMask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldMask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldMask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace longrunning. */ + namespace longrunning { + + /** Represents an Operations */ + class Operations extends $protobuf.rpc.Service { + + /** + * Constructs a new Operations service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Operations service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Operations; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOperationsResponse + */ + public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @returns Promise + */ + public listOperations(request: google.longrunning.IListOperationsRequest): Promise; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @returns Promise + */ + public getOperation(request: google.longrunning.IGetOperationRequest): Promise; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @returns Promise + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @returns Promise + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @returns Promise + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; + } + + namespace Operations { + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @param error Error, if any + * @param [response] ListOperationsResponse + */ + type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Operation. */ + interface IOperation { + + /** Operation name */ + name?: (string|null); + + /** Operation metadata */ + metadata?: (google.protobuf.IAny|null); + + /** Operation done */ + done?: (boolean|null); + + /** Operation error */ + error?: (google.rpc.IStatus|null); + + /** Operation response */ + response?: (google.protobuf.IAny|null); + } + + /** Represents an Operation. */ + class Operation implements IOperation { + + /** + * Constructs a new Operation. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperation); + + /** Operation name. */ + public name: string; + + /** Operation metadata. */ + public metadata?: (google.protobuf.IAny|null); + + /** Operation done. */ + public done: boolean; + + /** Operation error. */ + public error?: (google.rpc.IStatus|null); + + /** Operation response. */ + public response?: (google.protobuf.IAny|null); + + /** Operation result. */ + public result?: ("error"|"response"); + + /** + * Creates a new Operation instance using the specified properties. + * @param [properties] Properties to set + * @returns Operation instance + */ + public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.Operation; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.Operation; + + /** + * Verifies an Operation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Operation + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @param message Operation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Operation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Operation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetOperationRequest. */ + interface IGetOperationRequest { + + /** GetOperationRequest name */ + name?: (string|null); + } + + /** Represents a GetOperationRequest. */ + class GetOperationRequest implements IGetOperationRequest { + + /** + * Constructs a new GetOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IGetOperationRequest); + + /** GetOperationRequest name. */ + public name: string; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOperationRequest instance + */ + public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.GetOperationRequest; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.GetOperationRequest; + + /** + * Verifies a GetOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @param message GetOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsRequest. */ + interface IListOperationsRequest { + + /** ListOperationsRequest name */ + name?: (string|null); + + /** ListOperationsRequest filter */ + filter?: (string|null); + + /** ListOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOperationsRequest. */ + class ListOperationsRequest implements IListOperationsRequest { + + /** + * Constructs a new ListOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsRequest); + + /** ListOperationsRequest name. */ + public name: string; + + /** ListOperationsRequest filter. */ + public filter: string; + + /** ListOperationsRequest pageSize. */ + public pageSize: number; + + /** ListOperationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsRequest instance + */ + public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsRequest; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsRequest; + + /** + * Verifies a ListOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @param message ListOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsResponse. */ + interface IListOperationsResponse { + + /** ListOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOperationsResponse. */ + class ListOperationsResponse implements IListOperationsResponse { + + /** + * Constructs a new ListOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsResponse); + + /** ListOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsResponse instance + */ + public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsResponse; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsResponse; + + /** + * Verifies a ListOperationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @param message ListOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelOperationRequest. */ + interface ICancelOperationRequest { + + /** CancelOperationRequest name */ + name?: (string|null); + } + + /** Represents a CancelOperationRequest. */ + class CancelOperationRequest implements ICancelOperationRequest { + + /** + * Constructs a new CancelOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.ICancelOperationRequest); + + /** CancelOperationRequest name. */ + public name: string; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelOperationRequest instance + */ + public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.CancelOperationRequest; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.CancelOperationRequest; + + /** + * Verifies a CancelOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @param message CancelOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteOperationRequest. */ + interface IDeleteOperationRequest { + + /** DeleteOperationRequest name */ + name?: (string|null); + } + + /** Represents a DeleteOperationRequest. */ + class DeleteOperationRequest implements IDeleteOperationRequest { + + /** + * Constructs a new DeleteOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IDeleteOperationRequest); + + /** DeleteOperationRequest name. */ + public name: string; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOperationRequest instance + */ + public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.DeleteOperationRequest; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.DeleteOperationRequest; + + /** + * Verifies a DeleteOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @param message DeleteOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WaitOperationRequest. */ + interface IWaitOperationRequest { + + /** WaitOperationRequest name */ + name?: (string|null); + + /** WaitOperationRequest timeout */ + timeout?: (google.protobuf.IDuration|null); + } + + /** Represents a WaitOperationRequest. */ + class WaitOperationRequest implements IWaitOperationRequest { + + /** + * Constructs a new WaitOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IWaitOperationRequest); + + /** WaitOperationRequest name. */ + public name: string; + + /** WaitOperationRequest timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WaitOperationRequest instance + */ + public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.WaitOperationRequest; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.WaitOperationRequest; + + /** + * Verifies a WaitOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WaitOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @param message WaitOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WaitOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WaitOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationInfo. */ + interface IOperationInfo { + + /** OperationInfo responseType */ + responseType?: (string|null); + + /** OperationInfo metadataType */ + metadataType?: (string|null); + } + + /** Represents an OperationInfo. */ + class OperationInfo implements IOperationInfo { + + /** + * Constructs a new OperationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperationInfo); + + /** OperationInfo responseType. */ + public responseType: string; + + /** OperationInfo metadataType. */ + public metadataType: string; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationInfo instance + */ + public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.OperationInfo; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.OperationInfo; + + /** + * Verifies an OperationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationInfo + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @param message OperationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; + + /** + * Verifies a Status message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/protos/protos.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/protos/protos.js new file mode 100644 index 00000000000..ad95c445742 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/protos/protos.js @@ -0,0 +1,43680 @@ +// 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. + +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +(function(global, factory) { /* global define, require, module */ + + /* AMD */ if (typeof define === 'function' && define.amd) + define(["protobufjs/minimal"], factory); + + /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) + module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal); + +})(this, function($protobuf) { + "use strict"; + + // Common aliases + var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + + // Exported root namespace + var $root = $protobuf.roots._google_cloud_speech_protos || ($protobuf.roots._google_cloud_speech_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.speech = (function() { + + /** + * Namespace speech. + * @memberof google.cloud + * @namespace + */ + var speech = {}; + + speech.v2 = (function() { + + /** + * Namespace v2. + * @memberof google.cloud.speech + * @namespace + */ + var v2 = {}; + + v2.Speech = (function() { + + /** + * Constructs a new Speech service. + * @memberof google.cloud.speech.v2 + * @classdesc Represents a Speech + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Speech(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Speech.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Speech; + + /** + * Creates new Speech service using the specified rpc implementation. + * @function create + * @memberof google.cloud.speech.v2.Speech + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Speech} RPC service. Useful where requests and/or responses are streamed. + */ + Speech.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.speech.v2.Speech|createRecognizer}. + * @memberof google.cloud.speech.v2.Speech + * @typedef CreateRecognizerCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateRecognizer. + * @function createRecognizer + * @memberof google.cloud.speech.v2.Speech + * @instance + * @param {google.cloud.speech.v2.ICreateRecognizerRequest} request CreateRecognizerRequest message or plain object + * @param {google.cloud.speech.v2.Speech.CreateRecognizerCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Speech.prototype.createRecognizer = function createRecognizer(request, callback) { + return this.rpcCall(createRecognizer, $root.google.cloud.speech.v2.CreateRecognizerRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateRecognizer" }); + + /** + * Calls CreateRecognizer. + * @function createRecognizer + * @memberof google.cloud.speech.v2.Speech + * @instance + * @param {google.cloud.speech.v2.ICreateRecognizerRequest} request CreateRecognizerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.speech.v2.Speech|listRecognizers}. + * @memberof google.cloud.speech.v2.Speech + * @typedef ListRecognizersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.speech.v2.ListRecognizersResponse} [response] ListRecognizersResponse + */ + + /** + * Calls ListRecognizers. + * @function listRecognizers + * @memberof google.cloud.speech.v2.Speech + * @instance + * @param {google.cloud.speech.v2.IListRecognizersRequest} request ListRecognizersRequest message or plain object + * @param {google.cloud.speech.v2.Speech.ListRecognizersCallback} callback Node-style callback called with the error, if any, and ListRecognizersResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Speech.prototype.listRecognizers = function listRecognizers(request, callback) { + return this.rpcCall(listRecognizers, $root.google.cloud.speech.v2.ListRecognizersRequest, $root.google.cloud.speech.v2.ListRecognizersResponse, request, callback); + }, "name", { value: "ListRecognizers" }); + + /** + * Calls ListRecognizers. + * @function listRecognizers + * @memberof google.cloud.speech.v2.Speech + * @instance + * @param {google.cloud.speech.v2.IListRecognizersRequest} request ListRecognizersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.speech.v2.Speech|getRecognizer}. + * @memberof google.cloud.speech.v2.Speech + * @typedef GetRecognizerCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.speech.v2.Recognizer} [response] Recognizer + */ + + /** + * Calls GetRecognizer. + * @function getRecognizer + * @memberof google.cloud.speech.v2.Speech + * @instance + * @param {google.cloud.speech.v2.IGetRecognizerRequest} request GetRecognizerRequest message or plain object + * @param {google.cloud.speech.v2.Speech.GetRecognizerCallback} callback Node-style callback called with the error, if any, and Recognizer + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Speech.prototype.getRecognizer = function getRecognizer(request, callback) { + return this.rpcCall(getRecognizer, $root.google.cloud.speech.v2.GetRecognizerRequest, $root.google.cloud.speech.v2.Recognizer, request, callback); + }, "name", { value: "GetRecognizer" }); + + /** + * Calls GetRecognizer. + * @function getRecognizer + * @memberof google.cloud.speech.v2.Speech + * @instance + * @param {google.cloud.speech.v2.IGetRecognizerRequest} request GetRecognizerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.speech.v2.Speech|updateRecognizer}. + * @memberof google.cloud.speech.v2.Speech + * @typedef UpdateRecognizerCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateRecognizer. + * @function updateRecognizer + * @memberof google.cloud.speech.v2.Speech + * @instance + * @param {google.cloud.speech.v2.IUpdateRecognizerRequest} request UpdateRecognizerRequest message or plain object + * @param {google.cloud.speech.v2.Speech.UpdateRecognizerCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Speech.prototype.updateRecognizer = function updateRecognizer(request, callback) { + return this.rpcCall(updateRecognizer, $root.google.cloud.speech.v2.UpdateRecognizerRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateRecognizer" }); + + /** + * Calls UpdateRecognizer. + * @function updateRecognizer + * @memberof google.cloud.speech.v2.Speech + * @instance + * @param {google.cloud.speech.v2.IUpdateRecognizerRequest} request UpdateRecognizerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.speech.v2.Speech|deleteRecognizer}. + * @memberof google.cloud.speech.v2.Speech + * @typedef DeleteRecognizerCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteRecognizer. + * @function deleteRecognizer + * @memberof google.cloud.speech.v2.Speech + * @instance + * @param {google.cloud.speech.v2.IDeleteRecognizerRequest} request DeleteRecognizerRequest message or plain object + * @param {google.cloud.speech.v2.Speech.DeleteRecognizerCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Speech.prototype.deleteRecognizer = function deleteRecognizer(request, callback) { + return this.rpcCall(deleteRecognizer, $root.google.cloud.speech.v2.DeleteRecognizerRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteRecognizer" }); + + /** + * Calls DeleteRecognizer. + * @function deleteRecognizer + * @memberof google.cloud.speech.v2.Speech + * @instance + * @param {google.cloud.speech.v2.IDeleteRecognizerRequest} request DeleteRecognizerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.speech.v2.Speech|undeleteRecognizer}. + * @memberof google.cloud.speech.v2.Speech + * @typedef UndeleteRecognizerCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UndeleteRecognizer. + * @function undeleteRecognizer + * @memberof google.cloud.speech.v2.Speech + * @instance + * @param {google.cloud.speech.v2.IUndeleteRecognizerRequest} request UndeleteRecognizerRequest message or plain object + * @param {google.cloud.speech.v2.Speech.UndeleteRecognizerCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Speech.prototype.undeleteRecognizer = function undeleteRecognizer(request, callback) { + return this.rpcCall(undeleteRecognizer, $root.google.cloud.speech.v2.UndeleteRecognizerRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UndeleteRecognizer" }); + + /** + * Calls UndeleteRecognizer. + * @function undeleteRecognizer + * @memberof google.cloud.speech.v2.Speech + * @instance + * @param {google.cloud.speech.v2.IUndeleteRecognizerRequest} request UndeleteRecognizerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.speech.v2.Speech|recognize}. + * @memberof google.cloud.speech.v2.Speech + * @typedef RecognizeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.speech.v2.RecognizeResponse} [response] RecognizeResponse + */ + + /** + * Calls Recognize. + * @function recognize + * @memberof google.cloud.speech.v2.Speech + * @instance + * @param {google.cloud.speech.v2.IRecognizeRequest} request RecognizeRequest message or plain object + * @param {google.cloud.speech.v2.Speech.RecognizeCallback} callback Node-style callback called with the error, if any, and RecognizeResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Speech.prototype.recognize = function recognize(request, callback) { + return this.rpcCall(recognize, $root.google.cloud.speech.v2.RecognizeRequest, $root.google.cloud.speech.v2.RecognizeResponse, request, callback); + }, "name", { value: "Recognize" }); + + /** + * Calls Recognize. + * @function recognize + * @memberof google.cloud.speech.v2.Speech + * @instance + * @param {google.cloud.speech.v2.IRecognizeRequest} request RecognizeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.speech.v2.Speech|streamingRecognize}. + * @memberof google.cloud.speech.v2.Speech + * @typedef StreamingRecognizeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.speech.v2.StreamingRecognizeResponse} [response] StreamingRecognizeResponse + */ + + /** + * Calls StreamingRecognize. + * @function streamingRecognize + * @memberof google.cloud.speech.v2.Speech + * @instance + * @param {google.cloud.speech.v2.IStreamingRecognizeRequest} request StreamingRecognizeRequest message or plain object + * @param {google.cloud.speech.v2.Speech.StreamingRecognizeCallback} callback Node-style callback called with the error, if any, and StreamingRecognizeResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Speech.prototype.streamingRecognize = function streamingRecognize(request, callback) { + return this.rpcCall(streamingRecognize, $root.google.cloud.speech.v2.StreamingRecognizeRequest, $root.google.cloud.speech.v2.StreamingRecognizeResponse, request, callback); + }, "name", { value: "StreamingRecognize" }); + + /** + * Calls StreamingRecognize. + * @function streamingRecognize + * @memberof google.cloud.speech.v2.Speech + * @instance + * @param {google.cloud.speech.v2.IStreamingRecognizeRequest} request StreamingRecognizeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.speech.v2.Speech|batchRecognize}. + * @memberof google.cloud.speech.v2.Speech + * @typedef BatchRecognizeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls BatchRecognize. + * @function batchRecognize + * @memberof google.cloud.speech.v2.Speech + * @instance + * @param {google.cloud.speech.v2.IBatchRecognizeRequest} request BatchRecognizeRequest message or plain object + * @param {google.cloud.speech.v2.Speech.BatchRecognizeCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Speech.prototype.batchRecognize = function batchRecognize(request, callback) { + return this.rpcCall(batchRecognize, $root.google.cloud.speech.v2.BatchRecognizeRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "BatchRecognize" }); + + /** + * Calls BatchRecognize. + * @function batchRecognize + * @memberof google.cloud.speech.v2.Speech + * @instance + * @param {google.cloud.speech.v2.IBatchRecognizeRequest} request BatchRecognizeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.speech.v2.Speech|getConfig}. + * @memberof google.cloud.speech.v2.Speech + * @typedef GetConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.speech.v2.Config} [response] Config + */ + + /** + * Calls GetConfig. + * @function getConfig + * @memberof google.cloud.speech.v2.Speech + * @instance + * @param {google.cloud.speech.v2.IGetConfigRequest} request GetConfigRequest message or plain object + * @param {google.cloud.speech.v2.Speech.GetConfigCallback} callback Node-style callback called with the error, if any, and Config + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Speech.prototype.getConfig = function getConfig(request, callback) { + return this.rpcCall(getConfig, $root.google.cloud.speech.v2.GetConfigRequest, $root.google.cloud.speech.v2.Config, request, callback); + }, "name", { value: "GetConfig" }); + + /** + * Calls GetConfig. + * @function getConfig + * @memberof google.cloud.speech.v2.Speech + * @instance + * @param {google.cloud.speech.v2.IGetConfigRequest} request GetConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.speech.v2.Speech|updateConfig}. + * @memberof google.cloud.speech.v2.Speech + * @typedef UpdateConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.speech.v2.Config} [response] Config + */ + + /** + * Calls UpdateConfig. + * @function updateConfig + * @memberof google.cloud.speech.v2.Speech + * @instance + * @param {google.cloud.speech.v2.IUpdateConfigRequest} request UpdateConfigRequest message or plain object + * @param {google.cloud.speech.v2.Speech.UpdateConfigCallback} callback Node-style callback called with the error, if any, and Config + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Speech.prototype.updateConfig = function updateConfig(request, callback) { + return this.rpcCall(updateConfig, $root.google.cloud.speech.v2.UpdateConfigRequest, $root.google.cloud.speech.v2.Config, request, callback); + }, "name", { value: "UpdateConfig" }); + + /** + * Calls UpdateConfig. + * @function updateConfig + * @memberof google.cloud.speech.v2.Speech + * @instance + * @param {google.cloud.speech.v2.IUpdateConfigRequest} request UpdateConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.speech.v2.Speech|createCustomClass}. + * @memberof google.cloud.speech.v2.Speech + * @typedef CreateCustomClassCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateCustomClass. + * @function createCustomClass + * @memberof google.cloud.speech.v2.Speech + * @instance + * @param {google.cloud.speech.v2.ICreateCustomClassRequest} request CreateCustomClassRequest message or plain object + * @param {google.cloud.speech.v2.Speech.CreateCustomClassCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Speech.prototype.createCustomClass = function createCustomClass(request, callback) { + return this.rpcCall(createCustomClass, $root.google.cloud.speech.v2.CreateCustomClassRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateCustomClass" }); + + /** + * Calls CreateCustomClass. + * @function createCustomClass + * @memberof google.cloud.speech.v2.Speech + * @instance + * @param {google.cloud.speech.v2.ICreateCustomClassRequest} request CreateCustomClassRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.speech.v2.Speech|listCustomClasses}. + * @memberof google.cloud.speech.v2.Speech + * @typedef ListCustomClassesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.speech.v2.ListCustomClassesResponse} [response] ListCustomClassesResponse + */ + + /** + * Calls ListCustomClasses. + * @function listCustomClasses + * @memberof google.cloud.speech.v2.Speech + * @instance + * @param {google.cloud.speech.v2.IListCustomClassesRequest} request ListCustomClassesRequest message or plain object + * @param {google.cloud.speech.v2.Speech.ListCustomClassesCallback} callback Node-style callback called with the error, if any, and ListCustomClassesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Speech.prototype.listCustomClasses = function listCustomClasses(request, callback) { + return this.rpcCall(listCustomClasses, $root.google.cloud.speech.v2.ListCustomClassesRequest, $root.google.cloud.speech.v2.ListCustomClassesResponse, request, callback); + }, "name", { value: "ListCustomClasses" }); + + /** + * Calls ListCustomClasses. + * @function listCustomClasses + * @memberof google.cloud.speech.v2.Speech + * @instance + * @param {google.cloud.speech.v2.IListCustomClassesRequest} request ListCustomClassesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.speech.v2.Speech|getCustomClass}. + * @memberof google.cloud.speech.v2.Speech + * @typedef GetCustomClassCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.speech.v2.CustomClass} [response] CustomClass + */ + + /** + * Calls GetCustomClass. + * @function getCustomClass + * @memberof google.cloud.speech.v2.Speech + * @instance + * @param {google.cloud.speech.v2.IGetCustomClassRequest} request GetCustomClassRequest message or plain object + * @param {google.cloud.speech.v2.Speech.GetCustomClassCallback} callback Node-style callback called with the error, if any, and CustomClass + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Speech.prototype.getCustomClass = function getCustomClass(request, callback) { + return this.rpcCall(getCustomClass, $root.google.cloud.speech.v2.GetCustomClassRequest, $root.google.cloud.speech.v2.CustomClass, request, callback); + }, "name", { value: "GetCustomClass" }); + + /** + * Calls GetCustomClass. + * @function getCustomClass + * @memberof google.cloud.speech.v2.Speech + * @instance + * @param {google.cloud.speech.v2.IGetCustomClassRequest} request GetCustomClassRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.speech.v2.Speech|updateCustomClass}. + * @memberof google.cloud.speech.v2.Speech + * @typedef UpdateCustomClassCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateCustomClass. + * @function updateCustomClass + * @memberof google.cloud.speech.v2.Speech + * @instance + * @param {google.cloud.speech.v2.IUpdateCustomClassRequest} request UpdateCustomClassRequest message or plain object + * @param {google.cloud.speech.v2.Speech.UpdateCustomClassCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Speech.prototype.updateCustomClass = function updateCustomClass(request, callback) { + return this.rpcCall(updateCustomClass, $root.google.cloud.speech.v2.UpdateCustomClassRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateCustomClass" }); + + /** + * Calls UpdateCustomClass. + * @function updateCustomClass + * @memberof google.cloud.speech.v2.Speech + * @instance + * @param {google.cloud.speech.v2.IUpdateCustomClassRequest} request UpdateCustomClassRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.speech.v2.Speech|deleteCustomClass}. + * @memberof google.cloud.speech.v2.Speech + * @typedef DeleteCustomClassCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteCustomClass. + * @function deleteCustomClass + * @memberof google.cloud.speech.v2.Speech + * @instance + * @param {google.cloud.speech.v2.IDeleteCustomClassRequest} request DeleteCustomClassRequest message or plain object + * @param {google.cloud.speech.v2.Speech.DeleteCustomClassCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Speech.prototype.deleteCustomClass = function deleteCustomClass(request, callback) { + return this.rpcCall(deleteCustomClass, $root.google.cloud.speech.v2.DeleteCustomClassRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteCustomClass" }); + + /** + * Calls DeleteCustomClass. + * @function deleteCustomClass + * @memberof google.cloud.speech.v2.Speech + * @instance + * @param {google.cloud.speech.v2.IDeleteCustomClassRequest} request DeleteCustomClassRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.speech.v2.Speech|undeleteCustomClass}. + * @memberof google.cloud.speech.v2.Speech + * @typedef UndeleteCustomClassCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UndeleteCustomClass. + * @function undeleteCustomClass + * @memberof google.cloud.speech.v2.Speech + * @instance + * @param {google.cloud.speech.v2.IUndeleteCustomClassRequest} request UndeleteCustomClassRequest message or plain object + * @param {google.cloud.speech.v2.Speech.UndeleteCustomClassCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Speech.prototype.undeleteCustomClass = function undeleteCustomClass(request, callback) { + return this.rpcCall(undeleteCustomClass, $root.google.cloud.speech.v2.UndeleteCustomClassRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UndeleteCustomClass" }); + + /** + * Calls UndeleteCustomClass. + * @function undeleteCustomClass + * @memberof google.cloud.speech.v2.Speech + * @instance + * @param {google.cloud.speech.v2.IUndeleteCustomClassRequest} request UndeleteCustomClassRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.speech.v2.Speech|createPhraseSet}. + * @memberof google.cloud.speech.v2.Speech + * @typedef CreatePhraseSetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreatePhraseSet. + * @function createPhraseSet + * @memberof google.cloud.speech.v2.Speech + * @instance + * @param {google.cloud.speech.v2.ICreatePhraseSetRequest} request CreatePhraseSetRequest message or plain object + * @param {google.cloud.speech.v2.Speech.CreatePhraseSetCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Speech.prototype.createPhraseSet = function createPhraseSet(request, callback) { + return this.rpcCall(createPhraseSet, $root.google.cloud.speech.v2.CreatePhraseSetRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreatePhraseSet" }); + + /** + * Calls CreatePhraseSet. + * @function createPhraseSet + * @memberof google.cloud.speech.v2.Speech + * @instance + * @param {google.cloud.speech.v2.ICreatePhraseSetRequest} request CreatePhraseSetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.speech.v2.Speech|listPhraseSets}. + * @memberof google.cloud.speech.v2.Speech + * @typedef ListPhraseSetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.speech.v2.ListPhraseSetsResponse} [response] ListPhraseSetsResponse + */ + + /** + * Calls ListPhraseSets. + * @function listPhraseSets + * @memberof google.cloud.speech.v2.Speech + * @instance + * @param {google.cloud.speech.v2.IListPhraseSetsRequest} request ListPhraseSetsRequest message or plain object + * @param {google.cloud.speech.v2.Speech.ListPhraseSetsCallback} callback Node-style callback called with the error, if any, and ListPhraseSetsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Speech.prototype.listPhraseSets = function listPhraseSets(request, callback) { + return this.rpcCall(listPhraseSets, $root.google.cloud.speech.v2.ListPhraseSetsRequest, $root.google.cloud.speech.v2.ListPhraseSetsResponse, request, callback); + }, "name", { value: "ListPhraseSets" }); + + /** + * Calls ListPhraseSets. + * @function listPhraseSets + * @memberof google.cloud.speech.v2.Speech + * @instance + * @param {google.cloud.speech.v2.IListPhraseSetsRequest} request ListPhraseSetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.speech.v2.Speech|getPhraseSet}. + * @memberof google.cloud.speech.v2.Speech + * @typedef GetPhraseSetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.speech.v2.PhraseSet} [response] PhraseSet + */ + + /** + * Calls GetPhraseSet. + * @function getPhraseSet + * @memberof google.cloud.speech.v2.Speech + * @instance + * @param {google.cloud.speech.v2.IGetPhraseSetRequest} request GetPhraseSetRequest message or plain object + * @param {google.cloud.speech.v2.Speech.GetPhraseSetCallback} callback Node-style callback called with the error, if any, and PhraseSet + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Speech.prototype.getPhraseSet = function getPhraseSet(request, callback) { + return this.rpcCall(getPhraseSet, $root.google.cloud.speech.v2.GetPhraseSetRequest, $root.google.cloud.speech.v2.PhraseSet, request, callback); + }, "name", { value: "GetPhraseSet" }); + + /** + * Calls GetPhraseSet. + * @function getPhraseSet + * @memberof google.cloud.speech.v2.Speech + * @instance + * @param {google.cloud.speech.v2.IGetPhraseSetRequest} request GetPhraseSetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.speech.v2.Speech|updatePhraseSet}. + * @memberof google.cloud.speech.v2.Speech + * @typedef UpdatePhraseSetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdatePhraseSet. + * @function updatePhraseSet + * @memberof google.cloud.speech.v2.Speech + * @instance + * @param {google.cloud.speech.v2.IUpdatePhraseSetRequest} request UpdatePhraseSetRequest message or plain object + * @param {google.cloud.speech.v2.Speech.UpdatePhraseSetCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Speech.prototype.updatePhraseSet = function updatePhraseSet(request, callback) { + return this.rpcCall(updatePhraseSet, $root.google.cloud.speech.v2.UpdatePhraseSetRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdatePhraseSet" }); + + /** + * Calls UpdatePhraseSet. + * @function updatePhraseSet + * @memberof google.cloud.speech.v2.Speech + * @instance + * @param {google.cloud.speech.v2.IUpdatePhraseSetRequest} request UpdatePhraseSetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.speech.v2.Speech|deletePhraseSet}. + * @memberof google.cloud.speech.v2.Speech + * @typedef DeletePhraseSetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeletePhraseSet. + * @function deletePhraseSet + * @memberof google.cloud.speech.v2.Speech + * @instance + * @param {google.cloud.speech.v2.IDeletePhraseSetRequest} request DeletePhraseSetRequest message or plain object + * @param {google.cloud.speech.v2.Speech.DeletePhraseSetCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Speech.prototype.deletePhraseSet = function deletePhraseSet(request, callback) { + return this.rpcCall(deletePhraseSet, $root.google.cloud.speech.v2.DeletePhraseSetRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeletePhraseSet" }); + + /** + * Calls DeletePhraseSet. + * @function deletePhraseSet + * @memberof google.cloud.speech.v2.Speech + * @instance + * @param {google.cloud.speech.v2.IDeletePhraseSetRequest} request DeletePhraseSetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.speech.v2.Speech|undeletePhraseSet}. + * @memberof google.cloud.speech.v2.Speech + * @typedef UndeletePhraseSetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UndeletePhraseSet. + * @function undeletePhraseSet + * @memberof google.cloud.speech.v2.Speech + * @instance + * @param {google.cloud.speech.v2.IUndeletePhraseSetRequest} request UndeletePhraseSetRequest message or plain object + * @param {google.cloud.speech.v2.Speech.UndeletePhraseSetCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Speech.prototype.undeletePhraseSet = function undeletePhraseSet(request, callback) { + return this.rpcCall(undeletePhraseSet, $root.google.cloud.speech.v2.UndeletePhraseSetRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UndeletePhraseSet" }); + + /** + * Calls UndeletePhraseSet. + * @function undeletePhraseSet + * @memberof google.cloud.speech.v2.Speech + * @instance + * @param {google.cloud.speech.v2.IUndeletePhraseSetRequest} request UndeletePhraseSetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Speech; + })(); + + v2.CreateRecognizerRequest = (function() { + + /** + * Properties of a CreateRecognizerRequest. + * @memberof google.cloud.speech.v2 + * @interface ICreateRecognizerRequest + * @property {google.cloud.speech.v2.IRecognizer|null} [recognizer] CreateRecognizerRequest recognizer + * @property {boolean|null} [validateOnly] CreateRecognizerRequest validateOnly + * @property {string|null} [recognizerId] CreateRecognizerRequest recognizerId + * @property {string|null} [parent] CreateRecognizerRequest parent + */ + + /** + * Constructs a new CreateRecognizerRequest. + * @memberof google.cloud.speech.v2 + * @classdesc Represents a CreateRecognizerRequest. + * @implements ICreateRecognizerRequest + * @constructor + * @param {google.cloud.speech.v2.ICreateRecognizerRequest=} [properties] Properties to set + */ + function CreateRecognizerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateRecognizerRequest recognizer. + * @member {google.cloud.speech.v2.IRecognizer|null|undefined} recognizer + * @memberof google.cloud.speech.v2.CreateRecognizerRequest + * @instance + */ + CreateRecognizerRequest.prototype.recognizer = null; + + /** + * CreateRecognizerRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.speech.v2.CreateRecognizerRequest + * @instance + */ + CreateRecognizerRequest.prototype.validateOnly = false; + + /** + * CreateRecognizerRequest recognizerId. + * @member {string} recognizerId + * @memberof google.cloud.speech.v2.CreateRecognizerRequest + * @instance + */ + CreateRecognizerRequest.prototype.recognizerId = ""; + + /** + * CreateRecognizerRequest parent. + * @member {string} parent + * @memberof google.cloud.speech.v2.CreateRecognizerRequest + * @instance + */ + CreateRecognizerRequest.prototype.parent = ""; + + /** + * Creates a new CreateRecognizerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.CreateRecognizerRequest + * @static + * @param {google.cloud.speech.v2.ICreateRecognizerRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v2.CreateRecognizerRequest} CreateRecognizerRequest instance + */ + CreateRecognizerRequest.create = function create(properties) { + return new CreateRecognizerRequest(properties); + }; + + /** + * Encodes the specified CreateRecognizerRequest message. Does not implicitly {@link google.cloud.speech.v2.CreateRecognizerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.CreateRecognizerRequest + * @static + * @param {google.cloud.speech.v2.ICreateRecognizerRequest} message CreateRecognizerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateRecognizerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.recognizer != null && Object.hasOwnProperty.call(message, "recognizer")) + $root.google.cloud.speech.v2.Recognizer.encode(message.recognizer, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.validateOnly); + if (message.recognizerId != null && Object.hasOwnProperty.call(message, "recognizerId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.recognizerId); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.parent); + return writer; + }; + + /** + * Encodes the specified CreateRecognizerRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v2.CreateRecognizerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.CreateRecognizerRequest + * @static + * @param {google.cloud.speech.v2.ICreateRecognizerRequest} message CreateRecognizerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateRecognizerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateRecognizerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.CreateRecognizerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.CreateRecognizerRequest} CreateRecognizerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateRecognizerRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.CreateRecognizerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.recognizer = $root.google.cloud.speech.v2.Recognizer.decode(reader, reader.uint32()); + break; + } + case 2: { + message.validateOnly = reader.bool(); + break; + } + case 3: { + message.recognizerId = reader.string(); + break; + } + case 4: { + message.parent = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateRecognizerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.CreateRecognizerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.CreateRecognizerRequest} CreateRecognizerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateRecognizerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateRecognizerRequest message. + * @function verify + * @memberof google.cloud.speech.v2.CreateRecognizerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateRecognizerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.recognizer != null && message.hasOwnProperty("recognizer")) { + var error = $root.google.cloud.speech.v2.Recognizer.verify(message.recognizer); + if (error) + return "recognizer." + error; + } + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.recognizerId != null && message.hasOwnProperty("recognizerId")) + if (!$util.isString(message.recognizerId)) + return "recognizerId: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + return null; + }; + + /** + * Creates a CreateRecognizerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.CreateRecognizerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.CreateRecognizerRequest} CreateRecognizerRequest + */ + CreateRecognizerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.CreateRecognizerRequest) + return object; + var message = new $root.google.cloud.speech.v2.CreateRecognizerRequest(); + if (object.recognizer != null) { + if (typeof object.recognizer !== "object") + throw TypeError(".google.cloud.speech.v2.CreateRecognizerRequest.recognizer: object expected"); + message.recognizer = $root.google.cloud.speech.v2.Recognizer.fromObject(object.recognizer); + } + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.recognizerId != null) + message.recognizerId = String(object.recognizerId); + if (object.parent != null) + message.parent = String(object.parent); + return message; + }; + + /** + * Creates a plain object from a CreateRecognizerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.CreateRecognizerRequest + * @static + * @param {google.cloud.speech.v2.CreateRecognizerRequest} message CreateRecognizerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateRecognizerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.recognizer = null; + object.validateOnly = false; + object.recognizerId = ""; + object.parent = ""; + } + if (message.recognizer != null && message.hasOwnProperty("recognizer")) + object.recognizer = $root.google.cloud.speech.v2.Recognizer.toObject(message.recognizer, options); + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.recognizerId != null && message.hasOwnProperty("recognizerId")) + object.recognizerId = message.recognizerId; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + return object; + }; + + /** + * Converts this CreateRecognizerRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.CreateRecognizerRequest + * @instance + * @returns {Object.} JSON object + */ + CreateRecognizerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateRecognizerRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v2.CreateRecognizerRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateRecognizerRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.CreateRecognizerRequest"; + }; + + return CreateRecognizerRequest; + })(); + + v2.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.speech.v2 + * @interface IOperationMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] OperationMetadata updateTime + * @property {string|null} [resource] OperationMetadata resource + * @property {string|null} [method] OperationMetadata method + * @property {string|null} [kmsKeyName] OperationMetadata kmsKeyName + * @property {string|null} [kmsKeyVersionName] OperationMetadata kmsKeyVersionName + * @property {google.cloud.speech.v2.IBatchRecognizeRequest|null} [batchRecognizeRequest] OperationMetadata batchRecognizeRequest + * @property {google.cloud.speech.v2.ICreateRecognizerRequest|null} [createRecognizerRequest] OperationMetadata createRecognizerRequest + * @property {google.cloud.speech.v2.IUpdateRecognizerRequest|null} [updateRecognizerRequest] OperationMetadata updateRecognizerRequest + * @property {google.cloud.speech.v2.IDeleteRecognizerRequest|null} [deleteRecognizerRequest] OperationMetadata deleteRecognizerRequest + * @property {google.cloud.speech.v2.IUndeleteRecognizerRequest|null} [undeleteRecognizerRequest] OperationMetadata undeleteRecognizerRequest + * @property {google.cloud.speech.v2.ICreateCustomClassRequest|null} [createCustomClassRequest] OperationMetadata createCustomClassRequest + * @property {google.cloud.speech.v2.IUpdateCustomClassRequest|null} [updateCustomClassRequest] OperationMetadata updateCustomClassRequest + * @property {google.cloud.speech.v2.IDeleteCustomClassRequest|null} [deleteCustomClassRequest] OperationMetadata deleteCustomClassRequest + * @property {google.cloud.speech.v2.IUndeleteCustomClassRequest|null} [undeleteCustomClassRequest] OperationMetadata undeleteCustomClassRequest + * @property {google.cloud.speech.v2.ICreatePhraseSetRequest|null} [createPhraseSetRequest] OperationMetadata createPhraseSetRequest + * @property {google.cloud.speech.v2.IUpdatePhraseSetRequest|null} [updatePhraseSetRequest] OperationMetadata updatePhraseSetRequest + * @property {google.cloud.speech.v2.IDeletePhraseSetRequest|null} [deletePhraseSetRequest] OperationMetadata deletePhraseSetRequest + * @property {google.cloud.speech.v2.IUndeletePhraseSetRequest|null} [undeletePhraseSetRequest] OperationMetadata undeletePhraseSetRequest + * @property {google.cloud.speech.v2.IUpdateConfigRequest|null} [updateConfigRequest] OperationMetadata updateConfigRequest + * @property {number|null} [progressPercent] OperationMetadata progressPercent + * @property {google.cloud.speech.v2.IBatchRecognizeMetadata|null} [batchRecognizeMetadata] OperationMetadata batchRecognizeMetadata + */ + + /** + * Constructs a new OperationMetadata. + * @memberof google.cloud.speech.v2 + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.speech.v2.IOperationMetadata=} [properties] Properties to set + */ + function OperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.speech.v2.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.speech.v2.OperationMetadata + * @instance + */ + OperationMetadata.prototype.updateTime = null; + + /** + * OperationMetadata resource. + * @member {string} resource + * @memberof google.cloud.speech.v2.OperationMetadata + * @instance + */ + OperationMetadata.prototype.resource = ""; + + /** + * OperationMetadata method. + * @member {string} method + * @memberof google.cloud.speech.v2.OperationMetadata + * @instance + */ + OperationMetadata.prototype.method = ""; + + /** + * OperationMetadata kmsKeyName. + * @member {string} kmsKeyName + * @memberof google.cloud.speech.v2.OperationMetadata + * @instance + */ + OperationMetadata.prototype.kmsKeyName = ""; + + /** + * OperationMetadata kmsKeyVersionName. + * @member {string} kmsKeyVersionName + * @memberof google.cloud.speech.v2.OperationMetadata + * @instance + */ + OperationMetadata.prototype.kmsKeyVersionName = ""; + + /** + * OperationMetadata batchRecognizeRequest. + * @member {google.cloud.speech.v2.IBatchRecognizeRequest|null|undefined} batchRecognizeRequest + * @memberof google.cloud.speech.v2.OperationMetadata + * @instance + */ + OperationMetadata.prototype.batchRecognizeRequest = null; + + /** + * OperationMetadata createRecognizerRequest. + * @member {google.cloud.speech.v2.ICreateRecognizerRequest|null|undefined} createRecognizerRequest + * @memberof google.cloud.speech.v2.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createRecognizerRequest = null; + + /** + * OperationMetadata updateRecognizerRequest. + * @member {google.cloud.speech.v2.IUpdateRecognizerRequest|null|undefined} updateRecognizerRequest + * @memberof google.cloud.speech.v2.OperationMetadata + * @instance + */ + OperationMetadata.prototype.updateRecognizerRequest = null; + + /** + * OperationMetadata deleteRecognizerRequest. + * @member {google.cloud.speech.v2.IDeleteRecognizerRequest|null|undefined} deleteRecognizerRequest + * @memberof google.cloud.speech.v2.OperationMetadata + * @instance + */ + OperationMetadata.prototype.deleteRecognizerRequest = null; + + /** + * OperationMetadata undeleteRecognizerRequest. + * @member {google.cloud.speech.v2.IUndeleteRecognizerRequest|null|undefined} undeleteRecognizerRequest + * @memberof google.cloud.speech.v2.OperationMetadata + * @instance + */ + OperationMetadata.prototype.undeleteRecognizerRequest = null; + + /** + * OperationMetadata createCustomClassRequest. + * @member {google.cloud.speech.v2.ICreateCustomClassRequest|null|undefined} createCustomClassRequest + * @memberof google.cloud.speech.v2.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createCustomClassRequest = null; + + /** + * OperationMetadata updateCustomClassRequest. + * @member {google.cloud.speech.v2.IUpdateCustomClassRequest|null|undefined} updateCustomClassRequest + * @memberof google.cloud.speech.v2.OperationMetadata + * @instance + */ + OperationMetadata.prototype.updateCustomClassRequest = null; + + /** + * OperationMetadata deleteCustomClassRequest. + * @member {google.cloud.speech.v2.IDeleteCustomClassRequest|null|undefined} deleteCustomClassRequest + * @memberof google.cloud.speech.v2.OperationMetadata + * @instance + */ + OperationMetadata.prototype.deleteCustomClassRequest = null; + + /** + * OperationMetadata undeleteCustomClassRequest. + * @member {google.cloud.speech.v2.IUndeleteCustomClassRequest|null|undefined} undeleteCustomClassRequest + * @memberof google.cloud.speech.v2.OperationMetadata + * @instance + */ + OperationMetadata.prototype.undeleteCustomClassRequest = null; + + /** + * OperationMetadata createPhraseSetRequest. + * @member {google.cloud.speech.v2.ICreatePhraseSetRequest|null|undefined} createPhraseSetRequest + * @memberof google.cloud.speech.v2.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createPhraseSetRequest = null; + + /** + * OperationMetadata updatePhraseSetRequest. + * @member {google.cloud.speech.v2.IUpdatePhraseSetRequest|null|undefined} updatePhraseSetRequest + * @memberof google.cloud.speech.v2.OperationMetadata + * @instance + */ + OperationMetadata.prototype.updatePhraseSetRequest = null; + + /** + * OperationMetadata deletePhraseSetRequest. + * @member {google.cloud.speech.v2.IDeletePhraseSetRequest|null|undefined} deletePhraseSetRequest + * @memberof google.cloud.speech.v2.OperationMetadata + * @instance + */ + OperationMetadata.prototype.deletePhraseSetRequest = null; + + /** + * OperationMetadata undeletePhraseSetRequest. + * @member {google.cloud.speech.v2.IUndeletePhraseSetRequest|null|undefined} undeletePhraseSetRequest + * @memberof google.cloud.speech.v2.OperationMetadata + * @instance + */ + OperationMetadata.prototype.undeletePhraseSetRequest = null; + + /** + * OperationMetadata updateConfigRequest. + * @member {google.cloud.speech.v2.IUpdateConfigRequest|null|undefined} updateConfigRequest + * @memberof google.cloud.speech.v2.OperationMetadata + * @instance + */ + OperationMetadata.prototype.updateConfigRequest = null; + + /** + * OperationMetadata progressPercent. + * @member {number} progressPercent + * @memberof google.cloud.speech.v2.OperationMetadata + * @instance + */ + OperationMetadata.prototype.progressPercent = 0; + + /** + * OperationMetadata batchRecognizeMetadata. + * @member {google.cloud.speech.v2.IBatchRecognizeMetadata|null|undefined} batchRecognizeMetadata + * @memberof google.cloud.speech.v2.OperationMetadata + * @instance + */ + OperationMetadata.prototype.batchRecognizeMetadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * OperationMetadata request. + * @member {"batchRecognizeRequest"|"createRecognizerRequest"|"updateRecognizerRequest"|"deleteRecognizerRequest"|"undeleteRecognizerRequest"|"createCustomClassRequest"|"updateCustomClassRequest"|"deleteCustomClassRequest"|"undeleteCustomClassRequest"|"createPhraseSetRequest"|"updatePhraseSetRequest"|"deletePhraseSetRequest"|"undeletePhraseSetRequest"|"updateConfigRequest"|undefined} request + * @memberof google.cloud.speech.v2.OperationMetadata + * @instance + */ + Object.defineProperty(OperationMetadata.prototype, "request", { + get: $util.oneOfGetter($oneOfFields = ["batchRecognizeRequest", "createRecognizerRequest", "updateRecognizerRequest", "deleteRecognizerRequest", "undeleteRecognizerRequest", "createCustomClassRequest", "updateCustomClassRequest", "deleteCustomClassRequest", "undeleteCustomClassRequest", "createPhraseSetRequest", "updatePhraseSetRequest", "deletePhraseSetRequest", "undeletePhraseSetRequest", "updateConfigRequest"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * OperationMetadata metadata. + * @member {"batchRecognizeMetadata"|undefined} metadata + * @memberof google.cloud.speech.v2.OperationMetadata + * @instance + */ + Object.defineProperty(OperationMetadata.prototype, "metadata", { + get: $util.oneOfGetter($oneOfFields = ["batchRecognizeMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.OperationMetadata + * @static + * @param {google.cloud.speech.v2.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.speech.v2.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.speech.v2.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.OperationMetadata + * @static + * @param {google.cloud.speech.v2.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.resource); + if (message.method != null && Object.hasOwnProperty.call(message, "method")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.method); + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.kmsKeyName); + if (message.kmsKeyVersionName != null && Object.hasOwnProperty.call(message, "kmsKeyVersionName")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.kmsKeyVersionName); + if (message.batchRecognizeRequest != null && Object.hasOwnProperty.call(message, "batchRecognizeRequest")) + $root.google.cloud.speech.v2.BatchRecognizeRequest.encode(message.batchRecognizeRequest, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.createRecognizerRequest != null && Object.hasOwnProperty.call(message, "createRecognizerRequest")) + $root.google.cloud.speech.v2.CreateRecognizerRequest.encode(message.createRecognizerRequest, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.updateRecognizerRequest != null && Object.hasOwnProperty.call(message, "updateRecognizerRequest")) + $root.google.cloud.speech.v2.UpdateRecognizerRequest.encode(message.updateRecognizerRequest, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.deleteRecognizerRequest != null && Object.hasOwnProperty.call(message, "deleteRecognizerRequest")) + $root.google.cloud.speech.v2.DeleteRecognizerRequest.encode(message.deleteRecognizerRequest, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.undeleteRecognizerRequest != null && Object.hasOwnProperty.call(message, "undeleteRecognizerRequest")) + $root.google.cloud.speech.v2.UndeleteRecognizerRequest.encode(message.undeleteRecognizerRequest, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.createCustomClassRequest != null && Object.hasOwnProperty.call(message, "createCustomClassRequest")) + $root.google.cloud.speech.v2.CreateCustomClassRequest.encode(message.createCustomClassRequest, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.updateCustomClassRequest != null && Object.hasOwnProperty.call(message, "updateCustomClassRequest")) + $root.google.cloud.speech.v2.UpdateCustomClassRequest.encode(message.updateCustomClassRequest, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.deleteCustomClassRequest != null && Object.hasOwnProperty.call(message, "deleteCustomClassRequest")) + $root.google.cloud.speech.v2.DeleteCustomClassRequest.encode(message.deleteCustomClassRequest, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.undeleteCustomClassRequest != null && Object.hasOwnProperty.call(message, "undeleteCustomClassRequest")) + $root.google.cloud.speech.v2.UndeleteCustomClassRequest.encode(message.undeleteCustomClassRequest, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.createPhraseSetRequest != null && Object.hasOwnProperty.call(message, "createPhraseSetRequest")) + $root.google.cloud.speech.v2.CreatePhraseSetRequest.encode(message.createPhraseSetRequest, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.updatePhraseSetRequest != null && Object.hasOwnProperty.call(message, "updatePhraseSetRequest")) + $root.google.cloud.speech.v2.UpdatePhraseSetRequest.encode(message.updatePhraseSetRequest, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.deletePhraseSetRequest != null && Object.hasOwnProperty.call(message, "deletePhraseSetRequest")) + $root.google.cloud.speech.v2.DeletePhraseSetRequest.encode(message.deletePhraseSetRequest, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.undeletePhraseSetRequest != null && Object.hasOwnProperty.call(message, "undeletePhraseSetRequest")) + $root.google.cloud.speech.v2.UndeletePhraseSetRequest.encode(message.undeletePhraseSetRequest, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.updateConfigRequest != null && Object.hasOwnProperty.call(message, "updateConfigRequest")) + $root.google.cloud.speech.v2.UpdateConfigRequest.encode(message.updateConfigRequest, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.progressPercent != null && Object.hasOwnProperty.call(message, "progressPercent")) + writer.uint32(/* id 22, wireType 0 =*/176).int32(message.progressPercent); + if (message.batchRecognizeMetadata != null && Object.hasOwnProperty.call(message, "batchRecognizeMetadata")) + $root.google.cloud.speech.v2.BatchRecognizeMetadata.encode(message.batchRecognizeMetadata, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.speech.v2.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.OperationMetadata + * @static + * @param {google.cloud.speech.v2.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.OperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.resource = reader.string(); + break; + } + case 4: { + message.method = reader.string(); + break; + } + case 6: { + message.kmsKeyName = reader.string(); + break; + } + case 7: { + message.kmsKeyVersionName = reader.string(); + break; + } + case 8: { + message.batchRecognizeRequest = $root.google.cloud.speech.v2.BatchRecognizeRequest.decode(reader, reader.uint32()); + break; + } + case 9: { + message.createRecognizerRequest = $root.google.cloud.speech.v2.CreateRecognizerRequest.decode(reader, reader.uint32()); + break; + } + case 10: { + message.updateRecognizerRequest = $root.google.cloud.speech.v2.UpdateRecognizerRequest.decode(reader, reader.uint32()); + break; + } + case 11: { + message.deleteRecognizerRequest = $root.google.cloud.speech.v2.DeleteRecognizerRequest.decode(reader, reader.uint32()); + break; + } + case 12: { + message.undeleteRecognizerRequest = $root.google.cloud.speech.v2.UndeleteRecognizerRequest.decode(reader, reader.uint32()); + break; + } + case 13: { + message.createCustomClassRequest = $root.google.cloud.speech.v2.CreateCustomClassRequest.decode(reader, reader.uint32()); + break; + } + case 14: { + message.updateCustomClassRequest = $root.google.cloud.speech.v2.UpdateCustomClassRequest.decode(reader, reader.uint32()); + break; + } + case 15: { + message.deleteCustomClassRequest = $root.google.cloud.speech.v2.DeleteCustomClassRequest.decode(reader, reader.uint32()); + break; + } + case 16: { + message.undeleteCustomClassRequest = $root.google.cloud.speech.v2.UndeleteCustomClassRequest.decode(reader, reader.uint32()); + break; + } + case 17: { + message.createPhraseSetRequest = $root.google.cloud.speech.v2.CreatePhraseSetRequest.decode(reader, reader.uint32()); + break; + } + case 18: { + message.updatePhraseSetRequest = $root.google.cloud.speech.v2.UpdatePhraseSetRequest.decode(reader, reader.uint32()); + break; + } + case 19: { + message.deletePhraseSetRequest = $root.google.cloud.speech.v2.DeletePhraseSetRequest.decode(reader, reader.uint32()); + break; + } + case 20: { + message.undeletePhraseSetRequest = $root.google.cloud.speech.v2.UndeletePhraseSetRequest.decode(reader, reader.uint32()); + break; + } + case 21: { + message.updateConfigRequest = $root.google.cloud.speech.v2.UpdateConfigRequest.decode(reader, reader.uint32()); + break; + } + case 22: { + message.progressPercent = reader.int32(); + break; + } + case 23: { + message.batchRecognizeMetadata = $root.google.cloud.speech.v2.BatchRecognizeMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationMetadata message. + * @function verify + * @memberof google.cloud.speech.v2.OperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.method != null && message.hasOwnProperty("method")) + if (!$util.isString(message.method)) + return "method: string expected"; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (!$util.isString(message.kmsKeyName)) + return "kmsKeyName: string expected"; + if (message.kmsKeyVersionName != null && message.hasOwnProperty("kmsKeyVersionName")) + if (!$util.isString(message.kmsKeyVersionName)) + return "kmsKeyVersionName: string expected"; + if (message.batchRecognizeRequest != null && message.hasOwnProperty("batchRecognizeRequest")) { + properties.request = 1; + { + var error = $root.google.cloud.speech.v2.BatchRecognizeRequest.verify(message.batchRecognizeRequest); + if (error) + return "batchRecognizeRequest." + error; + } + } + if (message.createRecognizerRequest != null && message.hasOwnProperty("createRecognizerRequest")) { + if (properties.request === 1) + return "request: multiple values"; + properties.request = 1; + { + var error = $root.google.cloud.speech.v2.CreateRecognizerRequest.verify(message.createRecognizerRequest); + if (error) + return "createRecognizerRequest." + error; + } + } + if (message.updateRecognizerRequest != null && message.hasOwnProperty("updateRecognizerRequest")) { + if (properties.request === 1) + return "request: multiple values"; + properties.request = 1; + { + var error = $root.google.cloud.speech.v2.UpdateRecognizerRequest.verify(message.updateRecognizerRequest); + if (error) + return "updateRecognizerRequest." + error; + } + } + if (message.deleteRecognizerRequest != null && message.hasOwnProperty("deleteRecognizerRequest")) { + if (properties.request === 1) + return "request: multiple values"; + properties.request = 1; + { + var error = $root.google.cloud.speech.v2.DeleteRecognizerRequest.verify(message.deleteRecognizerRequest); + if (error) + return "deleteRecognizerRequest." + error; + } + } + if (message.undeleteRecognizerRequest != null && message.hasOwnProperty("undeleteRecognizerRequest")) { + if (properties.request === 1) + return "request: multiple values"; + properties.request = 1; + { + var error = $root.google.cloud.speech.v2.UndeleteRecognizerRequest.verify(message.undeleteRecognizerRequest); + if (error) + return "undeleteRecognizerRequest." + error; + } + } + if (message.createCustomClassRequest != null && message.hasOwnProperty("createCustomClassRequest")) { + if (properties.request === 1) + return "request: multiple values"; + properties.request = 1; + { + var error = $root.google.cloud.speech.v2.CreateCustomClassRequest.verify(message.createCustomClassRequest); + if (error) + return "createCustomClassRequest." + error; + } + } + if (message.updateCustomClassRequest != null && message.hasOwnProperty("updateCustomClassRequest")) { + if (properties.request === 1) + return "request: multiple values"; + properties.request = 1; + { + var error = $root.google.cloud.speech.v2.UpdateCustomClassRequest.verify(message.updateCustomClassRequest); + if (error) + return "updateCustomClassRequest." + error; + } + } + if (message.deleteCustomClassRequest != null && message.hasOwnProperty("deleteCustomClassRequest")) { + if (properties.request === 1) + return "request: multiple values"; + properties.request = 1; + { + var error = $root.google.cloud.speech.v2.DeleteCustomClassRequest.verify(message.deleteCustomClassRequest); + if (error) + return "deleteCustomClassRequest." + error; + } + } + if (message.undeleteCustomClassRequest != null && message.hasOwnProperty("undeleteCustomClassRequest")) { + if (properties.request === 1) + return "request: multiple values"; + properties.request = 1; + { + var error = $root.google.cloud.speech.v2.UndeleteCustomClassRequest.verify(message.undeleteCustomClassRequest); + if (error) + return "undeleteCustomClassRequest." + error; + } + } + if (message.createPhraseSetRequest != null && message.hasOwnProperty("createPhraseSetRequest")) { + if (properties.request === 1) + return "request: multiple values"; + properties.request = 1; + { + var error = $root.google.cloud.speech.v2.CreatePhraseSetRequest.verify(message.createPhraseSetRequest); + if (error) + return "createPhraseSetRequest." + error; + } + } + if (message.updatePhraseSetRequest != null && message.hasOwnProperty("updatePhraseSetRequest")) { + if (properties.request === 1) + return "request: multiple values"; + properties.request = 1; + { + var error = $root.google.cloud.speech.v2.UpdatePhraseSetRequest.verify(message.updatePhraseSetRequest); + if (error) + return "updatePhraseSetRequest." + error; + } + } + if (message.deletePhraseSetRequest != null && message.hasOwnProperty("deletePhraseSetRequest")) { + if (properties.request === 1) + return "request: multiple values"; + properties.request = 1; + { + var error = $root.google.cloud.speech.v2.DeletePhraseSetRequest.verify(message.deletePhraseSetRequest); + if (error) + return "deletePhraseSetRequest." + error; + } + } + if (message.undeletePhraseSetRequest != null && message.hasOwnProperty("undeletePhraseSetRequest")) { + if (properties.request === 1) + return "request: multiple values"; + properties.request = 1; + { + var error = $root.google.cloud.speech.v2.UndeletePhraseSetRequest.verify(message.undeletePhraseSetRequest); + if (error) + return "undeletePhraseSetRequest." + error; + } + } + if (message.updateConfigRequest != null && message.hasOwnProperty("updateConfigRequest")) { + if (properties.request === 1) + return "request: multiple values"; + properties.request = 1; + { + var error = $root.google.cloud.speech.v2.UpdateConfigRequest.verify(message.updateConfigRequest); + if (error) + return "updateConfigRequest." + error; + } + } + if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + if (!$util.isInteger(message.progressPercent)) + return "progressPercent: integer expected"; + if (message.batchRecognizeMetadata != null && message.hasOwnProperty("batchRecognizeMetadata")) { + properties.metadata = 1; + { + var error = $root.google.cloud.speech.v2.BatchRecognizeMetadata.verify(message.batchRecognizeMetadata); + if (error) + return "batchRecognizeMetadata." + error; + } + } + return null; + }; + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.OperationMetadata) + return object; + var message = new $root.google.cloud.speech.v2.OperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.speech.v2.OperationMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.speech.v2.OperationMetadata.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.resource != null) + message.resource = String(object.resource); + if (object.method != null) + message.method = String(object.method); + if (object.kmsKeyName != null) + message.kmsKeyName = String(object.kmsKeyName); + if (object.kmsKeyVersionName != null) + message.kmsKeyVersionName = String(object.kmsKeyVersionName); + if (object.batchRecognizeRequest != null) { + if (typeof object.batchRecognizeRequest !== "object") + throw TypeError(".google.cloud.speech.v2.OperationMetadata.batchRecognizeRequest: object expected"); + message.batchRecognizeRequest = $root.google.cloud.speech.v2.BatchRecognizeRequest.fromObject(object.batchRecognizeRequest); + } + if (object.createRecognizerRequest != null) { + if (typeof object.createRecognizerRequest !== "object") + throw TypeError(".google.cloud.speech.v2.OperationMetadata.createRecognizerRequest: object expected"); + message.createRecognizerRequest = $root.google.cloud.speech.v2.CreateRecognizerRequest.fromObject(object.createRecognizerRequest); + } + if (object.updateRecognizerRequest != null) { + if (typeof object.updateRecognizerRequest !== "object") + throw TypeError(".google.cloud.speech.v2.OperationMetadata.updateRecognizerRequest: object expected"); + message.updateRecognizerRequest = $root.google.cloud.speech.v2.UpdateRecognizerRequest.fromObject(object.updateRecognizerRequest); + } + if (object.deleteRecognizerRequest != null) { + if (typeof object.deleteRecognizerRequest !== "object") + throw TypeError(".google.cloud.speech.v2.OperationMetadata.deleteRecognizerRequest: object expected"); + message.deleteRecognizerRequest = $root.google.cloud.speech.v2.DeleteRecognizerRequest.fromObject(object.deleteRecognizerRequest); + } + if (object.undeleteRecognizerRequest != null) { + if (typeof object.undeleteRecognizerRequest !== "object") + throw TypeError(".google.cloud.speech.v2.OperationMetadata.undeleteRecognizerRequest: object expected"); + message.undeleteRecognizerRequest = $root.google.cloud.speech.v2.UndeleteRecognizerRequest.fromObject(object.undeleteRecognizerRequest); + } + if (object.createCustomClassRequest != null) { + if (typeof object.createCustomClassRequest !== "object") + throw TypeError(".google.cloud.speech.v2.OperationMetadata.createCustomClassRequest: object expected"); + message.createCustomClassRequest = $root.google.cloud.speech.v2.CreateCustomClassRequest.fromObject(object.createCustomClassRequest); + } + if (object.updateCustomClassRequest != null) { + if (typeof object.updateCustomClassRequest !== "object") + throw TypeError(".google.cloud.speech.v2.OperationMetadata.updateCustomClassRequest: object expected"); + message.updateCustomClassRequest = $root.google.cloud.speech.v2.UpdateCustomClassRequest.fromObject(object.updateCustomClassRequest); + } + if (object.deleteCustomClassRequest != null) { + if (typeof object.deleteCustomClassRequest !== "object") + throw TypeError(".google.cloud.speech.v2.OperationMetadata.deleteCustomClassRequest: object expected"); + message.deleteCustomClassRequest = $root.google.cloud.speech.v2.DeleteCustomClassRequest.fromObject(object.deleteCustomClassRequest); + } + if (object.undeleteCustomClassRequest != null) { + if (typeof object.undeleteCustomClassRequest !== "object") + throw TypeError(".google.cloud.speech.v2.OperationMetadata.undeleteCustomClassRequest: object expected"); + message.undeleteCustomClassRequest = $root.google.cloud.speech.v2.UndeleteCustomClassRequest.fromObject(object.undeleteCustomClassRequest); + } + if (object.createPhraseSetRequest != null) { + if (typeof object.createPhraseSetRequest !== "object") + throw TypeError(".google.cloud.speech.v2.OperationMetadata.createPhraseSetRequest: object expected"); + message.createPhraseSetRequest = $root.google.cloud.speech.v2.CreatePhraseSetRequest.fromObject(object.createPhraseSetRequest); + } + if (object.updatePhraseSetRequest != null) { + if (typeof object.updatePhraseSetRequest !== "object") + throw TypeError(".google.cloud.speech.v2.OperationMetadata.updatePhraseSetRequest: object expected"); + message.updatePhraseSetRequest = $root.google.cloud.speech.v2.UpdatePhraseSetRequest.fromObject(object.updatePhraseSetRequest); + } + if (object.deletePhraseSetRequest != null) { + if (typeof object.deletePhraseSetRequest !== "object") + throw TypeError(".google.cloud.speech.v2.OperationMetadata.deletePhraseSetRequest: object expected"); + message.deletePhraseSetRequest = $root.google.cloud.speech.v2.DeletePhraseSetRequest.fromObject(object.deletePhraseSetRequest); + } + if (object.undeletePhraseSetRequest != null) { + if (typeof object.undeletePhraseSetRequest !== "object") + throw TypeError(".google.cloud.speech.v2.OperationMetadata.undeletePhraseSetRequest: object expected"); + message.undeletePhraseSetRequest = $root.google.cloud.speech.v2.UndeletePhraseSetRequest.fromObject(object.undeletePhraseSetRequest); + } + if (object.updateConfigRequest != null) { + if (typeof object.updateConfigRequest !== "object") + throw TypeError(".google.cloud.speech.v2.OperationMetadata.updateConfigRequest: object expected"); + message.updateConfigRequest = $root.google.cloud.speech.v2.UpdateConfigRequest.fromObject(object.updateConfigRequest); + } + if (object.progressPercent != null) + message.progressPercent = object.progressPercent | 0; + if (object.batchRecognizeMetadata != null) { + if (typeof object.batchRecognizeMetadata !== "object") + throw TypeError(".google.cloud.speech.v2.OperationMetadata.batchRecognizeMetadata: object expected"); + message.batchRecognizeMetadata = $root.google.cloud.speech.v2.BatchRecognizeMetadata.fromObject(object.batchRecognizeMetadata); + } + return message; + }; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.OperationMetadata + * @static + * @param {google.cloud.speech.v2.OperationMetadata} message OperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.createTime = null; + object.updateTime = null; + object.resource = ""; + object.method = ""; + object.kmsKeyName = ""; + object.kmsKeyVersionName = ""; + object.progressPercent = 0; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.method != null && message.hasOwnProperty("method")) + object.method = message.method; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + object.kmsKeyName = message.kmsKeyName; + if (message.kmsKeyVersionName != null && message.hasOwnProperty("kmsKeyVersionName")) + object.kmsKeyVersionName = message.kmsKeyVersionName; + if (message.batchRecognizeRequest != null && message.hasOwnProperty("batchRecognizeRequest")) { + object.batchRecognizeRequest = $root.google.cloud.speech.v2.BatchRecognizeRequest.toObject(message.batchRecognizeRequest, options); + if (options.oneofs) + object.request = "batchRecognizeRequest"; + } + if (message.createRecognizerRequest != null && message.hasOwnProperty("createRecognizerRequest")) { + object.createRecognizerRequest = $root.google.cloud.speech.v2.CreateRecognizerRequest.toObject(message.createRecognizerRequest, options); + if (options.oneofs) + object.request = "createRecognizerRequest"; + } + if (message.updateRecognizerRequest != null && message.hasOwnProperty("updateRecognizerRequest")) { + object.updateRecognizerRequest = $root.google.cloud.speech.v2.UpdateRecognizerRequest.toObject(message.updateRecognizerRequest, options); + if (options.oneofs) + object.request = "updateRecognizerRequest"; + } + if (message.deleteRecognizerRequest != null && message.hasOwnProperty("deleteRecognizerRequest")) { + object.deleteRecognizerRequest = $root.google.cloud.speech.v2.DeleteRecognizerRequest.toObject(message.deleteRecognizerRequest, options); + if (options.oneofs) + object.request = "deleteRecognizerRequest"; + } + if (message.undeleteRecognizerRequest != null && message.hasOwnProperty("undeleteRecognizerRequest")) { + object.undeleteRecognizerRequest = $root.google.cloud.speech.v2.UndeleteRecognizerRequest.toObject(message.undeleteRecognizerRequest, options); + if (options.oneofs) + object.request = "undeleteRecognizerRequest"; + } + if (message.createCustomClassRequest != null && message.hasOwnProperty("createCustomClassRequest")) { + object.createCustomClassRequest = $root.google.cloud.speech.v2.CreateCustomClassRequest.toObject(message.createCustomClassRequest, options); + if (options.oneofs) + object.request = "createCustomClassRequest"; + } + if (message.updateCustomClassRequest != null && message.hasOwnProperty("updateCustomClassRequest")) { + object.updateCustomClassRequest = $root.google.cloud.speech.v2.UpdateCustomClassRequest.toObject(message.updateCustomClassRequest, options); + if (options.oneofs) + object.request = "updateCustomClassRequest"; + } + if (message.deleteCustomClassRequest != null && message.hasOwnProperty("deleteCustomClassRequest")) { + object.deleteCustomClassRequest = $root.google.cloud.speech.v2.DeleteCustomClassRequest.toObject(message.deleteCustomClassRequest, options); + if (options.oneofs) + object.request = "deleteCustomClassRequest"; + } + if (message.undeleteCustomClassRequest != null && message.hasOwnProperty("undeleteCustomClassRequest")) { + object.undeleteCustomClassRequest = $root.google.cloud.speech.v2.UndeleteCustomClassRequest.toObject(message.undeleteCustomClassRequest, options); + if (options.oneofs) + object.request = "undeleteCustomClassRequest"; + } + if (message.createPhraseSetRequest != null && message.hasOwnProperty("createPhraseSetRequest")) { + object.createPhraseSetRequest = $root.google.cloud.speech.v2.CreatePhraseSetRequest.toObject(message.createPhraseSetRequest, options); + if (options.oneofs) + object.request = "createPhraseSetRequest"; + } + if (message.updatePhraseSetRequest != null && message.hasOwnProperty("updatePhraseSetRequest")) { + object.updatePhraseSetRequest = $root.google.cloud.speech.v2.UpdatePhraseSetRequest.toObject(message.updatePhraseSetRequest, options); + if (options.oneofs) + object.request = "updatePhraseSetRequest"; + } + if (message.deletePhraseSetRequest != null && message.hasOwnProperty("deletePhraseSetRequest")) { + object.deletePhraseSetRequest = $root.google.cloud.speech.v2.DeletePhraseSetRequest.toObject(message.deletePhraseSetRequest, options); + if (options.oneofs) + object.request = "deletePhraseSetRequest"; + } + if (message.undeletePhraseSetRequest != null && message.hasOwnProperty("undeletePhraseSetRequest")) { + object.undeletePhraseSetRequest = $root.google.cloud.speech.v2.UndeletePhraseSetRequest.toObject(message.undeletePhraseSetRequest, options); + if (options.oneofs) + object.request = "undeletePhraseSetRequest"; + } + if (message.updateConfigRequest != null && message.hasOwnProperty("updateConfigRequest")) { + object.updateConfigRequest = $root.google.cloud.speech.v2.UpdateConfigRequest.toObject(message.updateConfigRequest, options); + if (options.oneofs) + object.request = "updateConfigRequest"; + } + if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + object.progressPercent = message.progressPercent; + if (message.batchRecognizeMetadata != null && message.hasOwnProperty("batchRecognizeMetadata")) { + object.batchRecognizeMetadata = $root.google.cloud.speech.v2.BatchRecognizeMetadata.toObject(message.batchRecognizeMetadata, options); + if (options.oneofs) + object.metadata = "batchRecognizeMetadata"; + } + return object; + }; + + /** + * Converts this OperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.OperationMetadata + * @instance + * @returns {Object.} JSON object + */ + OperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationMetadata + * @function getTypeUrl + * @memberof google.cloud.speech.v2.OperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.OperationMetadata"; + }; + + return OperationMetadata; + })(); + + v2.ListRecognizersRequest = (function() { + + /** + * Properties of a ListRecognizersRequest. + * @memberof google.cloud.speech.v2 + * @interface IListRecognizersRequest + * @property {string|null} [parent] ListRecognizersRequest parent + * @property {number|null} [pageSize] ListRecognizersRequest pageSize + * @property {string|null} [pageToken] ListRecognizersRequest pageToken + * @property {boolean|null} [showDeleted] ListRecognizersRequest showDeleted + */ + + /** + * Constructs a new ListRecognizersRequest. + * @memberof google.cloud.speech.v2 + * @classdesc Represents a ListRecognizersRequest. + * @implements IListRecognizersRequest + * @constructor + * @param {google.cloud.speech.v2.IListRecognizersRequest=} [properties] Properties to set + */ + function ListRecognizersRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListRecognizersRequest parent. + * @member {string} parent + * @memberof google.cloud.speech.v2.ListRecognizersRequest + * @instance + */ + ListRecognizersRequest.prototype.parent = ""; + + /** + * ListRecognizersRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.speech.v2.ListRecognizersRequest + * @instance + */ + ListRecognizersRequest.prototype.pageSize = 0; + + /** + * ListRecognizersRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.speech.v2.ListRecognizersRequest + * @instance + */ + ListRecognizersRequest.prototype.pageToken = ""; + + /** + * ListRecognizersRequest showDeleted. + * @member {boolean} showDeleted + * @memberof google.cloud.speech.v2.ListRecognizersRequest + * @instance + */ + ListRecognizersRequest.prototype.showDeleted = false; + + /** + * Creates a new ListRecognizersRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.ListRecognizersRequest + * @static + * @param {google.cloud.speech.v2.IListRecognizersRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v2.ListRecognizersRequest} ListRecognizersRequest instance + */ + ListRecognizersRequest.create = function create(properties) { + return new ListRecognizersRequest(properties); + }; + + /** + * Encodes the specified ListRecognizersRequest message. Does not implicitly {@link google.cloud.speech.v2.ListRecognizersRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.ListRecognizersRequest + * @static + * @param {google.cloud.speech.v2.IListRecognizersRequest} message ListRecognizersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRecognizersRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.showDeleted != null && Object.hasOwnProperty.call(message, "showDeleted")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.showDeleted); + return writer; + }; + + /** + * Encodes the specified ListRecognizersRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v2.ListRecognizersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.ListRecognizersRequest + * @static + * @param {google.cloud.speech.v2.IListRecognizersRequest} message ListRecognizersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRecognizersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRecognizersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.ListRecognizersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.ListRecognizersRequest} ListRecognizersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRecognizersRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.ListRecognizersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.showDeleted = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListRecognizersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.ListRecognizersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.ListRecognizersRequest} ListRecognizersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRecognizersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRecognizersRequest message. + * @function verify + * @memberof google.cloud.speech.v2.ListRecognizersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRecognizersRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.showDeleted != null && message.hasOwnProperty("showDeleted")) + if (typeof message.showDeleted !== "boolean") + return "showDeleted: boolean expected"; + return null; + }; + + /** + * Creates a ListRecognizersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.ListRecognizersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.ListRecognizersRequest} ListRecognizersRequest + */ + ListRecognizersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.ListRecognizersRequest) + return object; + var message = new $root.google.cloud.speech.v2.ListRecognizersRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.showDeleted != null) + message.showDeleted = Boolean(object.showDeleted); + return message; + }; + + /** + * Creates a plain object from a ListRecognizersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.ListRecognizersRequest + * @static + * @param {google.cloud.speech.v2.ListRecognizersRequest} message ListRecognizersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRecognizersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.showDeleted = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.showDeleted != null && message.hasOwnProperty("showDeleted")) + object.showDeleted = message.showDeleted; + return object; + }; + + /** + * Converts this ListRecognizersRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.ListRecognizersRequest + * @instance + * @returns {Object.} JSON object + */ + ListRecognizersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListRecognizersRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v2.ListRecognizersRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListRecognizersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.ListRecognizersRequest"; + }; + + return ListRecognizersRequest; + })(); + + v2.ListRecognizersResponse = (function() { + + /** + * Properties of a ListRecognizersResponse. + * @memberof google.cloud.speech.v2 + * @interface IListRecognizersResponse + * @property {Array.|null} [recognizers] ListRecognizersResponse recognizers + * @property {string|null} [nextPageToken] ListRecognizersResponse nextPageToken + */ + + /** + * Constructs a new ListRecognizersResponse. + * @memberof google.cloud.speech.v2 + * @classdesc Represents a ListRecognizersResponse. + * @implements IListRecognizersResponse + * @constructor + * @param {google.cloud.speech.v2.IListRecognizersResponse=} [properties] Properties to set + */ + function ListRecognizersResponse(properties) { + this.recognizers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListRecognizersResponse recognizers. + * @member {Array.} recognizers + * @memberof google.cloud.speech.v2.ListRecognizersResponse + * @instance + */ + ListRecognizersResponse.prototype.recognizers = $util.emptyArray; + + /** + * ListRecognizersResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.speech.v2.ListRecognizersResponse + * @instance + */ + ListRecognizersResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListRecognizersResponse instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.ListRecognizersResponse + * @static + * @param {google.cloud.speech.v2.IListRecognizersResponse=} [properties] Properties to set + * @returns {google.cloud.speech.v2.ListRecognizersResponse} ListRecognizersResponse instance + */ + ListRecognizersResponse.create = function create(properties) { + return new ListRecognizersResponse(properties); + }; + + /** + * Encodes the specified ListRecognizersResponse message. Does not implicitly {@link google.cloud.speech.v2.ListRecognizersResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.ListRecognizersResponse + * @static + * @param {google.cloud.speech.v2.IListRecognizersResponse} message ListRecognizersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRecognizersResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.recognizers != null && message.recognizers.length) + for (var i = 0; i < message.recognizers.length; ++i) + $root.google.cloud.speech.v2.Recognizer.encode(message.recognizers[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListRecognizersResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v2.ListRecognizersResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.ListRecognizersResponse + * @static + * @param {google.cloud.speech.v2.IListRecognizersResponse} message ListRecognizersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRecognizersResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRecognizersResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.ListRecognizersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.ListRecognizersResponse} ListRecognizersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRecognizersResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.ListRecognizersResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.recognizers && message.recognizers.length)) + message.recognizers = []; + message.recognizers.push($root.google.cloud.speech.v2.Recognizer.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListRecognizersResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.ListRecognizersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.ListRecognizersResponse} ListRecognizersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRecognizersResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRecognizersResponse message. + * @function verify + * @memberof google.cloud.speech.v2.ListRecognizersResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRecognizersResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.recognizers != null && message.hasOwnProperty("recognizers")) { + if (!Array.isArray(message.recognizers)) + return "recognizers: array expected"; + for (var i = 0; i < message.recognizers.length; ++i) { + var error = $root.google.cloud.speech.v2.Recognizer.verify(message.recognizers[i]); + if (error) + return "recognizers." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListRecognizersResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.ListRecognizersResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.ListRecognizersResponse} ListRecognizersResponse + */ + ListRecognizersResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.ListRecognizersResponse) + return object; + var message = new $root.google.cloud.speech.v2.ListRecognizersResponse(); + if (object.recognizers) { + if (!Array.isArray(object.recognizers)) + throw TypeError(".google.cloud.speech.v2.ListRecognizersResponse.recognizers: array expected"); + message.recognizers = []; + for (var i = 0; i < object.recognizers.length; ++i) { + if (typeof object.recognizers[i] !== "object") + throw TypeError(".google.cloud.speech.v2.ListRecognizersResponse.recognizers: object expected"); + message.recognizers[i] = $root.google.cloud.speech.v2.Recognizer.fromObject(object.recognizers[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListRecognizersResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.ListRecognizersResponse + * @static + * @param {google.cloud.speech.v2.ListRecognizersResponse} message ListRecognizersResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRecognizersResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.recognizers = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.recognizers && message.recognizers.length) { + object.recognizers = []; + for (var j = 0; j < message.recognizers.length; ++j) + object.recognizers[j] = $root.google.cloud.speech.v2.Recognizer.toObject(message.recognizers[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListRecognizersResponse to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.ListRecognizersResponse + * @instance + * @returns {Object.} JSON object + */ + ListRecognizersResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListRecognizersResponse + * @function getTypeUrl + * @memberof google.cloud.speech.v2.ListRecognizersResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListRecognizersResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.ListRecognizersResponse"; + }; + + return ListRecognizersResponse; + })(); + + v2.GetRecognizerRequest = (function() { + + /** + * Properties of a GetRecognizerRequest. + * @memberof google.cloud.speech.v2 + * @interface IGetRecognizerRequest + * @property {string|null} [name] GetRecognizerRequest name + */ + + /** + * Constructs a new GetRecognizerRequest. + * @memberof google.cloud.speech.v2 + * @classdesc Represents a GetRecognizerRequest. + * @implements IGetRecognizerRequest + * @constructor + * @param {google.cloud.speech.v2.IGetRecognizerRequest=} [properties] Properties to set + */ + function GetRecognizerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetRecognizerRequest name. + * @member {string} name + * @memberof google.cloud.speech.v2.GetRecognizerRequest + * @instance + */ + GetRecognizerRequest.prototype.name = ""; + + /** + * Creates a new GetRecognizerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.GetRecognizerRequest + * @static + * @param {google.cloud.speech.v2.IGetRecognizerRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v2.GetRecognizerRequest} GetRecognizerRequest instance + */ + GetRecognizerRequest.create = function create(properties) { + return new GetRecognizerRequest(properties); + }; + + /** + * Encodes the specified GetRecognizerRequest message. Does not implicitly {@link google.cloud.speech.v2.GetRecognizerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.GetRecognizerRequest + * @static + * @param {google.cloud.speech.v2.IGetRecognizerRequest} message GetRecognizerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRecognizerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetRecognizerRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v2.GetRecognizerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.GetRecognizerRequest + * @static + * @param {google.cloud.speech.v2.IGetRecognizerRequest} message GetRecognizerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRecognizerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetRecognizerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.GetRecognizerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.GetRecognizerRequest} GetRecognizerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRecognizerRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.GetRecognizerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetRecognizerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.GetRecognizerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.GetRecognizerRequest} GetRecognizerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRecognizerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetRecognizerRequest message. + * @function verify + * @memberof google.cloud.speech.v2.GetRecognizerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetRecognizerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetRecognizerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.GetRecognizerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.GetRecognizerRequest} GetRecognizerRequest + */ + GetRecognizerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.GetRecognizerRequest) + return object; + var message = new $root.google.cloud.speech.v2.GetRecognizerRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetRecognizerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.GetRecognizerRequest + * @static + * @param {google.cloud.speech.v2.GetRecognizerRequest} message GetRecognizerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetRecognizerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetRecognizerRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.GetRecognizerRequest + * @instance + * @returns {Object.} JSON object + */ + GetRecognizerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetRecognizerRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v2.GetRecognizerRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetRecognizerRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.GetRecognizerRequest"; + }; + + return GetRecognizerRequest; + })(); + + v2.UpdateRecognizerRequest = (function() { + + /** + * Properties of an UpdateRecognizerRequest. + * @memberof google.cloud.speech.v2 + * @interface IUpdateRecognizerRequest + * @property {google.cloud.speech.v2.IRecognizer|null} [recognizer] UpdateRecognizerRequest recognizer + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateRecognizerRequest updateMask + * @property {boolean|null} [validateOnly] UpdateRecognizerRequest validateOnly + */ + + /** + * Constructs a new UpdateRecognizerRequest. + * @memberof google.cloud.speech.v2 + * @classdesc Represents an UpdateRecognizerRequest. + * @implements IUpdateRecognizerRequest + * @constructor + * @param {google.cloud.speech.v2.IUpdateRecognizerRequest=} [properties] Properties to set + */ + function UpdateRecognizerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateRecognizerRequest recognizer. + * @member {google.cloud.speech.v2.IRecognizer|null|undefined} recognizer + * @memberof google.cloud.speech.v2.UpdateRecognizerRequest + * @instance + */ + UpdateRecognizerRequest.prototype.recognizer = null; + + /** + * UpdateRecognizerRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.speech.v2.UpdateRecognizerRequest + * @instance + */ + UpdateRecognizerRequest.prototype.updateMask = null; + + /** + * UpdateRecognizerRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.speech.v2.UpdateRecognizerRequest + * @instance + */ + UpdateRecognizerRequest.prototype.validateOnly = false; + + /** + * Creates a new UpdateRecognizerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.UpdateRecognizerRequest + * @static + * @param {google.cloud.speech.v2.IUpdateRecognizerRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v2.UpdateRecognizerRequest} UpdateRecognizerRequest instance + */ + UpdateRecognizerRequest.create = function create(properties) { + return new UpdateRecognizerRequest(properties); + }; + + /** + * Encodes the specified UpdateRecognizerRequest message. Does not implicitly {@link google.cloud.speech.v2.UpdateRecognizerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.UpdateRecognizerRequest + * @static + * @param {google.cloud.speech.v2.IUpdateRecognizerRequest} message UpdateRecognizerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateRecognizerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.recognizer != null && Object.hasOwnProperty.call(message, "recognizer")) + $root.google.cloud.speech.v2.Recognizer.encode(message.recognizer, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified UpdateRecognizerRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v2.UpdateRecognizerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.UpdateRecognizerRequest + * @static + * @param {google.cloud.speech.v2.IUpdateRecognizerRequest} message UpdateRecognizerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateRecognizerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateRecognizerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.UpdateRecognizerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.UpdateRecognizerRequest} UpdateRecognizerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateRecognizerRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.UpdateRecognizerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.recognizer = $root.google.cloud.speech.v2.Recognizer.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateRecognizerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.UpdateRecognizerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.UpdateRecognizerRequest} UpdateRecognizerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateRecognizerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateRecognizerRequest message. + * @function verify + * @memberof google.cloud.speech.v2.UpdateRecognizerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateRecognizerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.recognizer != null && message.hasOwnProperty("recognizer")) { + var error = $root.google.cloud.speech.v2.Recognizer.verify(message.recognizer); + if (error) + return "recognizer." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates an UpdateRecognizerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.UpdateRecognizerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.UpdateRecognizerRequest} UpdateRecognizerRequest + */ + UpdateRecognizerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.UpdateRecognizerRequest) + return object; + var message = new $root.google.cloud.speech.v2.UpdateRecognizerRequest(); + if (object.recognizer != null) { + if (typeof object.recognizer !== "object") + throw TypeError(".google.cloud.speech.v2.UpdateRecognizerRequest.recognizer: object expected"); + message.recognizer = $root.google.cloud.speech.v2.Recognizer.fromObject(object.recognizer); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.speech.v2.UpdateRecognizerRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from an UpdateRecognizerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.UpdateRecognizerRequest + * @static + * @param {google.cloud.speech.v2.UpdateRecognizerRequest} message UpdateRecognizerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateRecognizerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.recognizer = null; + object.updateMask = null; + object.validateOnly = false; + } + if (message.recognizer != null && message.hasOwnProperty("recognizer")) + object.recognizer = $root.google.cloud.speech.v2.Recognizer.toObject(message.recognizer, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this UpdateRecognizerRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.UpdateRecognizerRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateRecognizerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateRecognizerRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v2.UpdateRecognizerRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateRecognizerRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.UpdateRecognizerRequest"; + }; + + return UpdateRecognizerRequest; + })(); + + v2.DeleteRecognizerRequest = (function() { + + /** + * Properties of a DeleteRecognizerRequest. + * @memberof google.cloud.speech.v2 + * @interface IDeleteRecognizerRequest + * @property {string|null} [name] DeleteRecognizerRequest name + * @property {boolean|null} [validateOnly] DeleteRecognizerRequest validateOnly + * @property {boolean|null} [allowMissing] DeleteRecognizerRequest allowMissing + * @property {string|null} [etag] DeleteRecognizerRequest etag + */ + + /** + * Constructs a new DeleteRecognizerRequest. + * @memberof google.cloud.speech.v2 + * @classdesc Represents a DeleteRecognizerRequest. + * @implements IDeleteRecognizerRequest + * @constructor + * @param {google.cloud.speech.v2.IDeleteRecognizerRequest=} [properties] Properties to set + */ + function DeleteRecognizerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteRecognizerRequest name. + * @member {string} name + * @memberof google.cloud.speech.v2.DeleteRecognizerRequest + * @instance + */ + DeleteRecognizerRequest.prototype.name = ""; + + /** + * DeleteRecognizerRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.speech.v2.DeleteRecognizerRequest + * @instance + */ + DeleteRecognizerRequest.prototype.validateOnly = false; + + /** + * DeleteRecognizerRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.speech.v2.DeleteRecognizerRequest + * @instance + */ + DeleteRecognizerRequest.prototype.allowMissing = false; + + /** + * DeleteRecognizerRequest etag. + * @member {string} etag + * @memberof google.cloud.speech.v2.DeleteRecognizerRequest + * @instance + */ + DeleteRecognizerRequest.prototype.etag = ""; + + /** + * Creates a new DeleteRecognizerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.DeleteRecognizerRequest + * @static + * @param {google.cloud.speech.v2.IDeleteRecognizerRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v2.DeleteRecognizerRequest} DeleteRecognizerRequest instance + */ + DeleteRecognizerRequest.create = function create(properties) { + return new DeleteRecognizerRequest(properties); + }; + + /** + * Encodes the specified DeleteRecognizerRequest message. Does not implicitly {@link google.cloud.speech.v2.DeleteRecognizerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.DeleteRecognizerRequest + * @static + * @param {google.cloud.speech.v2.IDeleteRecognizerRequest} message DeleteRecognizerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteRecognizerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.validateOnly); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.allowMissing); + return writer; + }; + + /** + * Encodes the specified DeleteRecognizerRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v2.DeleteRecognizerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.DeleteRecognizerRequest + * @static + * @param {google.cloud.speech.v2.IDeleteRecognizerRequest} message DeleteRecognizerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteRecognizerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteRecognizerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.DeleteRecognizerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.DeleteRecognizerRequest} DeleteRecognizerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteRecognizerRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.DeleteRecognizerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.validateOnly = reader.bool(); + break; + } + case 4: { + message.allowMissing = reader.bool(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteRecognizerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.DeleteRecognizerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.DeleteRecognizerRequest} DeleteRecognizerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteRecognizerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteRecognizerRequest message. + * @function verify + * @memberof google.cloud.speech.v2.DeleteRecognizerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteRecognizerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteRecognizerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.DeleteRecognizerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.DeleteRecognizerRequest} DeleteRecognizerRequest + */ + DeleteRecognizerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.DeleteRecognizerRequest) + return object; + var message = new $root.google.cloud.speech.v2.DeleteRecognizerRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteRecognizerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.DeleteRecognizerRequest + * @static + * @param {google.cloud.speech.v2.DeleteRecognizerRequest} message DeleteRecognizerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteRecognizerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.validateOnly = false; + object.etag = ""; + object.allowMissing = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + return object; + }; + + /** + * Converts this DeleteRecognizerRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.DeleteRecognizerRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteRecognizerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteRecognizerRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v2.DeleteRecognizerRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteRecognizerRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.DeleteRecognizerRequest"; + }; + + return DeleteRecognizerRequest; + })(); + + v2.UndeleteRecognizerRequest = (function() { + + /** + * Properties of an UndeleteRecognizerRequest. + * @memberof google.cloud.speech.v2 + * @interface IUndeleteRecognizerRequest + * @property {string|null} [name] UndeleteRecognizerRequest name + * @property {boolean|null} [validateOnly] UndeleteRecognizerRequest validateOnly + * @property {string|null} [etag] UndeleteRecognizerRequest etag + */ + + /** + * Constructs a new UndeleteRecognizerRequest. + * @memberof google.cloud.speech.v2 + * @classdesc Represents an UndeleteRecognizerRequest. + * @implements IUndeleteRecognizerRequest + * @constructor + * @param {google.cloud.speech.v2.IUndeleteRecognizerRequest=} [properties] Properties to set + */ + function UndeleteRecognizerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UndeleteRecognizerRequest name. + * @member {string} name + * @memberof google.cloud.speech.v2.UndeleteRecognizerRequest + * @instance + */ + UndeleteRecognizerRequest.prototype.name = ""; + + /** + * UndeleteRecognizerRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.speech.v2.UndeleteRecognizerRequest + * @instance + */ + UndeleteRecognizerRequest.prototype.validateOnly = false; + + /** + * UndeleteRecognizerRequest etag. + * @member {string} etag + * @memberof google.cloud.speech.v2.UndeleteRecognizerRequest + * @instance + */ + UndeleteRecognizerRequest.prototype.etag = ""; + + /** + * Creates a new UndeleteRecognizerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.UndeleteRecognizerRequest + * @static + * @param {google.cloud.speech.v2.IUndeleteRecognizerRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v2.UndeleteRecognizerRequest} UndeleteRecognizerRequest instance + */ + UndeleteRecognizerRequest.create = function create(properties) { + return new UndeleteRecognizerRequest(properties); + }; + + /** + * Encodes the specified UndeleteRecognizerRequest message. Does not implicitly {@link google.cloud.speech.v2.UndeleteRecognizerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.UndeleteRecognizerRequest + * @static + * @param {google.cloud.speech.v2.IUndeleteRecognizerRequest} message UndeleteRecognizerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeleteRecognizerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.etag); + return writer; + }; + + /** + * Encodes the specified UndeleteRecognizerRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v2.UndeleteRecognizerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.UndeleteRecognizerRequest + * @static + * @param {google.cloud.speech.v2.IUndeleteRecognizerRequest} message UndeleteRecognizerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeleteRecognizerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UndeleteRecognizerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.UndeleteRecognizerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.UndeleteRecognizerRequest} UndeleteRecognizerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeleteRecognizerRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.UndeleteRecognizerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.validateOnly = reader.bool(); + break; + } + case 4: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UndeleteRecognizerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.UndeleteRecognizerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.UndeleteRecognizerRequest} UndeleteRecognizerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeleteRecognizerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UndeleteRecognizerRequest message. + * @function verify + * @memberof google.cloud.speech.v2.UndeleteRecognizerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UndeleteRecognizerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates an UndeleteRecognizerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.UndeleteRecognizerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.UndeleteRecognizerRequest} UndeleteRecognizerRequest + */ + UndeleteRecognizerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.UndeleteRecognizerRequest) + return object; + var message = new $root.google.cloud.speech.v2.UndeleteRecognizerRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from an UndeleteRecognizerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.UndeleteRecognizerRequest + * @static + * @param {google.cloud.speech.v2.UndeleteRecognizerRequest} message UndeleteRecognizerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UndeleteRecognizerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.validateOnly = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this UndeleteRecognizerRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.UndeleteRecognizerRequest + * @instance + * @returns {Object.} JSON object + */ + UndeleteRecognizerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UndeleteRecognizerRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v2.UndeleteRecognizerRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UndeleteRecognizerRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.UndeleteRecognizerRequest"; + }; + + return UndeleteRecognizerRequest; + })(); + + v2.Recognizer = (function() { + + /** + * Properties of a Recognizer. + * @memberof google.cloud.speech.v2 + * @interface IRecognizer + * @property {string|null} [name] Recognizer name + * @property {string|null} [uid] Recognizer uid + * @property {string|null} [displayName] Recognizer displayName + * @property {string|null} [model] Recognizer model + * @property {Array.|null} [languageCodes] Recognizer languageCodes + * @property {google.cloud.speech.v2.IRecognitionConfig|null} [defaultRecognitionConfig] Recognizer defaultRecognitionConfig + * @property {Object.|null} [annotations] Recognizer annotations + * @property {google.cloud.speech.v2.Recognizer.State|null} [state] Recognizer state + * @property {google.protobuf.ITimestamp|null} [createTime] Recognizer createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Recognizer updateTime + * @property {google.protobuf.ITimestamp|null} [deleteTime] Recognizer deleteTime + * @property {google.protobuf.ITimestamp|null} [expireTime] Recognizer expireTime + * @property {string|null} [etag] Recognizer etag + * @property {boolean|null} [reconciling] Recognizer reconciling + * @property {string|null} [kmsKeyName] Recognizer kmsKeyName + * @property {string|null} [kmsKeyVersionName] Recognizer kmsKeyVersionName + */ + + /** + * Constructs a new Recognizer. + * @memberof google.cloud.speech.v2 + * @classdesc Represents a Recognizer. + * @implements IRecognizer + * @constructor + * @param {google.cloud.speech.v2.IRecognizer=} [properties] Properties to set + */ + function Recognizer(properties) { + this.languageCodes = []; + this.annotations = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Recognizer name. + * @member {string} name + * @memberof google.cloud.speech.v2.Recognizer + * @instance + */ + Recognizer.prototype.name = ""; + + /** + * Recognizer uid. + * @member {string} uid + * @memberof google.cloud.speech.v2.Recognizer + * @instance + */ + Recognizer.prototype.uid = ""; + + /** + * Recognizer displayName. + * @member {string} displayName + * @memberof google.cloud.speech.v2.Recognizer + * @instance + */ + Recognizer.prototype.displayName = ""; + + /** + * Recognizer model. + * @member {string} model + * @memberof google.cloud.speech.v2.Recognizer + * @instance + */ + Recognizer.prototype.model = ""; + + /** + * Recognizer languageCodes. + * @member {Array.} languageCodes + * @memberof google.cloud.speech.v2.Recognizer + * @instance + */ + Recognizer.prototype.languageCodes = $util.emptyArray; + + /** + * Recognizer defaultRecognitionConfig. + * @member {google.cloud.speech.v2.IRecognitionConfig|null|undefined} defaultRecognitionConfig + * @memberof google.cloud.speech.v2.Recognizer + * @instance + */ + Recognizer.prototype.defaultRecognitionConfig = null; + + /** + * Recognizer annotations. + * @member {Object.} annotations + * @memberof google.cloud.speech.v2.Recognizer + * @instance + */ + Recognizer.prototype.annotations = $util.emptyObject; + + /** + * Recognizer state. + * @member {google.cloud.speech.v2.Recognizer.State} state + * @memberof google.cloud.speech.v2.Recognizer + * @instance + */ + Recognizer.prototype.state = 0; + + /** + * Recognizer createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.speech.v2.Recognizer + * @instance + */ + Recognizer.prototype.createTime = null; + + /** + * Recognizer updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.speech.v2.Recognizer + * @instance + */ + Recognizer.prototype.updateTime = null; + + /** + * Recognizer deleteTime. + * @member {google.protobuf.ITimestamp|null|undefined} deleteTime + * @memberof google.cloud.speech.v2.Recognizer + * @instance + */ + Recognizer.prototype.deleteTime = null; + + /** + * Recognizer expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.cloud.speech.v2.Recognizer + * @instance + */ + Recognizer.prototype.expireTime = null; + + /** + * Recognizer etag. + * @member {string} etag + * @memberof google.cloud.speech.v2.Recognizer + * @instance + */ + Recognizer.prototype.etag = ""; + + /** + * Recognizer reconciling. + * @member {boolean} reconciling + * @memberof google.cloud.speech.v2.Recognizer + * @instance + */ + Recognizer.prototype.reconciling = false; + + /** + * Recognizer kmsKeyName. + * @member {string} kmsKeyName + * @memberof google.cloud.speech.v2.Recognizer + * @instance + */ + Recognizer.prototype.kmsKeyName = ""; + + /** + * Recognizer kmsKeyVersionName. + * @member {string} kmsKeyVersionName + * @memberof google.cloud.speech.v2.Recognizer + * @instance + */ + Recognizer.prototype.kmsKeyVersionName = ""; + + /** + * Creates a new Recognizer instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.Recognizer + * @static + * @param {google.cloud.speech.v2.IRecognizer=} [properties] Properties to set + * @returns {google.cloud.speech.v2.Recognizer} Recognizer instance + */ + Recognizer.create = function create(properties) { + return new Recognizer(properties); + }; + + /** + * Encodes the specified Recognizer message. Does not implicitly {@link google.cloud.speech.v2.Recognizer.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.Recognizer + * @static + * @param {google.cloud.speech.v2.IRecognizer} message Recognizer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Recognizer.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uid); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.model); + if (message.defaultRecognitionConfig != null && Object.hasOwnProperty.call(message, "defaultRecognitionConfig")) + $root.google.cloud.speech.v2.RecognitionConfig.encode(message.defaultRecognitionConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.state); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) + $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.etag); + if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) + writer.uint32(/* id 13, wireType 0 =*/104).bool(message.reconciling); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.kmsKeyName); + if (message.kmsKeyVersionName != null && Object.hasOwnProperty.call(message, "kmsKeyVersionName")) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.kmsKeyVersionName); + if (message.languageCodes != null && message.languageCodes.length) + for (var i = 0; i < message.languageCodes.length; ++i) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.languageCodes[i]); + return writer; + }; + + /** + * Encodes the specified Recognizer message, length delimited. Does not implicitly {@link google.cloud.speech.v2.Recognizer.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.Recognizer + * @static + * @param {google.cloud.speech.v2.IRecognizer} message Recognizer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Recognizer.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Recognizer message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.Recognizer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.Recognizer} Recognizer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Recognizer.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.Recognizer(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.uid = reader.string(); + break; + } + case 3: { + message.displayName = reader.string(); + break; + } + case 4: { + message.model = reader.string(); + break; + } + case 17: { + if (!(message.languageCodes && message.languageCodes.length)) + message.languageCodes = []; + message.languageCodes.push(reader.string()); + break; + } + case 6: { + message.defaultRecognitionConfig = $root.google.cloud.speech.v2.RecognitionConfig.decode(reader, reader.uint32()); + break; + } + case 7: { + if (message.annotations === $util.emptyObject) + message.annotations = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.annotations[key] = value; + break; + } + case 8: { + message.state = reader.int32(); + break; + } + case 9: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 11: { + message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 14: { + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 12: { + message.etag = reader.string(); + break; + } + case 13: { + message.reconciling = reader.bool(); + break; + } + case 15: { + message.kmsKeyName = reader.string(); + break; + } + case 16: { + message.kmsKeyVersionName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Recognizer message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.Recognizer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.Recognizer} Recognizer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Recognizer.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Recognizer message. + * @function verify + * @memberof google.cloud.speech.v2.Recognizer + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Recognizer.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.languageCodes != null && message.hasOwnProperty("languageCodes")) { + if (!Array.isArray(message.languageCodes)) + return "languageCodes: array expected"; + for (var i = 0; i < message.languageCodes.length; ++i) + if (!$util.isString(message.languageCodes[i])) + return "languageCodes: string[] expected"; + } + if (message.defaultRecognitionConfig != null && message.hasOwnProperty("defaultRecognitionConfig")) { + var error = $root.google.cloud.speech.v2.RecognitionConfig.verify(message.defaultRecognitionConfig); + if (error) + return "defaultRecognitionConfig." + error; + } + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!$util.isObject(message.annotations)) + return "annotations: object expected"; + var key = Object.keys(message.annotations); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.annotations[key[i]])) + return "annotations: string{k:string} expected"; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 2: + case 4: + break; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); + if (error) + return "deleteTime." + error; + } + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + error; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + if (typeof message.reconciling !== "boolean") + return "reconciling: boolean expected"; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (!$util.isString(message.kmsKeyName)) + return "kmsKeyName: string expected"; + if (message.kmsKeyVersionName != null && message.hasOwnProperty("kmsKeyVersionName")) + if (!$util.isString(message.kmsKeyVersionName)) + return "kmsKeyVersionName: string expected"; + return null; + }; + + /** + * Creates a Recognizer message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.Recognizer + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.Recognizer} Recognizer + */ + Recognizer.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.Recognizer) + return object; + var message = new $root.google.cloud.speech.v2.Recognizer(); + if (object.name != null) + message.name = String(object.name); + if (object.uid != null) + message.uid = String(object.uid); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.model != null) + message.model = String(object.model); + if (object.languageCodes) { + if (!Array.isArray(object.languageCodes)) + throw TypeError(".google.cloud.speech.v2.Recognizer.languageCodes: array expected"); + message.languageCodes = []; + for (var i = 0; i < object.languageCodes.length; ++i) + message.languageCodes[i] = String(object.languageCodes[i]); + } + if (object.defaultRecognitionConfig != null) { + if (typeof object.defaultRecognitionConfig !== "object") + throw TypeError(".google.cloud.speech.v2.Recognizer.defaultRecognitionConfig: object expected"); + message.defaultRecognitionConfig = $root.google.cloud.speech.v2.RecognitionConfig.fromObject(object.defaultRecognitionConfig); + } + if (object.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.speech.v2.Recognizer.annotations: object expected"); + message.annotations = {}; + for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) + message.annotations[keys[i]] = String(object.annotations[keys[i]]); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 2: + message.state = 2; + break; + case "DELETED": + case 4: + message.state = 4; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.speech.v2.Recognizer.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.speech.v2.Recognizer.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.deleteTime != null) { + if (typeof object.deleteTime !== "object") + throw TypeError(".google.cloud.speech.v2.Recognizer.deleteTime: object expected"); + message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); + } + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.cloud.speech.v2.Recognizer.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.reconciling != null) + message.reconciling = Boolean(object.reconciling); + if (object.kmsKeyName != null) + message.kmsKeyName = String(object.kmsKeyName); + if (object.kmsKeyVersionName != null) + message.kmsKeyVersionName = String(object.kmsKeyVersionName); + return message; + }; + + /** + * Creates a plain object from a Recognizer message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.Recognizer + * @static + * @param {google.cloud.speech.v2.Recognizer} message Recognizer + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Recognizer.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.languageCodes = []; + if (options.objects || options.defaults) + object.annotations = {}; + if (options.defaults) { + object.name = ""; + object.uid = ""; + object.displayName = ""; + object.model = ""; + object.defaultRecognitionConfig = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.createTime = null; + object.updateTime = null; + object.deleteTime = null; + object.etag = ""; + object.reconciling = false; + object.expireTime = null; + object.kmsKeyName = ""; + object.kmsKeyVersionName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.defaultRecognitionConfig != null && message.hasOwnProperty("defaultRecognitionConfig")) + object.defaultRecognitionConfig = $root.google.cloud.speech.v2.RecognitionConfig.toObject(message.defaultRecognitionConfig, options); + var keys2; + if (message.annotations && (keys2 = Object.keys(message.annotations)).length) { + object.annotations = {}; + for (var j = 0; j < keys2.length; ++j) + object.annotations[keys2[j]] = message.annotations[keys2[j]]; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.speech.v2.Recognizer.State[message.state] === undefined ? message.state : $root.google.cloud.speech.v2.Recognizer.State[message.state] : message.state; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) + object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + object.reconciling = message.reconciling; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + object.kmsKeyName = message.kmsKeyName; + if (message.kmsKeyVersionName != null && message.hasOwnProperty("kmsKeyVersionName")) + object.kmsKeyVersionName = message.kmsKeyVersionName; + if (message.languageCodes && message.languageCodes.length) { + object.languageCodes = []; + for (var j = 0; j < message.languageCodes.length; ++j) + object.languageCodes[j] = message.languageCodes[j]; + } + return object; + }; + + /** + * Converts this Recognizer to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.Recognizer + * @instance + * @returns {Object.} JSON object + */ + Recognizer.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Recognizer + * @function getTypeUrl + * @memberof google.cloud.speech.v2.Recognizer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Recognizer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.Recognizer"; + }; + + /** + * State enum. + * @name google.cloud.speech.v2.Recognizer.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=2 ACTIVE value + * @property {number} DELETED=4 DELETED value + */ + Recognizer.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[2] = "ACTIVE"] = 2; + values[valuesById[4] = "DELETED"] = 4; + return values; + })(); + + return Recognizer; + })(); + + v2.AutoDetectDecodingConfig = (function() { + + /** + * Properties of an AutoDetectDecodingConfig. + * @memberof google.cloud.speech.v2 + * @interface IAutoDetectDecodingConfig + */ + + /** + * Constructs a new AutoDetectDecodingConfig. + * @memberof google.cloud.speech.v2 + * @classdesc Represents an AutoDetectDecodingConfig. + * @implements IAutoDetectDecodingConfig + * @constructor + * @param {google.cloud.speech.v2.IAutoDetectDecodingConfig=} [properties] Properties to set + */ + function AutoDetectDecodingConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new AutoDetectDecodingConfig instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.AutoDetectDecodingConfig + * @static + * @param {google.cloud.speech.v2.IAutoDetectDecodingConfig=} [properties] Properties to set + * @returns {google.cloud.speech.v2.AutoDetectDecodingConfig} AutoDetectDecodingConfig instance + */ + AutoDetectDecodingConfig.create = function create(properties) { + return new AutoDetectDecodingConfig(properties); + }; + + /** + * Encodes the specified AutoDetectDecodingConfig message. Does not implicitly {@link google.cloud.speech.v2.AutoDetectDecodingConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.AutoDetectDecodingConfig + * @static + * @param {google.cloud.speech.v2.IAutoDetectDecodingConfig} message AutoDetectDecodingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoDetectDecodingConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified AutoDetectDecodingConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v2.AutoDetectDecodingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.AutoDetectDecodingConfig + * @static + * @param {google.cloud.speech.v2.IAutoDetectDecodingConfig} message AutoDetectDecodingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoDetectDecodingConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutoDetectDecodingConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.AutoDetectDecodingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.AutoDetectDecodingConfig} AutoDetectDecodingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoDetectDecodingConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.AutoDetectDecodingConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutoDetectDecodingConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.AutoDetectDecodingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.AutoDetectDecodingConfig} AutoDetectDecodingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoDetectDecodingConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutoDetectDecodingConfig message. + * @function verify + * @memberof google.cloud.speech.v2.AutoDetectDecodingConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutoDetectDecodingConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an AutoDetectDecodingConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.AutoDetectDecodingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.AutoDetectDecodingConfig} AutoDetectDecodingConfig + */ + AutoDetectDecodingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.AutoDetectDecodingConfig) + return object; + return new $root.google.cloud.speech.v2.AutoDetectDecodingConfig(); + }; + + /** + * Creates a plain object from an AutoDetectDecodingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.AutoDetectDecodingConfig + * @static + * @param {google.cloud.speech.v2.AutoDetectDecodingConfig} message AutoDetectDecodingConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutoDetectDecodingConfig.toObject = function toObject() { + return {}; + }; + + /** + * Converts this AutoDetectDecodingConfig to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.AutoDetectDecodingConfig + * @instance + * @returns {Object.} JSON object + */ + AutoDetectDecodingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AutoDetectDecodingConfig + * @function getTypeUrl + * @memberof google.cloud.speech.v2.AutoDetectDecodingConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AutoDetectDecodingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.AutoDetectDecodingConfig"; + }; + + return AutoDetectDecodingConfig; + })(); + + v2.ExplicitDecodingConfig = (function() { + + /** + * Properties of an ExplicitDecodingConfig. + * @memberof google.cloud.speech.v2 + * @interface IExplicitDecodingConfig + * @property {google.cloud.speech.v2.ExplicitDecodingConfig.AudioEncoding|null} [encoding] ExplicitDecodingConfig encoding + * @property {number|null} [sampleRateHertz] ExplicitDecodingConfig sampleRateHertz + * @property {number|null} [audioChannelCount] ExplicitDecodingConfig audioChannelCount + */ + + /** + * Constructs a new ExplicitDecodingConfig. + * @memberof google.cloud.speech.v2 + * @classdesc Represents an ExplicitDecodingConfig. + * @implements IExplicitDecodingConfig + * @constructor + * @param {google.cloud.speech.v2.IExplicitDecodingConfig=} [properties] Properties to set + */ + function ExplicitDecodingConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExplicitDecodingConfig encoding. + * @member {google.cloud.speech.v2.ExplicitDecodingConfig.AudioEncoding} encoding + * @memberof google.cloud.speech.v2.ExplicitDecodingConfig + * @instance + */ + ExplicitDecodingConfig.prototype.encoding = 0; + + /** + * ExplicitDecodingConfig sampleRateHertz. + * @member {number} sampleRateHertz + * @memberof google.cloud.speech.v2.ExplicitDecodingConfig + * @instance + */ + ExplicitDecodingConfig.prototype.sampleRateHertz = 0; + + /** + * ExplicitDecodingConfig audioChannelCount. + * @member {number} audioChannelCount + * @memberof google.cloud.speech.v2.ExplicitDecodingConfig + * @instance + */ + ExplicitDecodingConfig.prototype.audioChannelCount = 0; + + /** + * Creates a new ExplicitDecodingConfig instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.ExplicitDecodingConfig + * @static + * @param {google.cloud.speech.v2.IExplicitDecodingConfig=} [properties] Properties to set + * @returns {google.cloud.speech.v2.ExplicitDecodingConfig} ExplicitDecodingConfig instance + */ + ExplicitDecodingConfig.create = function create(properties) { + return new ExplicitDecodingConfig(properties); + }; + + /** + * Encodes the specified ExplicitDecodingConfig message. Does not implicitly {@link google.cloud.speech.v2.ExplicitDecodingConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.ExplicitDecodingConfig + * @static + * @param {google.cloud.speech.v2.IExplicitDecodingConfig} message ExplicitDecodingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExplicitDecodingConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.encoding); + if (message.sampleRateHertz != null && Object.hasOwnProperty.call(message, "sampleRateHertz")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.sampleRateHertz); + if (message.audioChannelCount != null && Object.hasOwnProperty.call(message, "audioChannelCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.audioChannelCount); + return writer; + }; + + /** + * Encodes the specified ExplicitDecodingConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v2.ExplicitDecodingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.ExplicitDecodingConfig + * @static + * @param {google.cloud.speech.v2.IExplicitDecodingConfig} message ExplicitDecodingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExplicitDecodingConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExplicitDecodingConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.ExplicitDecodingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.ExplicitDecodingConfig} ExplicitDecodingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExplicitDecodingConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.ExplicitDecodingConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.encoding = reader.int32(); + break; + } + case 2: { + message.sampleRateHertz = reader.int32(); + break; + } + case 3: { + message.audioChannelCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExplicitDecodingConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.ExplicitDecodingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.ExplicitDecodingConfig} ExplicitDecodingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExplicitDecodingConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExplicitDecodingConfig message. + * @function verify + * @memberof google.cloud.speech.v2.ExplicitDecodingConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExplicitDecodingConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.encoding != null && message.hasOwnProperty("encoding")) + switch (message.encoding) { + default: + return "encoding: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + break; + } + if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) + if (!$util.isInteger(message.sampleRateHertz)) + return "sampleRateHertz: integer expected"; + if (message.audioChannelCount != null && message.hasOwnProperty("audioChannelCount")) + if (!$util.isInteger(message.audioChannelCount)) + return "audioChannelCount: integer expected"; + return null; + }; + + /** + * Creates an ExplicitDecodingConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.ExplicitDecodingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.ExplicitDecodingConfig} ExplicitDecodingConfig + */ + ExplicitDecodingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.ExplicitDecodingConfig) + return object; + var message = new $root.google.cloud.speech.v2.ExplicitDecodingConfig(); + switch (object.encoding) { + default: + if (typeof object.encoding === "number") { + message.encoding = object.encoding; + break; + } + break; + case "AUDIO_ENCODING_UNSPECIFIED": + case 0: + message.encoding = 0; + break; + case "LINEAR16": + case 1: + message.encoding = 1; + break; + case "MULAW": + case 2: + message.encoding = 2; + break; + case "ALAW": + case 3: + message.encoding = 3; + break; + case "AMR": + case 4: + message.encoding = 4; + break; + case "AMR_WB": + case 5: + message.encoding = 5; + break; + case "FLAC": + case 6: + message.encoding = 6; + break; + case "MP3": + case 7: + message.encoding = 7; + break; + case "OGG_OPUS": + case 8: + message.encoding = 8; + break; + case "WEBM_OPUS": + case 9: + message.encoding = 9; + break; + case "MP4_AAC": + case 10: + message.encoding = 10; + break; + case "M4A_AAC": + case 11: + message.encoding = 11; + break; + case "MOV_AAC": + case 12: + message.encoding = 12; + break; + } + if (object.sampleRateHertz != null) + message.sampleRateHertz = object.sampleRateHertz | 0; + if (object.audioChannelCount != null) + message.audioChannelCount = object.audioChannelCount | 0; + return message; + }; + + /** + * Creates a plain object from an ExplicitDecodingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.ExplicitDecodingConfig + * @static + * @param {google.cloud.speech.v2.ExplicitDecodingConfig} message ExplicitDecodingConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExplicitDecodingConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.encoding = options.enums === String ? "AUDIO_ENCODING_UNSPECIFIED" : 0; + object.sampleRateHertz = 0; + object.audioChannelCount = 0; + } + if (message.encoding != null && message.hasOwnProperty("encoding")) + object.encoding = options.enums === String ? $root.google.cloud.speech.v2.ExplicitDecodingConfig.AudioEncoding[message.encoding] === undefined ? message.encoding : $root.google.cloud.speech.v2.ExplicitDecodingConfig.AudioEncoding[message.encoding] : message.encoding; + if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) + object.sampleRateHertz = message.sampleRateHertz; + if (message.audioChannelCount != null && message.hasOwnProperty("audioChannelCount")) + object.audioChannelCount = message.audioChannelCount; + return object; + }; + + /** + * Converts this ExplicitDecodingConfig to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.ExplicitDecodingConfig + * @instance + * @returns {Object.} JSON object + */ + ExplicitDecodingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExplicitDecodingConfig + * @function getTypeUrl + * @memberof google.cloud.speech.v2.ExplicitDecodingConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExplicitDecodingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.ExplicitDecodingConfig"; + }; + + /** + * AudioEncoding enum. + * @name google.cloud.speech.v2.ExplicitDecodingConfig.AudioEncoding + * @enum {number} + * @property {number} AUDIO_ENCODING_UNSPECIFIED=0 AUDIO_ENCODING_UNSPECIFIED value + * @property {number} LINEAR16=1 LINEAR16 value + * @property {number} MULAW=2 MULAW value + * @property {number} ALAW=3 ALAW value + * @property {number} AMR=4 AMR value + * @property {number} AMR_WB=5 AMR_WB value + * @property {number} FLAC=6 FLAC value + * @property {number} MP3=7 MP3 value + * @property {number} OGG_OPUS=8 OGG_OPUS value + * @property {number} WEBM_OPUS=9 WEBM_OPUS value + * @property {number} MP4_AAC=10 MP4_AAC value + * @property {number} M4A_AAC=11 M4A_AAC value + * @property {number} MOV_AAC=12 MOV_AAC value + */ + ExplicitDecodingConfig.AudioEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "AUDIO_ENCODING_UNSPECIFIED"] = 0; + values[valuesById[1] = "LINEAR16"] = 1; + values[valuesById[2] = "MULAW"] = 2; + values[valuesById[3] = "ALAW"] = 3; + values[valuesById[4] = "AMR"] = 4; + values[valuesById[5] = "AMR_WB"] = 5; + values[valuesById[6] = "FLAC"] = 6; + values[valuesById[7] = "MP3"] = 7; + values[valuesById[8] = "OGG_OPUS"] = 8; + values[valuesById[9] = "WEBM_OPUS"] = 9; + values[valuesById[10] = "MP4_AAC"] = 10; + values[valuesById[11] = "M4A_AAC"] = 11; + values[valuesById[12] = "MOV_AAC"] = 12; + return values; + })(); + + return ExplicitDecodingConfig; + })(); + + v2.SpeakerDiarizationConfig = (function() { + + /** + * Properties of a SpeakerDiarizationConfig. + * @memberof google.cloud.speech.v2 + * @interface ISpeakerDiarizationConfig + * @property {number|null} [minSpeakerCount] SpeakerDiarizationConfig minSpeakerCount + * @property {number|null} [maxSpeakerCount] SpeakerDiarizationConfig maxSpeakerCount + */ + + /** + * Constructs a new SpeakerDiarizationConfig. + * @memberof google.cloud.speech.v2 + * @classdesc Represents a SpeakerDiarizationConfig. + * @implements ISpeakerDiarizationConfig + * @constructor + * @param {google.cloud.speech.v2.ISpeakerDiarizationConfig=} [properties] Properties to set + */ + function SpeakerDiarizationConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpeakerDiarizationConfig minSpeakerCount. + * @member {number} minSpeakerCount + * @memberof google.cloud.speech.v2.SpeakerDiarizationConfig + * @instance + */ + SpeakerDiarizationConfig.prototype.minSpeakerCount = 0; + + /** + * SpeakerDiarizationConfig maxSpeakerCount. + * @member {number} maxSpeakerCount + * @memberof google.cloud.speech.v2.SpeakerDiarizationConfig + * @instance + */ + SpeakerDiarizationConfig.prototype.maxSpeakerCount = 0; + + /** + * Creates a new SpeakerDiarizationConfig instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.SpeakerDiarizationConfig + * @static + * @param {google.cloud.speech.v2.ISpeakerDiarizationConfig=} [properties] Properties to set + * @returns {google.cloud.speech.v2.SpeakerDiarizationConfig} SpeakerDiarizationConfig instance + */ + SpeakerDiarizationConfig.create = function create(properties) { + return new SpeakerDiarizationConfig(properties); + }; + + /** + * Encodes the specified SpeakerDiarizationConfig message. Does not implicitly {@link google.cloud.speech.v2.SpeakerDiarizationConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.SpeakerDiarizationConfig + * @static + * @param {google.cloud.speech.v2.ISpeakerDiarizationConfig} message SpeakerDiarizationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeakerDiarizationConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.minSpeakerCount != null && Object.hasOwnProperty.call(message, "minSpeakerCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.minSpeakerCount); + if (message.maxSpeakerCount != null && Object.hasOwnProperty.call(message, "maxSpeakerCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.maxSpeakerCount); + return writer; + }; + + /** + * Encodes the specified SpeakerDiarizationConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v2.SpeakerDiarizationConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.SpeakerDiarizationConfig + * @static + * @param {google.cloud.speech.v2.ISpeakerDiarizationConfig} message SpeakerDiarizationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeakerDiarizationConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpeakerDiarizationConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.SpeakerDiarizationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.SpeakerDiarizationConfig} SpeakerDiarizationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeakerDiarizationConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.SpeakerDiarizationConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.minSpeakerCount = reader.int32(); + break; + } + case 3: { + message.maxSpeakerCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpeakerDiarizationConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.SpeakerDiarizationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.SpeakerDiarizationConfig} SpeakerDiarizationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeakerDiarizationConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpeakerDiarizationConfig message. + * @function verify + * @memberof google.cloud.speech.v2.SpeakerDiarizationConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpeakerDiarizationConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.minSpeakerCount != null && message.hasOwnProperty("minSpeakerCount")) + if (!$util.isInteger(message.minSpeakerCount)) + return "minSpeakerCount: integer expected"; + if (message.maxSpeakerCount != null && message.hasOwnProperty("maxSpeakerCount")) + if (!$util.isInteger(message.maxSpeakerCount)) + return "maxSpeakerCount: integer expected"; + return null; + }; + + /** + * Creates a SpeakerDiarizationConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.SpeakerDiarizationConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.SpeakerDiarizationConfig} SpeakerDiarizationConfig + */ + SpeakerDiarizationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.SpeakerDiarizationConfig) + return object; + var message = new $root.google.cloud.speech.v2.SpeakerDiarizationConfig(); + if (object.minSpeakerCount != null) + message.minSpeakerCount = object.minSpeakerCount | 0; + if (object.maxSpeakerCount != null) + message.maxSpeakerCount = object.maxSpeakerCount | 0; + return message; + }; + + /** + * Creates a plain object from a SpeakerDiarizationConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.SpeakerDiarizationConfig + * @static + * @param {google.cloud.speech.v2.SpeakerDiarizationConfig} message SpeakerDiarizationConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpeakerDiarizationConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.minSpeakerCount = 0; + object.maxSpeakerCount = 0; + } + if (message.minSpeakerCount != null && message.hasOwnProperty("minSpeakerCount")) + object.minSpeakerCount = message.minSpeakerCount; + if (message.maxSpeakerCount != null && message.hasOwnProperty("maxSpeakerCount")) + object.maxSpeakerCount = message.maxSpeakerCount; + return object; + }; + + /** + * Converts this SpeakerDiarizationConfig to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.SpeakerDiarizationConfig + * @instance + * @returns {Object.} JSON object + */ + SpeakerDiarizationConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpeakerDiarizationConfig + * @function getTypeUrl + * @memberof google.cloud.speech.v2.SpeakerDiarizationConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpeakerDiarizationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.SpeakerDiarizationConfig"; + }; + + return SpeakerDiarizationConfig; + })(); + + v2.RecognitionFeatures = (function() { + + /** + * Properties of a RecognitionFeatures. + * @memberof google.cloud.speech.v2 + * @interface IRecognitionFeatures + * @property {boolean|null} [profanityFilter] RecognitionFeatures profanityFilter + * @property {boolean|null} [enableWordTimeOffsets] RecognitionFeatures enableWordTimeOffsets + * @property {boolean|null} [enableWordConfidence] RecognitionFeatures enableWordConfidence + * @property {boolean|null} [enableAutomaticPunctuation] RecognitionFeatures enableAutomaticPunctuation + * @property {boolean|null} [enableSpokenPunctuation] RecognitionFeatures enableSpokenPunctuation + * @property {boolean|null} [enableSpokenEmojis] RecognitionFeatures enableSpokenEmojis + * @property {google.cloud.speech.v2.RecognitionFeatures.MultiChannelMode|null} [multiChannelMode] RecognitionFeatures multiChannelMode + * @property {google.cloud.speech.v2.ISpeakerDiarizationConfig|null} [diarizationConfig] RecognitionFeatures diarizationConfig + * @property {number|null} [maxAlternatives] RecognitionFeatures maxAlternatives + */ + + /** + * Constructs a new RecognitionFeatures. + * @memberof google.cloud.speech.v2 + * @classdesc Represents a RecognitionFeatures. + * @implements IRecognitionFeatures + * @constructor + * @param {google.cloud.speech.v2.IRecognitionFeatures=} [properties] Properties to set + */ + function RecognitionFeatures(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RecognitionFeatures profanityFilter. + * @member {boolean} profanityFilter + * @memberof google.cloud.speech.v2.RecognitionFeatures + * @instance + */ + RecognitionFeatures.prototype.profanityFilter = false; + + /** + * RecognitionFeatures enableWordTimeOffsets. + * @member {boolean} enableWordTimeOffsets + * @memberof google.cloud.speech.v2.RecognitionFeatures + * @instance + */ + RecognitionFeatures.prototype.enableWordTimeOffsets = false; + + /** + * RecognitionFeatures enableWordConfidence. + * @member {boolean} enableWordConfidence + * @memberof google.cloud.speech.v2.RecognitionFeatures + * @instance + */ + RecognitionFeatures.prototype.enableWordConfidence = false; + + /** + * RecognitionFeatures enableAutomaticPunctuation. + * @member {boolean} enableAutomaticPunctuation + * @memberof google.cloud.speech.v2.RecognitionFeatures + * @instance + */ + RecognitionFeatures.prototype.enableAutomaticPunctuation = false; + + /** + * RecognitionFeatures enableSpokenPunctuation. + * @member {boolean} enableSpokenPunctuation + * @memberof google.cloud.speech.v2.RecognitionFeatures + * @instance + */ + RecognitionFeatures.prototype.enableSpokenPunctuation = false; + + /** + * RecognitionFeatures enableSpokenEmojis. + * @member {boolean} enableSpokenEmojis + * @memberof google.cloud.speech.v2.RecognitionFeatures + * @instance + */ + RecognitionFeatures.prototype.enableSpokenEmojis = false; + + /** + * RecognitionFeatures multiChannelMode. + * @member {google.cloud.speech.v2.RecognitionFeatures.MultiChannelMode} multiChannelMode + * @memberof google.cloud.speech.v2.RecognitionFeatures + * @instance + */ + RecognitionFeatures.prototype.multiChannelMode = 0; + + /** + * RecognitionFeatures diarizationConfig. + * @member {google.cloud.speech.v2.ISpeakerDiarizationConfig|null|undefined} diarizationConfig + * @memberof google.cloud.speech.v2.RecognitionFeatures + * @instance + */ + RecognitionFeatures.prototype.diarizationConfig = null; + + /** + * RecognitionFeatures maxAlternatives. + * @member {number} maxAlternatives + * @memberof google.cloud.speech.v2.RecognitionFeatures + * @instance + */ + RecognitionFeatures.prototype.maxAlternatives = 0; + + /** + * Creates a new RecognitionFeatures instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.RecognitionFeatures + * @static + * @param {google.cloud.speech.v2.IRecognitionFeatures=} [properties] Properties to set + * @returns {google.cloud.speech.v2.RecognitionFeatures} RecognitionFeatures instance + */ + RecognitionFeatures.create = function create(properties) { + return new RecognitionFeatures(properties); + }; + + /** + * Encodes the specified RecognitionFeatures message. Does not implicitly {@link google.cloud.speech.v2.RecognitionFeatures.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.RecognitionFeatures + * @static + * @param {google.cloud.speech.v2.IRecognitionFeatures} message RecognitionFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecognitionFeatures.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.profanityFilter != null && Object.hasOwnProperty.call(message, "profanityFilter")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.profanityFilter); + if (message.enableWordTimeOffsets != null && Object.hasOwnProperty.call(message, "enableWordTimeOffsets")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enableWordTimeOffsets); + if (message.enableWordConfidence != null && Object.hasOwnProperty.call(message, "enableWordConfidence")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enableWordConfidence); + if (message.enableAutomaticPunctuation != null && Object.hasOwnProperty.call(message, "enableAutomaticPunctuation")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.enableAutomaticPunctuation); + if (message.diarizationConfig != null && Object.hasOwnProperty.call(message, "diarizationConfig")) + $root.google.cloud.speech.v2.SpeakerDiarizationConfig.encode(message.diarizationConfig, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.enableSpokenPunctuation != null && Object.hasOwnProperty.call(message, "enableSpokenPunctuation")) + writer.uint32(/* id 14, wireType 0 =*/112).bool(message.enableSpokenPunctuation); + if (message.enableSpokenEmojis != null && Object.hasOwnProperty.call(message, "enableSpokenEmojis")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.enableSpokenEmojis); + if (message.maxAlternatives != null && Object.hasOwnProperty.call(message, "maxAlternatives")) + writer.uint32(/* id 16, wireType 0 =*/128).int32(message.maxAlternatives); + if (message.multiChannelMode != null && Object.hasOwnProperty.call(message, "multiChannelMode")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.multiChannelMode); + return writer; + }; + + /** + * Encodes the specified RecognitionFeatures message, length delimited. Does not implicitly {@link google.cloud.speech.v2.RecognitionFeatures.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.RecognitionFeatures + * @static + * @param {google.cloud.speech.v2.IRecognitionFeatures} message RecognitionFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecognitionFeatures.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RecognitionFeatures message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.RecognitionFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.RecognitionFeatures} RecognitionFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecognitionFeatures.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.RecognitionFeatures(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.profanityFilter = reader.bool(); + break; + } + case 2: { + message.enableWordTimeOffsets = reader.bool(); + break; + } + case 3: { + message.enableWordConfidence = reader.bool(); + break; + } + case 4: { + message.enableAutomaticPunctuation = reader.bool(); + break; + } + case 14: { + message.enableSpokenPunctuation = reader.bool(); + break; + } + case 15: { + message.enableSpokenEmojis = reader.bool(); + break; + } + case 17: { + message.multiChannelMode = reader.int32(); + break; + } + case 9: { + message.diarizationConfig = $root.google.cloud.speech.v2.SpeakerDiarizationConfig.decode(reader, reader.uint32()); + break; + } + case 16: { + message.maxAlternatives = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RecognitionFeatures message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.RecognitionFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.RecognitionFeatures} RecognitionFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecognitionFeatures.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RecognitionFeatures message. + * @function verify + * @memberof google.cloud.speech.v2.RecognitionFeatures + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RecognitionFeatures.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.profanityFilter != null && message.hasOwnProperty("profanityFilter")) + if (typeof message.profanityFilter !== "boolean") + return "profanityFilter: boolean expected"; + if (message.enableWordTimeOffsets != null && message.hasOwnProperty("enableWordTimeOffsets")) + if (typeof message.enableWordTimeOffsets !== "boolean") + return "enableWordTimeOffsets: boolean expected"; + if (message.enableWordConfidence != null && message.hasOwnProperty("enableWordConfidence")) + if (typeof message.enableWordConfidence !== "boolean") + return "enableWordConfidence: boolean expected"; + if (message.enableAutomaticPunctuation != null && message.hasOwnProperty("enableAutomaticPunctuation")) + if (typeof message.enableAutomaticPunctuation !== "boolean") + return "enableAutomaticPunctuation: boolean expected"; + if (message.enableSpokenPunctuation != null && message.hasOwnProperty("enableSpokenPunctuation")) + if (typeof message.enableSpokenPunctuation !== "boolean") + return "enableSpokenPunctuation: boolean expected"; + if (message.enableSpokenEmojis != null && message.hasOwnProperty("enableSpokenEmojis")) + if (typeof message.enableSpokenEmojis !== "boolean") + return "enableSpokenEmojis: boolean expected"; + if (message.multiChannelMode != null && message.hasOwnProperty("multiChannelMode")) + switch (message.multiChannelMode) { + default: + return "multiChannelMode: enum value expected"; + case 0: + case 1: + break; + } + if (message.diarizationConfig != null && message.hasOwnProperty("diarizationConfig")) { + var error = $root.google.cloud.speech.v2.SpeakerDiarizationConfig.verify(message.diarizationConfig); + if (error) + return "diarizationConfig." + error; + } + if (message.maxAlternatives != null && message.hasOwnProperty("maxAlternatives")) + if (!$util.isInteger(message.maxAlternatives)) + return "maxAlternatives: integer expected"; + return null; + }; + + /** + * Creates a RecognitionFeatures message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.RecognitionFeatures + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.RecognitionFeatures} RecognitionFeatures + */ + RecognitionFeatures.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.RecognitionFeatures) + return object; + var message = new $root.google.cloud.speech.v2.RecognitionFeatures(); + if (object.profanityFilter != null) + message.profanityFilter = Boolean(object.profanityFilter); + if (object.enableWordTimeOffsets != null) + message.enableWordTimeOffsets = Boolean(object.enableWordTimeOffsets); + if (object.enableWordConfidence != null) + message.enableWordConfidence = Boolean(object.enableWordConfidence); + if (object.enableAutomaticPunctuation != null) + message.enableAutomaticPunctuation = Boolean(object.enableAutomaticPunctuation); + if (object.enableSpokenPunctuation != null) + message.enableSpokenPunctuation = Boolean(object.enableSpokenPunctuation); + if (object.enableSpokenEmojis != null) + message.enableSpokenEmojis = Boolean(object.enableSpokenEmojis); + switch (object.multiChannelMode) { + default: + if (typeof object.multiChannelMode === "number") { + message.multiChannelMode = object.multiChannelMode; + break; + } + break; + case "MULTI_CHANNEL_MODE_UNSPECIFIED": + case 0: + message.multiChannelMode = 0; + break; + case "SEPARATE_RECOGNITION_PER_CHANNEL": + case 1: + message.multiChannelMode = 1; + break; + } + if (object.diarizationConfig != null) { + if (typeof object.diarizationConfig !== "object") + throw TypeError(".google.cloud.speech.v2.RecognitionFeatures.diarizationConfig: object expected"); + message.diarizationConfig = $root.google.cloud.speech.v2.SpeakerDiarizationConfig.fromObject(object.diarizationConfig); + } + if (object.maxAlternatives != null) + message.maxAlternatives = object.maxAlternatives | 0; + return message; + }; + + /** + * Creates a plain object from a RecognitionFeatures message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.RecognitionFeatures + * @static + * @param {google.cloud.speech.v2.RecognitionFeatures} message RecognitionFeatures + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RecognitionFeatures.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.profanityFilter = false; + object.enableWordTimeOffsets = false; + object.enableWordConfidence = false; + object.enableAutomaticPunctuation = false; + object.diarizationConfig = null; + object.enableSpokenPunctuation = false; + object.enableSpokenEmojis = false; + object.maxAlternatives = 0; + object.multiChannelMode = options.enums === String ? "MULTI_CHANNEL_MODE_UNSPECIFIED" : 0; + } + if (message.profanityFilter != null && message.hasOwnProperty("profanityFilter")) + object.profanityFilter = message.profanityFilter; + if (message.enableWordTimeOffsets != null && message.hasOwnProperty("enableWordTimeOffsets")) + object.enableWordTimeOffsets = message.enableWordTimeOffsets; + if (message.enableWordConfidence != null && message.hasOwnProperty("enableWordConfidence")) + object.enableWordConfidence = message.enableWordConfidence; + if (message.enableAutomaticPunctuation != null && message.hasOwnProperty("enableAutomaticPunctuation")) + object.enableAutomaticPunctuation = message.enableAutomaticPunctuation; + if (message.diarizationConfig != null && message.hasOwnProperty("diarizationConfig")) + object.diarizationConfig = $root.google.cloud.speech.v2.SpeakerDiarizationConfig.toObject(message.diarizationConfig, options); + if (message.enableSpokenPunctuation != null && message.hasOwnProperty("enableSpokenPunctuation")) + object.enableSpokenPunctuation = message.enableSpokenPunctuation; + if (message.enableSpokenEmojis != null && message.hasOwnProperty("enableSpokenEmojis")) + object.enableSpokenEmojis = message.enableSpokenEmojis; + if (message.maxAlternatives != null && message.hasOwnProperty("maxAlternatives")) + object.maxAlternatives = message.maxAlternatives; + if (message.multiChannelMode != null && message.hasOwnProperty("multiChannelMode")) + object.multiChannelMode = options.enums === String ? $root.google.cloud.speech.v2.RecognitionFeatures.MultiChannelMode[message.multiChannelMode] === undefined ? message.multiChannelMode : $root.google.cloud.speech.v2.RecognitionFeatures.MultiChannelMode[message.multiChannelMode] : message.multiChannelMode; + return object; + }; + + /** + * Converts this RecognitionFeatures to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.RecognitionFeatures + * @instance + * @returns {Object.} JSON object + */ + RecognitionFeatures.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RecognitionFeatures + * @function getTypeUrl + * @memberof google.cloud.speech.v2.RecognitionFeatures + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RecognitionFeatures.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.RecognitionFeatures"; + }; + + /** + * MultiChannelMode enum. + * @name google.cloud.speech.v2.RecognitionFeatures.MultiChannelMode + * @enum {number} + * @property {number} MULTI_CHANNEL_MODE_UNSPECIFIED=0 MULTI_CHANNEL_MODE_UNSPECIFIED value + * @property {number} SEPARATE_RECOGNITION_PER_CHANNEL=1 SEPARATE_RECOGNITION_PER_CHANNEL value + */ + RecognitionFeatures.MultiChannelMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MULTI_CHANNEL_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SEPARATE_RECOGNITION_PER_CHANNEL"] = 1; + return values; + })(); + + return RecognitionFeatures; + })(); + + v2.TranscriptNormalization = (function() { + + /** + * Properties of a TranscriptNormalization. + * @memberof google.cloud.speech.v2 + * @interface ITranscriptNormalization + * @property {Array.|null} [entries] TranscriptNormalization entries + */ + + /** + * Constructs a new TranscriptNormalization. + * @memberof google.cloud.speech.v2 + * @classdesc Represents a TranscriptNormalization. + * @implements ITranscriptNormalization + * @constructor + * @param {google.cloud.speech.v2.ITranscriptNormalization=} [properties] Properties to set + */ + function TranscriptNormalization(properties) { + this.entries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TranscriptNormalization entries. + * @member {Array.} entries + * @memberof google.cloud.speech.v2.TranscriptNormalization + * @instance + */ + TranscriptNormalization.prototype.entries = $util.emptyArray; + + /** + * Creates a new TranscriptNormalization instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.TranscriptNormalization + * @static + * @param {google.cloud.speech.v2.ITranscriptNormalization=} [properties] Properties to set + * @returns {google.cloud.speech.v2.TranscriptNormalization} TranscriptNormalization instance + */ + TranscriptNormalization.create = function create(properties) { + return new TranscriptNormalization(properties); + }; + + /** + * Encodes the specified TranscriptNormalization message. Does not implicitly {@link google.cloud.speech.v2.TranscriptNormalization.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.TranscriptNormalization + * @static + * @param {google.cloud.speech.v2.ITranscriptNormalization} message TranscriptNormalization message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranscriptNormalization.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entries != null && message.entries.length) + for (var i = 0; i < message.entries.length; ++i) + $root.google.cloud.speech.v2.TranscriptNormalization.Entry.encode(message.entries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TranscriptNormalization message, length delimited. Does not implicitly {@link google.cloud.speech.v2.TranscriptNormalization.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.TranscriptNormalization + * @static + * @param {google.cloud.speech.v2.ITranscriptNormalization} message TranscriptNormalization message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranscriptNormalization.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TranscriptNormalization message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.TranscriptNormalization + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.TranscriptNormalization} TranscriptNormalization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranscriptNormalization.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.TranscriptNormalization(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.entries && message.entries.length)) + message.entries = []; + message.entries.push($root.google.cloud.speech.v2.TranscriptNormalization.Entry.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TranscriptNormalization message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.TranscriptNormalization + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.TranscriptNormalization} TranscriptNormalization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranscriptNormalization.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TranscriptNormalization message. + * @function verify + * @memberof google.cloud.speech.v2.TranscriptNormalization + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TranscriptNormalization.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entries != null && message.hasOwnProperty("entries")) { + if (!Array.isArray(message.entries)) + return "entries: array expected"; + for (var i = 0; i < message.entries.length; ++i) { + var error = $root.google.cloud.speech.v2.TranscriptNormalization.Entry.verify(message.entries[i]); + if (error) + return "entries." + error; + } + } + return null; + }; + + /** + * Creates a TranscriptNormalization message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.TranscriptNormalization + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.TranscriptNormalization} TranscriptNormalization + */ + TranscriptNormalization.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.TranscriptNormalization) + return object; + var message = new $root.google.cloud.speech.v2.TranscriptNormalization(); + if (object.entries) { + if (!Array.isArray(object.entries)) + throw TypeError(".google.cloud.speech.v2.TranscriptNormalization.entries: array expected"); + message.entries = []; + for (var i = 0; i < object.entries.length; ++i) { + if (typeof object.entries[i] !== "object") + throw TypeError(".google.cloud.speech.v2.TranscriptNormalization.entries: object expected"); + message.entries[i] = $root.google.cloud.speech.v2.TranscriptNormalization.Entry.fromObject(object.entries[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TranscriptNormalization message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.TranscriptNormalization + * @static + * @param {google.cloud.speech.v2.TranscriptNormalization} message TranscriptNormalization + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TranscriptNormalization.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.entries = []; + if (message.entries && message.entries.length) { + object.entries = []; + for (var j = 0; j < message.entries.length; ++j) + object.entries[j] = $root.google.cloud.speech.v2.TranscriptNormalization.Entry.toObject(message.entries[j], options); + } + return object; + }; + + /** + * Converts this TranscriptNormalization to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.TranscriptNormalization + * @instance + * @returns {Object.} JSON object + */ + TranscriptNormalization.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TranscriptNormalization + * @function getTypeUrl + * @memberof google.cloud.speech.v2.TranscriptNormalization + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TranscriptNormalization.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.TranscriptNormalization"; + }; + + TranscriptNormalization.Entry = (function() { + + /** + * Properties of an Entry. + * @memberof google.cloud.speech.v2.TranscriptNormalization + * @interface IEntry + * @property {string|null} [search] Entry search + * @property {string|null} [replace] Entry replace + * @property {boolean|null} [caseSensitive] Entry caseSensitive + */ + + /** + * Constructs a new Entry. + * @memberof google.cloud.speech.v2.TranscriptNormalization + * @classdesc Represents an Entry. + * @implements IEntry + * @constructor + * @param {google.cloud.speech.v2.TranscriptNormalization.IEntry=} [properties] Properties to set + */ + function Entry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Entry search. + * @member {string} search + * @memberof google.cloud.speech.v2.TranscriptNormalization.Entry + * @instance + */ + Entry.prototype.search = ""; + + /** + * Entry replace. + * @member {string} replace + * @memberof google.cloud.speech.v2.TranscriptNormalization.Entry + * @instance + */ + Entry.prototype.replace = ""; + + /** + * Entry caseSensitive. + * @member {boolean} caseSensitive + * @memberof google.cloud.speech.v2.TranscriptNormalization.Entry + * @instance + */ + Entry.prototype.caseSensitive = false; + + /** + * Creates a new Entry instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.TranscriptNormalization.Entry + * @static + * @param {google.cloud.speech.v2.TranscriptNormalization.IEntry=} [properties] Properties to set + * @returns {google.cloud.speech.v2.TranscriptNormalization.Entry} Entry instance + */ + Entry.create = function create(properties) { + return new Entry(properties); + }; + + /** + * Encodes the specified Entry message. Does not implicitly {@link google.cloud.speech.v2.TranscriptNormalization.Entry.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.TranscriptNormalization.Entry + * @static + * @param {google.cloud.speech.v2.TranscriptNormalization.IEntry} message Entry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.search != null && Object.hasOwnProperty.call(message, "search")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.search); + if (message.replace != null && Object.hasOwnProperty.call(message, "replace")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.replace); + if (message.caseSensitive != null && Object.hasOwnProperty.call(message, "caseSensitive")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.caseSensitive); + return writer; + }; + + /** + * Encodes the specified Entry message, length delimited. Does not implicitly {@link google.cloud.speech.v2.TranscriptNormalization.Entry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.TranscriptNormalization.Entry + * @static + * @param {google.cloud.speech.v2.TranscriptNormalization.IEntry} message Entry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Entry message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.TranscriptNormalization.Entry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.TranscriptNormalization.Entry} Entry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entry.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.TranscriptNormalization.Entry(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.search = reader.string(); + break; + } + case 2: { + message.replace = reader.string(); + break; + } + case 3: { + message.caseSensitive = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Entry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.TranscriptNormalization.Entry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.TranscriptNormalization.Entry} Entry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Entry message. + * @function verify + * @memberof google.cloud.speech.v2.TranscriptNormalization.Entry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Entry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.search != null && message.hasOwnProperty("search")) + if (!$util.isString(message.search)) + return "search: string expected"; + if (message.replace != null && message.hasOwnProperty("replace")) + if (!$util.isString(message.replace)) + return "replace: string expected"; + if (message.caseSensitive != null && message.hasOwnProperty("caseSensitive")) + if (typeof message.caseSensitive !== "boolean") + return "caseSensitive: boolean expected"; + return null; + }; + + /** + * Creates an Entry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.TranscriptNormalization.Entry + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.TranscriptNormalization.Entry} Entry + */ + Entry.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.TranscriptNormalization.Entry) + return object; + var message = new $root.google.cloud.speech.v2.TranscriptNormalization.Entry(); + if (object.search != null) + message.search = String(object.search); + if (object.replace != null) + message.replace = String(object.replace); + if (object.caseSensitive != null) + message.caseSensitive = Boolean(object.caseSensitive); + return message; + }; + + /** + * Creates a plain object from an Entry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.TranscriptNormalization.Entry + * @static + * @param {google.cloud.speech.v2.TranscriptNormalization.Entry} message Entry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Entry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.search = ""; + object.replace = ""; + object.caseSensitive = false; + } + if (message.search != null && message.hasOwnProperty("search")) + object.search = message.search; + if (message.replace != null && message.hasOwnProperty("replace")) + object.replace = message.replace; + if (message.caseSensitive != null && message.hasOwnProperty("caseSensitive")) + object.caseSensitive = message.caseSensitive; + return object; + }; + + /** + * Converts this Entry to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.TranscriptNormalization.Entry + * @instance + * @returns {Object.} JSON object + */ + Entry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Entry + * @function getTypeUrl + * @memberof google.cloud.speech.v2.TranscriptNormalization.Entry + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Entry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.TranscriptNormalization.Entry"; + }; + + return Entry; + })(); + + return TranscriptNormalization; + })(); + + v2.TranslationConfig = (function() { + + /** + * Properties of a TranslationConfig. + * @memberof google.cloud.speech.v2 + * @interface ITranslationConfig + * @property {string|null} [targetLanguage] TranslationConfig targetLanguage + */ + + /** + * Constructs a new TranslationConfig. + * @memberof google.cloud.speech.v2 + * @classdesc Represents a TranslationConfig. + * @implements ITranslationConfig + * @constructor + * @param {google.cloud.speech.v2.ITranslationConfig=} [properties] Properties to set + */ + function TranslationConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TranslationConfig targetLanguage. + * @member {string} targetLanguage + * @memberof google.cloud.speech.v2.TranslationConfig + * @instance + */ + TranslationConfig.prototype.targetLanguage = ""; + + /** + * Creates a new TranslationConfig instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.TranslationConfig + * @static + * @param {google.cloud.speech.v2.ITranslationConfig=} [properties] Properties to set + * @returns {google.cloud.speech.v2.TranslationConfig} TranslationConfig instance + */ + TranslationConfig.create = function create(properties) { + return new TranslationConfig(properties); + }; + + /** + * Encodes the specified TranslationConfig message. Does not implicitly {@link google.cloud.speech.v2.TranslationConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.TranslationConfig + * @static + * @param {google.cloud.speech.v2.ITranslationConfig} message TranslationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranslationConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.targetLanguage != null && Object.hasOwnProperty.call(message, "targetLanguage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.targetLanguage); + return writer; + }; + + /** + * Encodes the specified TranslationConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v2.TranslationConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.TranslationConfig + * @static + * @param {google.cloud.speech.v2.ITranslationConfig} message TranslationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranslationConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TranslationConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.TranslationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.TranslationConfig} TranslationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranslationConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.TranslationConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.targetLanguage = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TranslationConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.TranslationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.TranslationConfig} TranslationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranslationConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TranslationConfig message. + * @function verify + * @memberof google.cloud.speech.v2.TranslationConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TranslationConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.targetLanguage != null && message.hasOwnProperty("targetLanguage")) + if (!$util.isString(message.targetLanguage)) + return "targetLanguage: string expected"; + return null; + }; + + /** + * Creates a TranslationConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.TranslationConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.TranslationConfig} TranslationConfig + */ + TranslationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.TranslationConfig) + return object; + var message = new $root.google.cloud.speech.v2.TranslationConfig(); + if (object.targetLanguage != null) + message.targetLanguage = String(object.targetLanguage); + return message; + }; + + /** + * Creates a plain object from a TranslationConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.TranslationConfig + * @static + * @param {google.cloud.speech.v2.TranslationConfig} message TranslationConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TranslationConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.targetLanguage = ""; + if (message.targetLanguage != null && message.hasOwnProperty("targetLanguage")) + object.targetLanguage = message.targetLanguage; + return object; + }; + + /** + * Converts this TranslationConfig to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.TranslationConfig + * @instance + * @returns {Object.} JSON object + */ + TranslationConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TranslationConfig + * @function getTypeUrl + * @memberof google.cloud.speech.v2.TranslationConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TranslationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.TranslationConfig"; + }; + + return TranslationConfig; + })(); + + v2.SpeechAdaptation = (function() { + + /** + * Properties of a SpeechAdaptation. + * @memberof google.cloud.speech.v2 + * @interface ISpeechAdaptation + * @property {Array.|null} [phraseSets] SpeechAdaptation phraseSets + * @property {Array.|null} [customClasses] SpeechAdaptation customClasses + */ + + /** + * Constructs a new SpeechAdaptation. + * @memberof google.cloud.speech.v2 + * @classdesc Represents a SpeechAdaptation. + * @implements ISpeechAdaptation + * @constructor + * @param {google.cloud.speech.v2.ISpeechAdaptation=} [properties] Properties to set + */ + function SpeechAdaptation(properties) { + this.phraseSets = []; + this.customClasses = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpeechAdaptation phraseSets. + * @member {Array.} phraseSets + * @memberof google.cloud.speech.v2.SpeechAdaptation + * @instance + */ + SpeechAdaptation.prototype.phraseSets = $util.emptyArray; + + /** + * SpeechAdaptation customClasses. + * @member {Array.} customClasses + * @memberof google.cloud.speech.v2.SpeechAdaptation + * @instance + */ + SpeechAdaptation.prototype.customClasses = $util.emptyArray; + + /** + * Creates a new SpeechAdaptation instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.SpeechAdaptation + * @static + * @param {google.cloud.speech.v2.ISpeechAdaptation=} [properties] Properties to set + * @returns {google.cloud.speech.v2.SpeechAdaptation} SpeechAdaptation instance + */ + SpeechAdaptation.create = function create(properties) { + return new SpeechAdaptation(properties); + }; + + /** + * Encodes the specified SpeechAdaptation message. Does not implicitly {@link google.cloud.speech.v2.SpeechAdaptation.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.SpeechAdaptation + * @static + * @param {google.cloud.speech.v2.ISpeechAdaptation} message SpeechAdaptation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechAdaptation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.phraseSets != null && message.phraseSets.length) + for (var i = 0; i < message.phraseSets.length; ++i) + $root.google.cloud.speech.v2.SpeechAdaptation.AdaptationPhraseSet.encode(message.phraseSets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.customClasses != null && message.customClasses.length) + for (var i = 0; i < message.customClasses.length; ++i) + $root.google.cloud.speech.v2.CustomClass.encode(message.customClasses[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SpeechAdaptation message, length delimited. Does not implicitly {@link google.cloud.speech.v2.SpeechAdaptation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.SpeechAdaptation + * @static + * @param {google.cloud.speech.v2.ISpeechAdaptation} message SpeechAdaptation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechAdaptation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpeechAdaptation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.SpeechAdaptation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.SpeechAdaptation} SpeechAdaptation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechAdaptation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.SpeechAdaptation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.phraseSets && message.phraseSets.length)) + message.phraseSets = []; + message.phraseSets.push($root.google.cloud.speech.v2.SpeechAdaptation.AdaptationPhraseSet.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.customClasses && message.customClasses.length)) + message.customClasses = []; + message.customClasses.push($root.google.cloud.speech.v2.CustomClass.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpeechAdaptation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.SpeechAdaptation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.SpeechAdaptation} SpeechAdaptation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechAdaptation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpeechAdaptation message. + * @function verify + * @memberof google.cloud.speech.v2.SpeechAdaptation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpeechAdaptation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.phraseSets != null && message.hasOwnProperty("phraseSets")) { + if (!Array.isArray(message.phraseSets)) + return "phraseSets: array expected"; + for (var i = 0; i < message.phraseSets.length; ++i) { + var error = $root.google.cloud.speech.v2.SpeechAdaptation.AdaptationPhraseSet.verify(message.phraseSets[i]); + if (error) + return "phraseSets." + error; + } + } + if (message.customClasses != null && message.hasOwnProperty("customClasses")) { + if (!Array.isArray(message.customClasses)) + return "customClasses: array expected"; + for (var i = 0; i < message.customClasses.length; ++i) { + var error = $root.google.cloud.speech.v2.CustomClass.verify(message.customClasses[i]); + if (error) + return "customClasses." + error; + } + } + return null; + }; + + /** + * Creates a SpeechAdaptation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.SpeechAdaptation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.SpeechAdaptation} SpeechAdaptation + */ + SpeechAdaptation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.SpeechAdaptation) + return object; + var message = new $root.google.cloud.speech.v2.SpeechAdaptation(); + if (object.phraseSets) { + if (!Array.isArray(object.phraseSets)) + throw TypeError(".google.cloud.speech.v2.SpeechAdaptation.phraseSets: array expected"); + message.phraseSets = []; + for (var i = 0; i < object.phraseSets.length; ++i) { + if (typeof object.phraseSets[i] !== "object") + throw TypeError(".google.cloud.speech.v2.SpeechAdaptation.phraseSets: object expected"); + message.phraseSets[i] = $root.google.cloud.speech.v2.SpeechAdaptation.AdaptationPhraseSet.fromObject(object.phraseSets[i]); + } + } + if (object.customClasses) { + if (!Array.isArray(object.customClasses)) + throw TypeError(".google.cloud.speech.v2.SpeechAdaptation.customClasses: array expected"); + message.customClasses = []; + for (var i = 0; i < object.customClasses.length; ++i) { + if (typeof object.customClasses[i] !== "object") + throw TypeError(".google.cloud.speech.v2.SpeechAdaptation.customClasses: object expected"); + message.customClasses[i] = $root.google.cloud.speech.v2.CustomClass.fromObject(object.customClasses[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SpeechAdaptation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.SpeechAdaptation + * @static + * @param {google.cloud.speech.v2.SpeechAdaptation} message SpeechAdaptation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpeechAdaptation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.phraseSets = []; + object.customClasses = []; + } + if (message.phraseSets && message.phraseSets.length) { + object.phraseSets = []; + for (var j = 0; j < message.phraseSets.length; ++j) + object.phraseSets[j] = $root.google.cloud.speech.v2.SpeechAdaptation.AdaptationPhraseSet.toObject(message.phraseSets[j], options); + } + if (message.customClasses && message.customClasses.length) { + object.customClasses = []; + for (var j = 0; j < message.customClasses.length; ++j) + object.customClasses[j] = $root.google.cloud.speech.v2.CustomClass.toObject(message.customClasses[j], options); + } + return object; + }; + + /** + * Converts this SpeechAdaptation to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.SpeechAdaptation + * @instance + * @returns {Object.} JSON object + */ + SpeechAdaptation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpeechAdaptation + * @function getTypeUrl + * @memberof google.cloud.speech.v2.SpeechAdaptation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpeechAdaptation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.SpeechAdaptation"; + }; + + SpeechAdaptation.AdaptationPhraseSet = (function() { + + /** + * Properties of an AdaptationPhraseSet. + * @memberof google.cloud.speech.v2.SpeechAdaptation + * @interface IAdaptationPhraseSet + * @property {string|null} [phraseSet] AdaptationPhraseSet phraseSet + * @property {google.cloud.speech.v2.IPhraseSet|null} [inlinePhraseSet] AdaptationPhraseSet inlinePhraseSet + */ + + /** + * Constructs a new AdaptationPhraseSet. + * @memberof google.cloud.speech.v2.SpeechAdaptation + * @classdesc Represents an AdaptationPhraseSet. + * @implements IAdaptationPhraseSet + * @constructor + * @param {google.cloud.speech.v2.SpeechAdaptation.IAdaptationPhraseSet=} [properties] Properties to set + */ + function AdaptationPhraseSet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AdaptationPhraseSet phraseSet. + * @member {string|null|undefined} phraseSet + * @memberof google.cloud.speech.v2.SpeechAdaptation.AdaptationPhraseSet + * @instance + */ + AdaptationPhraseSet.prototype.phraseSet = null; + + /** + * AdaptationPhraseSet inlinePhraseSet. + * @member {google.cloud.speech.v2.IPhraseSet|null|undefined} inlinePhraseSet + * @memberof google.cloud.speech.v2.SpeechAdaptation.AdaptationPhraseSet + * @instance + */ + AdaptationPhraseSet.prototype.inlinePhraseSet = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AdaptationPhraseSet value. + * @member {"phraseSet"|"inlinePhraseSet"|undefined} value + * @memberof google.cloud.speech.v2.SpeechAdaptation.AdaptationPhraseSet + * @instance + */ + Object.defineProperty(AdaptationPhraseSet.prototype, "value", { + get: $util.oneOfGetter($oneOfFields = ["phraseSet", "inlinePhraseSet"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AdaptationPhraseSet instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.SpeechAdaptation.AdaptationPhraseSet + * @static + * @param {google.cloud.speech.v2.SpeechAdaptation.IAdaptationPhraseSet=} [properties] Properties to set + * @returns {google.cloud.speech.v2.SpeechAdaptation.AdaptationPhraseSet} AdaptationPhraseSet instance + */ + AdaptationPhraseSet.create = function create(properties) { + return new AdaptationPhraseSet(properties); + }; + + /** + * Encodes the specified AdaptationPhraseSet message. Does not implicitly {@link google.cloud.speech.v2.SpeechAdaptation.AdaptationPhraseSet.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.SpeechAdaptation.AdaptationPhraseSet + * @static + * @param {google.cloud.speech.v2.SpeechAdaptation.IAdaptationPhraseSet} message AdaptationPhraseSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AdaptationPhraseSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.phraseSet != null && Object.hasOwnProperty.call(message, "phraseSet")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.phraseSet); + if (message.inlinePhraseSet != null && Object.hasOwnProperty.call(message, "inlinePhraseSet")) + $root.google.cloud.speech.v2.PhraseSet.encode(message.inlinePhraseSet, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AdaptationPhraseSet message, length delimited. Does not implicitly {@link google.cloud.speech.v2.SpeechAdaptation.AdaptationPhraseSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.SpeechAdaptation.AdaptationPhraseSet + * @static + * @param {google.cloud.speech.v2.SpeechAdaptation.IAdaptationPhraseSet} message AdaptationPhraseSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AdaptationPhraseSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AdaptationPhraseSet message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.SpeechAdaptation.AdaptationPhraseSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.SpeechAdaptation.AdaptationPhraseSet} AdaptationPhraseSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AdaptationPhraseSet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.SpeechAdaptation.AdaptationPhraseSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.phraseSet = reader.string(); + break; + } + case 2: { + message.inlinePhraseSet = $root.google.cloud.speech.v2.PhraseSet.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AdaptationPhraseSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.SpeechAdaptation.AdaptationPhraseSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.SpeechAdaptation.AdaptationPhraseSet} AdaptationPhraseSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AdaptationPhraseSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AdaptationPhraseSet message. + * @function verify + * @memberof google.cloud.speech.v2.SpeechAdaptation.AdaptationPhraseSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AdaptationPhraseSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.phraseSet != null && message.hasOwnProperty("phraseSet")) { + properties.value = 1; + if (!$util.isString(message.phraseSet)) + return "phraseSet: string expected"; + } + if (message.inlinePhraseSet != null && message.hasOwnProperty("inlinePhraseSet")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.cloud.speech.v2.PhraseSet.verify(message.inlinePhraseSet); + if (error) + return "inlinePhraseSet." + error; + } + } + return null; + }; + + /** + * Creates an AdaptationPhraseSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.SpeechAdaptation.AdaptationPhraseSet + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.SpeechAdaptation.AdaptationPhraseSet} AdaptationPhraseSet + */ + AdaptationPhraseSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.SpeechAdaptation.AdaptationPhraseSet) + return object; + var message = new $root.google.cloud.speech.v2.SpeechAdaptation.AdaptationPhraseSet(); + if (object.phraseSet != null) + message.phraseSet = String(object.phraseSet); + if (object.inlinePhraseSet != null) { + if (typeof object.inlinePhraseSet !== "object") + throw TypeError(".google.cloud.speech.v2.SpeechAdaptation.AdaptationPhraseSet.inlinePhraseSet: object expected"); + message.inlinePhraseSet = $root.google.cloud.speech.v2.PhraseSet.fromObject(object.inlinePhraseSet); + } + return message; + }; + + /** + * Creates a plain object from an AdaptationPhraseSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.SpeechAdaptation.AdaptationPhraseSet + * @static + * @param {google.cloud.speech.v2.SpeechAdaptation.AdaptationPhraseSet} message AdaptationPhraseSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AdaptationPhraseSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.phraseSet != null && message.hasOwnProperty("phraseSet")) { + object.phraseSet = message.phraseSet; + if (options.oneofs) + object.value = "phraseSet"; + } + if (message.inlinePhraseSet != null && message.hasOwnProperty("inlinePhraseSet")) { + object.inlinePhraseSet = $root.google.cloud.speech.v2.PhraseSet.toObject(message.inlinePhraseSet, options); + if (options.oneofs) + object.value = "inlinePhraseSet"; + } + return object; + }; + + /** + * Converts this AdaptationPhraseSet to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.SpeechAdaptation.AdaptationPhraseSet + * @instance + * @returns {Object.} JSON object + */ + AdaptationPhraseSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AdaptationPhraseSet + * @function getTypeUrl + * @memberof google.cloud.speech.v2.SpeechAdaptation.AdaptationPhraseSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AdaptationPhraseSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.SpeechAdaptation.AdaptationPhraseSet"; + }; + + return AdaptationPhraseSet; + })(); + + return SpeechAdaptation; + })(); + + v2.RecognitionConfig = (function() { + + /** + * Properties of a RecognitionConfig. + * @memberof google.cloud.speech.v2 + * @interface IRecognitionConfig + * @property {google.cloud.speech.v2.IAutoDetectDecodingConfig|null} [autoDecodingConfig] RecognitionConfig autoDecodingConfig + * @property {google.cloud.speech.v2.IExplicitDecodingConfig|null} [explicitDecodingConfig] RecognitionConfig explicitDecodingConfig + * @property {string|null} [model] RecognitionConfig model + * @property {Array.|null} [languageCodes] RecognitionConfig languageCodes + * @property {google.cloud.speech.v2.IRecognitionFeatures|null} [features] RecognitionConfig features + * @property {google.cloud.speech.v2.ISpeechAdaptation|null} [adaptation] RecognitionConfig adaptation + * @property {google.cloud.speech.v2.ITranscriptNormalization|null} [transcriptNormalization] RecognitionConfig transcriptNormalization + * @property {google.cloud.speech.v2.ITranslationConfig|null} [translationConfig] RecognitionConfig translationConfig + */ + + /** + * Constructs a new RecognitionConfig. + * @memberof google.cloud.speech.v2 + * @classdesc Represents a RecognitionConfig. + * @implements IRecognitionConfig + * @constructor + * @param {google.cloud.speech.v2.IRecognitionConfig=} [properties] Properties to set + */ + function RecognitionConfig(properties) { + this.languageCodes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RecognitionConfig autoDecodingConfig. + * @member {google.cloud.speech.v2.IAutoDetectDecodingConfig|null|undefined} autoDecodingConfig + * @memberof google.cloud.speech.v2.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.autoDecodingConfig = null; + + /** + * RecognitionConfig explicitDecodingConfig. + * @member {google.cloud.speech.v2.IExplicitDecodingConfig|null|undefined} explicitDecodingConfig + * @memberof google.cloud.speech.v2.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.explicitDecodingConfig = null; + + /** + * RecognitionConfig model. + * @member {string} model + * @memberof google.cloud.speech.v2.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.model = ""; + + /** + * RecognitionConfig languageCodes. + * @member {Array.} languageCodes + * @memberof google.cloud.speech.v2.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.languageCodes = $util.emptyArray; + + /** + * RecognitionConfig features. + * @member {google.cloud.speech.v2.IRecognitionFeatures|null|undefined} features + * @memberof google.cloud.speech.v2.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.features = null; + + /** + * RecognitionConfig adaptation. + * @member {google.cloud.speech.v2.ISpeechAdaptation|null|undefined} adaptation + * @memberof google.cloud.speech.v2.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.adaptation = null; + + /** + * RecognitionConfig transcriptNormalization. + * @member {google.cloud.speech.v2.ITranscriptNormalization|null|undefined} transcriptNormalization + * @memberof google.cloud.speech.v2.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.transcriptNormalization = null; + + /** + * RecognitionConfig translationConfig. + * @member {google.cloud.speech.v2.ITranslationConfig|null|undefined} translationConfig + * @memberof google.cloud.speech.v2.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.translationConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RecognitionConfig decodingConfig. + * @member {"autoDecodingConfig"|"explicitDecodingConfig"|undefined} decodingConfig + * @memberof google.cloud.speech.v2.RecognitionConfig + * @instance + */ + Object.defineProperty(RecognitionConfig.prototype, "decodingConfig", { + get: $util.oneOfGetter($oneOfFields = ["autoDecodingConfig", "explicitDecodingConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RecognitionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.RecognitionConfig + * @static + * @param {google.cloud.speech.v2.IRecognitionConfig=} [properties] Properties to set + * @returns {google.cloud.speech.v2.RecognitionConfig} RecognitionConfig instance + */ + RecognitionConfig.create = function create(properties) { + return new RecognitionConfig(properties); + }; + + /** + * Encodes the specified RecognitionConfig message. Does not implicitly {@link google.cloud.speech.v2.RecognitionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.RecognitionConfig + * @static + * @param {google.cloud.speech.v2.IRecognitionConfig} message RecognitionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecognitionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.cloud.speech.v2.RecognitionFeatures.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.adaptation != null && Object.hasOwnProperty.call(message, "adaptation")) + $root.google.cloud.speech.v2.SpeechAdaptation.encode(message.adaptation, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.autoDecodingConfig != null && Object.hasOwnProperty.call(message, "autoDecodingConfig")) + $root.google.cloud.speech.v2.AutoDetectDecodingConfig.encode(message.autoDecodingConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.explicitDecodingConfig != null && Object.hasOwnProperty.call(message, "explicitDecodingConfig")) + $root.google.cloud.speech.v2.ExplicitDecodingConfig.encode(message.explicitDecodingConfig, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.model); + if (message.languageCodes != null && message.languageCodes.length) + for (var i = 0; i < message.languageCodes.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.languageCodes[i]); + if (message.transcriptNormalization != null && Object.hasOwnProperty.call(message, "transcriptNormalization")) + $root.google.cloud.speech.v2.TranscriptNormalization.encode(message.transcriptNormalization, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.translationConfig != null && Object.hasOwnProperty.call(message, "translationConfig")) + $root.google.cloud.speech.v2.TranslationConfig.encode(message.translationConfig, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RecognitionConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v2.RecognitionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.RecognitionConfig + * @static + * @param {google.cloud.speech.v2.IRecognitionConfig} message RecognitionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecognitionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RecognitionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.RecognitionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.RecognitionConfig} RecognitionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecognitionConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.RecognitionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 7: { + message.autoDecodingConfig = $root.google.cloud.speech.v2.AutoDetectDecodingConfig.decode(reader, reader.uint32()); + break; + } + case 8: { + message.explicitDecodingConfig = $root.google.cloud.speech.v2.ExplicitDecodingConfig.decode(reader, reader.uint32()); + break; + } + case 9: { + message.model = reader.string(); + break; + } + case 10: { + if (!(message.languageCodes && message.languageCodes.length)) + message.languageCodes = []; + message.languageCodes.push(reader.string()); + break; + } + case 2: { + message.features = $root.google.cloud.speech.v2.RecognitionFeatures.decode(reader, reader.uint32()); + break; + } + case 6: { + message.adaptation = $root.google.cloud.speech.v2.SpeechAdaptation.decode(reader, reader.uint32()); + break; + } + case 11: { + message.transcriptNormalization = $root.google.cloud.speech.v2.TranscriptNormalization.decode(reader, reader.uint32()); + break; + } + case 15: { + message.translationConfig = $root.google.cloud.speech.v2.TranslationConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RecognitionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.RecognitionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.RecognitionConfig} RecognitionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecognitionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RecognitionConfig message. + * @function verify + * @memberof google.cloud.speech.v2.RecognitionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RecognitionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.autoDecodingConfig != null && message.hasOwnProperty("autoDecodingConfig")) { + properties.decodingConfig = 1; + { + var error = $root.google.cloud.speech.v2.AutoDetectDecodingConfig.verify(message.autoDecodingConfig); + if (error) + return "autoDecodingConfig." + error; + } + } + if (message.explicitDecodingConfig != null && message.hasOwnProperty("explicitDecodingConfig")) { + if (properties.decodingConfig === 1) + return "decodingConfig: multiple values"; + properties.decodingConfig = 1; + { + var error = $root.google.cloud.speech.v2.ExplicitDecodingConfig.verify(message.explicitDecodingConfig); + if (error) + return "explicitDecodingConfig." + error; + } + } + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.languageCodes != null && message.hasOwnProperty("languageCodes")) { + if (!Array.isArray(message.languageCodes)) + return "languageCodes: array expected"; + for (var i = 0; i < message.languageCodes.length; ++i) + if (!$util.isString(message.languageCodes[i])) + return "languageCodes: string[] expected"; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.cloud.speech.v2.RecognitionFeatures.verify(message.features); + if (error) + return "features." + error; + } + if (message.adaptation != null && message.hasOwnProperty("adaptation")) { + var error = $root.google.cloud.speech.v2.SpeechAdaptation.verify(message.adaptation); + if (error) + return "adaptation." + error; + } + if (message.transcriptNormalization != null && message.hasOwnProperty("transcriptNormalization")) { + var error = $root.google.cloud.speech.v2.TranscriptNormalization.verify(message.transcriptNormalization); + if (error) + return "transcriptNormalization." + error; + } + if (message.translationConfig != null && message.hasOwnProperty("translationConfig")) { + var error = $root.google.cloud.speech.v2.TranslationConfig.verify(message.translationConfig); + if (error) + return "translationConfig." + error; + } + return null; + }; + + /** + * Creates a RecognitionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.RecognitionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.RecognitionConfig} RecognitionConfig + */ + RecognitionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.RecognitionConfig) + return object; + var message = new $root.google.cloud.speech.v2.RecognitionConfig(); + if (object.autoDecodingConfig != null) { + if (typeof object.autoDecodingConfig !== "object") + throw TypeError(".google.cloud.speech.v2.RecognitionConfig.autoDecodingConfig: object expected"); + message.autoDecodingConfig = $root.google.cloud.speech.v2.AutoDetectDecodingConfig.fromObject(object.autoDecodingConfig); + } + if (object.explicitDecodingConfig != null) { + if (typeof object.explicitDecodingConfig !== "object") + throw TypeError(".google.cloud.speech.v2.RecognitionConfig.explicitDecodingConfig: object expected"); + message.explicitDecodingConfig = $root.google.cloud.speech.v2.ExplicitDecodingConfig.fromObject(object.explicitDecodingConfig); + } + if (object.model != null) + message.model = String(object.model); + if (object.languageCodes) { + if (!Array.isArray(object.languageCodes)) + throw TypeError(".google.cloud.speech.v2.RecognitionConfig.languageCodes: array expected"); + message.languageCodes = []; + for (var i = 0; i < object.languageCodes.length; ++i) + message.languageCodes[i] = String(object.languageCodes[i]); + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.cloud.speech.v2.RecognitionConfig.features: object expected"); + message.features = $root.google.cloud.speech.v2.RecognitionFeatures.fromObject(object.features); + } + if (object.adaptation != null) { + if (typeof object.adaptation !== "object") + throw TypeError(".google.cloud.speech.v2.RecognitionConfig.adaptation: object expected"); + message.adaptation = $root.google.cloud.speech.v2.SpeechAdaptation.fromObject(object.adaptation); + } + if (object.transcriptNormalization != null) { + if (typeof object.transcriptNormalization !== "object") + throw TypeError(".google.cloud.speech.v2.RecognitionConfig.transcriptNormalization: object expected"); + message.transcriptNormalization = $root.google.cloud.speech.v2.TranscriptNormalization.fromObject(object.transcriptNormalization); + } + if (object.translationConfig != null) { + if (typeof object.translationConfig !== "object") + throw TypeError(".google.cloud.speech.v2.RecognitionConfig.translationConfig: object expected"); + message.translationConfig = $root.google.cloud.speech.v2.TranslationConfig.fromObject(object.translationConfig); + } + return message; + }; + + /** + * Creates a plain object from a RecognitionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.RecognitionConfig + * @static + * @param {google.cloud.speech.v2.RecognitionConfig} message RecognitionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RecognitionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.languageCodes = []; + if (options.defaults) { + object.features = null; + object.adaptation = null; + object.model = ""; + object.transcriptNormalization = null; + object.translationConfig = null; + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.cloud.speech.v2.RecognitionFeatures.toObject(message.features, options); + if (message.adaptation != null && message.hasOwnProperty("adaptation")) + object.adaptation = $root.google.cloud.speech.v2.SpeechAdaptation.toObject(message.adaptation, options); + if (message.autoDecodingConfig != null && message.hasOwnProperty("autoDecodingConfig")) { + object.autoDecodingConfig = $root.google.cloud.speech.v2.AutoDetectDecodingConfig.toObject(message.autoDecodingConfig, options); + if (options.oneofs) + object.decodingConfig = "autoDecodingConfig"; + } + if (message.explicitDecodingConfig != null && message.hasOwnProperty("explicitDecodingConfig")) { + object.explicitDecodingConfig = $root.google.cloud.speech.v2.ExplicitDecodingConfig.toObject(message.explicitDecodingConfig, options); + if (options.oneofs) + object.decodingConfig = "explicitDecodingConfig"; + } + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.languageCodes && message.languageCodes.length) { + object.languageCodes = []; + for (var j = 0; j < message.languageCodes.length; ++j) + object.languageCodes[j] = message.languageCodes[j]; + } + if (message.transcriptNormalization != null && message.hasOwnProperty("transcriptNormalization")) + object.transcriptNormalization = $root.google.cloud.speech.v2.TranscriptNormalization.toObject(message.transcriptNormalization, options); + if (message.translationConfig != null && message.hasOwnProperty("translationConfig")) + object.translationConfig = $root.google.cloud.speech.v2.TranslationConfig.toObject(message.translationConfig, options); + return object; + }; + + /** + * Converts this RecognitionConfig to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.RecognitionConfig + * @instance + * @returns {Object.} JSON object + */ + RecognitionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RecognitionConfig + * @function getTypeUrl + * @memberof google.cloud.speech.v2.RecognitionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RecognitionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.RecognitionConfig"; + }; + + return RecognitionConfig; + })(); + + v2.RecognizeRequest = (function() { + + /** + * Properties of a RecognizeRequest. + * @memberof google.cloud.speech.v2 + * @interface IRecognizeRequest + * @property {string|null} [recognizer] RecognizeRequest recognizer + * @property {google.cloud.speech.v2.IRecognitionConfig|null} [config] RecognizeRequest config + * @property {google.protobuf.IFieldMask|null} [configMask] RecognizeRequest configMask + * @property {Uint8Array|null} [content] RecognizeRequest content + * @property {string|null} [uri] RecognizeRequest uri + */ + + /** + * Constructs a new RecognizeRequest. + * @memberof google.cloud.speech.v2 + * @classdesc Represents a RecognizeRequest. + * @implements IRecognizeRequest + * @constructor + * @param {google.cloud.speech.v2.IRecognizeRequest=} [properties] Properties to set + */ + function RecognizeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RecognizeRequest recognizer. + * @member {string} recognizer + * @memberof google.cloud.speech.v2.RecognizeRequest + * @instance + */ + RecognizeRequest.prototype.recognizer = ""; + + /** + * RecognizeRequest config. + * @member {google.cloud.speech.v2.IRecognitionConfig|null|undefined} config + * @memberof google.cloud.speech.v2.RecognizeRequest + * @instance + */ + RecognizeRequest.prototype.config = null; + + /** + * RecognizeRequest configMask. + * @member {google.protobuf.IFieldMask|null|undefined} configMask + * @memberof google.cloud.speech.v2.RecognizeRequest + * @instance + */ + RecognizeRequest.prototype.configMask = null; + + /** + * RecognizeRequest content. + * @member {Uint8Array|null|undefined} content + * @memberof google.cloud.speech.v2.RecognizeRequest + * @instance + */ + RecognizeRequest.prototype.content = null; + + /** + * RecognizeRequest uri. + * @member {string|null|undefined} uri + * @memberof google.cloud.speech.v2.RecognizeRequest + * @instance + */ + RecognizeRequest.prototype.uri = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RecognizeRequest audioSource. + * @member {"content"|"uri"|undefined} audioSource + * @memberof google.cloud.speech.v2.RecognizeRequest + * @instance + */ + Object.defineProperty(RecognizeRequest.prototype, "audioSource", { + get: $util.oneOfGetter($oneOfFields = ["content", "uri"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RecognizeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.RecognizeRequest + * @static + * @param {google.cloud.speech.v2.IRecognizeRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v2.RecognizeRequest} RecognizeRequest instance + */ + RecognizeRequest.create = function create(properties) { + return new RecognizeRequest(properties); + }; + + /** + * Encodes the specified RecognizeRequest message. Does not implicitly {@link google.cloud.speech.v2.RecognizeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.RecognizeRequest + * @static + * @param {google.cloud.speech.v2.IRecognizeRequest} message RecognizeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecognizeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.cloud.speech.v2.RecognitionConfig.encode(message.config, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.recognizer != null && Object.hasOwnProperty.call(message, "recognizer")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.recognizer); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.content); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.uri); + if (message.configMask != null && Object.hasOwnProperty.call(message, "configMask")) + $root.google.protobuf.FieldMask.encode(message.configMask, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RecognizeRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v2.RecognizeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.RecognizeRequest + * @static + * @param {google.cloud.speech.v2.IRecognizeRequest} message RecognizeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecognizeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RecognizeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.RecognizeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.RecognizeRequest} RecognizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecognizeRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.RecognizeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.recognizer = reader.string(); + break; + } + case 1: { + message.config = $root.google.cloud.speech.v2.RecognitionConfig.decode(reader, reader.uint32()); + break; + } + case 8: { + message.configMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 5: { + message.content = reader.bytes(); + break; + } + case 6: { + message.uri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RecognizeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.RecognizeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.RecognizeRequest} RecognizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecognizeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RecognizeRequest message. + * @function verify + * @memberof google.cloud.speech.v2.RecognizeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RecognizeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.recognizer != null && message.hasOwnProperty("recognizer")) + if (!$util.isString(message.recognizer)) + return "recognizer: string expected"; + if (message.config != null && message.hasOwnProperty("config")) { + var error = $root.google.cloud.speech.v2.RecognitionConfig.verify(message.config); + if (error) + return "config." + error; + } + if (message.configMask != null && message.hasOwnProperty("configMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.configMask); + if (error) + return "configMask." + error; + } + if (message.content != null && message.hasOwnProperty("content")) { + properties.audioSource = 1; + if (!(message.content && typeof message.content.length === "number" || $util.isString(message.content))) + return "content: buffer expected"; + } + if (message.uri != null && message.hasOwnProperty("uri")) { + if (properties.audioSource === 1) + return "audioSource: multiple values"; + properties.audioSource = 1; + if (!$util.isString(message.uri)) + return "uri: string expected"; + } + return null; + }; + + /** + * Creates a RecognizeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.RecognizeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.RecognizeRequest} RecognizeRequest + */ + RecognizeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.RecognizeRequest) + return object; + var message = new $root.google.cloud.speech.v2.RecognizeRequest(); + if (object.recognizer != null) + message.recognizer = String(object.recognizer); + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.cloud.speech.v2.RecognizeRequest.config: object expected"); + message.config = $root.google.cloud.speech.v2.RecognitionConfig.fromObject(object.config); + } + if (object.configMask != null) { + if (typeof object.configMask !== "object") + throw TypeError(".google.cloud.speech.v2.RecognizeRequest.configMask: object expected"); + message.configMask = $root.google.protobuf.FieldMask.fromObject(object.configMask); + } + if (object.content != null) + if (typeof object.content === "string") + $util.base64.decode(object.content, message.content = $util.newBuffer($util.base64.length(object.content)), 0); + else if (object.content.length >= 0) + message.content = object.content; + if (object.uri != null) + message.uri = String(object.uri); + return message; + }; + + /** + * Creates a plain object from a RecognizeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.RecognizeRequest + * @static + * @param {google.cloud.speech.v2.RecognizeRequest} message RecognizeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RecognizeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.config = null; + object.recognizer = ""; + object.configMask = null; + } + if (message.config != null && message.hasOwnProperty("config")) + object.config = $root.google.cloud.speech.v2.RecognitionConfig.toObject(message.config, options); + if (message.recognizer != null && message.hasOwnProperty("recognizer")) + object.recognizer = message.recognizer; + if (message.content != null && message.hasOwnProperty("content")) { + object.content = options.bytes === String ? $util.base64.encode(message.content, 0, message.content.length) : options.bytes === Array ? Array.prototype.slice.call(message.content) : message.content; + if (options.oneofs) + object.audioSource = "content"; + } + if (message.uri != null && message.hasOwnProperty("uri")) { + object.uri = message.uri; + if (options.oneofs) + object.audioSource = "uri"; + } + if (message.configMask != null && message.hasOwnProperty("configMask")) + object.configMask = $root.google.protobuf.FieldMask.toObject(message.configMask, options); + return object; + }; + + /** + * Converts this RecognizeRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.RecognizeRequest + * @instance + * @returns {Object.} JSON object + */ + RecognizeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RecognizeRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v2.RecognizeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RecognizeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.RecognizeRequest"; + }; + + return RecognizeRequest; + })(); + + v2.RecognitionResponseMetadata = (function() { + + /** + * Properties of a RecognitionResponseMetadata. + * @memberof google.cloud.speech.v2 + * @interface IRecognitionResponseMetadata + * @property {string|null} [requestId] RecognitionResponseMetadata requestId + * @property {google.protobuf.IDuration|null} [totalBilledDuration] RecognitionResponseMetadata totalBilledDuration + */ + + /** + * Constructs a new RecognitionResponseMetadata. + * @memberof google.cloud.speech.v2 + * @classdesc Represents a RecognitionResponseMetadata. + * @implements IRecognitionResponseMetadata + * @constructor + * @param {google.cloud.speech.v2.IRecognitionResponseMetadata=} [properties] Properties to set + */ + function RecognitionResponseMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RecognitionResponseMetadata requestId. + * @member {string} requestId + * @memberof google.cloud.speech.v2.RecognitionResponseMetadata + * @instance + */ + RecognitionResponseMetadata.prototype.requestId = ""; + + /** + * RecognitionResponseMetadata totalBilledDuration. + * @member {google.protobuf.IDuration|null|undefined} totalBilledDuration + * @memberof google.cloud.speech.v2.RecognitionResponseMetadata + * @instance + */ + RecognitionResponseMetadata.prototype.totalBilledDuration = null; + + /** + * Creates a new RecognitionResponseMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.RecognitionResponseMetadata + * @static + * @param {google.cloud.speech.v2.IRecognitionResponseMetadata=} [properties] Properties to set + * @returns {google.cloud.speech.v2.RecognitionResponseMetadata} RecognitionResponseMetadata instance + */ + RecognitionResponseMetadata.create = function create(properties) { + return new RecognitionResponseMetadata(properties); + }; + + /** + * Encodes the specified RecognitionResponseMetadata message. Does not implicitly {@link google.cloud.speech.v2.RecognitionResponseMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.RecognitionResponseMetadata + * @static + * @param {google.cloud.speech.v2.IRecognitionResponseMetadata} message RecognitionResponseMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecognitionResponseMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.totalBilledDuration != null && Object.hasOwnProperty.call(message, "totalBilledDuration")) + $root.google.protobuf.Duration.encode(message.totalBilledDuration, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified RecognitionResponseMetadata message, length delimited. Does not implicitly {@link google.cloud.speech.v2.RecognitionResponseMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.RecognitionResponseMetadata + * @static + * @param {google.cloud.speech.v2.IRecognitionResponseMetadata} message RecognitionResponseMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecognitionResponseMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RecognitionResponseMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.RecognitionResponseMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.RecognitionResponseMetadata} RecognitionResponseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecognitionResponseMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.RecognitionResponseMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 9: { + message.requestId = reader.string(); + break; + } + case 6: { + message.totalBilledDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RecognitionResponseMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.RecognitionResponseMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.RecognitionResponseMetadata} RecognitionResponseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecognitionResponseMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RecognitionResponseMetadata message. + * @function verify + * @memberof google.cloud.speech.v2.RecognitionResponseMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RecognitionResponseMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.totalBilledDuration != null && message.hasOwnProperty("totalBilledDuration")) { + var error = $root.google.protobuf.Duration.verify(message.totalBilledDuration); + if (error) + return "totalBilledDuration." + error; + } + return null; + }; + + /** + * Creates a RecognitionResponseMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.RecognitionResponseMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.RecognitionResponseMetadata} RecognitionResponseMetadata + */ + RecognitionResponseMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.RecognitionResponseMetadata) + return object; + var message = new $root.google.cloud.speech.v2.RecognitionResponseMetadata(); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.totalBilledDuration != null) { + if (typeof object.totalBilledDuration !== "object") + throw TypeError(".google.cloud.speech.v2.RecognitionResponseMetadata.totalBilledDuration: object expected"); + message.totalBilledDuration = $root.google.protobuf.Duration.fromObject(object.totalBilledDuration); + } + return message; + }; + + /** + * Creates a plain object from a RecognitionResponseMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.RecognitionResponseMetadata + * @static + * @param {google.cloud.speech.v2.RecognitionResponseMetadata} message RecognitionResponseMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RecognitionResponseMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.totalBilledDuration = null; + object.requestId = ""; + } + if (message.totalBilledDuration != null && message.hasOwnProperty("totalBilledDuration")) + object.totalBilledDuration = $root.google.protobuf.Duration.toObject(message.totalBilledDuration, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this RecognitionResponseMetadata to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.RecognitionResponseMetadata + * @instance + * @returns {Object.} JSON object + */ + RecognitionResponseMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RecognitionResponseMetadata + * @function getTypeUrl + * @memberof google.cloud.speech.v2.RecognitionResponseMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RecognitionResponseMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.RecognitionResponseMetadata"; + }; + + return RecognitionResponseMetadata; + })(); + + v2.SpeechRecognitionAlternative = (function() { + + /** + * Properties of a SpeechRecognitionAlternative. + * @memberof google.cloud.speech.v2 + * @interface ISpeechRecognitionAlternative + * @property {string|null} [transcript] SpeechRecognitionAlternative transcript + * @property {number|null} [confidence] SpeechRecognitionAlternative confidence + * @property {Array.|null} [words] SpeechRecognitionAlternative words + */ + + /** + * Constructs a new SpeechRecognitionAlternative. + * @memberof google.cloud.speech.v2 + * @classdesc Represents a SpeechRecognitionAlternative. + * @implements ISpeechRecognitionAlternative + * @constructor + * @param {google.cloud.speech.v2.ISpeechRecognitionAlternative=} [properties] Properties to set + */ + function SpeechRecognitionAlternative(properties) { + this.words = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpeechRecognitionAlternative transcript. + * @member {string} transcript + * @memberof google.cloud.speech.v2.SpeechRecognitionAlternative + * @instance + */ + SpeechRecognitionAlternative.prototype.transcript = ""; + + /** + * SpeechRecognitionAlternative confidence. + * @member {number} confidence + * @memberof google.cloud.speech.v2.SpeechRecognitionAlternative + * @instance + */ + SpeechRecognitionAlternative.prototype.confidence = 0; + + /** + * SpeechRecognitionAlternative words. + * @member {Array.} words + * @memberof google.cloud.speech.v2.SpeechRecognitionAlternative + * @instance + */ + SpeechRecognitionAlternative.prototype.words = $util.emptyArray; + + /** + * Creates a new SpeechRecognitionAlternative instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.SpeechRecognitionAlternative + * @static + * @param {google.cloud.speech.v2.ISpeechRecognitionAlternative=} [properties] Properties to set + * @returns {google.cloud.speech.v2.SpeechRecognitionAlternative} SpeechRecognitionAlternative instance + */ + SpeechRecognitionAlternative.create = function create(properties) { + return new SpeechRecognitionAlternative(properties); + }; + + /** + * Encodes the specified SpeechRecognitionAlternative message. Does not implicitly {@link google.cloud.speech.v2.SpeechRecognitionAlternative.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.SpeechRecognitionAlternative + * @static + * @param {google.cloud.speech.v2.ISpeechRecognitionAlternative} message SpeechRecognitionAlternative message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechRecognitionAlternative.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.transcript != null && Object.hasOwnProperty.call(message, "transcript")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.transcript); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence); + if (message.words != null && message.words.length) + for (var i = 0; i < message.words.length; ++i) + $root.google.cloud.speech.v2.WordInfo.encode(message.words[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SpeechRecognitionAlternative message, length delimited. Does not implicitly {@link google.cloud.speech.v2.SpeechRecognitionAlternative.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.SpeechRecognitionAlternative + * @static + * @param {google.cloud.speech.v2.ISpeechRecognitionAlternative} message SpeechRecognitionAlternative message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechRecognitionAlternative.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpeechRecognitionAlternative message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.SpeechRecognitionAlternative + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.SpeechRecognitionAlternative} SpeechRecognitionAlternative + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechRecognitionAlternative.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.SpeechRecognitionAlternative(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.transcript = reader.string(); + break; + } + case 2: { + message.confidence = reader.float(); + break; + } + case 3: { + if (!(message.words && message.words.length)) + message.words = []; + message.words.push($root.google.cloud.speech.v2.WordInfo.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpeechRecognitionAlternative message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.SpeechRecognitionAlternative + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.SpeechRecognitionAlternative} SpeechRecognitionAlternative + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechRecognitionAlternative.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpeechRecognitionAlternative message. + * @function verify + * @memberof google.cloud.speech.v2.SpeechRecognitionAlternative + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpeechRecognitionAlternative.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.transcript != null && message.hasOwnProperty("transcript")) + if (!$util.isString(message.transcript)) + return "transcript: string expected"; + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + if (message.words != null && message.hasOwnProperty("words")) { + if (!Array.isArray(message.words)) + return "words: array expected"; + for (var i = 0; i < message.words.length; ++i) { + var error = $root.google.cloud.speech.v2.WordInfo.verify(message.words[i]); + if (error) + return "words." + error; + } + } + return null; + }; + + /** + * Creates a SpeechRecognitionAlternative message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.SpeechRecognitionAlternative + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.SpeechRecognitionAlternative} SpeechRecognitionAlternative + */ + SpeechRecognitionAlternative.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.SpeechRecognitionAlternative) + return object; + var message = new $root.google.cloud.speech.v2.SpeechRecognitionAlternative(); + if (object.transcript != null) + message.transcript = String(object.transcript); + if (object.confidence != null) + message.confidence = Number(object.confidence); + if (object.words) { + if (!Array.isArray(object.words)) + throw TypeError(".google.cloud.speech.v2.SpeechRecognitionAlternative.words: array expected"); + message.words = []; + for (var i = 0; i < object.words.length; ++i) { + if (typeof object.words[i] !== "object") + throw TypeError(".google.cloud.speech.v2.SpeechRecognitionAlternative.words: object expected"); + message.words[i] = $root.google.cloud.speech.v2.WordInfo.fromObject(object.words[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SpeechRecognitionAlternative message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.SpeechRecognitionAlternative + * @static + * @param {google.cloud.speech.v2.SpeechRecognitionAlternative} message SpeechRecognitionAlternative + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpeechRecognitionAlternative.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.words = []; + if (options.defaults) { + object.transcript = ""; + object.confidence = 0; + } + if (message.transcript != null && message.hasOwnProperty("transcript")) + object.transcript = message.transcript; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + if (message.words && message.words.length) { + object.words = []; + for (var j = 0; j < message.words.length; ++j) + object.words[j] = $root.google.cloud.speech.v2.WordInfo.toObject(message.words[j], options); + } + return object; + }; + + /** + * Converts this SpeechRecognitionAlternative to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.SpeechRecognitionAlternative + * @instance + * @returns {Object.} JSON object + */ + SpeechRecognitionAlternative.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpeechRecognitionAlternative + * @function getTypeUrl + * @memberof google.cloud.speech.v2.SpeechRecognitionAlternative + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpeechRecognitionAlternative.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.SpeechRecognitionAlternative"; + }; + + return SpeechRecognitionAlternative; + })(); + + v2.WordInfo = (function() { + + /** + * Properties of a WordInfo. + * @memberof google.cloud.speech.v2 + * @interface IWordInfo + * @property {google.protobuf.IDuration|null} [startOffset] WordInfo startOffset + * @property {google.protobuf.IDuration|null} [endOffset] WordInfo endOffset + * @property {string|null} [word] WordInfo word + * @property {number|null} [confidence] WordInfo confidence + * @property {string|null} [speakerLabel] WordInfo speakerLabel + */ + + /** + * Constructs a new WordInfo. + * @memberof google.cloud.speech.v2 + * @classdesc Represents a WordInfo. + * @implements IWordInfo + * @constructor + * @param {google.cloud.speech.v2.IWordInfo=} [properties] Properties to set + */ + function WordInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WordInfo startOffset. + * @member {google.protobuf.IDuration|null|undefined} startOffset + * @memberof google.cloud.speech.v2.WordInfo + * @instance + */ + WordInfo.prototype.startOffset = null; + + /** + * WordInfo endOffset. + * @member {google.protobuf.IDuration|null|undefined} endOffset + * @memberof google.cloud.speech.v2.WordInfo + * @instance + */ + WordInfo.prototype.endOffset = null; + + /** + * WordInfo word. + * @member {string} word + * @memberof google.cloud.speech.v2.WordInfo + * @instance + */ + WordInfo.prototype.word = ""; + + /** + * WordInfo confidence. + * @member {number} confidence + * @memberof google.cloud.speech.v2.WordInfo + * @instance + */ + WordInfo.prototype.confidence = 0; + + /** + * WordInfo speakerLabel. + * @member {string} speakerLabel + * @memberof google.cloud.speech.v2.WordInfo + * @instance + */ + WordInfo.prototype.speakerLabel = ""; + + /** + * Creates a new WordInfo instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.WordInfo + * @static + * @param {google.cloud.speech.v2.IWordInfo=} [properties] Properties to set + * @returns {google.cloud.speech.v2.WordInfo} WordInfo instance + */ + WordInfo.create = function create(properties) { + return new WordInfo(properties); + }; + + /** + * Encodes the specified WordInfo message. Does not implicitly {@link google.cloud.speech.v2.WordInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.WordInfo + * @static + * @param {google.cloud.speech.v2.IWordInfo} message WordInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WordInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startOffset != null && Object.hasOwnProperty.call(message, "startOffset")) + $root.google.protobuf.Duration.encode(message.startOffset, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endOffset != null && Object.hasOwnProperty.call(message, "endOffset")) + $root.google.protobuf.Duration.encode(message.endOffset, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.word != null && Object.hasOwnProperty.call(message, "word")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.word); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.confidence); + if (message.speakerLabel != null && Object.hasOwnProperty.call(message, "speakerLabel")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.speakerLabel); + return writer; + }; + + /** + * Encodes the specified WordInfo message, length delimited. Does not implicitly {@link google.cloud.speech.v2.WordInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.WordInfo + * @static + * @param {google.cloud.speech.v2.IWordInfo} message WordInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WordInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WordInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.WordInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.WordInfo} WordInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WordInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.WordInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.startOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 3: { + message.word = reader.string(); + break; + } + case 4: { + message.confidence = reader.float(); + break; + } + case 6: { + message.speakerLabel = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WordInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.WordInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.WordInfo} WordInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WordInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WordInfo message. + * @function verify + * @memberof google.cloud.speech.v2.WordInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WordInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startOffset != null && message.hasOwnProperty("startOffset")) { + var error = $root.google.protobuf.Duration.verify(message.startOffset); + if (error) + return "startOffset." + error; + } + if (message.endOffset != null && message.hasOwnProperty("endOffset")) { + var error = $root.google.protobuf.Duration.verify(message.endOffset); + if (error) + return "endOffset." + error; + } + if (message.word != null && message.hasOwnProperty("word")) + if (!$util.isString(message.word)) + return "word: string expected"; + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + if (message.speakerLabel != null && message.hasOwnProperty("speakerLabel")) + if (!$util.isString(message.speakerLabel)) + return "speakerLabel: string expected"; + return null; + }; + + /** + * Creates a WordInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.WordInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.WordInfo} WordInfo + */ + WordInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.WordInfo) + return object; + var message = new $root.google.cloud.speech.v2.WordInfo(); + if (object.startOffset != null) { + if (typeof object.startOffset !== "object") + throw TypeError(".google.cloud.speech.v2.WordInfo.startOffset: object expected"); + message.startOffset = $root.google.protobuf.Duration.fromObject(object.startOffset); + } + if (object.endOffset != null) { + if (typeof object.endOffset !== "object") + throw TypeError(".google.cloud.speech.v2.WordInfo.endOffset: object expected"); + message.endOffset = $root.google.protobuf.Duration.fromObject(object.endOffset); + } + if (object.word != null) + message.word = String(object.word); + if (object.confidence != null) + message.confidence = Number(object.confidence); + if (object.speakerLabel != null) + message.speakerLabel = String(object.speakerLabel); + return message; + }; + + /** + * Creates a plain object from a WordInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.WordInfo + * @static + * @param {google.cloud.speech.v2.WordInfo} message WordInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WordInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startOffset = null; + object.endOffset = null; + object.word = ""; + object.confidence = 0; + object.speakerLabel = ""; + } + if (message.startOffset != null && message.hasOwnProperty("startOffset")) + object.startOffset = $root.google.protobuf.Duration.toObject(message.startOffset, options); + if (message.endOffset != null && message.hasOwnProperty("endOffset")) + object.endOffset = $root.google.protobuf.Duration.toObject(message.endOffset, options); + if (message.word != null && message.hasOwnProperty("word")) + object.word = message.word; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + if (message.speakerLabel != null && message.hasOwnProperty("speakerLabel")) + object.speakerLabel = message.speakerLabel; + return object; + }; + + /** + * Converts this WordInfo to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.WordInfo + * @instance + * @returns {Object.} JSON object + */ + WordInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WordInfo + * @function getTypeUrl + * @memberof google.cloud.speech.v2.WordInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WordInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.WordInfo"; + }; + + return WordInfo; + })(); + + v2.SpeechRecognitionResult = (function() { + + /** + * Properties of a SpeechRecognitionResult. + * @memberof google.cloud.speech.v2 + * @interface ISpeechRecognitionResult + * @property {Array.|null} [alternatives] SpeechRecognitionResult alternatives + * @property {number|null} [channelTag] SpeechRecognitionResult channelTag + * @property {google.protobuf.IDuration|null} [resultEndOffset] SpeechRecognitionResult resultEndOffset + * @property {string|null} [languageCode] SpeechRecognitionResult languageCode + */ + + /** + * Constructs a new SpeechRecognitionResult. + * @memberof google.cloud.speech.v2 + * @classdesc Represents a SpeechRecognitionResult. + * @implements ISpeechRecognitionResult + * @constructor + * @param {google.cloud.speech.v2.ISpeechRecognitionResult=} [properties] Properties to set + */ + function SpeechRecognitionResult(properties) { + this.alternatives = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpeechRecognitionResult alternatives. + * @member {Array.} alternatives + * @memberof google.cloud.speech.v2.SpeechRecognitionResult + * @instance + */ + SpeechRecognitionResult.prototype.alternatives = $util.emptyArray; + + /** + * SpeechRecognitionResult channelTag. + * @member {number} channelTag + * @memberof google.cloud.speech.v2.SpeechRecognitionResult + * @instance + */ + SpeechRecognitionResult.prototype.channelTag = 0; + + /** + * SpeechRecognitionResult resultEndOffset. + * @member {google.protobuf.IDuration|null|undefined} resultEndOffset + * @memberof google.cloud.speech.v2.SpeechRecognitionResult + * @instance + */ + SpeechRecognitionResult.prototype.resultEndOffset = null; + + /** + * SpeechRecognitionResult languageCode. + * @member {string} languageCode + * @memberof google.cloud.speech.v2.SpeechRecognitionResult + * @instance + */ + SpeechRecognitionResult.prototype.languageCode = ""; + + /** + * Creates a new SpeechRecognitionResult instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.SpeechRecognitionResult + * @static + * @param {google.cloud.speech.v2.ISpeechRecognitionResult=} [properties] Properties to set + * @returns {google.cloud.speech.v2.SpeechRecognitionResult} SpeechRecognitionResult instance + */ + SpeechRecognitionResult.create = function create(properties) { + return new SpeechRecognitionResult(properties); + }; + + /** + * Encodes the specified SpeechRecognitionResult message. Does not implicitly {@link google.cloud.speech.v2.SpeechRecognitionResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.SpeechRecognitionResult + * @static + * @param {google.cloud.speech.v2.ISpeechRecognitionResult} message SpeechRecognitionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechRecognitionResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.alternatives != null && message.alternatives.length) + for (var i = 0; i < message.alternatives.length; ++i) + $root.google.cloud.speech.v2.SpeechRecognitionAlternative.encode(message.alternatives[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.channelTag != null && Object.hasOwnProperty.call(message, "channelTag")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.channelTag); + if (message.resultEndOffset != null && Object.hasOwnProperty.call(message, "resultEndOffset")) + $root.google.protobuf.Duration.encode(message.resultEndOffset, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified SpeechRecognitionResult message, length delimited. Does not implicitly {@link google.cloud.speech.v2.SpeechRecognitionResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.SpeechRecognitionResult + * @static + * @param {google.cloud.speech.v2.ISpeechRecognitionResult} message SpeechRecognitionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechRecognitionResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpeechRecognitionResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.SpeechRecognitionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.SpeechRecognitionResult} SpeechRecognitionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechRecognitionResult.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.SpeechRecognitionResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.alternatives && message.alternatives.length)) + message.alternatives = []; + message.alternatives.push($root.google.cloud.speech.v2.SpeechRecognitionAlternative.decode(reader, reader.uint32())); + break; + } + case 2: { + message.channelTag = reader.int32(); + break; + } + case 4: { + message.resultEndOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 5: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpeechRecognitionResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.SpeechRecognitionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.SpeechRecognitionResult} SpeechRecognitionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechRecognitionResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpeechRecognitionResult message. + * @function verify + * @memberof google.cloud.speech.v2.SpeechRecognitionResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpeechRecognitionResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.alternatives != null && message.hasOwnProperty("alternatives")) { + if (!Array.isArray(message.alternatives)) + return "alternatives: array expected"; + for (var i = 0; i < message.alternatives.length; ++i) { + var error = $root.google.cloud.speech.v2.SpeechRecognitionAlternative.verify(message.alternatives[i]); + if (error) + return "alternatives." + error; + } + } + if (message.channelTag != null && message.hasOwnProperty("channelTag")) + if (!$util.isInteger(message.channelTag)) + return "channelTag: integer expected"; + if (message.resultEndOffset != null && message.hasOwnProperty("resultEndOffset")) { + var error = $root.google.protobuf.Duration.verify(message.resultEndOffset); + if (error) + return "resultEndOffset." + error; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a SpeechRecognitionResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.SpeechRecognitionResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.SpeechRecognitionResult} SpeechRecognitionResult + */ + SpeechRecognitionResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.SpeechRecognitionResult) + return object; + var message = new $root.google.cloud.speech.v2.SpeechRecognitionResult(); + if (object.alternatives) { + if (!Array.isArray(object.alternatives)) + throw TypeError(".google.cloud.speech.v2.SpeechRecognitionResult.alternatives: array expected"); + message.alternatives = []; + for (var i = 0; i < object.alternatives.length; ++i) { + if (typeof object.alternatives[i] !== "object") + throw TypeError(".google.cloud.speech.v2.SpeechRecognitionResult.alternatives: object expected"); + message.alternatives[i] = $root.google.cloud.speech.v2.SpeechRecognitionAlternative.fromObject(object.alternatives[i]); + } + } + if (object.channelTag != null) + message.channelTag = object.channelTag | 0; + if (object.resultEndOffset != null) { + if (typeof object.resultEndOffset !== "object") + throw TypeError(".google.cloud.speech.v2.SpeechRecognitionResult.resultEndOffset: object expected"); + message.resultEndOffset = $root.google.protobuf.Duration.fromObject(object.resultEndOffset); + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a SpeechRecognitionResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.SpeechRecognitionResult + * @static + * @param {google.cloud.speech.v2.SpeechRecognitionResult} message SpeechRecognitionResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpeechRecognitionResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.alternatives = []; + if (options.defaults) { + object.channelTag = 0; + object.resultEndOffset = null; + object.languageCode = ""; + } + if (message.alternatives && message.alternatives.length) { + object.alternatives = []; + for (var j = 0; j < message.alternatives.length; ++j) + object.alternatives[j] = $root.google.cloud.speech.v2.SpeechRecognitionAlternative.toObject(message.alternatives[j], options); + } + if (message.channelTag != null && message.hasOwnProperty("channelTag")) + object.channelTag = message.channelTag; + if (message.resultEndOffset != null && message.hasOwnProperty("resultEndOffset")) + object.resultEndOffset = $root.google.protobuf.Duration.toObject(message.resultEndOffset, options); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this SpeechRecognitionResult to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.SpeechRecognitionResult + * @instance + * @returns {Object.} JSON object + */ + SpeechRecognitionResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpeechRecognitionResult + * @function getTypeUrl + * @memberof google.cloud.speech.v2.SpeechRecognitionResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpeechRecognitionResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.SpeechRecognitionResult"; + }; + + return SpeechRecognitionResult; + })(); + + v2.RecognizeResponse = (function() { + + /** + * Properties of a RecognizeResponse. + * @memberof google.cloud.speech.v2 + * @interface IRecognizeResponse + * @property {Array.|null} [results] RecognizeResponse results + * @property {google.cloud.speech.v2.IRecognitionResponseMetadata|null} [metadata] RecognizeResponse metadata + */ + + /** + * Constructs a new RecognizeResponse. + * @memberof google.cloud.speech.v2 + * @classdesc Represents a RecognizeResponse. + * @implements IRecognizeResponse + * @constructor + * @param {google.cloud.speech.v2.IRecognizeResponse=} [properties] Properties to set + */ + function RecognizeResponse(properties) { + this.results = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RecognizeResponse results. + * @member {Array.} results + * @memberof google.cloud.speech.v2.RecognizeResponse + * @instance + */ + RecognizeResponse.prototype.results = $util.emptyArray; + + /** + * RecognizeResponse metadata. + * @member {google.cloud.speech.v2.IRecognitionResponseMetadata|null|undefined} metadata + * @memberof google.cloud.speech.v2.RecognizeResponse + * @instance + */ + RecognizeResponse.prototype.metadata = null; + + /** + * Creates a new RecognizeResponse instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.RecognizeResponse + * @static + * @param {google.cloud.speech.v2.IRecognizeResponse=} [properties] Properties to set + * @returns {google.cloud.speech.v2.RecognizeResponse} RecognizeResponse instance + */ + RecognizeResponse.create = function create(properties) { + return new RecognizeResponse(properties); + }; + + /** + * Encodes the specified RecognizeResponse message. Does not implicitly {@link google.cloud.speech.v2.RecognizeResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.RecognizeResponse + * @static + * @param {google.cloud.speech.v2.IRecognizeResponse} message RecognizeResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecognizeResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.cloud.speech.v2.RecognitionResponseMetadata.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.results != null && message.results.length) + for (var i = 0; i < message.results.length; ++i) + $root.google.cloud.speech.v2.SpeechRecognitionResult.encode(message.results[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RecognizeResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v2.RecognizeResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.RecognizeResponse + * @static + * @param {google.cloud.speech.v2.IRecognizeResponse} message RecognizeResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecognizeResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RecognizeResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.RecognizeResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.RecognizeResponse} RecognizeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecognizeResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.RecognizeResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + if (!(message.results && message.results.length)) + message.results = []; + message.results.push($root.google.cloud.speech.v2.SpeechRecognitionResult.decode(reader, reader.uint32())); + break; + } + case 2: { + message.metadata = $root.google.cloud.speech.v2.RecognitionResponseMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RecognizeResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.RecognizeResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.RecognizeResponse} RecognizeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecognizeResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RecognizeResponse message. + * @function verify + * @memberof google.cloud.speech.v2.RecognizeResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RecognizeResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.results != null && message.hasOwnProperty("results")) { + if (!Array.isArray(message.results)) + return "results: array expected"; + for (var i = 0; i < message.results.length; ++i) { + var error = $root.google.cloud.speech.v2.SpeechRecognitionResult.verify(message.results[i]); + if (error) + return "results." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.cloud.speech.v2.RecognitionResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a RecognizeResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.RecognizeResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.RecognizeResponse} RecognizeResponse + */ + RecognizeResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.RecognizeResponse) + return object; + var message = new $root.google.cloud.speech.v2.RecognizeResponse(); + if (object.results) { + if (!Array.isArray(object.results)) + throw TypeError(".google.cloud.speech.v2.RecognizeResponse.results: array expected"); + message.results = []; + for (var i = 0; i < object.results.length; ++i) { + if (typeof object.results[i] !== "object") + throw TypeError(".google.cloud.speech.v2.RecognizeResponse.results: object expected"); + message.results[i] = $root.google.cloud.speech.v2.SpeechRecognitionResult.fromObject(object.results[i]); + } + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.speech.v2.RecognizeResponse.metadata: object expected"); + message.metadata = $root.google.cloud.speech.v2.RecognitionResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a RecognizeResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.RecognizeResponse + * @static + * @param {google.cloud.speech.v2.RecognizeResponse} message RecognizeResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RecognizeResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.results = []; + if (options.defaults) + object.metadata = null; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.cloud.speech.v2.RecognitionResponseMetadata.toObject(message.metadata, options); + if (message.results && message.results.length) { + object.results = []; + for (var j = 0; j < message.results.length; ++j) + object.results[j] = $root.google.cloud.speech.v2.SpeechRecognitionResult.toObject(message.results[j], options); + } + return object; + }; + + /** + * Converts this RecognizeResponse to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.RecognizeResponse + * @instance + * @returns {Object.} JSON object + */ + RecognizeResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RecognizeResponse + * @function getTypeUrl + * @memberof google.cloud.speech.v2.RecognizeResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RecognizeResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.RecognizeResponse"; + }; + + return RecognizeResponse; + })(); + + v2.StreamingRecognitionFeatures = (function() { + + /** + * Properties of a StreamingRecognitionFeatures. + * @memberof google.cloud.speech.v2 + * @interface IStreamingRecognitionFeatures + * @property {boolean|null} [enableVoiceActivityEvents] StreamingRecognitionFeatures enableVoiceActivityEvents + * @property {boolean|null} [interimResults] StreamingRecognitionFeatures interimResults + * @property {google.cloud.speech.v2.StreamingRecognitionFeatures.IVoiceActivityTimeout|null} [voiceActivityTimeout] StreamingRecognitionFeatures voiceActivityTimeout + */ + + /** + * Constructs a new StreamingRecognitionFeatures. + * @memberof google.cloud.speech.v2 + * @classdesc Represents a StreamingRecognitionFeatures. + * @implements IStreamingRecognitionFeatures + * @constructor + * @param {google.cloud.speech.v2.IStreamingRecognitionFeatures=} [properties] Properties to set + */ + function StreamingRecognitionFeatures(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamingRecognitionFeatures enableVoiceActivityEvents. + * @member {boolean} enableVoiceActivityEvents + * @memberof google.cloud.speech.v2.StreamingRecognitionFeatures + * @instance + */ + StreamingRecognitionFeatures.prototype.enableVoiceActivityEvents = false; + + /** + * StreamingRecognitionFeatures interimResults. + * @member {boolean} interimResults + * @memberof google.cloud.speech.v2.StreamingRecognitionFeatures + * @instance + */ + StreamingRecognitionFeatures.prototype.interimResults = false; + + /** + * StreamingRecognitionFeatures voiceActivityTimeout. + * @member {google.cloud.speech.v2.StreamingRecognitionFeatures.IVoiceActivityTimeout|null|undefined} voiceActivityTimeout + * @memberof google.cloud.speech.v2.StreamingRecognitionFeatures + * @instance + */ + StreamingRecognitionFeatures.prototype.voiceActivityTimeout = null; + + /** + * Creates a new StreamingRecognitionFeatures instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.StreamingRecognitionFeatures + * @static + * @param {google.cloud.speech.v2.IStreamingRecognitionFeatures=} [properties] Properties to set + * @returns {google.cloud.speech.v2.StreamingRecognitionFeatures} StreamingRecognitionFeatures instance + */ + StreamingRecognitionFeatures.create = function create(properties) { + return new StreamingRecognitionFeatures(properties); + }; + + /** + * Encodes the specified StreamingRecognitionFeatures message. Does not implicitly {@link google.cloud.speech.v2.StreamingRecognitionFeatures.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.StreamingRecognitionFeatures + * @static + * @param {google.cloud.speech.v2.IStreamingRecognitionFeatures} message StreamingRecognitionFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingRecognitionFeatures.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableVoiceActivityEvents != null && Object.hasOwnProperty.call(message, "enableVoiceActivityEvents")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableVoiceActivityEvents); + if (message.interimResults != null && Object.hasOwnProperty.call(message, "interimResults")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.interimResults); + if (message.voiceActivityTimeout != null && Object.hasOwnProperty.call(message, "voiceActivityTimeout")) + $root.google.cloud.speech.v2.StreamingRecognitionFeatures.VoiceActivityTimeout.encode(message.voiceActivityTimeout, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StreamingRecognitionFeatures message, length delimited. Does not implicitly {@link google.cloud.speech.v2.StreamingRecognitionFeatures.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.StreamingRecognitionFeatures + * @static + * @param {google.cloud.speech.v2.IStreamingRecognitionFeatures} message StreamingRecognitionFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingRecognitionFeatures.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamingRecognitionFeatures message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.StreamingRecognitionFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.StreamingRecognitionFeatures} StreamingRecognitionFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingRecognitionFeatures.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.StreamingRecognitionFeatures(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enableVoiceActivityEvents = reader.bool(); + break; + } + case 2: { + message.interimResults = reader.bool(); + break; + } + case 3: { + message.voiceActivityTimeout = $root.google.cloud.speech.v2.StreamingRecognitionFeatures.VoiceActivityTimeout.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamingRecognitionFeatures message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.StreamingRecognitionFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.StreamingRecognitionFeatures} StreamingRecognitionFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingRecognitionFeatures.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamingRecognitionFeatures message. + * @function verify + * @memberof google.cloud.speech.v2.StreamingRecognitionFeatures + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingRecognitionFeatures.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enableVoiceActivityEvents != null && message.hasOwnProperty("enableVoiceActivityEvents")) + if (typeof message.enableVoiceActivityEvents !== "boolean") + return "enableVoiceActivityEvents: boolean expected"; + if (message.interimResults != null && message.hasOwnProperty("interimResults")) + if (typeof message.interimResults !== "boolean") + return "interimResults: boolean expected"; + if (message.voiceActivityTimeout != null && message.hasOwnProperty("voiceActivityTimeout")) { + var error = $root.google.cloud.speech.v2.StreamingRecognitionFeatures.VoiceActivityTimeout.verify(message.voiceActivityTimeout); + if (error) + return "voiceActivityTimeout." + error; + } + return null; + }; + + /** + * Creates a StreamingRecognitionFeatures message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.StreamingRecognitionFeatures + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.StreamingRecognitionFeatures} StreamingRecognitionFeatures + */ + StreamingRecognitionFeatures.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.StreamingRecognitionFeatures) + return object; + var message = new $root.google.cloud.speech.v2.StreamingRecognitionFeatures(); + if (object.enableVoiceActivityEvents != null) + message.enableVoiceActivityEvents = Boolean(object.enableVoiceActivityEvents); + if (object.interimResults != null) + message.interimResults = Boolean(object.interimResults); + if (object.voiceActivityTimeout != null) { + if (typeof object.voiceActivityTimeout !== "object") + throw TypeError(".google.cloud.speech.v2.StreamingRecognitionFeatures.voiceActivityTimeout: object expected"); + message.voiceActivityTimeout = $root.google.cloud.speech.v2.StreamingRecognitionFeatures.VoiceActivityTimeout.fromObject(object.voiceActivityTimeout); + } + return message; + }; + + /** + * Creates a plain object from a StreamingRecognitionFeatures message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.StreamingRecognitionFeatures + * @static + * @param {google.cloud.speech.v2.StreamingRecognitionFeatures} message StreamingRecognitionFeatures + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingRecognitionFeatures.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.enableVoiceActivityEvents = false; + object.interimResults = false; + object.voiceActivityTimeout = null; + } + if (message.enableVoiceActivityEvents != null && message.hasOwnProperty("enableVoiceActivityEvents")) + object.enableVoiceActivityEvents = message.enableVoiceActivityEvents; + if (message.interimResults != null && message.hasOwnProperty("interimResults")) + object.interimResults = message.interimResults; + if (message.voiceActivityTimeout != null && message.hasOwnProperty("voiceActivityTimeout")) + object.voiceActivityTimeout = $root.google.cloud.speech.v2.StreamingRecognitionFeatures.VoiceActivityTimeout.toObject(message.voiceActivityTimeout, options); + return object; + }; + + /** + * Converts this StreamingRecognitionFeatures to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.StreamingRecognitionFeatures + * @instance + * @returns {Object.} JSON object + */ + StreamingRecognitionFeatures.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamingRecognitionFeatures + * @function getTypeUrl + * @memberof google.cloud.speech.v2.StreamingRecognitionFeatures + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamingRecognitionFeatures.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.StreamingRecognitionFeatures"; + }; + + StreamingRecognitionFeatures.VoiceActivityTimeout = (function() { + + /** + * Properties of a VoiceActivityTimeout. + * @memberof google.cloud.speech.v2.StreamingRecognitionFeatures + * @interface IVoiceActivityTimeout + * @property {google.protobuf.IDuration|null} [speechStartTimeout] VoiceActivityTimeout speechStartTimeout + * @property {google.protobuf.IDuration|null} [speechEndTimeout] VoiceActivityTimeout speechEndTimeout + */ + + /** + * Constructs a new VoiceActivityTimeout. + * @memberof google.cloud.speech.v2.StreamingRecognitionFeatures + * @classdesc Represents a VoiceActivityTimeout. + * @implements IVoiceActivityTimeout + * @constructor + * @param {google.cloud.speech.v2.StreamingRecognitionFeatures.IVoiceActivityTimeout=} [properties] Properties to set + */ + function VoiceActivityTimeout(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VoiceActivityTimeout speechStartTimeout. + * @member {google.protobuf.IDuration|null|undefined} speechStartTimeout + * @memberof google.cloud.speech.v2.StreamingRecognitionFeatures.VoiceActivityTimeout + * @instance + */ + VoiceActivityTimeout.prototype.speechStartTimeout = null; + + /** + * VoiceActivityTimeout speechEndTimeout. + * @member {google.protobuf.IDuration|null|undefined} speechEndTimeout + * @memberof google.cloud.speech.v2.StreamingRecognitionFeatures.VoiceActivityTimeout + * @instance + */ + VoiceActivityTimeout.prototype.speechEndTimeout = null; + + /** + * Creates a new VoiceActivityTimeout instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.StreamingRecognitionFeatures.VoiceActivityTimeout + * @static + * @param {google.cloud.speech.v2.StreamingRecognitionFeatures.IVoiceActivityTimeout=} [properties] Properties to set + * @returns {google.cloud.speech.v2.StreamingRecognitionFeatures.VoiceActivityTimeout} VoiceActivityTimeout instance + */ + VoiceActivityTimeout.create = function create(properties) { + return new VoiceActivityTimeout(properties); + }; + + /** + * Encodes the specified VoiceActivityTimeout message. Does not implicitly {@link google.cloud.speech.v2.StreamingRecognitionFeatures.VoiceActivityTimeout.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.StreamingRecognitionFeatures.VoiceActivityTimeout + * @static + * @param {google.cloud.speech.v2.StreamingRecognitionFeatures.IVoiceActivityTimeout} message VoiceActivityTimeout message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VoiceActivityTimeout.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.speechStartTimeout != null && Object.hasOwnProperty.call(message, "speechStartTimeout")) + $root.google.protobuf.Duration.encode(message.speechStartTimeout, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.speechEndTimeout != null && Object.hasOwnProperty.call(message, "speechEndTimeout")) + $root.google.protobuf.Duration.encode(message.speechEndTimeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VoiceActivityTimeout message, length delimited. Does not implicitly {@link google.cloud.speech.v2.StreamingRecognitionFeatures.VoiceActivityTimeout.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.StreamingRecognitionFeatures.VoiceActivityTimeout + * @static + * @param {google.cloud.speech.v2.StreamingRecognitionFeatures.IVoiceActivityTimeout} message VoiceActivityTimeout message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VoiceActivityTimeout.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VoiceActivityTimeout message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.StreamingRecognitionFeatures.VoiceActivityTimeout + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.StreamingRecognitionFeatures.VoiceActivityTimeout} VoiceActivityTimeout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VoiceActivityTimeout.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.StreamingRecognitionFeatures.VoiceActivityTimeout(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.speechStartTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.speechEndTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VoiceActivityTimeout message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.StreamingRecognitionFeatures.VoiceActivityTimeout + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.StreamingRecognitionFeatures.VoiceActivityTimeout} VoiceActivityTimeout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VoiceActivityTimeout.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VoiceActivityTimeout message. + * @function verify + * @memberof google.cloud.speech.v2.StreamingRecognitionFeatures.VoiceActivityTimeout + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VoiceActivityTimeout.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.speechStartTimeout != null && message.hasOwnProperty("speechStartTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.speechStartTimeout); + if (error) + return "speechStartTimeout." + error; + } + if (message.speechEndTimeout != null && message.hasOwnProperty("speechEndTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.speechEndTimeout); + if (error) + return "speechEndTimeout." + error; + } + return null; + }; + + /** + * Creates a VoiceActivityTimeout message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.StreamingRecognitionFeatures.VoiceActivityTimeout + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.StreamingRecognitionFeatures.VoiceActivityTimeout} VoiceActivityTimeout + */ + VoiceActivityTimeout.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.StreamingRecognitionFeatures.VoiceActivityTimeout) + return object; + var message = new $root.google.cloud.speech.v2.StreamingRecognitionFeatures.VoiceActivityTimeout(); + if (object.speechStartTimeout != null) { + if (typeof object.speechStartTimeout !== "object") + throw TypeError(".google.cloud.speech.v2.StreamingRecognitionFeatures.VoiceActivityTimeout.speechStartTimeout: object expected"); + message.speechStartTimeout = $root.google.protobuf.Duration.fromObject(object.speechStartTimeout); + } + if (object.speechEndTimeout != null) { + if (typeof object.speechEndTimeout !== "object") + throw TypeError(".google.cloud.speech.v2.StreamingRecognitionFeatures.VoiceActivityTimeout.speechEndTimeout: object expected"); + message.speechEndTimeout = $root.google.protobuf.Duration.fromObject(object.speechEndTimeout); + } + return message; + }; + + /** + * Creates a plain object from a VoiceActivityTimeout message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.StreamingRecognitionFeatures.VoiceActivityTimeout + * @static + * @param {google.cloud.speech.v2.StreamingRecognitionFeatures.VoiceActivityTimeout} message VoiceActivityTimeout + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VoiceActivityTimeout.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.speechStartTimeout = null; + object.speechEndTimeout = null; + } + if (message.speechStartTimeout != null && message.hasOwnProperty("speechStartTimeout")) + object.speechStartTimeout = $root.google.protobuf.Duration.toObject(message.speechStartTimeout, options); + if (message.speechEndTimeout != null && message.hasOwnProperty("speechEndTimeout")) + object.speechEndTimeout = $root.google.protobuf.Duration.toObject(message.speechEndTimeout, options); + return object; + }; + + /** + * Converts this VoiceActivityTimeout to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.StreamingRecognitionFeatures.VoiceActivityTimeout + * @instance + * @returns {Object.} JSON object + */ + VoiceActivityTimeout.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VoiceActivityTimeout + * @function getTypeUrl + * @memberof google.cloud.speech.v2.StreamingRecognitionFeatures.VoiceActivityTimeout + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VoiceActivityTimeout.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.StreamingRecognitionFeatures.VoiceActivityTimeout"; + }; + + return VoiceActivityTimeout; + })(); + + return StreamingRecognitionFeatures; + })(); + + v2.StreamingRecognitionConfig = (function() { + + /** + * Properties of a StreamingRecognitionConfig. + * @memberof google.cloud.speech.v2 + * @interface IStreamingRecognitionConfig + * @property {google.cloud.speech.v2.IRecognitionConfig|null} [config] StreamingRecognitionConfig config + * @property {google.protobuf.IFieldMask|null} [configMask] StreamingRecognitionConfig configMask + * @property {google.cloud.speech.v2.IStreamingRecognitionFeatures|null} [streamingFeatures] StreamingRecognitionConfig streamingFeatures + */ + + /** + * Constructs a new StreamingRecognitionConfig. + * @memberof google.cloud.speech.v2 + * @classdesc Represents a StreamingRecognitionConfig. + * @implements IStreamingRecognitionConfig + * @constructor + * @param {google.cloud.speech.v2.IStreamingRecognitionConfig=} [properties] Properties to set + */ + function StreamingRecognitionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamingRecognitionConfig config. + * @member {google.cloud.speech.v2.IRecognitionConfig|null|undefined} config + * @memberof google.cloud.speech.v2.StreamingRecognitionConfig + * @instance + */ + StreamingRecognitionConfig.prototype.config = null; + + /** + * StreamingRecognitionConfig configMask. + * @member {google.protobuf.IFieldMask|null|undefined} configMask + * @memberof google.cloud.speech.v2.StreamingRecognitionConfig + * @instance + */ + StreamingRecognitionConfig.prototype.configMask = null; + + /** + * StreamingRecognitionConfig streamingFeatures. + * @member {google.cloud.speech.v2.IStreamingRecognitionFeatures|null|undefined} streamingFeatures + * @memberof google.cloud.speech.v2.StreamingRecognitionConfig + * @instance + */ + StreamingRecognitionConfig.prototype.streamingFeatures = null; + + /** + * Creates a new StreamingRecognitionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.StreamingRecognitionConfig + * @static + * @param {google.cloud.speech.v2.IStreamingRecognitionConfig=} [properties] Properties to set + * @returns {google.cloud.speech.v2.StreamingRecognitionConfig} StreamingRecognitionConfig instance + */ + StreamingRecognitionConfig.create = function create(properties) { + return new StreamingRecognitionConfig(properties); + }; + + /** + * Encodes the specified StreamingRecognitionConfig message. Does not implicitly {@link google.cloud.speech.v2.StreamingRecognitionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.StreamingRecognitionConfig + * @static + * @param {google.cloud.speech.v2.IStreamingRecognitionConfig} message StreamingRecognitionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingRecognitionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.cloud.speech.v2.RecognitionConfig.encode(message.config, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.streamingFeatures != null && Object.hasOwnProperty.call(message, "streamingFeatures")) + $root.google.cloud.speech.v2.StreamingRecognitionFeatures.encode(message.streamingFeatures, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.configMask != null && Object.hasOwnProperty.call(message, "configMask")) + $root.google.protobuf.FieldMask.encode(message.configMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StreamingRecognitionConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v2.StreamingRecognitionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.StreamingRecognitionConfig + * @static + * @param {google.cloud.speech.v2.IStreamingRecognitionConfig} message StreamingRecognitionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingRecognitionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamingRecognitionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.StreamingRecognitionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.StreamingRecognitionConfig} StreamingRecognitionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingRecognitionConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.StreamingRecognitionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.config = $root.google.cloud.speech.v2.RecognitionConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.configMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.streamingFeatures = $root.google.cloud.speech.v2.StreamingRecognitionFeatures.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamingRecognitionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.StreamingRecognitionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.StreamingRecognitionConfig} StreamingRecognitionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingRecognitionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamingRecognitionConfig message. + * @function verify + * @memberof google.cloud.speech.v2.StreamingRecognitionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingRecognitionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.config != null && message.hasOwnProperty("config")) { + var error = $root.google.cloud.speech.v2.RecognitionConfig.verify(message.config); + if (error) + return "config." + error; + } + if (message.configMask != null && message.hasOwnProperty("configMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.configMask); + if (error) + return "configMask." + error; + } + if (message.streamingFeatures != null && message.hasOwnProperty("streamingFeatures")) { + var error = $root.google.cloud.speech.v2.StreamingRecognitionFeatures.verify(message.streamingFeatures); + if (error) + return "streamingFeatures." + error; + } + return null; + }; + + /** + * Creates a StreamingRecognitionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.StreamingRecognitionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.StreamingRecognitionConfig} StreamingRecognitionConfig + */ + StreamingRecognitionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.StreamingRecognitionConfig) + return object; + var message = new $root.google.cloud.speech.v2.StreamingRecognitionConfig(); + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.cloud.speech.v2.StreamingRecognitionConfig.config: object expected"); + message.config = $root.google.cloud.speech.v2.RecognitionConfig.fromObject(object.config); + } + if (object.configMask != null) { + if (typeof object.configMask !== "object") + throw TypeError(".google.cloud.speech.v2.StreamingRecognitionConfig.configMask: object expected"); + message.configMask = $root.google.protobuf.FieldMask.fromObject(object.configMask); + } + if (object.streamingFeatures != null) { + if (typeof object.streamingFeatures !== "object") + throw TypeError(".google.cloud.speech.v2.StreamingRecognitionConfig.streamingFeatures: object expected"); + message.streamingFeatures = $root.google.cloud.speech.v2.StreamingRecognitionFeatures.fromObject(object.streamingFeatures); + } + return message; + }; + + /** + * Creates a plain object from a StreamingRecognitionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.StreamingRecognitionConfig + * @static + * @param {google.cloud.speech.v2.StreamingRecognitionConfig} message StreamingRecognitionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingRecognitionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.config = null; + object.streamingFeatures = null; + object.configMask = null; + } + if (message.config != null && message.hasOwnProperty("config")) + object.config = $root.google.cloud.speech.v2.RecognitionConfig.toObject(message.config, options); + if (message.streamingFeatures != null && message.hasOwnProperty("streamingFeatures")) + object.streamingFeatures = $root.google.cloud.speech.v2.StreamingRecognitionFeatures.toObject(message.streamingFeatures, options); + if (message.configMask != null && message.hasOwnProperty("configMask")) + object.configMask = $root.google.protobuf.FieldMask.toObject(message.configMask, options); + return object; + }; + + /** + * Converts this StreamingRecognitionConfig to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.StreamingRecognitionConfig + * @instance + * @returns {Object.} JSON object + */ + StreamingRecognitionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamingRecognitionConfig + * @function getTypeUrl + * @memberof google.cloud.speech.v2.StreamingRecognitionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamingRecognitionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.StreamingRecognitionConfig"; + }; + + return StreamingRecognitionConfig; + })(); + + v2.StreamingRecognizeRequest = (function() { + + /** + * Properties of a StreamingRecognizeRequest. + * @memberof google.cloud.speech.v2 + * @interface IStreamingRecognizeRequest + * @property {string|null} [recognizer] StreamingRecognizeRequest recognizer + * @property {google.cloud.speech.v2.IStreamingRecognitionConfig|null} [streamingConfig] StreamingRecognizeRequest streamingConfig + * @property {Uint8Array|null} [audio] StreamingRecognizeRequest audio + */ + + /** + * Constructs a new StreamingRecognizeRequest. + * @memberof google.cloud.speech.v2 + * @classdesc Represents a StreamingRecognizeRequest. + * @implements IStreamingRecognizeRequest + * @constructor + * @param {google.cloud.speech.v2.IStreamingRecognizeRequest=} [properties] Properties to set + */ + function StreamingRecognizeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamingRecognizeRequest recognizer. + * @member {string} recognizer + * @memberof google.cloud.speech.v2.StreamingRecognizeRequest + * @instance + */ + StreamingRecognizeRequest.prototype.recognizer = ""; + + /** + * StreamingRecognizeRequest streamingConfig. + * @member {google.cloud.speech.v2.IStreamingRecognitionConfig|null|undefined} streamingConfig + * @memberof google.cloud.speech.v2.StreamingRecognizeRequest + * @instance + */ + StreamingRecognizeRequest.prototype.streamingConfig = null; + + /** + * StreamingRecognizeRequest audio. + * @member {Uint8Array|null|undefined} audio + * @memberof google.cloud.speech.v2.StreamingRecognizeRequest + * @instance + */ + StreamingRecognizeRequest.prototype.audio = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * StreamingRecognizeRequest streamingRequest. + * @member {"streamingConfig"|"audio"|undefined} streamingRequest + * @memberof google.cloud.speech.v2.StreamingRecognizeRequest + * @instance + */ + Object.defineProperty(StreamingRecognizeRequest.prototype, "streamingRequest", { + get: $util.oneOfGetter($oneOfFields = ["streamingConfig", "audio"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StreamingRecognizeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.StreamingRecognizeRequest + * @static + * @param {google.cloud.speech.v2.IStreamingRecognizeRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v2.StreamingRecognizeRequest} StreamingRecognizeRequest instance + */ + StreamingRecognizeRequest.create = function create(properties) { + return new StreamingRecognizeRequest(properties); + }; + + /** + * Encodes the specified StreamingRecognizeRequest message. Does not implicitly {@link google.cloud.speech.v2.StreamingRecognizeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.StreamingRecognizeRequest + * @static + * @param {google.cloud.speech.v2.IStreamingRecognizeRequest} message StreamingRecognizeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingRecognizeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.recognizer != null && Object.hasOwnProperty.call(message, "recognizer")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.recognizer); + if (message.audio != null && Object.hasOwnProperty.call(message, "audio")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.audio); + if (message.streamingConfig != null && Object.hasOwnProperty.call(message, "streamingConfig")) + $root.google.cloud.speech.v2.StreamingRecognitionConfig.encode(message.streamingConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StreamingRecognizeRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v2.StreamingRecognizeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.StreamingRecognizeRequest + * @static + * @param {google.cloud.speech.v2.IStreamingRecognizeRequest} message StreamingRecognizeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingRecognizeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamingRecognizeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.StreamingRecognizeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.StreamingRecognizeRequest} StreamingRecognizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingRecognizeRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.StreamingRecognizeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.recognizer = reader.string(); + break; + } + case 6: { + message.streamingConfig = $root.google.cloud.speech.v2.StreamingRecognitionConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + message.audio = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamingRecognizeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.StreamingRecognizeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.StreamingRecognizeRequest} StreamingRecognizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingRecognizeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamingRecognizeRequest message. + * @function verify + * @memberof google.cloud.speech.v2.StreamingRecognizeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingRecognizeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.recognizer != null && message.hasOwnProperty("recognizer")) + if (!$util.isString(message.recognizer)) + return "recognizer: string expected"; + if (message.streamingConfig != null && message.hasOwnProperty("streamingConfig")) { + properties.streamingRequest = 1; + { + var error = $root.google.cloud.speech.v2.StreamingRecognitionConfig.verify(message.streamingConfig); + if (error) + return "streamingConfig." + error; + } + } + if (message.audio != null && message.hasOwnProperty("audio")) { + if (properties.streamingRequest === 1) + return "streamingRequest: multiple values"; + properties.streamingRequest = 1; + if (!(message.audio && typeof message.audio.length === "number" || $util.isString(message.audio))) + return "audio: buffer expected"; + } + return null; + }; + + /** + * Creates a StreamingRecognizeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.StreamingRecognizeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.StreamingRecognizeRequest} StreamingRecognizeRequest + */ + StreamingRecognizeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.StreamingRecognizeRequest) + return object; + var message = new $root.google.cloud.speech.v2.StreamingRecognizeRequest(); + if (object.recognizer != null) + message.recognizer = String(object.recognizer); + if (object.streamingConfig != null) { + if (typeof object.streamingConfig !== "object") + throw TypeError(".google.cloud.speech.v2.StreamingRecognizeRequest.streamingConfig: object expected"); + message.streamingConfig = $root.google.cloud.speech.v2.StreamingRecognitionConfig.fromObject(object.streamingConfig); + } + if (object.audio != null) + if (typeof object.audio === "string") + $util.base64.decode(object.audio, message.audio = $util.newBuffer($util.base64.length(object.audio)), 0); + else if (object.audio.length >= 0) + message.audio = object.audio; + return message; + }; + + /** + * Creates a plain object from a StreamingRecognizeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.StreamingRecognizeRequest + * @static + * @param {google.cloud.speech.v2.StreamingRecognizeRequest} message StreamingRecognizeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingRecognizeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.recognizer = ""; + if (message.recognizer != null && message.hasOwnProperty("recognizer")) + object.recognizer = message.recognizer; + if (message.audio != null && message.hasOwnProperty("audio")) { + object.audio = options.bytes === String ? $util.base64.encode(message.audio, 0, message.audio.length) : options.bytes === Array ? Array.prototype.slice.call(message.audio) : message.audio; + if (options.oneofs) + object.streamingRequest = "audio"; + } + if (message.streamingConfig != null && message.hasOwnProperty("streamingConfig")) { + object.streamingConfig = $root.google.cloud.speech.v2.StreamingRecognitionConfig.toObject(message.streamingConfig, options); + if (options.oneofs) + object.streamingRequest = "streamingConfig"; + } + return object; + }; + + /** + * Converts this StreamingRecognizeRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.StreamingRecognizeRequest + * @instance + * @returns {Object.} JSON object + */ + StreamingRecognizeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamingRecognizeRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v2.StreamingRecognizeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamingRecognizeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.StreamingRecognizeRequest"; + }; + + return StreamingRecognizeRequest; + })(); + + v2.BatchRecognizeRequest = (function() { + + /** + * Properties of a BatchRecognizeRequest. + * @memberof google.cloud.speech.v2 + * @interface IBatchRecognizeRequest + * @property {string|null} [recognizer] BatchRecognizeRequest recognizer + * @property {google.cloud.speech.v2.IRecognitionConfig|null} [config] BatchRecognizeRequest config + * @property {google.protobuf.IFieldMask|null} [configMask] BatchRecognizeRequest configMask + * @property {Array.|null} [files] BatchRecognizeRequest files + * @property {google.cloud.speech.v2.IRecognitionOutputConfig|null} [recognitionOutputConfig] BatchRecognizeRequest recognitionOutputConfig + * @property {google.cloud.speech.v2.BatchRecognizeRequest.ProcessingStrategy|null} [processingStrategy] BatchRecognizeRequest processingStrategy + */ + + /** + * Constructs a new BatchRecognizeRequest. + * @memberof google.cloud.speech.v2 + * @classdesc Represents a BatchRecognizeRequest. + * @implements IBatchRecognizeRequest + * @constructor + * @param {google.cloud.speech.v2.IBatchRecognizeRequest=} [properties] Properties to set + */ + function BatchRecognizeRequest(properties) { + this.files = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchRecognizeRequest recognizer. + * @member {string} recognizer + * @memberof google.cloud.speech.v2.BatchRecognizeRequest + * @instance + */ + BatchRecognizeRequest.prototype.recognizer = ""; + + /** + * BatchRecognizeRequest config. + * @member {google.cloud.speech.v2.IRecognitionConfig|null|undefined} config + * @memberof google.cloud.speech.v2.BatchRecognizeRequest + * @instance + */ + BatchRecognizeRequest.prototype.config = null; + + /** + * BatchRecognizeRequest configMask. + * @member {google.protobuf.IFieldMask|null|undefined} configMask + * @memberof google.cloud.speech.v2.BatchRecognizeRequest + * @instance + */ + BatchRecognizeRequest.prototype.configMask = null; + + /** + * BatchRecognizeRequest files. + * @member {Array.} files + * @memberof google.cloud.speech.v2.BatchRecognizeRequest + * @instance + */ + BatchRecognizeRequest.prototype.files = $util.emptyArray; + + /** + * BatchRecognizeRequest recognitionOutputConfig. + * @member {google.cloud.speech.v2.IRecognitionOutputConfig|null|undefined} recognitionOutputConfig + * @memberof google.cloud.speech.v2.BatchRecognizeRequest + * @instance + */ + BatchRecognizeRequest.prototype.recognitionOutputConfig = null; + + /** + * BatchRecognizeRequest processingStrategy. + * @member {google.cloud.speech.v2.BatchRecognizeRequest.ProcessingStrategy} processingStrategy + * @memberof google.cloud.speech.v2.BatchRecognizeRequest + * @instance + */ + BatchRecognizeRequest.prototype.processingStrategy = 0; + + /** + * Creates a new BatchRecognizeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.BatchRecognizeRequest + * @static + * @param {google.cloud.speech.v2.IBatchRecognizeRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v2.BatchRecognizeRequest} BatchRecognizeRequest instance + */ + BatchRecognizeRequest.create = function create(properties) { + return new BatchRecognizeRequest(properties); + }; + + /** + * Encodes the specified BatchRecognizeRequest message. Does not implicitly {@link google.cloud.speech.v2.BatchRecognizeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.BatchRecognizeRequest + * @static + * @param {google.cloud.speech.v2.IBatchRecognizeRequest} message BatchRecognizeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchRecognizeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.recognizer != null && Object.hasOwnProperty.call(message, "recognizer")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.recognizer); + if (message.files != null && message.files.length) + for (var i = 0; i < message.files.length; ++i) + $root.google.cloud.speech.v2.BatchRecognizeFileMetadata.encode(message.files[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.cloud.speech.v2.RecognitionConfig.encode(message.config, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.configMask != null && Object.hasOwnProperty.call(message, "configMask")) + $root.google.protobuf.FieldMask.encode(message.configMask, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.recognitionOutputConfig != null && Object.hasOwnProperty.call(message, "recognitionOutputConfig")) + $root.google.cloud.speech.v2.RecognitionOutputConfig.encode(message.recognitionOutputConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.processingStrategy != null && Object.hasOwnProperty.call(message, "processingStrategy")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.processingStrategy); + return writer; + }; + + /** + * Encodes the specified BatchRecognizeRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v2.BatchRecognizeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.BatchRecognizeRequest + * @static + * @param {google.cloud.speech.v2.IBatchRecognizeRequest} message BatchRecognizeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchRecognizeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchRecognizeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.BatchRecognizeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.BatchRecognizeRequest} BatchRecognizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchRecognizeRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.BatchRecognizeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.recognizer = reader.string(); + break; + } + case 4: { + message.config = $root.google.cloud.speech.v2.RecognitionConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + message.configMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.files && message.files.length)) + message.files = []; + message.files.push($root.google.cloud.speech.v2.BatchRecognizeFileMetadata.decode(reader, reader.uint32())); + break; + } + case 6: { + message.recognitionOutputConfig = $root.google.cloud.speech.v2.RecognitionOutputConfig.decode(reader, reader.uint32()); + break; + } + case 7: { + message.processingStrategy = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchRecognizeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.BatchRecognizeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.BatchRecognizeRequest} BatchRecognizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchRecognizeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchRecognizeRequest message. + * @function verify + * @memberof google.cloud.speech.v2.BatchRecognizeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchRecognizeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.recognizer != null && message.hasOwnProperty("recognizer")) + if (!$util.isString(message.recognizer)) + return "recognizer: string expected"; + if (message.config != null && message.hasOwnProperty("config")) { + var error = $root.google.cloud.speech.v2.RecognitionConfig.verify(message.config); + if (error) + return "config." + error; + } + if (message.configMask != null && message.hasOwnProperty("configMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.configMask); + if (error) + return "configMask." + error; + } + if (message.files != null && message.hasOwnProperty("files")) { + if (!Array.isArray(message.files)) + return "files: array expected"; + for (var i = 0; i < message.files.length; ++i) { + var error = $root.google.cloud.speech.v2.BatchRecognizeFileMetadata.verify(message.files[i]); + if (error) + return "files." + error; + } + } + if (message.recognitionOutputConfig != null && message.hasOwnProperty("recognitionOutputConfig")) { + var error = $root.google.cloud.speech.v2.RecognitionOutputConfig.verify(message.recognitionOutputConfig); + if (error) + return "recognitionOutputConfig." + error; + } + if (message.processingStrategy != null && message.hasOwnProperty("processingStrategy")) + switch (message.processingStrategy) { + default: + return "processingStrategy: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates a BatchRecognizeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.BatchRecognizeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.BatchRecognizeRequest} BatchRecognizeRequest + */ + BatchRecognizeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.BatchRecognizeRequest) + return object; + var message = new $root.google.cloud.speech.v2.BatchRecognizeRequest(); + if (object.recognizer != null) + message.recognizer = String(object.recognizer); + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.cloud.speech.v2.BatchRecognizeRequest.config: object expected"); + message.config = $root.google.cloud.speech.v2.RecognitionConfig.fromObject(object.config); + } + if (object.configMask != null) { + if (typeof object.configMask !== "object") + throw TypeError(".google.cloud.speech.v2.BatchRecognizeRequest.configMask: object expected"); + message.configMask = $root.google.protobuf.FieldMask.fromObject(object.configMask); + } + if (object.files) { + if (!Array.isArray(object.files)) + throw TypeError(".google.cloud.speech.v2.BatchRecognizeRequest.files: array expected"); + message.files = []; + for (var i = 0; i < object.files.length; ++i) { + if (typeof object.files[i] !== "object") + throw TypeError(".google.cloud.speech.v2.BatchRecognizeRequest.files: object expected"); + message.files[i] = $root.google.cloud.speech.v2.BatchRecognizeFileMetadata.fromObject(object.files[i]); + } + } + if (object.recognitionOutputConfig != null) { + if (typeof object.recognitionOutputConfig !== "object") + throw TypeError(".google.cloud.speech.v2.BatchRecognizeRequest.recognitionOutputConfig: object expected"); + message.recognitionOutputConfig = $root.google.cloud.speech.v2.RecognitionOutputConfig.fromObject(object.recognitionOutputConfig); + } + switch (object.processingStrategy) { + default: + if (typeof object.processingStrategy === "number") { + message.processingStrategy = object.processingStrategy; + break; + } + break; + case "PROCESSING_STRATEGY_UNSPECIFIED": + case 0: + message.processingStrategy = 0; + break; + case "DYNAMIC_BATCHING": + case 1: + message.processingStrategy = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a BatchRecognizeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.BatchRecognizeRequest + * @static + * @param {google.cloud.speech.v2.BatchRecognizeRequest} message BatchRecognizeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchRecognizeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.files = []; + if (options.defaults) { + object.recognizer = ""; + object.config = null; + object.configMask = null; + object.recognitionOutputConfig = null; + object.processingStrategy = options.enums === String ? "PROCESSING_STRATEGY_UNSPECIFIED" : 0; + } + if (message.recognizer != null && message.hasOwnProperty("recognizer")) + object.recognizer = message.recognizer; + if (message.files && message.files.length) { + object.files = []; + for (var j = 0; j < message.files.length; ++j) + object.files[j] = $root.google.cloud.speech.v2.BatchRecognizeFileMetadata.toObject(message.files[j], options); + } + if (message.config != null && message.hasOwnProperty("config")) + object.config = $root.google.cloud.speech.v2.RecognitionConfig.toObject(message.config, options); + if (message.configMask != null && message.hasOwnProperty("configMask")) + object.configMask = $root.google.protobuf.FieldMask.toObject(message.configMask, options); + if (message.recognitionOutputConfig != null && message.hasOwnProperty("recognitionOutputConfig")) + object.recognitionOutputConfig = $root.google.cloud.speech.v2.RecognitionOutputConfig.toObject(message.recognitionOutputConfig, options); + if (message.processingStrategy != null && message.hasOwnProperty("processingStrategy")) + object.processingStrategy = options.enums === String ? $root.google.cloud.speech.v2.BatchRecognizeRequest.ProcessingStrategy[message.processingStrategy] === undefined ? message.processingStrategy : $root.google.cloud.speech.v2.BatchRecognizeRequest.ProcessingStrategy[message.processingStrategy] : message.processingStrategy; + return object; + }; + + /** + * Converts this BatchRecognizeRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.BatchRecognizeRequest + * @instance + * @returns {Object.} JSON object + */ + BatchRecognizeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchRecognizeRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v2.BatchRecognizeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchRecognizeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.BatchRecognizeRequest"; + }; + + /** + * ProcessingStrategy enum. + * @name google.cloud.speech.v2.BatchRecognizeRequest.ProcessingStrategy + * @enum {number} + * @property {number} PROCESSING_STRATEGY_UNSPECIFIED=0 PROCESSING_STRATEGY_UNSPECIFIED value + * @property {number} DYNAMIC_BATCHING=1 DYNAMIC_BATCHING value + */ + BatchRecognizeRequest.ProcessingStrategy = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PROCESSING_STRATEGY_UNSPECIFIED"] = 0; + values[valuesById[1] = "DYNAMIC_BATCHING"] = 1; + return values; + })(); + + return BatchRecognizeRequest; + })(); + + v2.GcsOutputConfig = (function() { + + /** + * Properties of a GcsOutputConfig. + * @memberof google.cloud.speech.v2 + * @interface IGcsOutputConfig + * @property {string|null} [uri] GcsOutputConfig uri + */ + + /** + * Constructs a new GcsOutputConfig. + * @memberof google.cloud.speech.v2 + * @classdesc Represents a GcsOutputConfig. + * @implements IGcsOutputConfig + * @constructor + * @param {google.cloud.speech.v2.IGcsOutputConfig=} [properties] Properties to set + */ + function GcsOutputConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GcsOutputConfig uri. + * @member {string} uri + * @memberof google.cloud.speech.v2.GcsOutputConfig + * @instance + */ + GcsOutputConfig.prototype.uri = ""; + + /** + * Creates a new GcsOutputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.GcsOutputConfig + * @static + * @param {google.cloud.speech.v2.IGcsOutputConfig=} [properties] Properties to set + * @returns {google.cloud.speech.v2.GcsOutputConfig} GcsOutputConfig instance + */ + GcsOutputConfig.create = function create(properties) { + return new GcsOutputConfig(properties); + }; + + /** + * Encodes the specified GcsOutputConfig message. Does not implicitly {@link google.cloud.speech.v2.GcsOutputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.GcsOutputConfig + * @static + * @param {google.cloud.speech.v2.IGcsOutputConfig} message GcsOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsOutputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + return writer; + }; + + /** + * Encodes the specified GcsOutputConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v2.GcsOutputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.GcsOutputConfig + * @static + * @param {google.cloud.speech.v2.IGcsOutputConfig} message GcsOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsOutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcsOutputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.GcsOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.GcsOutputConfig} GcsOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsOutputConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.GcsOutputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.uri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcsOutputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.GcsOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.GcsOutputConfig} GcsOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsOutputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcsOutputConfig message. + * @function verify + * @memberof google.cloud.speech.v2.GcsOutputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcsOutputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + return null; + }; + + /** + * Creates a GcsOutputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.GcsOutputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.GcsOutputConfig} GcsOutputConfig + */ + GcsOutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.GcsOutputConfig) + return object; + var message = new $root.google.cloud.speech.v2.GcsOutputConfig(); + if (object.uri != null) + message.uri = String(object.uri); + return message; + }; + + /** + * Creates a plain object from a GcsOutputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.GcsOutputConfig + * @static + * @param {google.cloud.speech.v2.GcsOutputConfig} message GcsOutputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcsOutputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.uri = ""; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + return object; + }; + + /** + * Converts this GcsOutputConfig to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.GcsOutputConfig + * @instance + * @returns {Object.} JSON object + */ + GcsOutputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GcsOutputConfig + * @function getTypeUrl + * @memberof google.cloud.speech.v2.GcsOutputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcsOutputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.GcsOutputConfig"; + }; + + return GcsOutputConfig; + })(); + + v2.InlineOutputConfig = (function() { + + /** + * Properties of an InlineOutputConfig. + * @memberof google.cloud.speech.v2 + * @interface IInlineOutputConfig + */ + + /** + * Constructs a new InlineOutputConfig. + * @memberof google.cloud.speech.v2 + * @classdesc Represents an InlineOutputConfig. + * @implements IInlineOutputConfig + * @constructor + * @param {google.cloud.speech.v2.IInlineOutputConfig=} [properties] Properties to set + */ + function InlineOutputConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new InlineOutputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.InlineOutputConfig + * @static + * @param {google.cloud.speech.v2.IInlineOutputConfig=} [properties] Properties to set + * @returns {google.cloud.speech.v2.InlineOutputConfig} InlineOutputConfig instance + */ + InlineOutputConfig.create = function create(properties) { + return new InlineOutputConfig(properties); + }; + + /** + * Encodes the specified InlineOutputConfig message. Does not implicitly {@link google.cloud.speech.v2.InlineOutputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.InlineOutputConfig + * @static + * @param {google.cloud.speech.v2.IInlineOutputConfig} message InlineOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InlineOutputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified InlineOutputConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v2.InlineOutputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.InlineOutputConfig + * @static + * @param {google.cloud.speech.v2.IInlineOutputConfig} message InlineOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InlineOutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InlineOutputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.InlineOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.InlineOutputConfig} InlineOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InlineOutputConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.InlineOutputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InlineOutputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.InlineOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.InlineOutputConfig} InlineOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InlineOutputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InlineOutputConfig message. + * @function verify + * @memberof google.cloud.speech.v2.InlineOutputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InlineOutputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an InlineOutputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.InlineOutputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.InlineOutputConfig} InlineOutputConfig + */ + InlineOutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.InlineOutputConfig) + return object; + return new $root.google.cloud.speech.v2.InlineOutputConfig(); + }; + + /** + * Creates a plain object from an InlineOutputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.InlineOutputConfig + * @static + * @param {google.cloud.speech.v2.InlineOutputConfig} message InlineOutputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InlineOutputConfig.toObject = function toObject() { + return {}; + }; + + /** + * Converts this InlineOutputConfig to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.InlineOutputConfig + * @instance + * @returns {Object.} JSON object + */ + InlineOutputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InlineOutputConfig + * @function getTypeUrl + * @memberof google.cloud.speech.v2.InlineOutputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InlineOutputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.InlineOutputConfig"; + }; + + return InlineOutputConfig; + })(); + + v2.NativeOutputFileFormatConfig = (function() { + + /** + * Properties of a NativeOutputFileFormatConfig. + * @memberof google.cloud.speech.v2 + * @interface INativeOutputFileFormatConfig + */ + + /** + * Constructs a new NativeOutputFileFormatConfig. + * @memberof google.cloud.speech.v2 + * @classdesc Represents a NativeOutputFileFormatConfig. + * @implements INativeOutputFileFormatConfig + * @constructor + * @param {google.cloud.speech.v2.INativeOutputFileFormatConfig=} [properties] Properties to set + */ + function NativeOutputFileFormatConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new NativeOutputFileFormatConfig instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.NativeOutputFileFormatConfig + * @static + * @param {google.cloud.speech.v2.INativeOutputFileFormatConfig=} [properties] Properties to set + * @returns {google.cloud.speech.v2.NativeOutputFileFormatConfig} NativeOutputFileFormatConfig instance + */ + NativeOutputFileFormatConfig.create = function create(properties) { + return new NativeOutputFileFormatConfig(properties); + }; + + /** + * Encodes the specified NativeOutputFileFormatConfig message. Does not implicitly {@link google.cloud.speech.v2.NativeOutputFileFormatConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.NativeOutputFileFormatConfig + * @static + * @param {google.cloud.speech.v2.INativeOutputFileFormatConfig} message NativeOutputFileFormatConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NativeOutputFileFormatConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified NativeOutputFileFormatConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v2.NativeOutputFileFormatConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.NativeOutputFileFormatConfig + * @static + * @param {google.cloud.speech.v2.INativeOutputFileFormatConfig} message NativeOutputFileFormatConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NativeOutputFileFormatConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NativeOutputFileFormatConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.NativeOutputFileFormatConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.NativeOutputFileFormatConfig} NativeOutputFileFormatConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NativeOutputFileFormatConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.NativeOutputFileFormatConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NativeOutputFileFormatConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.NativeOutputFileFormatConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.NativeOutputFileFormatConfig} NativeOutputFileFormatConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NativeOutputFileFormatConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NativeOutputFileFormatConfig message. + * @function verify + * @memberof google.cloud.speech.v2.NativeOutputFileFormatConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NativeOutputFileFormatConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a NativeOutputFileFormatConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.NativeOutputFileFormatConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.NativeOutputFileFormatConfig} NativeOutputFileFormatConfig + */ + NativeOutputFileFormatConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.NativeOutputFileFormatConfig) + return object; + return new $root.google.cloud.speech.v2.NativeOutputFileFormatConfig(); + }; + + /** + * Creates a plain object from a NativeOutputFileFormatConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.NativeOutputFileFormatConfig + * @static + * @param {google.cloud.speech.v2.NativeOutputFileFormatConfig} message NativeOutputFileFormatConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NativeOutputFileFormatConfig.toObject = function toObject() { + return {}; + }; + + /** + * Converts this NativeOutputFileFormatConfig to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.NativeOutputFileFormatConfig + * @instance + * @returns {Object.} JSON object + */ + NativeOutputFileFormatConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NativeOutputFileFormatConfig + * @function getTypeUrl + * @memberof google.cloud.speech.v2.NativeOutputFileFormatConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NativeOutputFileFormatConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.NativeOutputFileFormatConfig"; + }; + + return NativeOutputFileFormatConfig; + })(); + + v2.VttOutputFileFormatConfig = (function() { + + /** + * Properties of a VttOutputFileFormatConfig. + * @memberof google.cloud.speech.v2 + * @interface IVttOutputFileFormatConfig + */ + + /** + * Constructs a new VttOutputFileFormatConfig. + * @memberof google.cloud.speech.v2 + * @classdesc Represents a VttOutputFileFormatConfig. + * @implements IVttOutputFileFormatConfig + * @constructor + * @param {google.cloud.speech.v2.IVttOutputFileFormatConfig=} [properties] Properties to set + */ + function VttOutputFileFormatConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new VttOutputFileFormatConfig instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.VttOutputFileFormatConfig + * @static + * @param {google.cloud.speech.v2.IVttOutputFileFormatConfig=} [properties] Properties to set + * @returns {google.cloud.speech.v2.VttOutputFileFormatConfig} VttOutputFileFormatConfig instance + */ + VttOutputFileFormatConfig.create = function create(properties) { + return new VttOutputFileFormatConfig(properties); + }; + + /** + * Encodes the specified VttOutputFileFormatConfig message. Does not implicitly {@link google.cloud.speech.v2.VttOutputFileFormatConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.VttOutputFileFormatConfig + * @static + * @param {google.cloud.speech.v2.IVttOutputFileFormatConfig} message VttOutputFileFormatConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VttOutputFileFormatConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified VttOutputFileFormatConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v2.VttOutputFileFormatConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.VttOutputFileFormatConfig + * @static + * @param {google.cloud.speech.v2.IVttOutputFileFormatConfig} message VttOutputFileFormatConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VttOutputFileFormatConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VttOutputFileFormatConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.VttOutputFileFormatConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.VttOutputFileFormatConfig} VttOutputFileFormatConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VttOutputFileFormatConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.VttOutputFileFormatConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VttOutputFileFormatConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.VttOutputFileFormatConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.VttOutputFileFormatConfig} VttOutputFileFormatConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VttOutputFileFormatConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VttOutputFileFormatConfig message. + * @function verify + * @memberof google.cloud.speech.v2.VttOutputFileFormatConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VttOutputFileFormatConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a VttOutputFileFormatConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.VttOutputFileFormatConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.VttOutputFileFormatConfig} VttOutputFileFormatConfig + */ + VttOutputFileFormatConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.VttOutputFileFormatConfig) + return object; + return new $root.google.cloud.speech.v2.VttOutputFileFormatConfig(); + }; + + /** + * Creates a plain object from a VttOutputFileFormatConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.VttOutputFileFormatConfig + * @static + * @param {google.cloud.speech.v2.VttOutputFileFormatConfig} message VttOutputFileFormatConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VttOutputFileFormatConfig.toObject = function toObject() { + return {}; + }; + + /** + * Converts this VttOutputFileFormatConfig to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.VttOutputFileFormatConfig + * @instance + * @returns {Object.} JSON object + */ + VttOutputFileFormatConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VttOutputFileFormatConfig + * @function getTypeUrl + * @memberof google.cloud.speech.v2.VttOutputFileFormatConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VttOutputFileFormatConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.VttOutputFileFormatConfig"; + }; + + return VttOutputFileFormatConfig; + })(); + + v2.SrtOutputFileFormatConfig = (function() { + + /** + * Properties of a SrtOutputFileFormatConfig. + * @memberof google.cloud.speech.v2 + * @interface ISrtOutputFileFormatConfig + */ + + /** + * Constructs a new SrtOutputFileFormatConfig. + * @memberof google.cloud.speech.v2 + * @classdesc Represents a SrtOutputFileFormatConfig. + * @implements ISrtOutputFileFormatConfig + * @constructor + * @param {google.cloud.speech.v2.ISrtOutputFileFormatConfig=} [properties] Properties to set + */ + function SrtOutputFileFormatConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new SrtOutputFileFormatConfig instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.SrtOutputFileFormatConfig + * @static + * @param {google.cloud.speech.v2.ISrtOutputFileFormatConfig=} [properties] Properties to set + * @returns {google.cloud.speech.v2.SrtOutputFileFormatConfig} SrtOutputFileFormatConfig instance + */ + SrtOutputFileFormatConfig.create = function create(properties) { + return new SrtOutputFileFormatConfig(properties); + }; + + /** + * Encodes the specified SrtOutputFileFormatConfig message. Does not implicitly {@link google.cloud.speech.v2.SrtOutputFileFormatConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.SrtOutputFileFormatConfig + * @static + * @param {google.cloud.speech.v2.ISrtOutputFileFormatConfig} message SrtOutputFileFormatConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SrtOutputFileFormatConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified SrtOutputFileFormatConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v2.SrtOutputFileFormatConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.SrtOutputFileFormatConfig + * @static + * @param {google.cloud.speech.v2.ISrtOutputFileFormatConfig} message SrtOutputFileFormatConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SrtOutputFileFormatConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SrtOutputFileFormatConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.SrtOutputFileFormatConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.SrtOutputFileFormatConfig} SrtOutputFileFormatConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SrtOutputFileFormatConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.SrtOutputFileFormatConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SrtOutputFileFormatConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.SrtOutputFileFormatConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.SrtOutputFileFormatConfig} SrtOutputFileFormatConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SrtOutputFileFormatConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SrtOutputFileFormatConfig message. + * @function verify + * @memberof google.cloud.speech.v2.SrtOutputFileFormatConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SrtOutputFileFormatConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a SrtOutputFileFormatConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.SrtOutputFileFormatConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.SrtOutputFileFormatConfig} SrtOutputFileFormatConfig + */ + SrtOutputFileFormatConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.SrtOutputFileFormatConfig) + return object; + return new $root.google.cloud.speech.v2.SrtOutputFileFormatConfig(); + }; + + /** + * Creates a plain object from a SrtOutputFileFormatConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.SrtOutputFileFormatConfig + * @static + * @param {google.cloud.speech.v2.SrtOutputFileFormatConfig} message SrtOutputFileFormatConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SrtOutputFileFormatConfig.toObject = function toObject() { + return {}; + }; + + /** + * Converts this SrtOutputFileFormatConfig to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.SrtOutputFileFormatConfig + * @instance + * @returns {Object.} JSON object + */ + SrtOutputFileFormatConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SrtOutputFileFormatConfig + * @function getTypeUrl + * @memberof google.cloud.speech.v2.SrtOutputFileFormatConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SrtOutputFileFormatConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.SrtOutputFileFormatConfig"; + }; + + return SrtOutputFileFormatConfig; + })(); + + v2.OutputFormatConfig = (function() { + + /** + * Properties of an OutputFormatConfig. + * @memberof google.cloud.speech.v2 + * @interface IOutputFormatConfig + * @property {google.cloud.speech.v2.INativeOutputFileFormatConfig|null} [native] OutputFormatConfig native + * @property {google.cloud.speech.v2.IVttOutputFileFormatConfig|null} [vtt] OutputFormatConfig vtt + * @property {google.cloud.speech.v2.ISrtOutputFileFormatConfig|null} [srt] OutputFormatConfig srt + */ + + /** + * Constructs a new OutputFormatConfig. + * @memberof google.cloud.speech.v2 + * @classdesc Represents an OutputFormatConfig. + * @implements IOutputFormatConfig + * @constructor + * @param {google.cloud.speech.v2.IOutputFormatConfig=} [properties] Properties to set + */ + function OutputFormatConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OutputFormatConfig native. + * @member {google.cloud.speech.v2.INativeOutputFileFormatConfig|null|undefined} native + * @memberof google.cloud.speech.v2.OutputFormatConfig + * @instance + */ + OutputFormatConfig.prototype.native = null; + + /** + * OutputFormatConfig vtt. + * @member {google.cloud.speech.v2.IVttOutputFileFormatConfig|null|undefined} vtt + * @memberof google.cloud.speech.v2.OutputFormatConfig + * @instance + */ + OutputFormatConfig.prototype.vtt = null; + + /** + * OutputFormatConfig srt. + * @member {google.cloud.speech.v2.ISrtOutputFileFormatConfig|null|undefined} srt + * @memberof google.cloud.speech.v2.OutputFormatConfig + * @instance + */ + OutputFormatConfig.prototype.srt = null; + + /** + * Creates a new OutputFormatConfig instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.OutputFormatConfig + * @static + * @param {google.cloud.speech.v2.IOutputFormatConfig=} [properties] Properties to set + * @returns {google.cloud.speech.v2.OutputFormatConfig} OutputFormatConfig instance + */ + OutputFormatConfig.create = function create(properties) { + return new OutputFormatConfig(properties); + }; + + /** + * Encodes the specified OutputFormatConfig message. Does not implicitly {@link google.cloud.speech.v2.OutputFormatConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.OutputFormatConfig + * @static + * @param {google.cloud.speech.v2.IOutputFormatConfig} message OutputFormatConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputFormatConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.native != null && Object.hasOwnProperty.call(message, "native")) + $root.google.cloud.speech.v2.NativeOutputFileFormatConfig.encode(message.native, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.vtt != null && Object.hasOwnProperty.call(message, "vtt")) + $root.google.cloud.speech.v2.VttOutputFileFormatConfig.encode(message.vtt, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.srt != null && Object.hasOwnProperty.call(message, "srt")) + $root.google.cloud.speech.v2.SrtOutputFileFormatConfig.encode(message.srt, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OutputFormatConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v2.OutputFormatConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.OutputFormatConfig + * @static + * @param {google.cloud.speech.v2.IOutputFormatConfig} message OutputFormatConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputFormatConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OutputFormatConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.OutputFormatConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.OutputFormatConfig} OutputFormatConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputFormatConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.OutputFormatConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.native = $root.google.cloud.speech.v2.NativeOutputFileFormatConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.vtt = $root.google.cloud.speech.v2.VttOutputFileFormatConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.srt = $root.google.cloud.speech.v2.SrtOutputFileFormatConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OutputFormatConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.OutputFormatConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.OutputFormatConfig} OutputFormatConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputFormatConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OutputFormatConfig message. + * @function verify + * @memberof google.cloud.speech.v2.OutputFormatConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OutputFormatConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.native != null && message.hasOwnProperty("native")) { + var error = $root.google.cloud.speech.v2.NativeOutputFileFormatConfig.verify(message.native); + if (error) + return "native." + error; + } + if (message.vtt != null && message.hasOwnProperty("vtt")) { + var error = $root.google.cloud.speech.v2.VttOutputFileFormatConfig.verify(message.vtt); + if (error) + return "vtt." + error; + } + if (message.srt != null && message.hasOwnProperty("srt")) { + var error = $root.google.cloud.speech.v2.SrtOutputFileFormatConfig.verify(message.srt); + if (error) + return "srt." + error; + } + return null; + }; + + /** + * Creates an OutputFormatConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.OutputFormatConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.OutputFormatConfig} OutputFormatConfig + */ + OutputFormatConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.OutputFormatConfig) + return object; + var message = new $root.google.cloud.speech.v2.OutputFormatConfig(); + if (object.native != null) { + if (typeof object.native !== "object") + throw TypeError(".google.cloud.speech.v2.OutputFormatConfig.native: object expected"); + message.native = $root.google.cloud.speech.v2.NativeOutputFileFormatConfig.fromObject(object.native); + } + if (object.vtt != null) { + if (typeof object.vtt !== "object") + throw TypeError(".google.cloud.speech.v2.OutputFormatConfig.vtt: object expected"); + message.vtt = $root.google.cloud.speech.v2.VttOutputFileFormatConfig.fromObject(object.vtt); + } + if (object.srt != null) { + if (typeof object.srt !== "object") + throw TypeError(".google.cloud.speech.v2.OutputFormatConfig.srt: object expected"); + message.srt = $root.google.cloud.speech.v2.SrtOutputFileFormatConfig.fromObject(object.srt); + } + return message; + }; + + /** + * Creates a plain object from an OutputFormatConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.OutputFormatConfig + * @static + * @param {google.cloud.speech.v2.OutputFormatConfig} message OutputFormatConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OutputFormatConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.native = null; + object.vtt = null; + object.srt = null; + } + if (message.native != null && message.hasOwnProperty("native")) + object.native = $root.google.cloud.speech.v2.NativeOutputFileFormatConfig.toObject(message.native, options); + if (message.vtt != null && message.hasOwnProperty("vtt")) + object.vtt = $root.google.cloud.speech.v2.VttOutputFileFormatConfig.toObject(message.vtt, options); + if (message.srt != null && message.hasOwnProperty("srt")) + object.srt = $root.google.cloud.speech.v2.SrtOutputFileFormatConfig.toObject(message.srt, options); + return object; + }; + + /** + * Converts this OutputFormatConfig to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.OutputFormatConfig + * @instance + * @returns {Object.} JSON object + */ + OutputFormatConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OutputFormatConfig + * @function getTypeUrl + * @memberof google.cloud.speech.v2.OutputFormatConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OutputFormatConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.OutputFormatConfig"; + }; + + return OutputFormatConfig; + })(); + + v2.RecognitionOutputConfig = (function() { + + /** + * Properties of a RecognitionOutputConfig. + * @memberof google.cloud.speech.v2 + * @interface IRecognitionOutputConfig + * @property {google.cloud.speech.v2.IGcsOutputConfig|null} [gcsOutputConfig] RecognitionOutputConfig gcsOutputConfig + * @property {google.cloud.speech.v2.IInlineOutputConfig|null} [inlineResponseConfig] RecognitionOutputConfig inlineResponseConfig + * @property {google.cloud.speech.v2.IOutputFormatConfig|null} [outputFormatConfig] RecognitionOutputConfig outputFormatConfig + */ + + /** + * Constructs a new RecognitionOutputConfig. + * @memberof google.cloud.speech.v2 + * @classdesc Represents a RecognitionOutputConfig. + * @implements IRecognitionOutputConfig + * @constructor + * @param {google.cloud.speech.v2.IRecognitionOutputConfig=} [properties] Properties to set + */ + function RecognitionOutputConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RecognitionOutputConfig gcsOutputConfig. + * @member {google.cloud.speech.v2.IGcsOutputConfig|null|undefined} gcsOutputConfig + * @memberof google.cloud.speech.v2.RecognitionOutputConfig + * @instance + */ + RecognitionOutputConfig.prototype.gcsOutputConfig = null; + + /** + * RecognitionOutputConfig inlineResponseConfig. + * @member {google.cloud.speech.v2.IInlineOutputConfig|null|undefined} inlineResponseConfig + * @memberof google.cloud.speech.v2.RecognitionOutputConfig + * @instance + */ + RecognitionOutputConfig.prototype.inlineResponseConfig = null; + + /** + * RecognitionOutputConfig outputFormatConfig. + * @member {google.cloud.speech.v2.IOutputFormatConfig|null|undefined} outputFormatConfig + * @memberof google.cloud.speech.v2.RecognitionOutputConfig + * @instance + */ + RecognitionOutputConfig.prototype.outputFormatConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RecognitionOutputConfig output. + * @member {"gcsOutputConfig"|"inlineResponseConfig"|undefined} output + * @memberof google.cloud.speech.v2.RecognitionOutputConfig + * @instance + */ + Object.defineProperty(RecognitionOutputConfig.prototype, "output", { + get: $util.oneOfGetter($oneOfFields = ["gcsOutputConfig", "inlineResponseConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RecognitionOutputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.RecognitionOutputConfig + * @static + * @param {google.cloud.speech.v2.IRecognitionOutputConfig=} [properties] Properties to set + * @returns {google.cloud.speech.v2.RecognitionOutputConfig} RecognitionOutputConfig instance + */ + RecognitionOutputConfig.create = function create(properties) { + return new RecognitionOutputConfig(properties); + }; + + /** + * Encodes the specified RecognitionOutputConfig message. Does not implicitly {@link google.cloud.speech.v2.RecognitionOutputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.RecognitionOutputConfig + * @static + * @param {google.cloud.speech.v2.IRecognitionOutputConfig} message RecognitionOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecognitionOutputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsOutputConfig != null && Object.hasOwnProperty.call(message, "gcsOutputConfig")) + $root.google.cloud.speech.v2.GcsOutputConfig.encode(message.gcsOutputConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.inlineResponseConfig != null && Object.hasOwnProperty.call(message, "inlineResponseConfig")) + $root.google.cloud.speech.v2.InlineOutputConfig.encode(message.inlineResponseConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.outputFormatConfig != null && Object.hasOwnProperty.call(message, "outputFormatConfig")) + $root.google.cloud.speech.v2.OutputFormatConfig.encode(message.outputFormatConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RecognitionOutputConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v2.RecognitionOutputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.RecognitionOutputConfig + * @static + * @param {google.cloud.speech.v2.IRecognitionOutputConfig} message RecognitionOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecognitionOutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RecognitionOutputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.RecognitionOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.RecognitionOutputConfig} RecognitionOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecognitionOutputConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.RecognitionOutputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.gcsOutputConfig = $root.google.cloud.speech.v2.GcsOutputConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.inlineResponseConfig = $root.google.cloud.speech.v2.InlineOutputConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.outputFormatConfig = $root.google.cloud.speech.v2.OutputFormatConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RecognitionOutputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.RecognitionOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.RecognitionOutputConfig} RecognitionOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecognitionOutputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RecognitionOutputConfig message. + * @function verify + * @memberof google.cloud.speech.v2.RecognitionOutputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RecognitionOutputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsOutputConfig != null && message.hasOwnProperty("gcsOutputConfig")) { + properties.output = 1; + { + var error = $root.google.cloud.speech.v2.GcsOutputConfig.verify(message.gcsOutputConfig); + if (error) + return "gcsOutputConfig." + error; + } + } + if (message.inlineResponseConfig != null && message.hasOwnProperty("inlineResponseConfig")) { + if (properties.output === 1) + return "output: multiple values"; + properties.output = 1; + { + var error = $root.google.cloud.speech.v2.InlineOutputConfig.verify(message.inlineResponseConfig); + if (error) + return "inlineResponseConfig." + error; + } + } + if (message.outputFormatConfig != null && message.hasOwnProperty("outputFormatConfig")) { + var error = $root.google.cloud.speech.v2.OutputFormatConfig.verify(message.outputFormatConfig); + if (error) + return "outputFormatConfig." + error; + } + return null; + }; + + /** + * Creates a RecognitionOutputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.RecognitionOutputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.RecognitionOutputConfig} RecognitionOutputConfig + */ + RecognitionOutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.RecognitionOutputConfig) + return object; + var message = new $root.google.cloud.speech.v2.RecognitionOutputConfig(); + if (object.gcsOutputConfig != null) { + if (typeof object.gcsOutputConfig !== "object") + throw TypeError(".google.cloud.speech.v2.RecognitionOutputConfig.gcsOutputConfig: object expected"); + message.gcsOutputConfig = $root.google.cloud.speech.v2.GcsOutputConfig.fromObject(object.gcsOutputConfig); + } + if (object.inlineResponseConfig != null) { + if (typeof object.inlineResponseConfig !== "object") + throw TypeError(".google.cloud.speech.v2.RecognitionOutputConfig.inlineResponseConfig: object expected"); + message.inlineResponseConfig = $root.google.cloud.speech.v2.InlineOutputConfig.fromObject(object.inlineResponseConfig); + } + if (object.outputFormatConfig != null) { + if (typeof object.outputFormatConfig !== "object") + throw TypeError(".google.cloud.speech.v2.RecognitionOutputConfig.outputFormatConfig: object expected"); + message.outputFormatConfig = $root.google.cloud.speech.v2.OutputFormatConfig.fromObject(object.outputFormatConfig); + } + return message; + }; + + /** + * Creates a plain object from a RecognitionOutputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.RecognitionOutputConfig + * @static + * @param {google.cloud.speech.v2.RecognitionOutputConfig} message RecognitionOutputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RecognitionOutputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.outputFormatConfig = null; + if (message.gcsOutputConfig != null && message.hasOwnProperty("gcsOutputConfig")) { + object.gcsOutputConfig = $root.google.cloud.speech.v2.GcsOutputConfig.toObject(message.gcsOutputConfig, options); + if (options.oneofs) + object.output = "gcsOutputConfig"; + } + if (message.inlineResponseConfig != null && message.hasOwnProperty("inlineResponseConfig")) { + object.inlineResponseConfig = $root.google.cloud.speech.v2.InlineOutputConfig.toObject(message.inlineResponseConfig, options); + if (options.oneofs) + object.output = "inlineResponseConfig"; + } + if (message.outputFormatConfig != null && message.hasOwnProperty("outputFormatConfig")) + object.outputFormatConfig = $root.google.cloud.speech.v2.OutputFormatConfig.toObject(message.outputFormatConfig, options); + return object; + }; + + /** + * Converts this RecognitionOutputConfig to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.RecognitionOutputConfig + * @instance + * @returns {Object.} JSON object + */ + RecognitionOutputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RecognitionOutputConfig + * @function getTypeUrl + * @memberof google.cloud.speech.v2.RecognitionOutputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RecognitionOutputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.RecognitionOutputConfig"; + }; + + return RecognitionOutputConfig; + })(); + + v2.BatchRecognizeResponse = (function() { + + /** + * Properties of a BatchRecognizeResponse. + * @memberof google.cloud.speech.v2 + * @interface IBatchRecognizeResponse + * @property {Object.|null} [results] BatchRecognizeResponse results + * @property {google.protobuf.IDuration|null} [totalBilledDuration] BatchRecognizeResponse totalBilledDuration + */ + + /** + * Constructs a new BatchRecognizeResponse. + * @memberof google.cloud.speech.v2 + * @classdesc Represents a BatchRecognizeResponse. + * @implements IBatchRecognizeResponse + * @constructor + * @param {google.cloud.speech.v2.IBatchRecognizeResponse=} [properties] Properties to set + */ + function BatchRecognizeResponse(properties) { + this.results = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchRecognizeResponse results. + * @member {Object.} results + * @memberof google.cloud.speech.v2.BatchRecognizeResponse + * @instance + */ + BatchRecognizeResponse.prototype.results = $util.emptyObject; + + /** + * BatchRecognizeResponse totalBilledDuration. + * @member {google.protobuf.IDuration|null|undefined} totalBilledDuration + * @memberof google.cloud.speech.v2.BatchRecognizeResponse + * @instance + */ + BatchRecognizeResponse.prototype.totalBilledDuration = null; + + /** + * Creates a new BatchRecognizeResponse instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.BatchRecognizeResponse + * @static + * @param {google.cloud.speech.v2.IBatchRecognizeResponse=} [properties] Properties to set + * @returns {google.cloud.speech.v2.BatchRecognizeResponse} BatchRecognizeResponse instance + */ + BatchRecognizeResponse.create = function create(properties) { + return new BatchRecognizeResponse(properties); + }; + + /** + * Encodes the specified BatchRecognizeResponse message. Does not implicitly {@link google.cloud.speech.v2.BatchRecognizeResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.BatchRecognizeResponse + * @static + * @param {google.cloud.speech.v2.IBatchRecognizeResponse} message BatchRecognizeResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchRecognizeResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.results != null && Object.hasOwnProperty.call(message, "results")) + for (var keys = Object.keys(message.results), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.speech.v2.BatchRecognizeFileResult.encode(message.results[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.totalBilledDuration != null && Object.hasOwnProperty.call(message, "totalBilledDuration")) + $root.google.protobuf.Duration.encode(message.totalBilledDuration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchRecognizeResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v2.BatchRecognizeResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.BatchRecognizeResponse + * @static + * @param {google.cloud.speech.v2.IBatchRecognizeResponse} message BatchRecognizeResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchRecognizeResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchRecognizeResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.BatchRecognizeResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.BatchRecognizeResponse} BatchRecognizeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchRecognizeResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.BatchRecognizeResponse(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (message.results === $util.emptyObject) + message.results = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.speech.v2.BatchRecognizeFileResult.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.results[key] = value; + break; + } + case 2: { + message.totalBilledDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchRecognizeResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.BatchRecognizeResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.BatchRecognizeResponse} BatchRecognizeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchRecognizeResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchRecognizeResponse message. + * @function verify + * @memberof google.cloud.speech.v2.BatchRecognizeResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchRecognizeResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.results != null && message.hasOwnProperty("results")) { + if (!$util.isObject(message.results)) + return "results: object expected"; + var key = Object.keys(message.results); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.speech.v2.BatchRecognizeFileResult.verify(message.results[key[i]]); + if (error) + return "results." + error; + } + } + if (message.totalBilledDuration != null && message.hasOwnProperty("totalBilledDuration")) { + var error = $root.google.protobuf.Duration.verify(message.totalBilledDuration); + if (error) + return "totalBilledDuration." + error; + } + return null; + }; + + /** + * Creates a BatchRecognizeResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.BatchRecognizeResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.BatchRecognizeResponse} BatchRecognizeResponse + */ + BatchRecognizeResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.BatchRecognizeResponse) + return object; + var message = new $root.google.cloud.speech.v2.BatchRecognizeResponse(); + if (object.results) { + if (typeof object.results !== "object") + throw TypeError(".google.cloud.speech.v2.BatchRecognizeResponse.results: object expected"); + message.results = {}; + for (var keys = Object.keys(object.results), i = 0; i < keys.length; ++i) { + if (typeof object.results[keys[i]] !== "object") + throw TypeError(".google.cloud.speech.v2.BatchRecognizeResponse.results: object expected"); + message.results[keys[i]] = $root.google.cloud.speech.v2.BatchRecognizeFileResult.fromObject(object.results[keys[i]]); + } + } + if (object.totalBilledDuration != null) { + if (typeof object.totalBilledDuration !== "object") + throw TypeError(".google.cloud.speech.v2.BatchRecognizeResponse.totalBilledDuration: object expected"); + message.totalBilledDuration = $root.google.protobuf.Duration.fromObject(object.totalBilledDuration); + } + return message; + }; + + /** + * Creates a plain object from a BatchRecognizeResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.BatchRecognizeResponse + * @static + * @param {google.cloud.speech.v2.BatchRecognizeResponse} message BatchRecognizeResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchRecognizeResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.results = {}; + if (options.defaults) + object.totalBilledDuration = null; + var keys2; + if (message.results && (keys2 = Object.keys(message.results)).length) { + object.results = {}; + for (var j = 0; j < keys2.length; ++j) + object.results[keys2[j]] = $root.google.cloud.speech.v2.BatchRecognizeFileResult.toObject(message.results[keys2[j]], options); + } + if (message.totalBilledDuration != null && message.hasOwnProperty("totalBilledDuration")) + object.totalBilledDuration = $root.google.protobuf.Duration.toObject(message.totalBilledDuration, options); + return object; + }; + + /** + * Converts this BatchRecognizeResponse to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.BatchRecognizeResponse + * @instance + * @returns {Object.} JSON object + */ + BatchRecognizeResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchRecognizeResponse + * @function getTypeUrl + * @memberof google.cloud.speech.v2.BatchRecognizeResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchRecognizeResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.BatchRecognizeResponse"; + }; + + return BatchRecognizeResponse; + })(); + + v2.BatchRecognizeResults = (function() { + + /** + * Properties of a BatchRecognizeResults. + * @memberof google.cloud.speech.v2 + * @interface IBatchRecognizeResults + * @property {Array.|null} [results] BatchRecognizeResults results + * @property {google.cloud.speech.v2.IRecognitionResponseMetadata|null} [metadata] BatchRecognizeResults metadata + */ + + /** + * Constructs a new BatchRecognizeResults. + * @memberof google.cloud.speech.v2 + * @classdesc Represents a BatchRecognizeResults. + * @implements IBatchRecognizeResults + * @constructor + * @param {google.cloud.speech.v2.IBatchRecognizeResults=} [properties] Properties to set + */ + function BatchRecognizeResults(properties) { + this.results = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchRecognizeResults results. + * @member {Array.} results + * @memberof google.cloud.speech.v2.BatchRecognizeResults + * @instance + */ + BatchRecognizeResults.prototype.results = $util.emptyArray; + + /** + * BatchRecognizeResults metadata. + * @member {google.cloud.speech.v2.IRecognitionResponseMetadata|null|undefined} metadata + * @memberof google.cloud.speech.v2.BatchRecognizeResults + * @instance + */ + BatchRecognizeResults.prototype.metadata = null; + + /** + * Creates a new BatchRecognizeResults instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.BatchRecognizeResults + * @static + * @param {google.cloud.speech.v2.IBatchRecognizeResults=} [properties] Properties to set + * @returns {google.cloud.speech.v2.BatchRecognizeResults} BatchRecognizeResults instance + */ + BatchRecognizeResults.create = function create(properties) { + return new BatchRecognizeResults(properties); + }; + + /** + * Encodes the specified BatchRecognizeResults message. Does not implicitly {@link google.cloud.speech.v2.BatchRecognizeResults.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.BatchRecognizeResults + * @static + * @param {google.cloud.speech.v2.IBatchRecognizeResults} message BatchRecognizeResults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchRecognizeResults.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.results != null && message.results.length) + for (var i = 0; i < message.results.length; ++i) + $root.google.cloud.speech.v2.SpeechRecognitionResult.encode(message.results[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.cloud.speech.v2.RecognitionResponseMetadata.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchRecognizeResults message, length delimited. Does not implicitly {@link google.cloud.speech.v2.BatchRecognizeResults.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.BatchRecognizeResults + * @static + * @param {google.cloud.speech.v2.IBatchRecognizeResults} message BatchRecognizeResults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchRecognizeResults.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchRecognizeResults message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.BatchRecognizeResults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.BatchRecognizeResults} BatchRecognizeResults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchRecognizeResults.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.BatchRecognizeResults(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.results && message.results.length)) + message.results = []; + message.results.push($root.google.cloud.speech.v2.SpeechRecognitionResult.decode(reader, reader.uint32())); + break; + } + case 2: { + message.metadata = $root.google.cloud.speech.v2.RecognitionResponseMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchRecognizeResults message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.BatchRecognizeResults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.BatchRecognizeResults} BatchRecognizeResults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchRecognizeResults.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchRecognizeResults message. + * @function verify + * @memberof google.cloud.speech.v2.BatchRecognizeResults + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchRecognizeResults.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.results != null && message.hasOwnProperty("results")) { + if (!Array.isArray(message.results)) + return "results: array expected"; + for (var i = 0; i < message.results.length; ++i) { + var error = $root.google.cloud.speech.v2.SpeechRecognitionResult.verify(message.results[i]); + if (error) + return "results." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.cloud.speech.v2.RecognitionResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a BatchRecognizeResults message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.BatchRecognizeResults + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.BatchRecognizeResults} BatchRecognizeResults + */ + BatchRecognizeResults.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.BatchRecognizeResults) + return object; + var message = new $root.google.cloud.speech.v2.BatchRecognizeResults(); + if (object.results) { + if (!Array.isArray(object.results)) + throw TypeError(".google.cloud.speech.v2.BatchRecognizeResults.results: array expected"); + message.results = []; + for (var i = 0; i < object.results.length; ++i) { + if (typeof object.results[i] !== "object") + throw TypeError(".google.cloud.speech.v2.BatchRecognizeResults.results: object expected"); + message.results[i] = $root.google.cloud.speech.v2.SpeechRecognitionResult.fromObject(object.results[i]); + } + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.speech.v2.BatchRecognizeResults.metadata: object expected"); + message.metadata = $root.google.cloud.speech.v2.RecognitionResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a BatchRecognizeResults message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.BatchRecognizeResults + * @static + * @param {google.cloud.speech.v2.BatchRecognizeResults} message BatchRecognizeResults + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchRecognizeResults.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.results = []; + if (options.defaults) + object.metadata = null; + if (message.results && message.results.length) { + object.results = []; + for (var j = 0; j < message.results.length; ++j) + object.results[j] = $root.google.cloud.speech.v2.SpeechRecognitionResult.toObject(message.results[j], options); + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.cloud.speech.v2.RecognitionResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this BatchRecognizeResults to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.BatchRecognizeResults + * @instance + * @returns {Object.} JSON object + */ + BatchRecognizeResults.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchRecognizeResults + * @function getTypeUrl + * @memberof google.cloud.speech.v2.BatchRecognizeResults + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchRecognizeResults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.BatchRecognizeResults"; + }; + + return BatchRecognizeResults; + })(); + + v2.CloudStorageResult = (function() { + + /** + * Properties of a CloudStorageResult. + * @memberof google.cloud.speech.v2 + * @interface ICloudStorageResult + * @property {string|null} [uri] CloudStorageResult uri + * @property {string|null} [vttFormatUri] CloudStorageResult vttFormatUri + * @property {string|null} [srtFormatUri] CloudStorageResult srtFormatUri + */ + + /** + * Constructs a new CloudStorageResult. + * @memberof google.cloud.speech.v2 + * @classdesc Represents a CloudStorageResult. + * @implements ICloudStorageResult + * @constructor + * @param {google.cloud.speech.v2.ICloudStorageResult=} [properties] Properties to set + */ + function CloudStorageResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloudStorageResult uri. + * @member {string} uri + * @memberof google.cloud.speech.v2.CloudStorageResult + * @instance + */ + CloudStorageResult.prototype.uri = ""; + + /** + * CloudStorageResult vttFormatUri. + * @member {string} vttFormatUri + * @memberof google.cloud.speech.v2.CloudStorageResult + * @instance + */ + CloudStorageResult.prototype.vttFormatUri = ""; + + /** + * CloudStorageResult srtFormatUri. + * @member {string} srtFormatUri + * @memberof google.cloud.speech.v2.CloudStorageResult + * @instance + */ + CloudStorageResult.prototype.srtFormatUri = ""; + + /** + * Creates a new CloudStorageResult instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.CloudStorageResult + * @static + * @param {google.cloud.speech.v2.ICloudStorageResult=} [properties] Properties to set + * @returns {google.cloud.speech.v2.CloudStorageResult} CloudStorageResult instance + */ + CloudStorageResult.create = function create(properties) { + return new CloudStorageResult(properties); + }; + + /** + * Encodes the specified CloudStorageResult message. Does not implicitly {@link google.cloud.speech.v2.CloudStorageResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.CloudStorageResult + * @static + * @param {google.cloud.speech.v2.ICloudStorageResult} message CloudStorageResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudStorageResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + if (message.vttFormatUri != null && Object.hasOwnProperty.call(message, "vttFormatUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.vttFormatUri); + if (message.srtFormatUri != null && Object.hasOwnProperty.call(message, "srtFormatUri")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.srtFormatUri); + return writer; + }; + + /** + * Encodes the specified CloudStorageResult message, length delimited. Does not implicitly {@link google.cloud.speech.v2.CloudStorageResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.CloudStorageResult + * @static + * @param {google.cloud.speech.v2.ICloudStorageResult} message CloudStorageResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudStorageResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudStorageResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.CloudStorageResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.CloudStorageResult} CloudStorageResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudStorageResult.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.CloudStorageResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.uri = reader.string(); + break; + } + case 2: { + message.vttFormatUri = reader.string(); + break; + } + case 3: { + message.srtFormatUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudStorageResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.CloudStorageResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.CloudStorageResult} CloudStorageResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudStorageResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudStorageResult message. + * @function verify + * @memberof google.cloud.speech.v2.CloudStorageResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudStorageResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + if (message.vttFormatUri != null && message.hasOwnProperty("vttFormatUri")) + if (!$util.isString(message.vttFormatUri)) + return "vttFormatUri: string expected"; + if (message.srtFormatUri != null && message.hasOwnProperty("srtFormatUri")) + if (!$util.isString(message.srtFormatUri)) + return "srtFormatUri: string expected"; + return null; + }; + + /** + * Creates a CloudStorageResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.CloudStorageResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.CloudStorageResult} CloudStorageResult + */ + CloudStorageResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.CloudStorageResult) + return object; + var message = new $root.google.cloud.speech.v2.CloudStorageResult(); + if (object.uri != null) + message.uri = String(object.uri); + if (object.vttFormatUri != null) + message.vttFormatUri = String(object.vttFormatUri); + if (object.srtFormatUri != null) + message.srtFormatUri = String(object.srtFormatUri); + return message; + }; + + /** + * Creates a plain object from a CloudStorageResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.CloudStorageResult + * @static + * @param {google.cloud.speech.v2.CloudStorageResult} message CloudStorageResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudStorageResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.uri = ""; + object.vttFormatUri = ""; + object.srtFormatUri = ""; + } + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + if (message.vttFormatUri != null && message.hasOwnProperty("vttFormatUri")) + object.vttFormatUri = message.vttFormatUri; + if (message.srtFormatUri != null && message.hasOwnProperty("srtFormatUri")) + object.srtFormatUri = message.srtFormatUri; + return object; + }; + + /** + * Converts this CloudStorageResult to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.CloudStorageResult + * @instance + * @returns {Object.} JSON object + */ + CloudStorageResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudStorageResult + * @function getTypeUrl + * @memberof google.cloud.speech.v2.CloudStorageResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudStorageResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.CloudStorageResult"; + }; + + return CloudStorageResult; + })(); + + v2.InlineResult = (function() { + + /** + * Properties of an InlineResult. + * @memberof google.cloud.speech.v2 + * @interface IInlineResult + * @property {google.cloud.speech.v2.IBatchRecognizeResults|null} [transcript] InlineResult transcript + * @property {string|null} [vttCaptions] InlineResult vttCaptions + * @property {string|null} [srtCaptions] InlineResult srtCaptions + */ + + /** + * Constructs a new InlineResult. + * @memberof google.cloud.speech.v2 + * @classdesc Represents an InlineResult. + * @implements IInlineResult + * @constructor + * @param {google.cloud.speech.v2.IInlineResult=} [properties] Properties to set + */ + function InlineResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InlineResult transcript. + * @member {google.cloud.speech.v2.IBatchRecognizeResults|null|undefined} transcript + * @memberof google.cloud.speech.v2.InlineResult + * @instance + */ + InlineResult.prototype.transcript = null; + + /** + * InlineResult vttCaptions. + * @member {string} vttCaptions + * @memberof google.cloud.speech.v2.InlineResult + * @instance + */ + InlineResult.prototype.vttCaptions = ""; + + /** + * InlineResult srtCaptions. + * @member {string} srtCaptions + * @memberof google.cloud.speech.v2.InlineResult + * @instance + */ + InlineResult.prototype.srtCaptions = ""; + + /** + * Creates a new InlineResult instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.InlineResult + * @static + * @param {google.cloud.speech.v2.IInlineResult=} [properties] Properties to set + * @returns {google.cloud.speech.v2.InlineResult} InlineResult instance + */ + InlineResult.create = function create(properties) { + return new InlineResult(properties); + }; + + /** + * Encodes the specified InlineResult message. Does not implicitly {@link google.cloud.speech.v2.InlineResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.InlineResult + * @static + * @param {google.cloud.speech.v2.IInlineResult} message InlineResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InlineResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.transcript != null && Object.hasOwnProperty.call(message, "transcript")) + $root.google.cloud.speech.v2.BatchRecognizeResults.encode(message.transcript, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.vttCaptions != null && Object.hasOwnProperty.call(message, "vttCaptions")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.vttCaptions); + if (message.srtCaptions != null && Object.hasOwnProperty.call(message, "srtCaptions")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.srtCaptions); + return writer; + }; + + /** + * Encodes the specified InlineResult message, length delimited. Does not implicitly {@link google.cloud.speech.v2.InlineResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.InlineResult + * @static + * @param {google.cloud.speech.v2.IInlineResult} message InlineResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InlineResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InlineResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.InlineResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.InlineResult} InlineResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InlineResult.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.InlineResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.transcript = $root.google.cloud.speech.v2.BatchRecognizeResults.decode(reader, reader.uint32()); + break; + } + case 2: { + message.vttCaptions = reader.string(); + break; + } + case 3: { + message.srtCaptions = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InlineResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.InlineResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.InlineResult} InlineResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InlineResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InlineResult message. + * @function verify + * @memberof google.cloud.speech.v2.InlineResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InlineResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.transcript != null && message.hasOwnProperty("transcript")) { + var error = $root.google.cloud.speech.v2.BatchRecognizeResults.verify(message.transcript); + if (error) + return "transcript." + error; + } + if (message.vttCaptions != null && message.hasOwnProperty("vttCaptions")) + if (!$util.isString(message.vttCaptions)) + return "vttCaptions: string expected"; + if (message.srtCaptions != null && message.hasOwnProperty("srtCaptions")) + if (!$util.isString(message.srtCaptions)) + return "srtCaptions: string expected"; + return null; + }; + + /** + * Creates an InlineResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.InlineResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.InlineResult} InlineResult + */ + InlineResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.InlineResult) + return object; + var message = new $root.google.cloud.speech.v2.InlineResult(); + if (object.transcript != null) { + if (typeof object.transcript !== "object") + throw TypeError(".google.cloud.speech.v2.InlineResult.transcript: object expected"); + message.transcript = $root.google.cloud.speech.v2.BatchRecognizeResults.fromObject(object.transcript); + } + if (object.vttCaptions != null) + message.vttCaptions = String(object.vttCaptions); + if (object.srtCaptions != null) + message.srtCaptions = String(object.srtCaptions); + return message; + }; + + /** + * Creates a plain object from an InlineResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.InlineResult + * @static + * @param {google.cloud.speech.v2.InlineResult} message InlineResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InlineResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.transcript = null; + object.vttCaptions = ""; + object.srtCaptions = ""; + } + if (message.transcript != null && message.hasOwnProperty("transcript")) + object.transcript = $root.google.cloud.speech.v2.BatchRecognizeResults.toObject(message.transcript, options); + if (message.vttCaptions != null && message.hasOwnProperty("vttCaptions")) + object.vttCaptions = message.vttCaptions; + if (message.srtCaptions != null && message.hasOwnProperty("srtCaptions")) + object.srtCaptions = message.srtCaptions; + return object; + }; + + /** + * Converts this InlineResult to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.InlineResult + * @instance + * @returns {Object.} JSON object + */ + InlineResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InlineResult + * @function getTypeUrl + * @memberof google.cloud.speech.v2.InlineResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InlineResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.InlineResult"; + }; + + return InlineResult; + })(); + + v2.BatchRecognizeFileResult = (function() { + + /** + * Properties of a BatchRecognizeFileResult. + * @memberof google.cloud.speech.v2 + * @interface IBatchRecognizeFileResult + * @property {google.rpc.IStatus|null} [error] BatchRecognizeFileResult error + * @property {google.cloud.speech.v2.IRecognitionResponseMetadata|null} [metadata] BatchRecognizeFileResult metadata + * @property {google.cloud.speech.v2.ICloudStorageResult|null} [cloudStorageResult] BatchRecognizeFileResult cloudStorageResult + * @property {google.cloud.speech.v2.IInlineResult|null} [inlineResult] BatchRecognizeFileResult inlineResult + * @property {string|null} [uri] BatchRecognizeFileResult uri + * @property {google.cloud.speech.v2.IBatchRecognizeResults|null} [transcript] BatchRecognizeFileResult transcript + */ + + /** + * Constructs a new BatchRecognizeFileResult. + * @memberof google.cloud.speech.v2 + * @classdesc Represents a BatchRecognizeFileResult. + * @implements IBatchRecognizeFileResult + * @constructor + * @param {google.cloud.speech.v2.IBatchRecognizeFileResult=} [properties] Properties to set + */ + function BatchRecognizeFileResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchRecognizeFileResult error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.speech.v2.BatchRecognizeFileResult + * @instance + */ + BatchRecognizeFileResult.prototype.error = null; + + /** + * BatchRecognizeFileResult metadata. + * @member {google.cloud.speech.v2.IRecognitionResponseMetadata|null|undefined} metadata + * @memberof google.cloud.speech.v2.BatchRecognizeFileResult + * @instance + */ + BatchRecognizeFileResult.prototype.metadata = null; + + /** + * BatchRecognizeFileResult cloudStorageResult. + * @member {google.cloud.speech.v2.ICloudStorageResult|null|undefined} cloudStorageResult + * @memberof google.cloud.speech.v2.BatchRecognizeFileResult + * @instance + */ + BatchRecognizeFileResult.prototype.cloudStorageResult = null; + + /** + * BatchRecognizeFileResult inlineResult. + * @member {google.cloud.speech.v2.IInlineResult|null|undefined} inlineResult + * @memberof google.cloud.speech.v2.BatchRecognizeFileResult + * @instance + */ + BatchRecognizeFileResult.prototype.inlineResult = null; + + /** + * BatchRecognizeFileResult uri. + * @member {string} uri + * @memberof google.cloud.speech.v2.BatchRecognizeFileResult + * @instance + */ + BatchRecognizeFileResult.prototype.uri = ""; + + /** + * BatchRecognizeFileResult transcript. + * @member {google.cloud.speech.v2.IBatchRecognizeResults|null|undefined} transcript + * @memberof google.cloud.speech.v2.BatchRecognizeFileResult + * @instance + */ + BatchRecognizeFileResult.prototype.transcript = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BatchRecognizeFileResult result. + * @member {"cloudStorageResult"|"inlineResult"|undefined} result + * @memberof google.cloud.speech.v2.BatchRecognizeFileResult + * @instance + */ + Object.defineProperty(BatchRecognizeFileResult.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["cloudStorageResult", "inlineResult"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BatchRecognizeFileResult instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.BatchRecognizeFileResult + * @static + * @param {google.cloud.speech.v2.IBatchRecognizeFileResult=} [properties] Properties to set + * @returns {google.cloud.speech.v2.BatchRecognizeFileResult} BatchRecognizeFileResult instance + */ + BatchRecognizeFileResult.create = function create(properties) { + return new BatchRecognizeFileResult(properties); + }; + + /** + * Encodes the specified BatchRecognizeFileResult message. Does not implicitly {@link google.cloud.speech.v2.BatchRecognizeFileResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.BatchRecognizeFileResult + * @static + * @param {google.cloud.speech.v2.IBatchRecognizeFileResult} message BatchRecognizeFileResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchRecognizeFileResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.cloud.speech.v2.RecognitionResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.transcript != null && Object.hasOwnProperty.call(message, "transcript")) + $root.google.cloud.speech.v2.BatchRecognizeResults.encode(message.transcript, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.cloudStorageResult != null && Object.hasOwnProperty.call(message, "cloudStorageResult")) + $root.google.cloud.speech.v2.CloudStorageResult.encode(message.cloudStorageResult, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.inlineResult != null && Object.hasOwnProperty.call(message, "inlineResult")) + $root.google.cloud.speech.v2.InlineResult.encode(message.inlineResult, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchRecognizeFileResult message, length delimited. Does not implicitly {@link google.cloud.speech.v2.BatchRecognizeFileResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.BatchRecognizeFileResult + * @static + * @param {google.cloud.speech.v2.IBatchRecognizeFileResult} message BatchRecognizeFileResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchRecognizeFileResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchRecognizeFileResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.BatchRecognizeFileResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.BatchRecognizeFileResult} BatchRecognizeFileResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchRecognizeFileResult.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.BatchRecognizeFileResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 3: { + message.metadata = $root.google.cloud.speech.v2.RecognitionResponseMetadata.decode(reader, reader.uint32()); + break; + } + case 5: { + message.cloudStorageResult = $root.google.cloud.speech.v2.CloudStorageResult.decode(reader, reader.uint32()); + break; + } + case 6: { + message.inlineResult = $root.google.cloud.speech.v2.InlineResult.decode(reader, reader.uint32()); + break; + } + case 1: { + message.uri = reader.string(); + break; + } + case 4: { + message.transcript = $root.google.cloud.speech.v2.BatchRecognizeResults.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchRecognizeFileResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.BatchRecognizeFileResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.BatchRecognizeFileResult} BatchRecognizeFileResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchRecognizeFileResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchRecognizeFileResult message. + * @function verify + * @memberof google.cloud.speech.v2.BatchRecognizeFileResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchRecognizeFileResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.error != null && message.hasOwnProperty("error")) { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.cloud.speech.v2.RecognitionResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.cloudStorageResult != null && message.hasOwnProperty("cloudStorageResult")) { + properties.result = 1; + { + var error = $root.google.cloud.speech.v2.CloudStorageResult.verify(message.cloudStorageResult); + if (error) + return "cloudStorageResult." + error; + } + } + if (message.inlineResult != null && message.hasOwnProperty("inlineResult")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.cloud.speech.v2.InlineResult.verify(message.inlineResult); + if (error) + return "inlineResult." + error; + } + } + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + if (message.transcript != null && message.hasOwnProperty("transcript")) { + var error = $root.google.cloud.speech.v2.BatchRecognizeResults.verify(message.transcript); + if (error) + return "transcript." + error; + } + return null; + }; + + /** + * Creates a BatchRecognizeFileResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.BatchRecognizeFileResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.BatchRecognizeFileResult} BatchRecognizeFileResult + */ + BatchRecognizeFileResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.BatchRecognizeFileResult) + return object; + var message = new $root.google.cloud.speech.v2.BatchRecognizeFileResult(); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.speech.v2.BatchRecognizeFileResult.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.speech.v2.BatchRecognizeFileResult.metadata: object expected"); + message.metadata = $root.google.cloud.speech.v2.RecognitionResponseMetadata.fromObject(object.metadata); + } + if (object.cloudStorageResult != null) { + if (typeof object.cloudStorageResult !== "object") + throw TypeError(".google.cloud.speech.v2.BatchRecognizeFileResult.cloudStorageResult: object expected"); + message.cloudStorageResult = $root.google.cloud.speech.v2.CloudStorageResult.fromObject(object.cloudStorageResult); + } + if (object.inlineResult != null) { + if (typeof object.inlineResult !== "object") + throw TypeError(".google.cloud.speech.v2.BatchRecognizeFileResult.inlineResult: object expected"); + message.inlineResult = $root.google.cloud.speech.v2.InlineResult.fromObject(object.inlineResult); + } + if (object.uri != null) + message.uri = String(object.uri); + if (object.transcript != null) { + if (typeof object.transcript !== "object") + throw TypeError(".google.cloud.speech.v2.BatchRecognizeFileResult.transcript: object expected"); + message.transcript = $root.google.cloud.speech.v2.BatchRecognizeResults.fromObject(object.transcript); + } + return message; + }; + + /** + * Creates a plain object from a BatchRecognizeFileResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.BatchRecognizeFileResult + * @static + * @param {google.cloud.speech.v2.BatchRecognizeFileResult} message BatchRecognizeFileResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchRecognizeFileResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.uri = ""; + object.error = null; + object.metadata = null; + object.transcript = null; + } + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + if (message.error != null && message.hasOwnProperty("error")) + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.cloud.speech.v2.RecognitionResponseMetadata.toObject(message.metadata, options); + if (message.transcript != null && message.hasOwnProperty("transcript")) + object.transcript = $root.google.cloud.speech.v2.BatchRecognizeResults.toObject(message.transcript, options); + if (message.cloudStorageResult != null && message.hasOwnProperty("cloudStorageResult")) { + object.cloudStorageResult = $root.google.cloud.speech.v2.CloudStorageResult.toObject(message.cloudStorageResult, options); + if (options.oneofs) + object.result = "cloudStorageResult"; + } + if (message.inlineResult != null && message.hasOwnProperty("inlineResult")) { + object.inlineResult = $root.google.cloud.speech.v2.InlineResult.toObject(message.inlineResult, options); + if (options.oneofs) + object.result = "inlineResult"; + } + return object; + }; + + /** + * Converts this BatchRecognizeFileResult to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.BatchRecognizeFileResult + * @instance + * @returns {Object.} JSON object + */ + BatchRecognizeFileResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchRecognizeFileResult + * @function getTypeUrl + * @memberof google.cloud.speech.v2.BatchRecognizeFileResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchRecognizeFileResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.BatchRecognizeFileResult"; + }; + + return BatchRecognizeFileResult; + })(); + + v2.BatchRecognizeTranscriptionMetadata = (function() { + + /** + * Properties of a BatchRecognizeTranscriptionMetadata. + * @memberof google.cloud.speech.v2 + * @interface IBatchRecognizeTranscriptionMetadata + * @property {number|null} [progressPercent] BatchRecognizeTranscriptionMetadata progressPercent + * @property {google.rpc.IStatus|null} [error] BatchRecognizeTranscriptionMetadata error + * @property {string|null} [uri] BatchRecognizeTranscriptionMetadata uri + */ + + /** + * Constructs a new BatchRecognizeTranscriptionMetadata. + * @memberof google.cloud.speech.v2 + * @classdesc Represents a BatchRecognizeTranscriptionMetadata. + * @implements IBatchRecognizeTranscriptionMetadata + * @constructor + * @param {google.cloud.speech.v2.IBatchRecognizeTranscriptionMetadata=} [properties] Properties to set + */ + function BatchRecognizeTranscriptionMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchRecognizeTranscriptionMetadata progressPercent. + * @member {number} progressPercent + * @memberof google.cloud.speech.v2.BatchRecognizeTranscriptionMetadata + * @instance + */ + BatchRecognizeTranscriptionMetadata.prototype.progressPercent = 0; + + /** + * BatchRecognizeTranscriptionMetadata error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.speech.v2.BatchRecognizeTranscriptionMetadata + * @instance + */ + BatchRecognizeTranscriptionMetadata.prototype.error = null; + + /** + * BatchRecognizeTranscriptionMetadata uri. + * @member {string} uri + * @memberof google.cloud.speech.v2.BatchRecognizeTranscriptionMetadata + * @instance + */ + BatchRecognizeTranscriptionMetadata.prototype.uri = ""; + + /** + * Creates a new BatchRecognizeTranscriptionMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.BatchRecognizeTranscriptionMetadata + * @static + * @param {google.cloud.speech.v2.IBatchRecognizeTranscriptionMetadata=} [properties] Properties to set + * @returns {google.cloud.speech.v2.BatchRecognizeTranscriptionMetadata} BatchRecognizeTranscriptionMetadata instance + */ + BatchRecognizeTranscriptionMetadata.create = function create(properties) { + return new BatchRecognizeTranscriptionMetadata(properties); + }; + + /** + * Encodes the specified BatchRecognizeTranscriptionMetadata message. Does not implicitly {@link google.cloud.speech.v2.BatchRecognizeTranscriptionMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.BatchRecognizeTranscriptionMetadata + * @static + * @param {google.cloud.speech.v2.IBatchRecognizeTranscriptionMetadata} message BatchRecognizeTranscriptionMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchRecognizeTranscriptionMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.progressPercent != null && Object.hasOwnProperty.call(message, "progressPercent")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.progressPercent); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.uri); + return writer; + }; + + /** + * Encodes the specified BatchRecognizeTranscriptionMetadata message, length delimited. Does not implicitly {@link google.cloud.speech.v2.BatchRecognizeTranscriptionMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.BatchRecognizeTranscriptionMetadata + * @static + * @param {google.cloud.speech.v2.IBatchRecognizeTranscriptionMetadata} message BatchRecognizeTranscriptionMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchRecognizeTranscriptionMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchRecognizeTranscriptionMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.BatchRecognizeTranscriptionMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.BatchRecognizeTranscriptionMetadata} BatchRecognizeTranscriptionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchRecognizeTranscriptionMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.BatchRecognizeTranscriptionMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.progressPercent = reader.int32(); + break; + } + case 2: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 3: { + message.uri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchRecognizeTranscriptionMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.BatchRecognizeTranscriptionMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.BatchRecognizeTranscriptionMetadata} BatchRecognizeTranscriptionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchRecognizeTranscriptionMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchRecognizeTranscriptionMetadata message. + * @function verify + * @memberof google.cloud.speech.v2.BatchRecognizeTranscriptionMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchRecognizeTranscriptionMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + if (!$util.isInteger(message.progressPercent)) + return "progressPercent: integer expected"; + if (message.error != null && message.hasOwnProperty("error")) { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + return null; + }; + + /** + * Creates a BatchRecognizeTranscriptionMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.BatchRecognizeTranscriptionMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.BatchRecognizeTranscriptionMetadata} BatchRecognizeTranscriptionMetadata + */ + BatchRecognizeTranscriptionMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.BatchRecognizeTranscriptionMetadata) + return object; + var message = new $root.google.cloud.speech.v2.BatchRecognizeTranscriptionMetadata(); + if (object.progressPercent != null) + message.progressPercent = object.progressPercent | 0; + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.speech.v2.BatchRecognizeTranscriptionMetadata.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.uri != null) + message.uri = String(object.uri); + return message; + }; + + /** + * Creates a plain object from a BatchRecognizeTranscriptionMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.BatchRecognizeTranscriptionMetadata + * @static + * @param {google.cloud.speech.v2.BatchRecognizeTranscriptionMetadata} message BatchRecognizeTranscriptionMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchRecognizeTranscriptionMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.progressPercent = 0; + object.error = null; + object.uri = ""; + } + if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + object.progressPercent = message.progressPercent; + if (message.error != null && message.hasOwnProperty("error")) + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + return object; + }; + + /** + * Converts this BatchRecognizeTranscriptionMetadata to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.BatchRecognizeTranscriptionMetadata + * @instance + * @returns {Object.} JSON object + */ + BatchRecognizeTranscriptionMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchRecognizeTranscriptionMetadata + * @function getTypeUrl + * @memberof google.cloud.speech.v2.BatchRecognizeTranscriptionMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchRecognizeTranscriptionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.BatchRecognizeTranscriptionMetadata"; + }; + + return BatchRecognizeTranscriptionMetadata; + })(); + + v2.BatchRecognizeMetadata = (function() { + + /** + * Properties of a BatchRecognizeMetadata. + * @memberof google.cloud.speech.v2 + * @interface IBatchRecognizeMetadata + * @property {Object.|null} [transcriptionMetadata] BatchRecognizeMetadata transcriptionMetadata + */ + + /** + * Constructs a new BatchRecognizeMetadata. + * @memberof google.cloud.speech.v2 + * @classdesc Represents a BatchRecognizeMetadata. + * @implements IBatchRecognizeMetadata + * @constructor + * @param {google.cloud.speech.v2.IBatchRecognizeMetadata=} [properties] Properties to set + */ + function BatchRecognizeMetadata(properties) { + this.transcriptionMetadata = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchRecognizeMetadata transcriptionMetadata. + * @member {Object.} transcriptionMetadata + * @memberof google.cloud.speech.v2.BatchRecognizeMetadata + * @instance + */ + BatchRecognizeMetadata.prototype.transcriptionMetadata = $util.emptyObject; + + /** + * Creates a new BatchRecognizeMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.BatchRecognizeMetadata + * @static + * @param {google.cloud.speech.v2.IBatchRecognizeMetadata=} [properties] Properties to set + * @returns {google.cloud.speech.v2.BatchRecognizeMetadata} BatchRecognizeMetadata instance + */ + BatchRecognizeMetadata.create = function create(properties) { + return new BatchRecognizeMetadata(properties); + }; + + /** + * Encodes the specified BatchRecognizeMetadata message. Does not implicitly {@link google.cloud.speech.v2.BatchRecognizeMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.BatchRecognizeMetadata + * @static + * @param {google.cloud.speech.v2.IBatchRecognizeMetadata} message BatchRecognizeMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchRecognizeMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.transcriptionMetadata != null && Object.hasOwnProperty.call(message, "transcriptionMetadata")) + for (var keys = Object.keys(message.transcriptionMetadata), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.speech.v2.BatchRecognizeTranscriptionMetadata.encode(message.transcriptionMetadata[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified BatchRecognizeMetadata message, length delimited. Does not implicitly {@link google.cloud.speech.v2.BatchRecognizeMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.BatchRecognizeMetadata + * @static + * @param {google.cloud.speech.v2.IBatchRecognizeMetadata} message BatchRecognizeMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchRecognizeMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchRecognizeMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.BatchRecognizeMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.BatchRecognizeMetadata} BatchRecognizeMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchRecognizeMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.BatchRecognizeMetadata(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (message.transcriptionMetadata === $util.emptyObject) + message.transcriptionMetadata = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.speech.v2.BatchRecognizeTranscriptionMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.transcriptionMetadata[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchRecognizeMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.BatchRecognizeMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.BatchRecognizeMetadata} BatchRecognizeMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchRecognizeMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchRecognizeMetadata message. + * @function verify + * @memberof google.cloud.speech.v2.BatchRecognizeMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchRecognizeMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.transcriptionMetadata != null && message.hasOwnProperty("transcriptionMetadata")) { + if (!$util.isObject(message.transcriptionMetadata)) + return "transcriptionMetadata: object expected"; + var key = Object.keys(message.transcriptionMetadata); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.speech.v2.BatchRecognizeTranscriptionMetadata.verify(message.transcriptionMetadata[key[i]]); + if (error) + return "transcriptionMetadata." + error; + } + } + return null; + }; + + /** + * Creates a BatchRecognizeMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.BatchRecognizeMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.BatchRecognizeMetadata} BatchRecognizeMetadata + */ + BatchRecognizeMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.BatchRecognizeMetadata) + return object; + var message = new $root.google.cloud.speech.v2.BatchRecognizeMetadata(); + if (object.transcriptionMetadata) { + if (typeof object.transcriptionMetadata !== "object") + throw TypeError(".google.cloud.speech.v2.BatchRecognizeMetadata.transcriptionMetadata: object expected"); + message.transcriptionMetadata = {}; + for (var keys = Object.keys(object.transcriptionMetadata), i = 0; i < keys.length; ++i) { + if (typeof object.transcriptionMetadata[keys[i]] !== "object") + throw TypeError(".google.cloud.speech.v2.BatchRecognizeMetadata.transcriptionMetadata: object expected"); + message.transcriptionMetadata[keys[i]] = $root.google.cloud.speech.v2.BatchRecognizeTranscriptionMetadata.fromObject(object.transcriptionMetadata[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchRecognizeMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.BatchRecognizeMetadata + * @static + * @param {google.cloud.speech.v2.BatchRecognizeMetadata} message BatchRecognizeMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchRecognizeMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.transcriptionMetadata = {}; + var keys2; + if (message.transcriptionMetadata && (keys2 = Object.keys(message.transcriptionMetadata)).length) { + object.transcriptionMetadata = {}; + for (var j = 0; j < keys2.length; ++j) + object.transcriptionMetadata[keys2[j]] = $root.google.cloud.speech.v2.BatchRecognizeTranscriptionMetadata.toObject(message.transcriptionMetadata[keys2[j]], options); + } + return object; + }; + + /** + * Converts this BatchRecognizeMetadata to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.BatchRecognizeMetadata + * @instance + * @returns {Object.} JSON object + */ + BatchRecognizeMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchRecognizeMetadata + * @function getTypeUrl + * @memberof google.cloud.speech.v2.BatchRecognizeMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchRecognizeMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.BatchRecognizeMetadata"; + }; + + return BatchRecognizeMetadata; + })(); + + v2.BatchRecognizeFileMetadata = (function() { + + /** + * Properties of a BatchRecognizeFileMetadata. + * @memberof google.cloud.speech.v2 + * @interface IBatchRecognizeFileMetadata + * @property {string|null} [uri] BatchRecognizeFileMetadata uri + * @property {google.cloud.speech.v2.IRecognitionConfig|null} [config] BatchRecognizeFileMetadata config + * @property {google.protobuf.IFieldMask|null} [configMask] BatchRecognizeFileMetadata configMask + */ + + /** + * Constructs a new BatchRecognizeFileMetadata. + * @memberof google.cloud.speech.v2 + * @classdesc Represents a BatchRecognizeFileMetadata. + * @implements IBatchRecognizeFileMetadata + * @constructor + * @param {google.cloud.speech.v2.IBatchRecognizeFileMetadata=} [properties] Properties to set + */ + function BatchRecognizeFileMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchRecognizeFileMetadata uri. + * @member {string|null|undefined} uri + * @memberof google.cloud.speech.v2.BatchRecognizeFileMetadata + * @instance + */ + BatchRecognizeFileMetadata.prototype.uri = null; + + /** + * BatchRecognizeFileMetadata config. + * @member {google.cloud.speech.v2.IRecognitionConfig|null|undefined} config + * @memberof google.cloud.speech.v2.BatchRecognizeFileMetadata + * @instance + */ + BatchRecognizeFileMetadata.prototype.config = null; + + /** + * BatchRecognizeFileMetadata configMask. + * @member {google.protobuf.IFieldMask|null|undefined} configMask + * @memberof google.cloud.speech.v2.BatchRecognizeFileMetadata + * @instance + */ + BatchRecognizeFileMetadata.prototype.configMask = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BatchRecognizeFileMetadata audioSource. + * @member {"uri"|undefined} audioSource + * @memberof google.cloud.speech.v2.BatchRecognizeFileMetadata + * @instance + */ + Object.defineProperty(BatchRecognizeFileMetadata.prototype, "audioSource", { + get: $util.oneOfGetter($oneOfFields = ["uri"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BatchRecognizeFileMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.BatchRecognizeFileMetadata + * @static + * @param {google.cloud.speech.v2.IBatchRecognizeFileMetadata=} [properties] Properties to set + * @returns {google.cloud.speech.v2.BatchRecognizeFileMetadata} BatchRecognizeFileMetadata instance + */ + BatchRecognizeFileMetadata.create = function create(properties) { + return new BatchRecognizeFileMetadata(properties); + }; + + /** + * Encodes the specified BatchRecognizeFileMetadata message. Does not implicitly {@link google.cloud.speech.v2.BatchRecognizeFileMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.BatchRecognizeFileMetadata + * @static + * @param {google.cloud.speech.v2.IBatchRecognizeFileMetadata} message BatchRecognizeFileMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchRecognizeFileMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.cloud.speech.v2.RecognitionConfig.encode(message.config, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.configMask != null && Object.hasOwnProperty.call(message, "configMask")) + $root.google.protobuf.FieldMask.encode(message.configMask, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchRecognizeFileMetadata message, length delimited. Does not implicitly {@link google.cloud.speech.v2.BatchRecognizeFileMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.BatchRecognizeFileMetadata + * @static + * @param {google.cloud.speech.v2.IBatchRecognizeFileMetadata} message BatchRecognizeFileMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchRecognizeFileMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchRecognizeFileMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.BatchRecognizeFileMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.BatchRecognizeFileMetadata} BatchRecognizeFileMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchRecognizeFileMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.BatchRecognizeFileMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.uri = reader.string(); + break; + } + case 4: { + message.config = $root.google.cloud.speech.v2.RecognitionConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + message.configMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchRecognizeFileMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.BatchRecognizeFileMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.BatchRecognizeFileMetadata} BatchRecognizeFileMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchRecognizeFileMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchRecognizeFileMetadata message. + * @function verify + * @memberof google.cloud.speech.v2.BatchRecognizeFileMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchRecognizeFileMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.uri != null && message.hasOwnProperty("uri")) { + properties.audioSource = 1; + if (!$util.isString(message.uri)) + return "uri: string expected"; + } + if (message.config != null && message.hasOwnProperty("config")) { + var error = $root.google.cloud.speech.v2.RecognitionConfig.verify(message.config); + if (error) + return "config." + error; + } + if (message.configMask != null && message.hasOwnProperty("configMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.configMask); + if (error) + return "configMask." + error; + } + return null; + }; + + /** + * Creates a BatchRecognizeFileMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.BatchRecognizeFileMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.BatchRecognizeFileMetadata} BatchRecognizeFileMetadata + */ + BatchRecognizeFileMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.BatchRecognizeFileMetadata) + return object; + var message = new $root.google.cloud.speech.v2.BatchRecognizeFileMetadata(); + if (object.uri != null) + message.uri = String(object.uri); + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.cloud.speech.v2.BatchRecognizeFileMetadata.config: object expected"); + message.config = $root.google.cloud.speech.v2.RecognitionConfig.fromObject(object.config); + } + if (object.configMask != null) { + if (typeof object.configMask !== "object") + throw TypeError(".google.cloud.speech.v2.BatchRecognizeFileMetadata.configMask: object expected"); + message.configMask = $root.google.protobuf.FieldMask.fromObject(object.configMask); + } + return message; + }; + + /** + * Creates a plain object from a BatchRecognizeFileMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.BatchRecognizeFileMetadata + * @static + * @param {google.cloud.speech.v2.BatchRecognizeFileMetadata} message BatchRecognizeFileMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchRecognizeFileMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.config = null; + object.configMask = null; + } + if (message.uri != null && message.hasOwnProperty("uri")) { + object.uri = message.uri; + if (options.oneofs) + object.audioSource = "uri"; + } + if (message.config != null && message.hasOwnProperty("config")) + object.config = $root.google.cloud.speech.v2.RecognitionConfig.toObject(message.config, options); + if (message.configMask != null && message.hasOwnProperty("configMask")) + object.configMask = $root.google.protobuf.FieldMask.toObject(message.configMask, options); + return object; + }; + + /** + * Converts this BatchRecognizeFileMetadata to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.BatchRecognizeFileMetadata + * @instance + * @returns {Object.} JSON object + */ + BatchRecognizeFileMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchRecognizeFileMetadata + * @function getTypeUrl + * @memberof google.cloud.speech.v2.BatchRecognizeFileMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchRecognizeFileMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.BatchRecognizeFileMetadata"; + }; + + return BatchRecognizeFileMetadata; + })(); + + v2.StreamingRecognitionResult = (function() { + + /** + * Properties of a StreamingRecognitionResult. + * @memberof google.cloud.speech.v2 + * @interface IStreamingRecognitionResult + * @property {Array.|null} [alternatives] StreamingRecognitionResult alternatives + * @property {boolean|null} [isFinal] StreamingRecognitionResult isFinal + * @property {number|null} [stability] StreamingRecognitionResult stability + * @property {google.protobuf.IDuration|null} [resultEndOffset] StreamingRecognitionResult resultEndOffset + * @property {number|null} [channelTag] StreamingRecognitionResult channelTag + * @property {string|null} [languageCode] StreamingRecognitionResult languageCode + */ + + /** + * Constructs a new StreamingRecognitionResult. + * @memberof google.cloud.speech.v2 + * @classdesc Represents a StreamingRecognitionResult. + * @implements IStreamingRecognitionResult + * @constructor + * @param {google.cloud.speech.v2.IStreamingRecognitionResult=} [properties] Properties to set + */ + function StreamingRecognitionResult(properties) { + this.alternatives = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamingRecognitionResult alternatives. + * @member {Array.} alternatives + * @memberof google.cloud.speech.v2.StreamingRecognitionResult + * @instance + */ + StreamingRecognitionResult.prototype.alternatives = $util.emptyArray; + + /** + * StreamingRecognitionResult isFinal. + * @member {boolean} isFinal + * @memberof google.cloud.speech.v2.StreamingRecognitionResult + * @instance + */ + StreamingRecognitionResult.prototype.isFinal = false; + + /** + * StreamingRecognitionResult stability. + * @member {number} stability + * @memberof google.cloud.speech.v2.StreamingRecognitionResult + * @instance + */ + StreamingRecognitionResult.prototype.stability = 0; + + /** + * StreamingRecognitionResult resultEndOffset. + * @member {google.protobuf.IDuration|null|undefined} resultEndOffset + * @memberof google.cloud.speech.v2.StreamingRecognitionResult + * @instance + */ + StreamingRecognitionResult.prototype.resultEndOffset = null; + + /** + * StreamingRecognitionResult channelTag. + * @member {number} channelTag + * @memberof google.cloud.speech.v2.StreamingRecognitionResult + * @instance + */ + StreamingRecognitionResult.prototype.channelTag = 0; + + /** + * StreamingRecognitionResult languageCode. + * @member {string} languageCode + * @memberof google.cloud.speech.v2.StreamingRecognitionResult + * @instance + */ + StreamingRecognitionResult.prototype.languageCode = ""; + + /** + * Creates a new StreamingRecognitionResult instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.StreamingRecognitionResult + * @static + * @param {google.cloud.speech.v2.IStreamingRecognitionResult=} [properties] Properties to set + * @returns {google.cloud.speech.v2.StreamingRecognitionResult} StreamingRecognitionResult instance + */ + StreamingRecognitionResult.create = function create(properties) { + return new StreamingRecognitionResult(properties); + }; + + /** + * Encodes the specified StreamingRecognitionResult message. Does not implicitly {@link google.cloud.speech.v2.StreamingRecognitionResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.StreamingRecognitionResult + * @static + * @param {google.cloud.speech.v2.IStreamingRecognitionResult} message StreamingRecognitionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingRecognitionResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.alternatives != null && message.alternatives.length) + for (var i = 0; i < message.alternatives.length; ++i) + $root.google.cloud.speech.v2.SpeechRecognitionAlternative.encode(message.alternatives[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.isFinal != null && Object.hasOwnProperty.call(message, "isFinal")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isFinal); + if (message.stability != null && Object.hasOwnProperty.call(message, "stability")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.stability); + if (message.resultEndOffset != null && Object.hasOwnProperty.call(message, "resultEndOffset")) + $root.google.protobuf.Duration.encode(message.resultEndOffset, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.channelTag != null && Object.hasOwnProperty.call(message, "channelTag")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.channelTag); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified StreamingRecognitionResult message, length delimited. Does not implicitly {@link google.cloud.speech.v2.StreamingRecognitionResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.StreamingRecognitionResult + * @static + * @param {google.cloud.speech.v2.IStreamingRecognitionResult} message StreamingRecognitionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingRecognitionResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamingRecognitionResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.StreamingRecognitionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.StreamingRecognitionResult} StreamingRecognitionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingRecognitionResult.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.StreamingRecognitionResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.alternatives && message.alternatives.length)) + message.alternatives = []; + message.alternatives.push($root.google.cloud.speech.v2.SpeechRecognitionAlternative.decode(reader, reader.uint32())); + break; + } + case 2: { + message.isFinal = reader.bool(); + break; + } + case 3: { + message.stability = reader.float(); + break; + } + case 4: { + message.resultEndOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 5: { + message.channelTag = reader.int32(); + break; + } + case 6: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamingRecognitionResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.StreamingRecognitionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.StreamingRecognitionResult} StreamingRecognitionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingRecognitionResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamingRecognitionResult message. + * @function verify + * @memberof google.cloud.speech.v2.StreamingRecognitionResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingRecognitionResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.alternatives != null && message.hasOwnProperty("alternatives")) { + if (!Array.isArray(message.alternatives)) + return "alternatives: array expected"; + for (var i = 0; i < message.alternatives.length; ++i) { + var error = $root.google.cloud.speech.v2.SpeechRecognitionAlternative.verify(message.alternatives[i]); + if (error) + return "alternatives." + error; + } + } + if (message.isFinal != null && message.hasOwnProperty("isFinal")) + if (typeof message.isFinal !== "boolean") + return "isFinal: boolean expected"; + if (message.stability != null && message.hasOwnProperty("stability")) + if (typeof message.stability !== "number") + return "stability: number expected"; + if (message.resultEndOffset != null && message.hasOwnProperty("resultEndOffset")) { + var error = $root.google.protobuf.Duration.verify(message.resultEndOffset); + if (error) + return "resultEndOffset." + error; + } + if (message.channelTag != null && message.hasOwnProperty("channelTag")) + if (!$util.isInteger(message.channelTag)) + return "channelTag: integer expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a StreamingRecognitionResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.StreamingRecognitionResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.StreamingRecognitionResult} StreamingRecognitionResult + */ + StreamingRecognitionResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.StreamingRecognitionResult) + return object; + var message = new $root.google.cloud.speech.v2.StreamingRecognitionResult(); + if (object.alternatives) { + if (!Array.isArray(object.alternatives)) + throw TypeError(".google.cloud.speech.v2.StreamingRecognitionResult.alternatives: array expected"); + message.alternatives = []; + for (var i = 0; i < object.alternatives.length; ++i) { + if (typeof object.alternatives[i] !== "object") + throw TypeError(".google.cloud.speech.v2.StreamingRecognitionResult.alternatives: object expected"); + message.alternatives[i] = $root.google.cloud.speech.v2.SpeechRecognitionAlternative.fromObject(object.alternatives[i]); + } + } + if (object.isFinal != null) + message.isFinal = Boolean(object.isFinal); + if (object.stability != null) + message.stability = Number(object.stability); + if (object.resultEndOffset != null) { + if (typeof object.resultEndOffset !== "object") + throw TypeError(".google.cloud.speech.v2.StreamingRecognitionResult.resultEndOffset: object expected"); + message.resultEndOffset = $root.google.protobuf.Duration.fromObject(object.resultEndOffset); + } + if (object.channelTag != null) + message.channelTag = object.channelTag | 0; + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a StreamingRecognitionResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.StreamingRecognitionResult + * @static + * @param {google.cloud.speech.v2.StreamingRecognitionResult} message StreamingRecognitionResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingRecognitionResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.alternatives = []; + if (options.defaults) { + object.isFinal = false; + object.stability = 0; + object.resultEndOffset = null; + object.channelTag = 0; + object.languageCode = ""; + } + if (message.alternatives && message.alternatives.length) { + object.alternatives = []; + for (var j = 0; j < message.alternatives.length; ++j) + object.alternatives[j] = $root.google.cloud.speech.v2.SpeechRecognitionAlternative.toObject(message.alternatives[j], options); + } + if (message.isFinal != null && message.hasOwnProperty("isFinal")) + object.isFinal = message.isFinal; + if (message.stability != null && message.hasOwnProperty("stability")) + object.stability = options.json && !isFinite(message.stability) ? String(message.stability) : message.stability; + if (message.resultEndOffset != null && message.hasOwnProperty("resultEndOffset")) + object.resultEndOffset = $root.google.protobuf.Duration.toObject(message.resultEndOffset, options); + if (message.channelTag != null && message.hasOwnProperty("channelTag")) + object.channelTag = message.channelTag; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this StreamingRecognitionResult to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.StreamingRecognitionResult + * @instance + * @returns {Object.} JSON object + */ + StreamingRecognitionResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamingRecognitionResult + * @function getTypeUrl + * @memberof google.cloud.speech.v2.StreamingRecognitionResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamingRecognitionResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.StreamingRecognitionResult"; + }; + + return StreamingRecognitionResult; + })(); + + v2.StreamingRecognizeResponse = (function() { + + /** + * Properties of a StreamingRecognizeResponse. + * @memberof google.cloud.speech.v2 + * @interface IStreamingRecognizeResponse + * @property {Array.|null} [results] StreamingRecognizeResponse results + * @property {google.cloud.speech.v2.StreamingRecognizeResponse.SpeechEventType|null} [speechEventType] StreamingRecognizeResponse speechEventType + * @property {google.protobuf.IDuration|null} [speechEventOffset] StreamingRecognizeResponse speechEventOffset + * @property {google.cloud.speech.v2.IRecognitionResponseMetadata|null} [metadata] StreamingRecognizeResponse metadata + */ + + /** + * Constructs a new StreamingRecognizeResponse. + * @memberof google.cloud.speech.v2 + * @classdesc Represents a StreamingRecognizeResponse. + * @implements IStreamingRecognizeResponse + * @constructor + * @param {google.cloud.speech.v2.IStreamingRecognizeResponse=} [properties] Properties to set + */ + function StreamingRecognizeResponse(properties) { + this.results = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamingRecognizeResponse results. + * @member {Array.} results + * @memberof google.cloud.speech.v2.StreamingRecognizeResponse + * @instance + */ + StreamingRecognizeResponse.prototype.results = $util.emptyArray; + + /** + * StreamingRecognizeResponse speechEventType. + * @member {google.cloud.speech.v2.StreamingRecognizeResponse.SpeechEventType} speechEventType + * @memberof google.cloud.speech.v2.StreamingRecognizeResponse + * @instance + */ + StreamingRecognizeResponse.prototype.speechEventType = 0; + + /** + * StreamingRecognizeResponse speechEventOffset. + * @member {google.protobuf.IDuration|null|undefined} speechEventOffset + * @memberof google.cloud.speech.v2.StreamingRecognizeResponse + * @instance + */ + StreamingRecognizeResponse.prototype.speechEventOffset = null; + + /** + * StreamingRecognizeResponse metadata. + * @member {google.cloud.speech.v2.IRecognitionResponseMetadata|null|undefined} metadata + * @memberof google.cloud.speech.v2.StreamingRecognizeResponse + * @instance + */ + StreamingRecognizeResponse.prototype.metadata = null; + + /** + * Creates a new StreamingRecognizeResponse instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.StreamingRecognizeResponse + * @static + * @param {google.cloud.speech.v2.IStreamingRecognizeResponse=} [properties] Properties to set + * @returns {google.cloud.speech.v2.StreamingRecognizeResponse} StreamingRecognizeResponse instance + */ + StreamingRecognizeResponse.create = function create(properties) { + return new StreamingRecognizeResponse(properties); + }; + + /** + * Encodes the specified StreamingRecognizeResponse message. Does not implicitly {@link google.cloud.speech.v2.StreamingRecognizeResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.StreamingRecognizeResponse + * @static + * @param {google.cloud.speech.v2.IStreamingRecognizeResponse} message StreamingRecognizeResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingRecognizeResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.speechEventType != null && Object.hasOwnProperty.call(message, "speechEventType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.speechEventType); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.cloud.speech.v2.RecognitionResponseMetadata.encode(message.metadata, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.results != null && message.results.length) + for (var i = 0; i < message.results.length; ++i) + $root.google.cloud.speech.v2.StreamingRecognitionResult.encode(message.results[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.speechEventOffset != null && Object.hasOwnProperty.call(message, "speechEventOffset")) + $root.google.protobuf.Duration.encode(message.speechEventOffset, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StreamingRecognizeResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v2.StreamingRecognizeResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.StreamingRecognizeResponse + * @static + * @param {google.cloud.speech.v2.IStreamingRecognizeResponse} message StreamingRecognizeResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingRecognizeResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamingRecognizeResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.StreamingRecognizeResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.StreamingRecognizeResponse} StreamingRecognizeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingRecognizeResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.StreamingRecognizeResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 6: { + if (!(message.results && message.results.length)) + message.results = []; + message.results.push($root.google.cloud.speech.v2.StreamingRecognitionResult.decode(reader, reader.uint32())); + break; + } + case 3: { + message.speechEventType = reader.int32(); + break; + } + case 7: { + message.speechEventOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 5: { + message.metadata = $root.google.cloud.speech.v2.RecognitionResponseMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamingRecognizeResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.StreamingRecognizeResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.StreamingRecognizeResponse} StreamingRecognizeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingRecognizeResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamingRecognizeResponse message. + * @function verify + * @memberof google.cloud.speech.v2.StreamingRecognizeResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingRecognizeResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.results != null && message.hasOwnProperty("results")) { + if (!Array.isArray(message.results)) + return "results: array expected"; + for (var i = 0; i < message.results.length; ++i) { + var error = $root.google.cloud.speech.v2.StreamingRecognitionResult.verify(message.results[i]); + if (error) + return "results." + error; + } + } + if (message.speechEventType != null && message.hasOwnProperty("speechEventType")) + switch (message.speechEventType) { + default: + return "speechEventType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.speechEventOffset != null && message.hasOwnProperty("speechEventOffset")) { + var error = $root.google.protobuf.Duration.verify(message.speechEventOffset); + if (error) + return "speechEventOffset." + error; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.cloud.speech.v2.RecognitionResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a StreamingRecognizeResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.StreamingRecognizeResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.StreamingRecognizeResponse} StreamingRecognizeResponse + */ + StreamingRecognizeResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.StreamingRecognizeResponse) + return object; + var message = new $root.google.cloud.speech.v2.StreamingRecognizeResponse(); + if (object.results) { + if (!Array.isArray(object.results)) + throw TypeError(".google.cloud.speech.v2.StreamingRecognizeResponse.results: array expected"); + message.results = []; + for (var i = 0; i < object.results.length; ++i) { + if (typeof object.results[i] !== "object") + throw TypeError(".google.cloud.speech.v2.StreamingRecognizeResponse.results: object expected"); + message.results[i] = $root.google.cloud.speech.v2.StreamingRecognitionResult.fromObject(object.results[i]); + } + } + switch (object.speechEventType) { + default: + if (typeof object.speechEventType === "number") { + message.speechEventType = object.speechEventType; + break; + } + break; + case "SPEECH_EVENT_TYPE_UNSPECIFIED": + case 0: + message.speechEventType = 0; + break; + case "END_OF_SINGLE_UTTERANCE": + case 1: + message.speechEventType = 1; + break; + case "SPEECH_ACTIVITY_BEGIN": + case 2: + message.speechEventType = 2; + break; + case "SPEECH_ACTIVITY_END": + case 3: + message.speechEventType = 3; + break; + } + if (object.speechEventOffset != null) { + if (typeof object.speechEventOffset !== "object") + throw TypeError(".google.cloud.speech.v2.StreamingRecognizeResponse.speechEventOffset: object expected"); + message.speechEventOffset = $root.google.protobuf.Duration.fromObject(object.speechEventOffset); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.speech.v2.StreamingRecognizeResponse.metadata: object expected"); + message.metadata = $root.google.cloud.speech.v2.RecognitionResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a StreamingRecognizeResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.StreamingRecognizeResponse + * @static + * @param {google.cloud.speech.v2.StreamingRecognizeResponse} message StreamingRecognizeResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingRecognizeResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.results = []; + if (options.defaults) { + object.speechEventType = options.enums === String ? "SPEECH_EVENT_TYPE_UNSPECIFIED" : 0; + object.metadata = null; + object.speechEventOffset = null; + } + if (message.speechEventType != null && message.hasOwnProperty("speechEventType")) + object.speechEventType = options.enums === String ? $root.google.cloud.speech.v2.StreamingRecognizeResponse.SpeechEventType[message.speechEventType] === undefined ? message.speechEventType : $root.google.cloud.speech.v2.StreamingRecognizeResponse.SpeechEventType[message.speechEventType] : message.speechEventType; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.cloud.speech.v2.RecognitionResponseMetadata.toObject(message.metadata, options); + if (message.results && message.results.length) { + object.results = []; + for (var j = 0; j < message.results.length; ++j) + object.results[j] = $root.google.cloud.speech.v2.StreamingRecognitionResult.toObject(message.results[j], options); + } + if (message.speechEventOffset != null && message.hasOwnProperty("speechEventOffset")) + object.speechEventOffset = $root.google.protobuf.Duration.toObject(message.speechEventOffset, options); + return object; + }; + + /** + * Converts this StreamingRecognizeResponse to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.StreamingRecognizeResponse + * @instance + * @returns {Object.} JSON object + */ + StreamingRecognizeResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamingRecognizeResponse + * @function getTypeUrl + * @memberof google.cloud.speech.v2.StreamingRecognizeResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamingRecognizeResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.StreamingRecognizeResponse"; + }; + + /** + * SpeechEventType enum. + * @name google.cloud.speech.v2.StreamingRecognizeResponse.SpeechEventType + * @enum {number} + * @property {number} SPEECH_EVENT_TYPE_UNSPECIFIED=0 SPEECH_EVENT_TYPE_UNSPECIFIED value + * @property {number} END_OF_SINGLE_UTTERANCE=1 END_OF_SINGLE_UTTERANCE value + * @property {number} SPEECH_ACTIVITY_BEGIN=2 SPEECH_ACTIVITY_BEGIN value + * @property {number} SPEECH_ACTIVITY_END=3 SPEECH_ACTIVITY_END value + */ + StreamingRecognizeResponse.SpeechEventType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SPEECH_EVENT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "END_OF_SINGLE_UTTERANCE"] = 1; + values[valuesById[2] = "SPEECH_ACTIVITY_BEGIN"] = 2; + values[valuesById[3] = "SPEECH_ACTIVITY_END"] = 3; + return values; + })(); + + return StreamingRecognizeResponse; + })(); + + v2.Config = (function() { + + /** + * Properties of a Config. + * @memberof google.cloud.speech.v2 + * @interface IConfig + * @property {string|null} [name] Config name + * @property {string|null} [kmsKeyName] Config kmsKeyName + * @property {google.protobuf.ITimestamp|null} [updateTime] Config updateTime + */ + + /** + * Constructs a new Config. + * @memberof google.cloud.speech.v2 + * @classdesc Represents a Config. + * @implements IConfig + * @constructor + * @param {google.cloud.speech.v2.IConfig=} [properties] Properties to set + */ + function Config(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Config name. + * @member {string} name + * @memberof google.cloud.speech.v2.Config + * @instance + */ + Config.prototype.name = ""; + + /** + * Config kmsKeyName. + * @member {string} kmsKeyName + * @memberof google.cloud.speech.v2.Config + * @instance + */ + Config.prototype.kmsKeyName = ""; + + /** + * Config updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.speech.v2.Config + * @instance + */ + Config.prototype.updateTime = null; + + /** + * Creates a new Config instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.Config + * @static + * @param {google.cloud.speech.v2.IConfig=} [properties] Properties to set + * @returns {google.cloud.speech.v2.Config} Config instance + */ + Config.create = function create(properties) { + return new Config(properties); + }; + + /** + * Encodes the specified Config message. Does not implicitly {@link google.cloud.speech.v2.Config.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.Config + * @static + * @param {google.cloud.speech.v2.IConfig} message Config message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Config.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.kmsKeyName); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Config message, length delimited. Does not implicitly {@link google.cloud.speech.v2.Config.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.Config + * @static + * @param {google.cloud.speech.v2.IConfig} message Config message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Config.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Config message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.Config + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.Config} Config + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Config.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.Config(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.kmsKeyName = reader.string(); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Config message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.Config + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.Config} Config + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Config.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Config message. + * @function verify + * @memberof google.cloud.speech.v2.Config + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Config.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (!$util.isString(message.kmsKeyName)) + return "kmsKeyName: string expected"; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + return null; + }; + + /** + * Creates a Config message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.Config + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.Config} Config + */ + Config.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.Config) + return object; + var message = new $root.google.cloud.speech.v2.Config(); + if (object.name != null) + message.name = String(object.name); + if (object.kmsKeyName != null) + message.kmsKeyName = String(object.kmsKeyName); + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.speech.v2.Config.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from a Config message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.Config + * @static + * @param {google.cloud.speech.v2.Config} message Config + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Config.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.kmsKeyName = ""; + object.updateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + object.kmsKeyName = message.kmsKeyName; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; + + /** + * Converts this Config to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.Config + * @instance + * @returns {Object.} JSON object + */ + Config.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Config + * @function getTypeUrl + * @memberof google.cloud.speech.v2.Config + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Config.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.Config"; + }; + + return Config; + })(); + + v2.GetConfigRequest = (function() { + + /** + * Properties of a GetConfigRequest. + * @memberof google.cloud.speech.v2 + * @interface IGetConfigRequest + * @property {string|null} [name] GetConfigRequest name + */ + + /** + * Constructs a new GetConfigRequest. + * @memberof google.cloud.speech.v2 + * @classdesc Represents a GetConfigRequest. + * @implements IGetConfigRequest + * @constructor + * @param {google.cloud.speech.v2.IGetConfigRequest=} [properties] Properties to set + */ + function GetConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetConfigRequest name. + * @member {string} name + * @memberof google.cloud.speech.v2.GetConfigRequest + * @instance + */ + GetConfigRequest.prototype.name = ""; + + /** + * Creates a new GetConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.GetConfigRequest + * @static + * @param {google.cloud.speech.v2.IGetConfigRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v2.GetConfigRequest} GetConfigRequest instance + */ + GetConfigRequest.create = function create(properties) { + return new GetConfigRequest(properties); + }; + + /** + * Encodes the specified GetConfigRequest message. Does not implicitly {@link google.cloud.speech.v2.GetConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.GetConfigRequest + * @static + * @param {google.cloud.speech.v2.IGetConfigRequest} message GetConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetConfigRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v2.GetConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.GetConfigRequest + * @static + * @param {google.cloud.speech.v2.IGetConfigRequest} message GetConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.GetConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.GetConfigRequest} GetConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConfigRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.GetConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.GetConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.GetConfigRequest} GetConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetConfigRequest message. + * @function verify + * @memberof google.cloud.speech.v2.GetConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.GetConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.GetConfigRequest} GetConfigRequest + */ + GetConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.GetConfigRequest) + return object; + var message = new $root.google.cloud.speech.v2.GetConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.GetConfigRequest + * @static + * @param {google.cloud.speech.v2.GetConfigRequest} message GetConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.GetConfigRequest + * @instance + * @returns {Object.} JSON object + */ + GetConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetConfigRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v2.GetConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.GetConfigRequest"; + }; + + return GetConfigRequest; + })(); + + v2.UpdateConfigRequest = (function() { + + /** + * Properties of an UpdateConfigRequest. + * @memberof google.cloud.speech.v2 + * @interface IUpdateConfigRequest + * @property {google.cloud.speech.v2.IConfig|null} [config] UpdateConfigRequest config + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateConfigRequest updateMask + */ + + /** + * Constructs a new UpdateConfigRequest. + * @memberof google.cloud.speech.v2 + * @classdesc Represents an UpdateConfigRequest. + * @implements IUpdateConfigRequest + * @constructor + * @param {google.cloud.speech.v2.IUpdateConfigRequest=} [properties] Properties to set + */ + function UpdateConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateConfigRequest config. + * @member {google.cloud.speech.v2.IConfig|null|undefined} config + * @memberof google.cloud.speech.v2.UpdateConfigRequest + * @instance + */ + UpdateConfigRequest.prototype.config = null; + + /** + * UpdateConfigRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.speech.v2.UpdateConfigRequest + * @instance + */ + UpdateConfigRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.UpdateConfigRequest + * @static + * @param {google.cloud.speech.v2.IUpdateConfigRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v2.UpdateConfigRequest} UpdateConfigRequest instance + */ + UpdateConfigRequest.create = function create(properties) { + return new UpdateConfigRequest(properties); + }; + + /** + * Encodes the specified UpdateConfigRequest message. Does not implicitly {@link google.cloud.speech.v2.UpdateConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.UpdateConfigRequest + * @static + * @param {google.cloud.speech.v2.IUpdateConfigRequest} message UpdateConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.cloud.speech.v2.Config.encode(message.config, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateConfigRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v2.UpdateConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.UpdateConfigRequest + * @static + * @param {google.cloud.speech.v2.IUpdateConfigRequest} message UpdateConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.UpdateConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.UpdateConfigRequest} UpdateConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateConfigRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.UpdateConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.config = $root.google.cloud.speech.v2.Config.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.UpdateConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.UpdateConfigRequest} UpdateConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateConfigRequest message. + * @function verify + * @memberof google.cloud.speech.v2.UpdateConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.config != null && message.hasOwnProperty("config")) { + var error = $root.google.cloud.speech.v2.Config.verify(message.config); + if (error) + return "config." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.UpdateConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.UpdateConfigRequest} UpdateConfigRequest + */ + UpdateConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.UpdateConfigRequest) + return object; + var message = new $root.google.cloud.speech.v2.UpdateConfigRequest(); + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.cloud.speech.v2.UpdateConfigRequest.config: object expected"); + message.config = $root.google.cloud.speech.v2.Config.fromObject(object.config); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.speech.v2.UpdateConfigRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.UpdateConfigRequest + * @static + * @param {google.cloud.speech.v2.UpdateConfigRequest} message UpdateConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.config = null; + object.updateMask = null; + } + if (message.config != null && message.hasOwnProperty("config")) + object.config = $root.google.cloud.speech.v2.Config.toObject(message.config, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.UpdateConfigRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateConfigRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v2.UpdateConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.UpdateConfigRequest"; + }; + + return UpdateConfigRequest; + })(); + + v2.CustomClass = (function() { + + /** + * Properties of a CustomClass. + * @memberof google.cloud.speech.v2 + * @interface ICustomClass + * @property {string|null} [name] CustomClass name + * @property {string|null} [uid] CustomClass uid + * @property {string|null} [displayName] CustomClass displayName + * @property {Array.|null} [items] CustomClass items + * @property {google.cloud.speech.v2.CustomClass.State|null} [state] CustomClass state + * @property {google.protobuf.ITimestamp|null} [createTime] CustomClass createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] CustomClass updateTime + * @property {google.protobuf.ITimestamp|null} [deleteTime] CustomClass deleteTime + * @property {google.protobuf.ITimestamp|null} [expireTime] CustomClass expireTime + * @property {Object.|null} [annotations] CustomClass annotations + * @property {string|null} [etag] CustomClass etag + * @property {boolean|null} [reconciling] CustomClass reconciling + * @property {string|null} [kmsKeyName] CustomClass kmsKeyName + * @property {string|null} [kmsKeyVersionName] CustomClass kmsKeyVersionName + */ + + /** + * Constructs a new CustomClass. + * @memberof google.cloud.speech.v2 + * @classdesc Represents a CustomClass. + * @implements ICustomClass + * @constructor + * @param {google.cloud.speech.v2.ICustomClass=} [properties] Properties to set + */ + function CustomClass(properties) { + this.items = []; + this.annotations = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomClass name. + * @member {string} name + * @memberof google.cloud.speech.v2.CustomClass + * @instance + */ + CustomClass.prototype.name = ""; + + /** + * CustomClass uid. + * @member {string} uid + * @memberof google.cloud.speech.v2.CustomClass + * @instance + */ + CustomClass.prototype.uid = ""; + + /** + * CustomClass displayName. + * @member {string} displayName + * @memberof google.cloud.speech.v2.CustomClass + * @instance + */ + CustomClass.prototype.displayName = ""; + + /** + * CustomClass items. + * @member {Array.} items + * @memberof google.cloud.speech.v2.CustomClass + * @instance + */ + CustomClass.prototype.items = $util.emptyArray; + + /** + * CustomClass state. + * @member {google.cloud.speech.v2.CustomClass.State} state + * @memberof google.cloud.speech.v2.CustomClass + * @instance + */ + CustomClass.prototype.state = 0; + + /** + * CustomClass createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.speech.v2.CustomClass + * @instance + */ + CustomClass.prototype.createTime = null; + + /** + * CustomClass updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.speech.v2.CustomClass + * @instance + */ + CustomClass.prototype.updateTime = null; + + /** + * CustomClass deleteTime. + * @member {google.protobuf.ITimestamp|null|undefined} deleteTime + * @memberof google.cloud.speech.v2.CustomClass + * @instance + */ + CustomClass.prototype.deleteTime = null; + + /** + * CustomClass expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.cloud.speech.v2.CustomClass + * @instance + */ + CustomClass.prototype.expireTime = null; + + /** + * CustomClass annotations. + * @member {Object.} annotations + * @memberof google.cloud.speech.v2.CustomClass + * @instance + */ + CustomClass.prototype.annotations = $util.emptyObject; + + /** + * CustomClass etag. + * @member {string} etag + * @memberof google.cloud.speech.v2.CustomClass + * @instance + */ + CustomClass.prototype.etag = ""; + + /** + * CustomClass reconciling. + * @member {boolean} reconciling + * @memberof google.cloud.speech.v2.CustomClass + * @instance + */ + CustomClass.prototype.reconciling = false; + + /** + * CustomClass kmsKeyName. + * @member {string} kmsKeyName + * @memberof google.cloud.speech.v2.CustomClass + * @instance + */ + CustomClass.prototype.kmsKeyName = ""; + + /** + * CustomClass kmsKeyVersionName. + * @member {string} kmsKeyVersionName + * @memberof google.cloud.speech.v2.CustomClass + * @instance + */ + CustomClass.prototype.kmsKeyVersionName = ""; + + /** + * Creates a new CustomClass instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.CustomClass + * @static + * @param {google.cloud.speech.v2.ICustomClass=} [properties] Properties to set + * @returns {google.cloud.speech.v2.CustomClass} CustomClass instance + */ + CustomClass.create = function create(properties) { + return new CustomClass(properties); + }; + + /** + * Encodes the specified CustomClass message. Does not implicitly {@link google.cloud.speech.v2.CustomClass.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.CustomClass + * @static + * @param {google.cloud.speech.v2.ICustomClass} message CustomClass message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomClass.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uid); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.displayName); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.speech.v2.CustomClass.ClassItem.encode(message.items[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) + $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.etag); + if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.reconciling); + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.kmsKeyName); + if (message.kmsKeyVersionName != null && Object.hasOwnProperty.call(message, "kmsKeyVersionName")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.kmsKeyVersionName); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 15, wireType 0 =*/120).int32(message.state); + return writer; + }; + + /** + * Encodes the specified CustomClass message, length delimited. Does not implicitly {@link google.cloud.speech.v2.CustomClass.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.CustomClass + * @static + * @param {google.cloud.speech.v2.ICustomClass} message CustomClass message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomClass.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomClass message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.CustomClass + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.CustomClass} CustomClass + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomClass.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.CustomClass(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.uid = reader.string(); + break; + } + case 4: { + message.displayName = reader.string(); + break; + } + case 5: { + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.speech.v2.CustomClass.ClassItem.decode(reader, reader.uint32())); + break; + } + case 15: { + message.state = reader.int32(); + break; + } + case 6: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + if (message.annotations === $util.emptyObject) + message.annotations = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.annotations[key] = value; + break; + } + case 11: { + message.etag = reader.string(); + break; + } + case 12: { + message.reconciling = reader.bool(); + break; + } + case 13: { + message.kmsKeyName = reader.string(); + break; + } + case 14: { + message.kmsKeyVersionName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomClass message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.CustomClass + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.CustomClass} CustomClass + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomClass.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomClass message. + * @function verify + * @memberof google.cloud.speech.v2.CustomClass + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomClass.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.speech.v2.CustomClass.ClassItem.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 2: + case 4: + break; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); + if (error) + return "deleteTime." + error; + } + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + error; + } + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!$util.isObject(message.annotations)) + return "annotations: object expected"; + var key = Object.keys(message.annotations); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.annotations[key[i]])) + return "annotations: string{k:string} expected"; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + if (typeof message.reconciling !== "boolean") + return "reconciling: boolean expected"; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (!$util.isString(message.kmsKeyName)) + return "kmsKeyName: string expected"; + if (message.kmsKeyVersionName != null && message.hasOwnProperty("kmsKeyVersionName")) + if (!$util.isString(message.kmsKeyVersionName)) + return "kmsKeyVersionName: string expected"; + return null; + }; + + /** + * Creates a CustomClass message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.CustomClass + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.CustomClass} CustomClass + */ + CustomClass.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.CustomClass) + return object; + var message = new $root.google.cloud.speech.v2.CustomClass(); + if (object.name != null) + message.name = String(object.name); + if (object.uid != null) + message.uid = String(object.uid); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.speech.v2.CustomClass.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.speech.v2.CustomClass.items: object expected"); + message.items[i] = $root.google.cloud.speech.v2.CustomClass.ClassItem.fromObject(object.items[i]); + } + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 2: + message.state = 2; + break; + case "DELETED": + case 4: + message.state = 4; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.speech.v2.CustomClass.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.speech.v2.CustomClass.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.deleteTime != null) { + if (typeof object.deleteTime !== "object") + throw TypeError(".google.cloud.speech.v2.CustomClass.deleteTime: object expected"); + message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); + } + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.cloud.speech.v2.CustomClass.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + if (object.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.speech.v2.CustomClass.annotations: object expected"); + message.annotations = {}; + for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) + message.annotations[keys[i]] = String(object.annotations[keys[i]]); + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.reconciling != null) + message.reconciling = Boolean(object.reconciling); + if (object.kmsKeyName != null) + message.kmsKeyName = String(object.kmsKeyName); + if (object.kmsKeyVersionName != null) + message.kmsKeyVersionName = String(object.kmsKeyVersionName); + return message; + }; + + /** + * Creates a plain object from a CustomClass message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.CustomClass + * @static + * @param {google.cloud.speech.v2.CustomClass} message CustomClass + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomClass.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (options.objects || options.defaults) + object.annotations = {}; + if (options.defaults) { + object.name = ""; + object.uid = ""; + object.displayName = ""; + object.createTime = null; + object.updateTime = null; + object.deleteTime = null; + object.expireTime = null; + object.etag = ""; + object.reconciling = false; + object.kmsKeyName = ""; + object.kmsKeyVersionName = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.speech.v2.CustomClass.ClassItem.toObject(message.items[j], options); + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) + object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + var keys2; + if (message.annotations && (keys2 = Object.keys(message.annotations)).length) { + object.annotations = {}; + for (var j = 0; j < keys2.length; ++j) + object.annotations[keys2[j]] = message.annotations[keys2[j]]; + } + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + object.reconciling = message.reconciling; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + object.kmsKeyName = message.kmsKeyName; + if (message.kmsKeyVersionName != null && message.hasOwnProperty("kmsKeyVersionName")) + object.kmsKeyVersionName = message.kmsKeyVersionName; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.speech.v2.CustomClass.State[message.state] === undefined ? message.state : $root.google.cloud.speech.v2.CustomClass.State[message.state] : message.state; + return object; + }; + + /** + * Converts this CustomClass to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.CustomClass + * @instance + * @returns {Object.} JSON object + */ + CustomClass.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomClass + * @function getTypeUrl + * @memberof google.cloud.speech.v2.CustomClass + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomClass.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.CustomClass"; + }; + + CustomClass.ClassItem = (function() { + + /** + * Properties of a ClassItem. + * @memberof google.cloud.speech.v2.CustomClass + * @interface IClassItem + * @property {string|null} [value] ClassItem value + */ + + /** + * Constructs a new ClassItem. + * @memberof google.cloud.speech.v2.CustomClass + * @classdesc Represents a ClassItem. + * @implements IClassItem + * @constructor + * @param {google.cloud.speech.v2.CustomClass.IClassItem=} [properties] Properties to set + */ + function ClassItem(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClassItem value. + * @member {string} value + * @memberof google.cloud.speech.v2.CustomClass.ClassItem + * @instance + */ + ClassItem.prototype.value = ""; + + /** + * Creates a new ClassItem instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.CustomClass.ClassItem + * @static + * @param {google.cloud.speech.v2.CustomClass.IClassItem=} [properties] Properties to set + * @returns {google.cloud.speech.v2.CustomClass.ClassItem} ClassItem instance + */ + ClassItem.create = function create(properties) { + return new ClassItem(properties); + }; + + /** + * Encodes the specified ClassItem message. Does not implicitly {@link google.cloud.speech.v2.CustomClass.ClassItem.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.CustomClass.ClassItem + * @static + * @param {google.cloud.speech.v2.CustomClass.IClassItem} message ClassItem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClassItem.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + return writer; + }; + + /** + * Encodes the specified ClassItem message, length delimited. Does not implicitly {@link google.cloud.speech.v2.CustomClass.ClassItem.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.CustomClass.ClassItem + * @static + * @param {google.cloud.speech.v2.CustomClass.IClassItem} message ClassItem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClassItem.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClassItem message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.CustomClass.ClassItem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.CustomClass.ClassItem} ClassItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClassItem.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.CustomClass.ClassItem(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClassItem message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.CustomClass.ClassItem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.CustomClass.ClassItem} ClassItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClassItem.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClassItem message. + * @function verify + * @memberof google.cloud.speech.v2.CustomClass.ClassItem + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClassItem.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates a ClassItem message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.CustomClass.ClassItem + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.CustomClass.ClassItem} ClassItem + */ + ClassItem.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.CustomClass.ClassItem) + return object; + var message = new $root.google.cloud.speech.v2.CustomClass.ClassItem(); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a ClassItem message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.CustomClass.ClassItem + * @static + * @param {google.cloud.speech.v2.CustomClass.ClassItem} message ClassItem + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClassItem.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = ""; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this ClassItem to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.CustomClass.ClassItem + * @instance + * @returns {Object.} JSON object + */ + ClassItem.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClassItem + * @function getTypeUrl + * @memberof google.cloud.speech.v2.CustomClass.ClassItem + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClassItem.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.CustomClass.ClassItem"; + }; + + return ClassItem; + })(); + + /** + * State enum. + * @name google.cloud.speech.v2.CustomClass.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=2 ACTIVE value + * @property {number} DELETED=4 DELETED value + */ + CustomClass.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[2] = "ACTIVE"] = 2; + values[valuesById[4] = "DELETED"] = 4; + return values; + })(); + + return CustomClass; + })(); + + v2.PhraseSet = (function() { + + /** + * Properties of a PhraseSet. + * @memberof google.cloud.speech.v2 + * @interface IPhraseSet + * @property {string|null} [name] PhraseSet name + * @property {string|null} [uid] PhraseSet uid + * @property {Array.|null} [phrases] PhraseSet phrases + * @property {number|null} [boost] PhraseSet boost + * @property {string|null} [displayName] PhraseSet displayName + * @property {google.cloud.speech.v2.PhraseSet.State|null} [state] PhraseSet state + * @property {google.protobuf.ITimestamp|null} [createTime] PhraseSet createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] PhraseSet updateTime + * @property {google.protobuf.ITimestamp|null} [deleteTime] PhraseSet deleteTime + * @property {google.protobuf.ITimestamp|null} [expireTime] PhraseSet expireTime + * @property {Object.|null} [annotations] PhraseSet annotations + * @property {string|null} [etag] PhraseSet etag + * @property {boolean|null} [reconciling] PhraseSet reconciling + * @property {string|null} [kmsKeyName] PhraseSet kmsKeyName + * @property {string|null} [kmsKeyVersionName] PhraseSet kmsKeyVersionName + */ + + /** + * Constructs a new PhraseSet. + * @memberof google.cloud.speech.v2 + * @classdesc Represents a PhraseSet. + * @implements IPhraseSet + * @constructor + * @param {google.cloud.speech.v2.IPhraseSet=} [properties] Properties to set + */ + function PhraseSet(properties) { + this.phrases = []; + this.annotations = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PhraseSet name. + * @member {string} name + * @memberof google.cloud.speech.v2.PhraseSet + * @instance + */ + PhraseSet.prototype.name = ""; + + /** + * PhraseSet uid. + * @member {string} uid + * @memberof google.cloud.speech.v2.PhraseSet + * @instance + */ + PhraseSet.prototype.uid = ""; + + /** + * PhraseSet phrases. + * @member {Array.} phrases + * @memberof google.cloud.speech.v2.PhraseSet + * @instance + */ + PhraseSet.prototype.phrases = $util.emptyArray; + + /** + * PhraseSet boost. + * @member {number} boost + * @memberof google.cloud.speech.v2.PhraseSet + * @instance + */ + PhraseSet.prototype.boost = 0; + + /** + * PhraseSet displayName. + * @member {string} displayName + * @memberof google.cloud.speech.v2.PhraseSet + * @instance + */ + PhraseSet.prototype.displayName = ""; + + /** + * PhraseSet state. + * @member {google.cloud.speech.v2.PhraseSet.State} state + * @memberof google.cloud.speech.v2.PhraseSet + * @instance + */ + PhraseSet.prototype.state = 0; + + /** + * PhraseSet createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.speech.v2.PhraseSet + * @instance + */ + PhraseSet.prototype.createTime = null; + + /** + * PhraseSet updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.speech.v2.PhraseSet + * @instance + */ + PhraseSet.prototype.updateTime = null; + + /** + * PhraseSet deleteTime. + * @member {google.protobuf.ITimestamp|null|undefined} deleteTime + * @memberof google.cloud.speech.v2.PhraseSet + * @instance + */ + PhraseSet.prototype.deleteTime = null; + + /** + * PhraseSet expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.cloud.speech.v2.PhraseSet + * @instance + */ + PhraseSet.prototype.expireTime = null; + + /** + * PhraseSet annotations. + * @member {Object.} annotations + * @memberof google.cloud.speech.v2.PhraseSet + * @instance + */ + PhraseSet.prototype.annotations = $util.emptyObject; + + /** + * PhraseSet etag. + * @member {string} etag + * @memberof google.cloud.speech.v2.PhraseSet + * @instance + */ + PhraseSet.prototype.etag = ""; + + /** + * PhraseSet reconciling. + * @member {boolean} reconciling + * @memberof google.cloud.speech.v2.PhraseSet + * @instance + */ + PhraseSet.prototype.reconciling = false; + + /** + * PhraseSet kmsKeyName. + * @member {string} kmsKeyName + * @memberof google.cloud.speech.v2.PhraseSet + * @instance + */ + PhraseSet.prototype.kmsKeyName = ""; + + /** + * PhraseSet kmsKeyVersionName. + * @member {string} kmsKeyVersionName + * @memberof google.cloud.speech.v2.PhraseSet + * @instance + */ + PhraseSet.prototype.kmsKeyVersionName = ""; + + /** + * Creates a new PhraseSet instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.PhraseSet + * @static + * @param {google.cloud.speech.v2.IPhraseSet=} [properties] Properties to set + * @returns {google.cloud.speech.v2.PhraseSet} PhraseSet instance + */ + PhraseSet.create = function create(properties) { + return new PhraseSet(properties); + }; + + /** + * Encodes the specified PhraseSet message. Does not implicitly {@link google.cloud.speech.v2.PhraseSet.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.PhraseSet + * @static + * @param {google.cloud.speech.v2.IPhraseSet} message PhraseSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhraseSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uid); + if (message.phrases != null && message.phrases.length) + for (var i = 0; i < message.phrases.length; ++i) + $root.google.cloud.speech.v2.PhraseSet.Phrase.encode(message.phrases[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.boost != null && Object.hasOwnProperty.call(message, "boost")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.boost); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.displayName); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) + $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.etag); + if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.reconciling); + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.kmsKeyName); + if (message.kmsKeyVersionName != null && Object.hasOwnProperty.call(message, "kmsKeyVersionName")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.kmsKeyVersionName); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 15, wireType 0 =*/120).int32(message.state); + return writer; + }; + + /** + * Encodes the specified PhraseSet message, length delimited. Does not implicitly {@link google.cloud.speech.v2.PhraseSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.PhraseSet + * @static + * @param {google.cloud.speech.v2.IPhraseSet} message PhraseSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhraseSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PhraseSet message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.PhraseSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.PhraseSet} PhraseSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhraseSet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.PhraseSet(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.uid = reader.string(); + break; + } + case 3: { + if (!(message.phrases && message.phrases.length)) + message.phrases = []; + message.phrases.push($root.google.cloud.speech.v2.PhraseSet.Phrase.decode(reader, reader.uint32())); + break; + } + case 4: { + message.boost = reader.float(); + break; + } + case 5: { + message.displayName = reader.string(); + break; + } + case 15: { + message.state = reader.int32(); + break; + } + case 6: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + if (message.annotations === $util.emptyObject) + message.annotations = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.annotations[key] = value; + break; + } + case 11: { + message.etag = reader.string(); + break; + } + case 12: { + message.reconciling = reader.bool(); + break; + } + case 13: { + message.kmsKeyName = reader.string(); + break; + } + case 14: { + message.kmsKeyVersionName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PhraseSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.PhraseSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.PhraseSet} PhraseSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhraseSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PhraseSet message. + * @function verify + * @memberof google.cloud.speech.v2.PhraseSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PhraseSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.phrases != null && message.hasOwnProperty("phrases")) { + if (!Array.isArray(message.phrases)) + return "phrases: array expected"; + for (var i = 0; i < message.phrases.length; ++i) { + var error = $root.google.cloud.speech.v2.PhraseSet.Phrase.verify(message.phrases[i]); + if (error) + return "phrases." + error; + } + } + if (message.boost != null && message.hasOwnProperty("boost")) + if (typeof message.boost !== "number") + return "boost: number expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 2: + case 4: + break; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); + if (error) + return "deleteTime." + error; + } + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + error; + } + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!$util.isObject(message.annotations)) + return "annotations: object expected"; + var key = Object.keys(message.annotations); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.annotations[key[i]])) + return "annotations: string{k:string} expected"; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + if (typeof message.reconciling !== "boolean") + return "reconciling: boolean expected"; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (!$util.isString(message.kmsKeyName)) + return "kmsKeyName: string expected"; + if (message.kmsKeyVersionName != null && message.hasOwnProperty("kmsKeyVersionName")) + if (!$util.isString(message.kmsKeyVersionName)) + return "kmsKeyVersionName: string expected"; + return null; + }; + + /** + * Creates a PhraseSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.PhraseSet + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.PhraseSet} PhraseSet + */ + PhraseSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.PhraseSet) + return object; + var message = new $root.google.cloud.speech.v2.PhraseSet(); + if (object.name != null) + message.name = String(object.name); + if (object.uid != null) + message.uid = String(object.uid); + if (object.phrases) { + if (!Array.isArray(object.phrases)) + throw TypeError(".google.cloud.speech.v2.PhraseSet.phrases: array expected"); + message.phrases = []; + for (var i = 0; i < object.phrases.length; ++i) { + if (typeof object.phrases[i] !== "object") + throw TypeError(".google.cloud.speech.v2.PhraseSet.phrases: object expected"); + message.phrases[i] = $root.google.cloud.speech.v2.PhraseSet.Phrase.fromObject(object.phrases[i]); + } + } + if (object.boost != null) + message.boost = Number(object.boost); + if (object.displayName != null) + message.displayName = String(object.displayName); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 2: + message.state = 2; + break; + case "DELETED": + case 4: + message.state = 4; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.speech.v2.PhraseSet.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.speech.v2.PhraseSet.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.deleteTime != null) { + if (typeof object.deleteTime !== "object") + throw TypeError(".google.cloud.speech.v2.PhraseSet.deleteTime: object expected"); + message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); + } + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.cloud.speech.v2.PhraseSet.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + if (object.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.speech.v2.PhraseSet.annotations: object expected"); + message.annotations = {}; + for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) + message.annotations[keys[i]] = String(object.annotations[keys[i]]); + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.reconciling != null) + message.reconciling = Boolean(object.reconciling); + if (object.kmsKeyName != null) + message.kmsKeyName = String(object.kmsKeyName); + if (object.kmsKeyVersionName != null) + message.kmsKeyVersionName = String(object.kmsKeyVersionName); + return message; + }; + + /** + * Creates a plain object from a PhraseSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.PhraseSet + * @static + * @param {google.cloud.speech.v2.PhraseSet} message PhraseSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PhraseSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.phrases = []; + if (options.objects || options.defaults) + object.annotations = {}; + if (options.defaults) { + object.name = ""; + object.uid = ""; + object.boost = 0; + object.displayName = ""; + object.createTime = null; + object.updateTime = null; + object.deleteTime = null; + object.expireTime = null; + object.etag = ""; + object.reconciling = false; + object.kmsKeyName = ""; + object.kmsKeyVersionName = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.phrases && message.phrases.length) { + object.phrases = []; + for (var j = 0; j < message.phrases.length; ++j) + object.phrases[j] = $root.google.cloud.speech.v2.PhraseSet.Phrase.toObject(message.phrases[j], options); + } + if (message.boost != null && message.hasOwnProperty("boost")) + object.boost = options.json && !isFinite(message.boost) ? String(message.boost) : message.boost; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) + object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + var keys2; + if (message.annotations && (keys2 = Object.keys(message.annotations)).length) { + object.annotations = {}; + for (var j = 0; j < keys2.length; ++j) + object.annotations[keys2[j]] = message.annotations[keys2[j]]; + } + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + object.reconciling = message.reconciling; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + object.kmsKeyName = message.kmsKeyName; + if (message.kmsKeyVersionName != null && message.hasOwnProperty("kmsKeyVersionName")) + object.kmsKeyVersionName = message.kmsKeyVersionName; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.speech.v2.PhraseSet.State[message.state] === undefined ? message.state : $root.google.cloud.speech.v2.PhraseSet.State[message.state] : message.state; + return object; + }; + + /** + * Converts this PhraseSet to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.PhraseSet + * @instance + * @returns {Object.} JSON object + */ + PhraseSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PhraseSet + * @function getTypeUrl + * @memberof google.cloud.speech.v2.PhraseSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PhraseSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.PhraseSet"; + }; + + PhraseSet.Phrase = (function() { + + /** + * Properties of a Phrase. + * @memberof google.cloud.speech.v2.PhraseSet + * @interface IPhrase + * @property {string|null} [value] Phrase value + * @property {number|null} [boost] Phrase boost + */ + + /** + * Constructs a new Phrase. + * @memberof google.cloud.speech.v2.PhraseSet + * @classdesc Represents a Phrase. + * @implements IPhrase + * @constructor + * @param {google.cloud.speech.v2.PhraseSet.IPhrase=} [properties] Properties to set + */ + function Phrase(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Phrase value. + * @member {string} value + * @memberof google.cloud.speech.v2.PhraseSet.Phrase + * @instance + */ + Phrase.prototype.value = ""; + + /** + * Phrase boost. + * @member {number} boost + * @memberof google.cloud.speech.v2.PhraseSet.Phrase + * @instance + */ + Phrase.prototype.boost = 0; + + /** + * Creates a new Phrase instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.PhraseSet.Phrase + * @static + * @param {google.cloud.speech.v2.PhraseSet.IPhrase=} [properties] Properties to set + * @returns {google.cloud.speech.v2.PhraseSet.Phrase} Phrase instance + */ + Phrase.create = function create(properties) { + return new Phrase(properties); + }; + + /** + * Encodes the specified Phrase message. Does not implicitly {@link google.cloud.speech.v2.PhraseSet.Phrase.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.PhraseSet.Phrase + * @static + * @param {google.cloud.speech.v2.PhraseSet.IPhrase} message Phrase message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Phrase.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + if (message.boost != null && Object.hasOwnProperty.call(message, "boost")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.boost); + return writer; + }; + + /** + * Encodes the specified Phrase message, length delimited. Does not implicitly {@link google.cloud.speech.v2.PhraseSet.Phrase.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.PhraseSet.Phrase + * @static + * @param {google.cloud.speech.v2.PhraseSet.IPhrase} message Phrase message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Phrase.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Phrase message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.PhraseSet.Phrase + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.PhraseSet.Phrase} Phrase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Phrase.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.PhraseSet.Phrase(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.string(); + break; + } + case 2: { + message.boost = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Phrase message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.PhraseSet.Phrase + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.PhraseSet.Phrase} Phrase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Phrase.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Phrase message. + * @function verify + * @memberof google.cloud.speech.v2.PhraseSet.Phrase + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Phrase.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + if (message.boost != null && message.hasOwnProperty("boost")) + if (typeof message.boost !== "number") + return "boost: number expected"; + return null; + }; + + /** + * Creates a Phrase message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.PhraseSet.Phrase + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.PhraseSet.Phrase} Phrase + */ + Phrase.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.PhraseSet.Phrase) + return object; + var message = new $root.google.cloud.speech.v2.PhraseSet.Phrase(); + if (object.value != null) + message.value = String(object.value); + if (object.boost != null) + message.boost = Number(object.boost); + return message; + }; + + /** + * Creates a plain object from a Phrase message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.PhraseSet.Phrase + * @static + * @param {google.cloud.speech.v2.PhraseSet.Phrase} message Phrase + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Phrase.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + object.boost = 0; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.boost != null && message.hasOwnProperty("boost")) + object.boost = options.json && !isFinite(message.boost) ? String(message.boost) : message.boost; + return object; + }; + + /** + * Converts this Phrase to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.PhraseSet.Phrase + * @instance + * @returns {Object.} JSON object + */ + Phrase.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Phrase + * @function getTypeUrl + * @memberof google.cloud.speech.v2.PhraseSet.Phrase + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Phrase.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.PhraseSet.Phrase"; + }; + + return Phrase; + })(); + + /** + * State enum. + * @name google.cloud.speech.v2.PhraseSet.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=2 ACTIVE value + * @property {number} DELETED=4 DELETED value + */ + PhraseSet.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[2] = "ACTIVE"] = 2; + values[valuesById[4] = "DELETED"] = 4; + return values; + })(); + + return PhraseSet; + })(); + + v2.CreateCustomClassRequest = (function() { + + /** + * Properties of a CreateCustomClassRequest. + * @memberof google.cloud.speech.v2 + * @interface ICreateCustomClassRequest + * @property {google.cloud.speech.v2.ICustomClass|null} [customClass] CreateCustomClassRequest customClass + * @property {boolean|null} [validateOnly] CreateCustomClassRequest validateOnly + * @property {string|null} [customClassId] CreateCustomClassRequest customClassId + * @property {string|null} [parent] CreateCustomClassRequest parent + */ + + /** + * Constructs a new CreateCustomClassRequest. + * @memberof google.cloud.speech.v2 + * @classdesc Represents a CreateCustomClassRequest. + * @implements ICreateCustomClassRequest + * @constructor + * @param {google.cloud.speech.v2.ICreateCustomClassRequest=} [properties] Properties to set + */ + function CreateCustomClassRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateCustomClassRequest customClass. + * @member {google.cloud.speech.v2.ICustomClass|null|undefined} customClass + * @memberof google.cloud.speech.v2.CreateCustomClassRequest + * @instance + */ + CreateCustomClassRequest.prototype.customClass = null; + + /** + * CreateCustomClassRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.speech.v2.CreateCustomClassRequest + * @instance + */ + CreateCustomClassRequest.prototype.validateOnly = false; + + /** + * CreateCustomClassRequest customClassId. + * @member {string} customClassId + * @memberof google.cloud.speech.v2.CreateCustomClassRequest + * @instance + */ + CreateCustomClassRequest.prototype.customClassId = ""; + + /** + * CreateCustomClassRequest parent. + * @member {string} parent + * @memberof google.cloud.speech.v2.CreateCustomClassRequest + * @instance + */ + CreateCustomClassRequest.prototype.parent = ""; + + /** + * Creates a new CreateCustomClassRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.CreateCustomClassRequest + * @static + * @param {google.cloud.speech.v2.ICreateCustomClassRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v2.CreateCustomClassRequest} CreateCustomClassRequest instance + */ + CreateCustomClassRequest.create = function create(properties) { + return new CreateCustomClassRequest(properties); + }; + + /** + * Encodes the specified CreateCustomClassRequest message. Does not implicitly {@link google.cloud.speech.v2.CreateCustomClassRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.CreateCustomClassRequest + * @static + * @param {google.cloud.speech.v2.ICreateCustomClassRequest} message CreateCustomClassRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCustomClassRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.customClass != null && Object.hasOwnProperty.call(message, "customClass")) + $root.google.cloud.speech.v2.CustomClass.encode(message.customClass, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.validateOnly); + if (message.customClassId != null && Object.hasOwnProperty.call(message, "customClassId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.customClassId); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.parent); + return writer; + }; + + /** + * Encodes the specified CreateCustomClassRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v2.CreateCustomClassRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.CreateCustomClassRequest + * @static + * @param {google.cloud.speech.v2.ICreateCustomClassRequest} message CreateCustomClassRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCustomClassRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateCustomClassRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.CreateCustomClassRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.CreateCustomClassRequest} CreateCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCustomClassRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.CreateCustomClassRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.customClass = $root.google.cloud.speech.v2.CustomClass.decode(reader, reader.uint32()); + break; + } + case 2: { + message.validateOnly = reader.bool(); + break; + } + case 3: { + message.customClassId = reader.string(); + break; + } + case 4: { + message.parent = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateCustomClassRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.CreateCustomClassRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.CreateCustomClassRequest} CreateCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCustomClassRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateCustomClassRequest message. + * @function verify + * @memberof google.cloud.speech.v2.CreateCustomClassRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateCustomClassRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.customClass != null && message.hasOwnProperty("customClass")) { + var error = $root.google.cloud.speech.v2.CustomClass.verify(message.customClass); + if (error) + return "customClass." + error; + } + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.customClassId != null && message.hasOwnProperty("customClassId")) + if (!$util.isString(message.customClassId)) + return "customClassId: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + return null; + }; + + /** + * Creates a CreateCustomClassRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.CreateCustomClassRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.CreateCustomClassRequest} CreateCustomClassRequest + */ + CreateCustomClassRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.CreateCustomClassRequest) + return object; + var message = new $root.google.cloud.speech.v2.CreateCustomClassRequest(); + if (object.customClass != null) { + if (typeof object.customClass !== "object") + throw TypeError(".google.cloud.speech.v2.CreateCustomClassRequest.customClass: object expected"); + message.customClass = $root.google.cloud.speech.v2.CustomClass.fromObject(object.customClass); + } + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.customClassId != null) + message.customClassId = String(object.customClassId); + if (object.parent != null) + message.parent = String(object.parent); + return message; + }; + + /** + * Creates a plain object from a CreateCustomClassRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.CreateCustomClassRequest + * @static + * @param {google.cloud.speech.v2.CreateCustomClassRequest} message CreateCustomClassRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateCustomClassRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.customClass = null; + object.validateOnly = false; + object.customClassId = ""; + object.parent = ""; + } + if (message.customClass != null && message.hasOwnProperty("customClass")) + object.customClass = $root.google.cloud.speech.v2.CustomClass.toObject(message.customClass, options); + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.customClassId != null && message.hasOwnProperty("customClassId")) + object.customClassId = message.customClassId; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + return object; + }; + + /** + * Converts this CreateCustomClassRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.CreateCustomClassRequest + * @instance + * @returns {Object.} JSON object + */ + CreateCustomClassRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateCustomClassRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v2.CreateCustomClassRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateCustomClassRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.CreateCustomClassRequest"; + }; + + return CreateCustomClassRequest; + })(); + + v2.ListCustomClassesRequest = (function() { + + /** + * Properties of a ListCustomClassesRequest. + * @memberof google.cloud.speech.v2 + * @interface IListCustomClassesRequest + * @property {string|null} [parent] ListCustomClassesRequest parent + * @property {number|null} [pageSize] ListCustomClassesRequest pageSize + * @property {string|null} [pageToken] ListCustomClassesRequest pageToken + * @property {boolean|null} [showDeleted] ListCustomClassesRequest showDeleted + */ + + /** + * Constructs a new ListCustomClassesRequest. + * @memberof google.cloud.speech.v2 + * @classdesc Represents a ListCustomClassesRequest. + * @implements IListCustomClassesRequest + * @constructor + * @param {google.cloud.speech.v2.IListCustomClassesRequest=} [properties] Properties to set + */ + function ListCustomClassesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCustomClassesRequest parent. + * @member {string} parent + * @memberof google.cloud.speech.v2.ListCustomClassesRequest + * @instance + */ + ListCustomClassesRequest.prototype.parent = ""; + + /** + * ListCustomClassesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.speech.v2.ListCustomClassesRequest + * @instance + */ + ListCustomClassesRequest.prototype.pageSize = 0; + + /** + * ListCustomClassesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.speech.v2.ListCustomClassesRequest + * @instance + */ + ListCustomClassesRequest.prototype.pageToken = ""; + + /** + * ListCustomClassesRequest showDeleted. + * @member {boolean} showDeleted + * @memberof google.cloud.speech.v2.ListCustomClassesRequest + * @instance + */ + ListCustomClassesRequest.prototype.showDeleted = false; + + /** + * Creates a new ListCustomClassesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.ListCustomClassesRequest + * @static + * @param {google.cloud.speech.v2.IListCustomClassesRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v2.ListCustomClassesRequest} ListCustomClassesRequest instance + */ + ListCustomClassesRequest.create = function create(properties) { + return new ListCustomClassesRequest(properties); + }; + + /** + * Encodes the specified ListCustomClassesRequest message. Does not implicitly {@link google.cloud.speech.v2.ListCustomClassesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.ListCustomClassesRequest + * @static + * @param {google.cloud.speech.v2.IListCustomClassesRequest} message ListCustomClassesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCustomClassesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.showDeleted != null && Object.hasOwnProperty.call(message, "showDeleted")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.showDeleted); + return writer; + }; + + /** + * Encodes the specified ListCustomClassesRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v2.ListCustomClassesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.ListCustomClassesRequest + * @static + * @param {google.cloud.speech.v2.IListCustomClassesRequest} message ListCustomClassesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCustomClassesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCustomClassesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.ListCustomClassesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.ListCustomClassesRequest} ListCustomClassesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCustomClassesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.ListCustomClassesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.showDeleted = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCustomClassesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.ListCustomClassesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.ListCustomClassesRequest} ListCustomClassesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCustomClassesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCustomClassesRequest message. + * @function verify + * @memberof google.cloud.speech.v2.ListCustomClassesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCustomClassesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.showDeleted != null && message.hasOwnProperty("showDeleted")) + if (typeof message.showDeleted !== "boolean") + return "showDeleted: boolean expected"; + return null; + }; + + /** + * Creates a ListCustomClassesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.ListCustomClassesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.ListCustomClassesRequest} ListCustomClassesRequest + */ + ListCustomClassesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.ListCustomClassesRequest) + return object; + var message = new $root.google.cloud.speech.v2.ListCustomClassesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.showDeleted != null) + message.showDeleted = Boolean(object.showDeleted); + return message; + }; + + /** + * Creates a plain object from a ListCustomClassesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.ListCustomClassesRequest + * @static + * @param {google.cloud.speech.v2.ListCustomClassesRequest} message ListCustomClassesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCustomClassesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.showDeleted = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.showDeleted != null && message.hasOwnProperty("showDeleted")) + object.showDeleted = message.showDeleted; + return object; + }; + + /** + * Converts this ListCustomClassesRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.ListCustomClassesRequest + * @instance + * @returns {Object.} JSON object + */ + ListCustomClassesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCustomClassesRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v2.ListCustomClassesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCustomClassesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.ListCustomClassesRequest"; + }; + + return ListCustomClassesRequest; + })(); + + v2.ListCustomClassesResponse = (function() { + + /** + * Properties of a ListCustomClassesResponse. + * @memberof google.cloud.speech.v2 + * @interface IListCustomClassesResponse + * @property {Array.|null} [customClasses] ListCustomClassesResponse customClasses + * @property {string|null} [nextPageToken] ListCustomClassesResponse nextPageToken + */ + + /** + * Constructs a new ListCustomClassesResponse. + * @memberof google.cloud.speech.v2 + * @classdesc Represents a ListCustomClassesResponse. + * @implements IListCustomClassesResponse + * @constructor + * @param {google.cloud.speech.v2.IListCustomClassesResponse=} [properties] Properties to set + */ + function ListCustomClassesResponse(properties) { + this.customClasses = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCustomClassesResponse customClasses. + * @member {Array.} customClasses + * @memberof google.cloud.speech.v2.ListCustomClassesResponse + * @instance + */ + ListCustomClassesResponse.prototype.customClasses = $util.emptyArray; + + /** + * ListCustomClassesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.speech.v2.ListCustomClassesResponse + * @instance + */ + ListCustomClassesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListCustomClassesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.ListCustomClassesResponse + * @static + * @param {google.cloud.speech.v2.IListCustomClassesResponse=} [properties] Properties to set + * @returns {google.cloud.speech.v2.ListCustomClassesResponse} ListCustomClassesResponse instance + */ + ListCustomClassesResponse.create = function create(properties) { + return new ListCustomClassesResponse(properties); + }; + + /** + * Encodes the specified ListCustomClassesResponse message. Does not implicitly {@link google.cloud.speech.v2.ListCustomClassesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.ListCustomClassesResponse + * @static + * @param {google.cloud.speech.v2.IListCustomClassesResponse} message ListCustomClassesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCustomClassesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.customClasses != null && message.customClasses.length) + for (var i = 0; i < message.customClasses.length; ++i) + $root.google.cloud.speech.v2.CustomClass.encode(message.customClasses[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListCustomClassesResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v2.ListCustomClassesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.ListCustomClassesResponse + * @static + * @param {google.cloud.speech.v2.IListCustomClassesResponse} message ListCustomClassesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCustomClassesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCustomClassesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.ListCustomClassesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.ListCustomClassesResponse} ListCustomClassesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCustomClassesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.ListCustomClassesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.customClasses && message.customClasses.length)) + message.customClasses = []; + message.customClasses.push($root.google.cloud.speech.v2.CustomClass.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCustomClassesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.ListCustomClassesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.ListCustomClassesResponse} ListCustomClassesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCustomClassesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCustomClassesResponse message. + * @function verify + * @memberof google.cloud.speech.v2.ListCustomClassesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCustomClassesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.customClasses != null && message.hasOwnProperty("customClasses")) { + if (!Array.isArray(message.customClasses)) + return "customClasses: array expected"; + for (var i = 0; i < message.customClasses.length; ++i) { + var error = $root.google.cloud.speech.v2.CustomClass.verify(message.customClasses[i]); + if (error) + return "customClasses." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListCustomClassesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.ListCustomClassesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.ListCustomClassesResponse} ListCustomClassesResponse + */ + ListCustomClassesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.ListCustomClassesResponse) + return object; + var message = new $root.google.cloud.speech.v2.ListCustomClassesResponse(); + if (object.customClasses) { + if (!Array.isArray(object.customClasses)) + throw TypeError(".google.cloud.speech.v2.ListCustomClassesResponse.customClasses: array expected"); + message.customClasses = []; + for (var i = 0; i < object.customClasses.length; ++i) { + if (typeof object.customClasses[i] !== "object") + throw TypeError(".google.cloud.speech.v2.ListCustomClassesResponse.customClasses: object expected"); + message.customClasses[i] = $root.google.cloud.speech.v2.CustomClass.fromObject(object.customClasses[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListCustomClassesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.ListCustomClassesResponse + * @static + * @param {google.cloud.speech.v2.ListCustomClassesResponse} message ListCustomClassesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCustomClassesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.customClasses = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.customClasses && message.customClasses.length) { + object.customClasses = []; + for (var j = 0; j < message.customClasses.length; ++j) + object.customClasses[j] = $root.google.cloud.speech.v2.CustomClass.toObject(message.customClasses[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListCustomClassesResponse to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.ListCustomClassesResponse + * @instance + * @returns {Object.} JSON object + */ + ListCustomClassesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCustomClassesResponse + * @function getTypeUrl + * @memberof google.cloud.speech.v2.ListCustomClassesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCustomClassesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.ListCustomClassesResponse"; + }; + + return ListCustomClassesResponse; + })(); + + v2.GetCustomClassRequest = (function() { + + /** + * Properties of a GetCustomClassRequest. + * @memberof google.cloud.speech.v2 + * @interface IGetCustomClassRequest + * @property {string|null} [name] GetCustomClassRequest name + */ + + /** + * Constructs a new GetCustomClassRequest. + * @memberof google.cloud.speech.v2 + * @classdesc Represents a GetCustomClassRequest. + * @implements IGetCustomClassRequest + * @constructor + * @param {google.cloud.speech.v2.IGetCustomClassRequest=} [properties] Properties to set + */ + function GetCustomClassRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetCustomClassRequest name. + * @member {string} name + * @memberof google.cloud.speech.v2.GetCustomClassRequest + * @instance + */ + GetCustomClassRequest.prototype.name = ""; + + /** + * Creates a new GetCustomClassRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.GetCustomClassRequest + * @static + * @param {google.cloud.speech.v2.IGetCustomClassRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v2.GetCustomClassRequest} GetCustomClassRequest instance + */ + GetCustomClassRequest.create = function create(properties) { + return new GetCustomClassRequest(properties); + }; + + /** + * Encodes the specified GetCustomClassRequest message. Does not implicitly {@link google.cloud.speech.v2.GetCustomClassRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.GetCustomClassRequest + * @static + * @param {google.cloud.speech.v2.IGetCustomClassRequest} message GetCustomClassRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCustomClassRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetCustomClassRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v2.GetCustomClassRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.GetCustomClassRequest + * @static + * @param {google.cloud.speech.v2.IGetCustomClassRequest} message GetCustomClassRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCustomClassRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetCustomClassRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.GetCustomClassRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.GetCustomClassRequest} GetCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCustomClassRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.GetCustomClassRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetCustomClassRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.GetCustomClassRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.GetCustomClassRequest} GetCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCustomClassRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetCustomClassRequest message. + * @function verify + * @memberof google.cloud.speech.v2.GetCustomClassRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetCustomClassRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetCustomClassRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.GetCustomClassRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.GetCustomClassRequest} GetCustomClassRequest + */ + GetCustomClassRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.GetCustomClassRequest) + return object; + var message = new $root.google.cloud.speech.v2.GetCustomClassRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetCustomClassRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.GetCustomClassRequest + * @static + * @param {google.cloud.speech.v2.GetCustomClassRequest} message GetCustomClassRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetCustomClassRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetCustomClassRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.GetCustomClassRequest + * @instance + * @returns {Object.} JSON object + */ + GetCustomClassRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetCustomClassRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v2.GetCustomClassRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetCustomClassRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.GetCustomClassRequest"; + }; + + return GetCustomClassRequest; + })(); + + v2.UpdateCustomClassRequest = (function() { + + /** + * Properties of an UpdateCustomClassRequest. + * @memberof google.cloud.speech.v2 + * @interface IUpdateCustomClassRequest + * @property {google.cloud.speech.v2.ICustomClass|null} [customClass] UpdateCustomClassRequest customClass + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCustomClassRequest updateMask + * @property {boolean|null} [validateOnly] UpdateCustomClassRequest validateOnly + */ + + /** + * Constructs a new UpdateCustomClassRequest. + * @memberof google.cloud.speech.v2 + * @classdesc Represents an UpdateCustomClassRequest. + * @implements IUpdateCustomClassRequest + * @constructor + * @param {google.cloud.speech.v2.IUpdateCustomClassRequest=} [properties] Properties to set + */ + function UpdateCustomClassRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateCustomClassRequest customClass. + * @member {google.cloud.speech.v2.ICustomClass|null|undefined} customClass + * @memberof google.cloud.speech.v2.UpdateCustomClassRequest + * @instance + */ + UpdateCustomClassRequest.prototype.customClass = null; + + /** + * UpdateCustomClassRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.speech.v2.UpdateCustomClassRequest + * @instance + */ + UpdateCustomClassRequest.prototype.updateMask = null; + + /** + * UpdateCustomClassRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.speech.v2.UpdateCustomClassRequest + * @instance + */ + UpdateCustomClassRequest.prototype.validateOnly = false; + + /** + * Creates a new UpdateCustomClassRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.UpdateCustomClassRequest + * @static + * @param {google.cloud.speech.v2.IUpdateCustomClassRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v2.UpdateCustomClassRequest} UpdateCustomClassRequest instance + */ + UpdateCustomClassRequest.create = function create(properties) { + return new UpdateCustomClassRequest(properties); + }; + + /** + * Encodes the specified UpdateCustomClassRequest message. Does not implicitly {@link google.cloud.speech.v2.UpdateCustomClassRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.UpdateCustomClassRequest + * @static + * @param {google.cloud.speech.v2.IUpdateCustomClassRequest} message UpdateCustomClassRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCustomClassRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.customClass != null && Object.hasOwnProperty.call(message, "customClass")) + $root.google.cloud.speech.v2.CustomClass.encode(message.customClass, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified UpdateCustomClassRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v2.UpdateCustomClassRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.UpdateCustomClassRequest + * @static + * @param {google.cloud.speech.v2.IUpdateCustomClassRequest} message UpdateCustomClassRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCustomClassRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateCustomClassRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.UpdateCustomClassRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.UpdateCustomClassRequest} UpdateCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCustomClassRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.UpdateCustomClassRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.customClass = $root.google.cloud.speech.v2.CustomClass.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateCustomClassRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.UpdateCustomClassRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.UpdateCustomClassRequest} UpdateCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCustomClassRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateCustomClassRequest message. + * @function verify + * @memberof google.cloud.speech.v2.UpdateCustomClassRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateCustomClassRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.customClass != null && message.hasOwnProperty("customClass")) { + var error = $root.google.cloud.speech.v2.CustomClass.verify(message.customClass); + if (error) + return "customClass." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates an UpdateCustomClassRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.UpdateCustomClassRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.UpdateCustomClassRequest} UpdateCustomClassRequest + */ + UpdateCustomClassRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.UpdateCustomClassRequest) + return object; + var message = new $root.google.cloud.speech.v2.UpdateCustomClassRequest(); + if (object.customClass != null) { + if (typeof object.customClass !== "object") + throw TypeError(".google.cloud.speech.v2.UpdateCustomClassRequest.customClass: object expected"); + message.customClass = $root.google.cloud.speech.v2.CustomClass.fromObject(object.customClass); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.speech.v2.UpdateCustomClassRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from an UpdateCustomClassRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.UpdateCustomClassRequest + * @static + * @param {google.cloud.speech.v2.UpdateCustomClassRequest} message UpdateCustomClassRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateCustomClassRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.customClass = null; + object.updateMask = null; + object.validateOnly = false; + } + if (message.customClass != null && message.hasOwnProperty("customClass")) + object.customClass = $root.google.cloud.speech.v2.CustomClass.toObject(message.customClass, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this UpdateCustomClassRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.UpdateCustomClassRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateCustomClassRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateCustomClassRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v2.UpdateCustomClassRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateCustomClassRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.UpdateCustomClassRequest"; + }; + + return UpdateCustomClassRequest; + })(); + + v2.DeleteCustomClassRequest = (function() { + + /** + * Properties of a DeleteCustomClassRequest. + * @memberof google.cloud.speech.v2 + * @interface IDeleteCustomClassRequest + * @property {string|null} [name] DeleteCustomClassRequest name + * @property {boolean|null} [validateOnly] DeleteCustomClassRequest validateOnly + * @property {boolean|null} [allowMissing] DeleteCustomClassRequest allowMissing + * @property {string|null} [etag] DeleteCustomClassRequest etag + */ + + /** + * Constructs a new DeleteCustomClassRequest. + * @memberof google.cloud.speech.v2 + * @classdesc Represents a DeleteCustomClassRequest. + * @implements IDeleteCustomClassRequest + * @constructor + * @param {google.cloud.speech.v2.IDeleteCustomClassRequest=} [properties] Properties to set + */ + function DeleteCustomClassRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteCustomClassRequest name. + * @member {string} name + * @memberof google.cloud.speech.v2.DeleteCustomClassRequest + * @instance + */ + DeleteCustomClassRequest.prototype.name = ""; + + /** + * DeleteCustomClassRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.speech.v2.DeleteCustomClassRequest + * @instance + */ + DeleteCustomClassRequest.prototype.validateOnly = false; + + /** + * DeleteCustomClassRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.speech.v2.DeleteCustomClassRequest + * @instance + */ + DeleteCustomClassRequest.prototype.allowMissing = false; + + /** + * DeleteCustomClassRequest etag. + * @member {string} etag + * @memberof google.cloud.speech.v2.DeleteCustomClassRequest + * @instance + */ + DeleteCustomClassRequest.prototype.etag = ""; + + /** + * Creates a new DeleteCustomClassRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.DeleteCustomClassRequest + * @static + * @param {google.cloud.speech.v2.IDeleteCustomClassRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v2.DeleteCustomClassRequest} DeleteCustomClassRequest instance + */ + DeleteCustomClassRequest.create = function create(properties) { + return new DeleteCustomClassRequest(properties); + }; + + /** + * Encodes the specified DeleteCustomClassRequest message. Does not implicitly {@link google.cloud.speech.v2.DeleteCustomClassRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.DeleteCustomClassRequest + * @static + * @param {google.cloud.speech.v2.IDeleteCustomClassRequest} message DeleteCustomClassRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteCustomClassRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.validateOnly); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.allowMissing); + return writer; + }; + + /** + * Encodes the specified DeleteCustomClassRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v2.DeleteCustomClassRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.DeleteCustomClassRequest + * @static + * @param {google.cloud.speech.v2.IDeleteCustomClassRequest} message DeleteCustomClassRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteCustomClassRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteCustomClassRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.DeleteCustomClassRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.DeleteCustomClassRequest} DeleteCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteCustomClassRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.DeleteCustomClassRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.validateOnly = reader.bool(); + break; + } + case 4: { + message.allowMissing = reader.bool(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteCustomClassRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.DeleteCustomClassRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.DeleteCustomClassRequest} DeleteCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteCustomClassRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteCustomClassRequest message. + * @function verify + * @memberof google.cloud.speech.v2.DeleteCustomClassRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteCustomClassRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteCustomClassRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.DeleteCustomClassRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.DeleteCustomClassRequest} DeleteCustomClassRequest + */ + DeleteCustomClassRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.DeleteCustomClassRequest) + return object; + var message = new $root.google.cloud.speech.v2.DeleteCustomClassRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteCustomClassRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.DeleteCustomClassRequest + * @static + * @param {google.cloud.speech.v2.DeleteCustomClassRequest} message DeleteCustomClassRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteCustomClassRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.validateOnly = false; + object.etag = ""; + object.allowMissing = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + return object; + }; + + /** + * Converts this DeleteCustomClassRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.DeleteCustomClassRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteCustomClassRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteCustomClassRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v2.DeleteCustomClassRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteCustomClassRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.DeleteCustomClassRequest"; + }; + + return DeleteCustomClassRequest; + })(); + + v2.UndeleteCustomClassRequest = (function() { + + /** + * Properties of an UndeleteCustomClassRequest. + * @memberof google.cloud.speech.v2 + * @interface IUndeleteCustomClassRequest + * @property {string|null} [name] UndeleteCustomClassRequest name + * @property {boolean|null} [validateOnly] UndeleteCustomClassRequest validateOnly + * @property {string|null} [etag] UndeleteCustomClassRequest etag + */ + + /** + * Constructs a new UndeleteCustomClassRequest. + * @memberof google.cloud.speech.v2 + * @classdesc Represents an UndeleteCustomClassRequest. + * @implements IUndeleteCustomClassRequest + * @constructor + * @param {google.cloud.speech.v2.IUndeleteCustomClassRequest=} [properties] Properties to set + */ + function UndeleteCustomClassRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UndeleteCustomClassRequest name. + * @member {string} name + * @memberof google.cloud.speech.v2.UndeleteCustomClassRequest + * @instance + */ + UndeleteCustomClassRequest.prototype.name = ""; + + /** + * UndeleteCustomClassRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.speech.v2.UndeleteCustomClassRequest + * @instance + */ + UndeleteCustomClassRequest.prototype.validateOnly = false; + + /** + * UndeleteCustomClassRequest etag. + * @member {string} etag + * @memberof google.cloud.speech.v2.UndeleteCustomClassRequest + * @instance + */ + UndeleteCustomClassRequest.prototype.etag = ""; + + /** + * Creates a new UndeleteCustomClassRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.UndeleteCustomClassRequest + * @static + * @param {google.cloud.speech.v2.IUndeleteCustomClassRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v2.UndeleteCustomClassRequest} UndeleteCustomClassRequest instance + */ + UndeleteCustomClassRequest.create = function create(properties) { + return new UndeleteCustomClassRequest(properties); + }; + + /** + * Encodes the specified UndeleteCustomClassRequest message. Does not implicitly {@link google.cloud.speech.v2.UndeleteCustomClassRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.UndeleteCustomClassRequest + * @static + * @param {google.cloud.speech.v2.IUndeleteCustomClassRequest} message UndeleteCustomClassRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeleteCustomClassRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.etag); + return writer; + }; + + /** + * Encodes the specified UndeleteCustomClassRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v2.UndeleteCustomClassRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.UndeleteCustomClassRequest + * @static + * @param {google.cloud.speech.v2.IUndeleteCustomClassRequest} message UndeleteCustomClassRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeleteCustomClassRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UndeleteCustomClassRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.UndeleteCustomClassRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.UndeleteCustomClassRequest} UndeleteCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeleteCustomClassRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.UndeleteCustomClassRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.validateOnly = reader.bool(); + break; + } + case 4: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UndeleteCustomClassRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.UndeleteCustomClassRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.UndeleteCustomClassRequest} UndeleteCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeleteCustomClassRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UndeleteCustomClassRequest message. + * @function verify + * @memberof google.cloud.speech.v2.UndeleteCustomClassRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UndeleteCustomClassRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates an UndeleteCustomClassRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.UndeleteCustomClassRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.UndeleteCustomClassRequest} UndeleteCustomClassRequest + */ + UndeleteCustomClassRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.UndeleteCustomClassRequest) + return object; + var message = new $root.google.cloud.speech.v2.UndeleteCustomClassRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from an UndeleteCustomClassRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.UndeleteCustomClassRequest + * @static + * @param {google.cloud.speech.v2.UndeleteCustomClassRequest} message UndeleteCustomClassRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UndeleteCustomClassRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.validateOnly = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this UndeleteCustomClassRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.UndeleteCustomClassRequest + * @instance + * @returns {Object.} JSON object + */ + UndeleteCustomClassRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UndeleteCustomClassRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v2.UndeleteCustomClassRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UndeleteCustomClassRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.UndeleteCustomClassRequest"; + }; + + return UndeleteCustomClassRequest; + })(); + + v2.CreatePhraseSetRequest = (function() { + + /** + * Properties of a CreatePhraseSetRequest. + * @memberof google.cloud.speech.v2 + * @interface ICreatePhraseSetRequest + * @property {google.cloud.speech.v2.IPhraseSet|null} [phraseSet] CreatePhraseSetRequest phraseSet + * @property {boolean|null} [validateOnly] CreatePhraseSetRequest validateOnly + * @property {string|null} [phraseSetId] CreatePhraseSetRequest phraseSetId + * @property {string|null} [parent] CreatePhraseSetRequest parent + */ + + /** + * Constructs a new CreatePhraseSetRequest. + * @memberof google.cloud.speech.v2 + * @classdesc Represents a CreatePhraseSetRequest. + * @implements ICreatePhraseSetRequest + * @constructor + * @param {google.cloud.speech.v2.ICreatePhraseSetRequest=} [properties] Properties to set + */ + function CreatePhraseSetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreatePhraseSetRequest phraseSet. + * @member {google.cloud.speech.v2.IPhraseSet|null|undefined} phraseSet + * @memberof google.cloud.speech.v2.CreatePhraseSetRequest + * @instance + */ + CreatePhraseSetRequest.prototype.phraseSet = null; + + /** + * CreatePhraseSetRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.speech.v2.CreatePhraseSetRequest + * @instance + */ + CreatePhraseSetRequest.prototype.validateOnly = false; + + /** + * CreatePhraseSetRequest phraseSetId. + * @member {string} phraseSetId + * @memberof google.cloud.speech.v2.CreatePhraseSetRequest + * @instance + */ + CreatePhraseSetRequest.prototype.phraseSetId = ""; + + /** + * CreatePhraseSetRequest parent. + * @member {string} parent + * @memberof google.cloud.speech.v2.CreatePhraseSetRequest + * @instance + */ + CreatePhraseSetRequest.prototype.parent = ""; + + /** + * Creates a new CreatePhraseSetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.CreatePhraseSetRequest + * @static + * @param {google.cloud.speech.v2.ICreatePhraseSetRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v2.CreatePhraseSetRequest} CreatePhraseSetRequest instance + */ + CreatePhraseSetRequest.create = function create(properties) { + return new CreatePhraseSetRequest(properties); + }; + + /** + * Encodes the specified CreatePhraseSetRequest message. Does not implicitly {@link google.cloud.speech.v2.CreatePhraseSetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.CreatePhraseSetRequest + * @static + * @param {google.cloud.speech.v2.ICreatePhraseSetRequest} message CreatePhraseSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreatePhraseSetRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.phraseSet != null && Object.hasOwnProperty.call(message, "phraseSet")) + $root.google.cloud.speech.v2.PhraseSet.encode(message.phraseSet, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.validateOnly); + if (message.phraseSetId != null && Object.hasOwnProperty.call(message, "phraseSetId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.phraseSetId); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.parent); + return writer; + }; + + /** + * Encodes the specified CreatePhraseSetRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v2.CreatePhraseSetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.CreatePhraseSetRequest + * @static + * @param {google.cloud.speech.v2.ICreatePhraseSetRequest} message CreatePhraseSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreatePhraseSetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreatePhraseSetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.CreatePhraseSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.CreatePhraseSetRequest} CreatePhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreatePhraseSetRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.CreatePhraseSetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.phraseSet = $root.google.cloud.speech.v2.PhraseSet.decode(reader, reader.uint32()); + break; + } + case 2: { + message.validateOnly = reader.bool(); + break; + } + case 3: { + message.phraseSetId = reader.string(); + break; + } + case 4: { + message.parent = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreatePhraseSetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.CreatePhraseSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.CreatePhraseSetRequest} CreatePhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreatePhraseSetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreatePhraseSetRequest message. + * @function verify + * @memberof google.cloud.speech.v2.CreatePhraseSetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreatePhraseSetRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.phraseSet != null && message.hasOwnProperty("phraseSet")) { + var error = $root.google.cloud.speech.v2.PhraseSet.verify(message.phraseSet); + if (error) + return "phraseSet." + error; + } + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.phraseSetId != null && message.hasOwnProperty("phraseSetId")) + if (!$util.isString(message.phraseSetId)) + return "phraseSetId: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + return null; + }; + + /** + * Creates a CreatePhraseSetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.CreatePhraseSetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.CreatePhraseSetRequest} CreatePhraseSetRequest + */ + CreatePhraseSetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.CreatePhraseSetRequest) + return object; + var message = new $root.google.cloud.speech.v2.CreatePhraseSetRequest(); + if (object.phraseSet != null) { + if (typeof object.phraseSet !== "object") + throw TypeError(".google.cloud.speech.v2.CreatePhraseSetRequest.phraseSet: object expected"); + message.phraseSet = $root.google.cloud.speech.v2.PhraseSet.fromObject(object.phraseSet); + } + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.phraseSetId != null) + message.phraseSetId = String(object.phraseSetId); + if (object.parent != null) + message.parent = String(object.parent); + return message; + }; + + /** + * Creates a plain object from a CreatePhraseSetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.CreatePhraseSetRequest + * @static + * @param {google.cloud.speech.v2.CreatePhraseSetRequest} message CreatePhraseSetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreatePhraseSetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.phraseSet = null; + object.validateOnly = false; + object.phraseSetId = ""; + object.parent = ""; + } + if (message.phraseSet != null && message.hasOwnProperty("phraseSet")) + object.phraseSet = $root.google.cloud.speech.v2.PhraseSet.toObject(message.phraseSet, options); + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.phraseSetId != null && message.hasOwnProperty("phraseSetId")) + object.phraseSetId = message.phraseSetId; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + return object; + }; + + /** + * Converts this CreatePhraseSetRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.CreatePhraseSetRequest + * @instance + * @returns {Object.} JSON object + */ + CreatePhraseSetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreatePhraseSetRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v2.CreatePhraseSetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreatePhraseSetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.CreatePhraseSetRequest"; + }; + + return CreatePhraseSetRequest; + })(); + + v2.ListPhraseSetsRequest = (function() { + + /** + * Properties of a ListPhraseSetsRequest. + * @memberof google.cloud.speech.v2 + * @interface IListPhraseSetsRequest + * @property {string|null} [parent] ListPhraseSetsRequest parent + * @property {number|null} [pageSize] ListPhraseSetsRequest pageSize + * @property {string|null} [pageToken] ListPhraseSetsRequest pageToken + * @property {boolean|null} [showDeleted] ListPhraseSetsRequest showDeleted + */ + + /** + * Constructs a new ListPhraseSetsRequest. + * @memberof google.cloud.speech.v2 + * @classdesc Represents a ListPhraseSetsRequest. + * @implements IListPhraseSetsRequest + * @constructor + * @param {google.cloud.speech.v2.IListPhraseSetsRequest=} [properties] Properties to set + */ + function ListPhraseSetsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListPhraseSetsRequest parent. + * @member {string} parent + * @memberof google.cloud.speech.v2.ListPhraseSetsRequest + * @instance + */ + ListPhraseSetsRequest.prototype.parent = ""; + + /** + * ListPhraseSetsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.speech.v2.ListPhraseSetsRequest + * @instance + */ + ListPhraseSetsRequest.prototype.pageSize = 0; + + /** + * ListPhraseSetsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.speech.v2.ListPhraseSetsRequest + * @instance + */ + ListPhraseSetsRequest.prototype.pageToken = ""; + + /** + * ListPhraseSetsRequest showDeleted. + * @member {boolean} showDeleted + * @memberof google.cloud.speech.v2.ListPhraseSetsRequest + * @instance + */ + ListPhraseSetsRequest.prototype.showDeleted = false; + + /** + * Creates a new ListPhraseSetsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.ListPhraseSetsRequest + * @static + * @param {google.cloud.speech.v2.IListPhraseSetsRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v2.ListPhraseSetsRequest} ListPhraseSetsRequest instance + */ + ListPhraseSetsRequest.create = function create(properties) { + return new ListPhraseSetsRequest(properties); + }; + + /** + * Encodes the specified ListPhraseSetsRequest message. Does not implicitly {@link google.cloud.speech.v2.ListPhraseSetsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.ListPhraseSetsRequest + * @static + * @param {google.cloud.speech.v2.IListPhraseSetsRequest} message ListPhraseSetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPhraseSetsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.showDeleted != null && Object.hasOwnProperty.call(message, "showDeleted")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.showDeleted); + return writer; + }; + + /** + * Encodes the specified ListPhraseSetsRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v2.ListPhraseSetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.ListPhraseSetsRequest + * @static + * @param {google.cloud.speech.v2.IListPhraseSetsRequest} message ListPhraseSetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPhraseSetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPhraseSetsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.ListPhraseSetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.ListPhraseSetsRequest} ListPhraseSetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPhraseSetsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.ListPhraseSetsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.showDeleted = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListPhraseSetsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.ListPhraseSetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.ListPhraseSetsRequest} ListPhraseSetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPhraseSetsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPhraseSetsRequest message. + * @function verify + * @memberof google.cloud.speech.v2.ListPhraseSetsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPhraseSetsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.showDeleted != null && message.hasOwnProperty("showDeleted")) + if (typeof message.showDeleted !== "boolean") + return "showDeleted: boolean expected"; + return null; + }; + + /** + * Creates a ListPhraseSetsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.ListPhraseSetsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.ListPhraseSetsRequest} ListPhraseSetsRequest + */ + ListPhraseSetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.ListPhraseSetsRequest) + return object; + var message = new $root.google.cloud.speech.v2.ListPhraseSetsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.showDeleted != null) + message.showDeleted = Boolean(object.showDeleted); + return message; + }; + + /** + * Creates a plain object from a ListPhraseSetsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.ListPhraseSetsRequest + * @static + * @param {google.cloud.speech.v2.ListPhraseSetsRequest} message ListPhraseSetsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPhraseSetsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.showDeleted = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.showDeleted != null && message.hasOwnProperty("showDeleted")) + object.showDeleted = message.showDeleted; + return object; + }; + + /** + * Converts this ListPhraseSetsRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.ListPhraseSetsRequest + * @instance + * @returns {Object.} JSON object + */ + ListPhraseSetsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListPhraseSetsRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v2.ListPhraseSetsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPhraseSetsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.ListPhraseSetsRequest"; + }; + + return ListPhraseSetsRequest; + })(); + + v2.ListPhraseSetsResponse = (function() { + + /** + * Properties of a ListPhraseSetsResponse. + * @memberof google.cloud.speech.v2 + * @interface IListPhraseSetsResponse + * @property {Array.|null} [phraseSets] ListPhraseSetsResponse phraseSets + * @property {string|null} [nextPageToken] ListPhraseSetsResponse nextPageToken + */ + + /** + * Constructs a new ListPhraseSetsResponse. + * @memberof google.cloud.speech.v2 + * @classdesc Represents a ListPhraseSetsResponse. + * @implements IListPhraseSetsResponse + * @constructor + * @param {google.cloud.speech.v2.IListPhraseSetsResponse=} [properties] Properties to set + */ + function ListPhraseSetsResponse(properties) { + this.phraseSets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListPhraseSetsResponse phraseSets. + * @member {Array.} phraseSets + * @memberof google.cloud.speech.v2.ListPhraseSetsResponse + * @instance + */ + ListPhraseSetsResponse.prototype.phraseSets = $util.emptyArray; + + /** + * ListPhraseSetsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.speech.v2.ListPhraseSetsResponse + * @instance + */ + ListPhraseSetsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListPhraseSetsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.ListPhraseSetsResponse + * @static + * @param {google.cloud.speech.v2.IListPhraseSetsResponse=} [properties] Properties to set + * @returns {google.cloud.speech.v2.ListPhraseSetsResponse} ListPhraseSetsResponse instance + */ + ListPhraseSetsResponse.create = function create(properties) { + return new ListPhraseSetsResponse(properties); + }; + + /** + * Encodes the specified ListPhraseSetsResponse message. Does not implicitly {@link google.cloud.speech.v2.ListPhraseSetsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.ListPhraseSetsResponse + * @static + * @param {google.cloud.speech.v2.IListPhraseSetsResponse} message ListPhraseSetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPhraseSetsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.phraseSets != null && message.phraseSets.length) + for (var i = 0; i < message.phraseSets.length; ++i) + $root.google.cloud.speech.v2.PhraseSet.encode(message.phraseSets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListPhraseSetsResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v2.ListPhraseSetsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.ListPhraseSetsResponse + * @static + * @param {google.cloud.speech.v2.IListPhraseSetsResponse} message ListPhraseSetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPhraseSetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPhraseSetsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.ListPhraseSetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.ListPhraseSetsResponse} ListPhraseSetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPhraseSetsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.ListPhraseSetsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.phraseSets && message.phraseSets.length)) + message.phraseSets = []; + message.phraseSets.push($root.google.cloud.speech.v2.PhraseSet.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListPhraseSetsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.ListPhraseSetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.ListPhraseSetsResponse} ListPhraseSetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPhraseSetsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPhraseSetsResponse message. + * @function verify + * @memberof google.cloud.speech.v2.ListPhraseSetsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPhraseSetsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.phraseSets != null && message.hasOwnProperty("phraseSets")) { + if (!Array.isArray(message.phraseSets)) + return "phraseSets: array expected"; + for (var i = 0; i < message.phraseSets.length; ++i) { + var error = $root.google.cloud.speech.v2.PhraseSet.verify(message.phraseSets[i]); + if (error) + return "phraseSets." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListPhraseSetsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.ListPhraseSetsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.ListPhraseSetsResponse} ListPhraseSetsResponse + */ + ListPhraseSetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.ListPhraseSetsResponse) + return object; + var message = new $root.google.cloud.speech.v2.ListPhraseSetsResponse(); + if (object.phraseSets) { + if (!Array.isArray(object.phraseSets)) + throw TypeError(".google.cloud.speech.v2.ListPhraseSetsResponse.phraseSets: array expected"); + message.phraseSets = []; + for (var i = 0; i < object.phraseSets.length; ++i) { + if (typeof object.phraseSets[i] !== "object") + throw TypeError(".google.cloud.speech.v2.ListPhraseSetsResponse.phraseSets: object expected"); + message.phraseSets[i] = $root.google.cloud.speech.v2.PhraseSet.fromObject(object.phraseSets[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListPhraseSetsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.ListPhraseSetsResponse + * @static + * @param {google.cloud.speech.v2.ListPhraseSetsResponse} message ListPhraseSetsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPhraseSetsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.phraseSets = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.phraseSets && message.phraseSets.length) { + object.phraseSets = []; + for (var j = 0; j < message.phraseSets.length; ++j) + object.phraseSets[j] = $root.google.cloud.speech.v2.PhraseSet.toObject(message.phraseSets[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListPhraseSetsResponse to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.ListPhraseSetsResponse + * @instance + * @returns {Object.} JSON object + */ + ListPhraseSetsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListPhraseSetsResponse + * @function getTypeUrl + * @memberof google.cloud.speech.v2.ListPhraseSetsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPhraseSetsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.ListPhraseSetsResponse"; + }; + + return ListPhraseSetsResponse; + })(); + + v2.GetPhraseSetRequest = (function() { + + /** + * Properties of a GetPhraseSetRequest. + * @memberof google.cloud.speech.v2 + * @interface IGetPhraseSetRequest + * @property {string|null} [name] GetPhraseSetRequest name + */ + + /** + * Constructs a new GetPhraseSetRequest. + * @memberof google.cloud.speech.v2 + * @classdesc Represents a GetPhraseSetRequest. + * @implements IGetPhraseSetRequest + * @constructor + * @param {google.cloud.speech.v2.IGetPhraseSetRequest=} [properties] Properties to set + */ + function GetPhraseSetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetPhraseSetRequest name. + * @member {string} name + * @memberof google.cloud.speech.v2.GetPhraseSetRequest + * @instance + */ + GetPhraseSetRequest.prototype.name = ""; + + /** + * Creates a new GetPhraseSetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.GetPhraseSetRequest + * @static + * @param {google.cloud.speech.v2.IGetPhraseSetRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v2.GetPhraseSetRequest} GetPhraseSetRequest instance + */ + GetPhraseSetRequest.create = function create(properties) { + return new GetPhraseSetRequest(properties); + }; + + /** + * Encodes the specified GetPhraseSetRequest message. Does not implicitly {@link google.cloud.speech.v2.GetPhraseSetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.GetPhraseSetRequest + * @static + * @param {google.cloud.speech.v2.IGetPhraseSetRequest} message GetPhraseSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPhraseSetRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetPhraseSetRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v2.GetPhraseSetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.GetPhraseSetRequest + * @static + * @param {google.cloud.speech.v2.IGetPhraseSetRequest} message GetPhraseSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPhraseSetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPhraseSetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.GetPhraseSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.GetPhraseSetRequest} GetPhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPhraseSetRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.GetPhraseSetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetPhraseSetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.GetPhraseSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.GetPhraseSetRequest} GetPhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPhraseSetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPhraseSetRequest message. + * @function verify + * @memberof google.cloud.speech.v2.GetPhraseSetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPhraseSetRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetPhraseSetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.GetPhraseSetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.GetPhraseSetRequest} GetPhraseSetRequest + */ + GetPhraseSetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.GetPhraseSetRequest) + return object; + var message = new $root.google.cloud.speech.v2.GetPhraseSetRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetPhraseSetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.GetPhraseSetRequest + * @static + * @param {google.cloud.speech.v2.GetPhraseSetRequest} message GetPhraseSetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPhraseSetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetPhraseSetRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.GetPhraseSetRequest + * @instance + * @returns {Object.} JSON object + */ + GetPhraseSetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetPhraseSetRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v2.GetPhraseSetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetPhraseSetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.GetPhraseSetRequest"; + }; + + return GetPhraseSetRequest; + })(); + + v2.UpdatePhraseSetRequest = (function() { + + /** + * Properties of an UpdatePhraseSetRequest. + * @memberof google.cloud.speech.v2 + * @interface IUpdatePhraseSetRequest + * @property {google.cloud.speech.v2.IPhraseSet|null} [phraseSet] UpdatePhraseSetRequest phraseSet + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdatePhraseSetRequest updateMask + * @property {boolean|null} [validateOnly] UpdatePhraseSetRequest validateOnly + */ + + /** + * Constructs a new UpdatePhraseSetRequest. + * @memberof google.cloud.speech.v2 + * @classdesc Represents an UpdatePhraseSetRequest. + * @implements IUpdatePhraseSetRequest + * @constructor + * @param {google.cloud.speech.v2.IUpdatePhraseSetRequest=} [properties] Properties to set + */ + function UpdatePhraseSetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdatePhraseSetRequest phraseSet. + * @member {google.cloud.speech.v2.IPhraseSet|null|undefined} phraseSet + * @memberof google.cloud.speech.v2.UpdatePhraseSetRequest + * @instance + */ + UpdatePhraseSetRequest.prototype.phraseSet = null; + + /** + * UpdatePhraseSetRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.speech.v2.UpdatePhraseSetRequest + * @instance + */ + UpdatePhraseSetRequest.prototype.updateMask = null; + + /** + * UpdatePhraseSetRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.speech.v2.UpdatePhraseSetRequest + * @instance + */ + UpdatePhraseSetRequest.prototype.validateOnly = false; + + /** + * Creates a new UpdatePhraseSetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.UpdatePhraseSetRequest + * @static + * @param {google.cloud.speech.v2.IUpdatePhraseSetRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v2.UpdatePhraseSetRequest} UpdatePhraseSetRequest instance + */ + UpdatePhraseSetRequest.create = function create(properties) { + return new UpdatePhraseSetRequest(properties); + }; + + /** + * Encodes the specified UpdatePhraseSetRequest message. Does not implicitly {@link google.cloud.speech.v2.UpdatePhraseSetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.UpdatePhraseSetRequest + * @static + * @param {google.cloud.speech.v2.IUpdatePhraseSetRequest} message UpdatePhraseSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdatePhraseSetRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.phraseSet != null && Object.hasOwnProperty.call(message, "phraseSet")) + $root.google.cloud.speech.v2.PhraseSet.encode(message.phraseSet, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified UpdatePhraseSetRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v2.UpdatePhraseSetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.UpdatePhraseSetRequest + * @static + * @param {google.cloud.speech.v2.IUpdatePhraseSetRequest} message UpdatePhraseSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdatePhraseSetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdatePhraseSetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.UpdatePhraseSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.UpdatePhraseSetRequest} UpdatePhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdatePhraseSetRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.UpdatePhraseSetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.phraseSet = $root.google.cloud.speech.v2.PhraseSet.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdatePhraseSetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.UpdatePhraseSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.UpdatePhraseSetRequest} UpdatePhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdatePhraseSetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdatePhraseSetRequest message. + * @function verify + * @memberof google.cloud.speech.v2.UpdatePhraseSetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdatePhraseSetRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.phraseSet != null && message.hasOwnProperty("phraseSet")) { + var error = $root.google.cloud.speech.v2.PhraseSet.verify(message.phraseSet); + if (error) + return "phraseSet." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates an UpdatePhraseSetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.UpdatePhraseSetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.UpdatePhraseSetRequest} UpdatePhraseSetRequest + */ + UpdatePhraseSetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.UpdatePhraseSetRequest) + return object; + var message = new $root.google.cloud.speech.v2.UpdatePhraseSetRequest(); + if (object.phraseSet != null) { + if (typeof object.phraseSet !== "object") + throw TypeError(".google.cloud.speech.v2.UpdatePhraseSetRequest.phraseSet: object expected"); + message.phraseSet = $root.google.cloud.speech.v2.PhraseSet.fromObject(object.phraseSet); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.speech.v2.UpdatePhraseSetRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from an UpdatePhraseSetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.UpdatePhraseSetRequest + * @static + * @param {google.cloud.speech.v2.UpdatePhraseSetRequest} message UpdatePhraseSetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdatePhraseSetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.phraseSet = null; + object.updateMask = null; + object.validateOnly = false; + } + if (message.phraseSet != null && message.hasOwnProperty("phraseSet")) + object.phraseSet = $root.google.cloud.speech.v2.PhraseSet.toObject(message.phraseSet, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this UpdatePhraseSetRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.UpdatePhraseSetRequest + * @instance + * @returns {Object.} JSON object + */ + UpdatePhraseSetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdatePhraseSetRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v2.UpdatePhraseSetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdatePhraseSetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.UpdatePhraseSetRequest"; + }; + + return UpdatePhraseSetRequest; + })(); + + v2.DeletePhraseSetRequest = (function() { + + /** + * Properties of a DeletePhraseSetRequest. + * @memberof google.cloud.speech.v2 + * @interface IDeletePhraseSetRequest + * @property {string|null} [name] DeletePhraseSetRequest name + * @property {boolean|null} [validateOnly] DeletePhraseSetRequest validateOnly + * @property {boolean|null} [allowMissing] DeletePhraseSetRequest allowMissing + * @property {string|null} [etag] DeletePhraseSetRequest etag + */ + + /** + * Constructs a new DeletePhraseSetRequest. + * @memberof google.cloud.speech.v2 + * @classdesc Represents a DeletePhraseSetRequest. + * @implements IDeletePhraseSetRequest + * @constructor + * @param {google.cloud.speech.v2.IDeletePhraseSetRequest=} [properties] Properties to set + */ + function DeletePhraseSetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeletePhraseSetRequest name. + * @member {string} name + * @memberof google.cloud.speech.v2.DeletePhraseSetRequest + * @instance + */ + DeletePhraseSetRequest.prototype.name = ""; + + /** + * DeletePhraseSetRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.speech.v2.DeletePhraseSetRequest + * @instance + */ + DeletePhraseSetRequest.prototype.validateOnly = false; + + /** + * DeletePhraseSetRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.speech.v2.DeletePhraseSetRequest + * @instance + */ + DeletePhraseSetRequest.prototype.allowMissing = false; + + /** + * DeletePhraseSetRequest etag. + * @member {string} etag + * @memberof google.cloud.speech.v2.DeletePhraseSetRequest + * @instance + */ + DeletePhraseSetRequest.prototype.etag = ""; + + /** + * Creates a new DeletePhraseSetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.DeletePhraseSetRequest + * @static + * @param {google.cloud.speech.v2.IDeletePhraseSetRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v2.DeletePhraseSetRequest} DeletePhraseSetRequest instance + */ + DeletePhraseSetRequest.create = function create(properties) { + return new DeletePhraseSetRequest(properties); + }; + + /** + * Encodes the specified DeletePhraseSetRequest message. Does not implicitly {@link google.cloud.speech.v2.DeletePhraseSetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.DeletePhraseSetRequest + * @static + * @param {google.cloud.speech.v2.IDeletePhraseSetRequest} message DeletePhraseSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeletePhraseSetRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.validateOnly); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.allowMissing); + return writer; + }; + + /** + * Encodes the specified DeletePhraseSetRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v2.DeletePhraseSetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.DeletePhraseSetRequest + * @static + * @param {google.cloud.speech.v2.IDeletePhraseSetRequest} message DeletePhraseSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeletePhraseSetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeletePhraseSetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.DeletePhraseSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.DeletePhraseSetRequest} DeletePhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeletePhraseSetRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.DeletePhraseSetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.validateOnly = reader.bool(); + break; + } + case 4: { + message.allowMissing = reader.bool(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeletePhraseSetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.DeletePhraseSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.DeletePhraseSetRequest} DeletePhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeletePhraseSetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeletePhraseSetRequest message. + * @function verify + * @memberof google.cloud.speech.v2.DeletePhraseSetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeletePhraseSetRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeletePhraseSetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.DeletePhraseSetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.DeletePhraseSetRequest} DeletePhraseSetRequest + */ + DeletePhraseSetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.DeletePhraseSetRequest) + return object; + var message = new $root.google.cloud.speech.v2.DeletePhraseSetRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeletePhraseSetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.DeletePhraseSetRequest + * @static + * @param {google.cloud.speech.v2.DeletePhraseSetRequest} message DeletePhraseSetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeletePhraseSetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.validateOnly = false; + object.etag = ""; + object.allowMissing = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + return object; + }; + + /** + * Converts this DeletePhraseSetRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.DeletePhraseSetRequest + * @instance + * @returns {Object.} JSON object + */ + DeletePhraseSetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeletePhraseSetRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v2.DeletePhraseSetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeletePhraseSetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.DeletePhraseSetRequest"; + }; + + return DeletePhraseSetRequest; + })(); + + v2.UndeletePhraseSetRequest = (function() { + + /** + * Properties of an UndeletePhraseSetRequest. + * @memberof google.cloud.speech.v2 + * @interface IUndeletePhraseSetRequest + * @property {string|null} [name] UndeletePhraseSetRequest name + * @property {boolean|null} [validateOnly] UndeletePhraseSetRequest validateOnly + * @property {string|null} [etag] UndeletePhraseSetRequest etag + */ + + /** + * Constructs a new UndeletePhraseSetRequest. + * @memberof google.cloud.speech.v2 + * @classdesc Represents an UndeletePhraseSetRequest. + * @implements IUndeletePhraseSetRequest + * @constructor + * @param {google.cloud.speech.v2.IUndeletePhraseSetRequest=} [properties] Properties to set + */ + function UndeletePhraseSetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UndeletePhraseSetRequest name. + * @member {string} name + * @memberof google.cloud.speech.v2.UndeletePhraseSetRequest + * @instance + */ + UndeletePhraseSetRequest.prototype.name = ""; + + /** + * UndeletePhraseSetRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.speech.v2.UndeletePhraseSetRequest + * @instance + */ + UndeletePhraseSetRequest.prototype.validateOnly = false; + + /** + * UndeletePhraseSetRequest etag. + * @member {string} etag + * @memberof google.cloud.speech.v2.UndeletePhraseSetRequest + * @instance + */ + UndeletePhraseSetRequest.prototype.etag = ""; + + /** + * Creates a new UndeletePhraseSetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.UndeletePhraseSetRequest + * @static + * @param {google.cloud.speech.v2.IUndeletePhraseSetRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v2.UndeletePhraseSetRequest} UndeletePhraseSetRequest instance + */ + UndeletePhraseSetRequest.create = function create(properties) { + return new UndeletePhraseSetRequest(properties); + }; + + /** + * Encodes the specified UndeletePhraseSetRequest message. Does not implicitly {@link google.cloud.speech.v2.UndeletePhraseSetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.UndeletePhraseSetRequest + * @static + * @param {google.cloud.speech.v2.IUndeletePhraseSetRequest} message UndeletePhraseSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeletePhraseSetRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.etag); + return writer; + }; + + /** + * Encodes the specified UndeletePhraseSetRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v2.UndeletePhraseSetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.UndeletePhraseSetRequest + * @static + * @param {google.cloud.speech.v2.IUndeletePhraseSetRequest} message UndeletePhraseSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeletePhraseSetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UndeletePhraseSetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.UndeletePhraseSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.UndeletePhraseSetRequest} UndeletePhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeletePhraseSetRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.UndeletePhraseSetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.validateOnly = reader.bool(); + break; + } + case 4: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UndeletePhraseSetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.UndeletePhraseSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.UndeletePhraseSetRequest} UndeletePhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeletePhraseSetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UndeletePhraseSetRequest message. + * @function verify + * @memberof google.cloud.speech.v2.UndeletePhraseSetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UndeletePhraseSetRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates an UndeletePhraseSetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.UndeletePhraseSetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.UndeletePhraseSetRequest} UndeletePhraseSetRequest + */ + UndeletePhraseSetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.UndeletePhraseSetRequest) + return object; + var message = new $root.google.cloud.speech.v2.UndeletePhraseSetRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from an UndeletePhraseSetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.UndeletePhraseSetRequest + * @static + * @param {google.cloud.speech.v2.UndeletePhraseSetRequest} message UndeletePhraseSetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UndeletePhraseSetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.validateOnly = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this UndeletePhraseSetRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.UndeletePhraseSetRequest + * @instance + * @returns {Object.} JSON object + */ + UndeletePhraseSetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UndeletePhraseSetRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v2.UndeletePhraseSetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UndeletePhraseSetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.UndeletePhraseSetRequest"; + }; + + return UndeletePhraseSetRequest; + })(); + + v2.ModelFeature = (function() { + + /** + * Properties of a ModelFeature. + * @memberof google.cloud.speech.v2 + * @interface IModelFeature + * @property {string|null} [feature] ModelFeature feature + * @property {string|null} [releaseState] ModelFeature releaseState + */ + + /** + * Constructs a new ModelFeature. + * @memberof google.cloud.speech.v2 + * @classdesc Represents a ModelFeature. + * @implements IModelFeature + * @constructor + * @param {google.cloud.speech.v2.IModelFeature=} [properties] Properties to set + */ + function ModelFeature(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ModelFeature feature. + * @member {string} feature + * @memberof google.cloud.speech.v2.ModelFeature + * @instance + */ + ModelFeature.prototype.feature = ""; + + /** + * ModelFeature releaseState. + * @member {string} releaseState + * @memberof google.cloud.speech.v2.ModelFeature + * @instance + */ + ModelFeature.prototype.releaseState = ""; + + /** + * Creates a new ModelFeature instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.ModelFeature + * @static + * @param {google.cloud.speech.v2.IModelFeature=} [properties] Properties to set + * @returns {google.cloud.speech.v2.ModelFeature} ModelFeature instance + */ + ModelFeature.create = function create(properties) { + return new ModelFeature(properties); + }; + + /** + * Encodes the specified ModelFeature message. Does not implicitly {@link google.cloud.speech.v2.ModelFeature.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.ModelFeature + * @static + * @param {google.cloud.speech.v2.IModelFeature} message ModelFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelFeature.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.feature != null && Object.hasOwnProperty.call(message, "feature")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.feature); + if (message.releaseState != null && Object.hasOwnProperty.call(message, "releaseState")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.releaseState); + return writer; + }; + + /** + * Encodes the specified ModelFeature message, length delimited. Does not implicitly {@link google.cloud.speech.v2.ModelFeature.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.ModelFeature + * @static + * @param {google.cloud.speech.v2.IModelFeature} message ModelFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelFeature.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ModelFeature message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.ModelFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.ModelFeature} ModelFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelFeature.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.ModelFeature(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.feature = reader.string(); + break; + } + case 2: { + message.releaseState = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ModelFeature message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.ModelFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.ModelFeature} ModelFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelFeature.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ModelFeature message. + * @function verify + * @memberof google.cloud.speech.v2.ModelFeature + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ModelFeature.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.feature != null && message.hasOwnProperty("feature")) + if (!$util.isString(message.feature)) + return "feature: string expected"; + if (message.releaseState != null && message.hasOwnProperty("releaseState")) + if (!$util.isString(message.releaseState)) + return "releaseState: string expected"; + return null; + }; + + /** + * Creates a ModelFeature message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.ModelFeature + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.ModelFeature} ModelFeature + */ + ModelFeature.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.ModelFeature) + return object; + var message = new $root.google.cloud.speech.v2.ModelFeature(); + if (object.feature != null) + message.feature = String(object.feature); + if (object.releaseState != null) + message.releaseState = String(object.releaseState); + return message; + }; + + /** + * Creates a plain object from a ModelFeature message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.ModelFeature + * @static + * @param {google.cloud.speech.v2.ModelFeature} message ModelFeature + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ModelFeature.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.feature = ""; + object.releaseState = ""; + } + if (message.feature != null && message.hasOwnProperty("feature")) + object.feature = message.feature; + if (message.releaseState != null && message.hasOwnProperty("releaseState")) + object.releaseState = message.releaseState; + return object; + }; + + /** + * Converts this ModelFeature to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.ModelFeature + * @instance + * @returns {Object.} JSON object + */ + ModelFeature.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ModelFeature + * @function getTypeUrl + * @memberof google.cloud.speech.v2.ModelFeature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ModelFeature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.ModelFeature"; + }; + + return ModelFeature; + })(); + + v2.ModelFeatures = (function() { + + /** + * Properties of a ModelFeatures. + * @memberof google.cloud.speech.v2 + * @interface IModelFeatures + * @property {Array.|null} [modelFeature] ModelFeatures modelFeature + */ + + /** + * Constructs a new ModelFeatures. + * @memberof google.cloud.speech.v2 + * @classdesc Represents a ModelFeatures. + * @implements IModelFeatures + * @constructor + * @param {google.cloud.speech.v2.IModelFeatures=} [properties] Properties to set + */ + function ModelFeatures(properties) { + this.modelFeature = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ModelFeatures modelFeature. + * @member {Array.} modelFeature + * @memberof google.cloud.speech.v2.ModelFeatures + * @instance + */ + ModelFeatures.prototype.modelFeature = $util.emptyArray; + + /** + * Creates a new ModelFeatures instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.ModelFeatures + * @static + * @param {google.cloud.speech.v2.IModelFeatures=} [properties] Properties to set + * @returns {google.cloud.speech.v2.ModelFeatures} ModelFeatures instance + */ + ModelFeatures.create = function create(properties) { + return new ModelFeatures(properties); + }; + + /** + * Encodes the specified ModelFeatures message. Does not implicitly {@link google.cloud.speech.v2.ModelFeatures.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.ModelFeatures + * @static + * @param {google.cloud.speech.v2.IModelFeatures} message ModelFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelFeatures.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.modelFeature != null && message.modelFeature.length) + for (var i = 0; i < message.modelFeature.length; ++i) + $root.google.cloud.speech.v2.ModelFeature.encode(message.modelFeature[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ModelFeatures message, length delimited. Does not implicitly {@link google.cloud.speech.v2.ModelFeatures.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.ModelFeatures + * @static + * @param {google.cloud.speech.v2.IModelFeatures} message ModelFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelFeatures.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ModelFeatures message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.ModelFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.ModelFeatures} ModelFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelFeatures.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.ModelFeatures(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.modelFeature && message.modelFeature.length)) + message.modelFeature = []; + message.modelFeature.push($root.google.cloud.speech.v2.ModelFeature.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ModelFeatures message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.ModelFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.ModelFeatures} ModelFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelFeatures.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ModelFeatures message. + * @function verify + * @memberof google.cloud.speech.v2.ModelFeatures + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ModelFeatures.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.modelFeature != null && message.hasOwnProperty("modelFeature")) { + if (!Array.isArray(message.modelFeature)) + return "modelFeature: array expected"; + for (var i = 0; i < message.modelFeature.length; ++i) { + var error = $root.google.cloud.speech.v2.ModelFeature.verify(message.modelFeature[i]); + if (error) + return "modelFeature." + error; + } + } + return null; + }; + + /** + * Creates a ModelFeatures message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.ModelFeatures + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.ModelFeatures} ModelFeatures + */ + ModelFeatures.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.ModelFeatures) + return object; + var message = new $root.google.cloud.speech.v2.ModelFeatures(); + if (object.modelFeature) { + if (!Array.isArray(object.modelFeature)) + throw TypeError(".google.cloud.speech.v2.ModelFeatures.modelFeature: array expected"); + message.modelFeature = []; + for (var i = 0; i < object.modelFeature.length; ++i) { + if (typeof object.modelFeature[i] !== "object") + throw TypeError(".google.cloud.speech.v2.ModelFeatures.modelFeature: object expected"); + message.modelFeature[i] = $root.google.cloud.speech.v2.ModelFeature.fromObject(object.modelFeature[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ModelFeatures message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.ModelFeatures + * @static + * @param {google.cloud.speech.v2.ModelFeatures} message ModelFeatures + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ModelFeatures.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.modelFeature = []; + if (message.modelFeature && message.modelFeature.length) { + object.modelFeature = []; + for (var j = 0; j < message.modelFeature.length; ++j) + object.modelFeature[j] = $root.google.cloud.speech.v2.ModelFeature.toObject(message.modelFeature[j], options); + } + return object; + }; + + /** + * Converts this ModelFeatures to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.ModelFeatures + * @instance + * @returns {Object.} JSON object + */ + ModelFeatures.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ModelFeatures + * @function getTypeUrl + * @memberof google.cloud.speech.v2.ModelFeatures + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ModelFeatures.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.ModelFeatures"; + }; + + return ModelFeatures; + })(); + + v2.ModelMetadata = (function() { + + /** + * Properties of a ModelMetadata. + * @memberof google.cloud.speech.v2 + * @interface IModelMetadata + * @property {Object.|null} [modelFeatures] ModelMetadata modelFeatures + */ + + /** + * Constructs a new ModelMetadata. + * @memberof google.cloud.speech.v2 + * @classdesc Represents a ModelMetadata. + * @implements IModelMetadata + * @constructor + * @param {google.cloud.speech.v2.IModelMetadata=} [properties] Properties to set + */ + function ModelMetadata(properties) { + this.modelFeatures = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ModelMetadata modelFeatures. + * @member {Object.} modelFeatures + * @memberof google.cloud.speech.v2.ModelMetadata + * @instance + */ + ModelMetadata.prototype.modelFeatures = $util.emptyObject; + + /** + * Creates a new ModelMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.ModelMetadata + * @static + * @param {google.cloud.speech.v2.IModelMetadata=} [properties] Properties to set + * @returns {google.cloud.speech.v2.ModelMetadata} ModelMetadata instance + */ + ModelMetadata.create = function create(properties) { + return new ModelMetadata(properties); + }; + + /** + * Encodes the specified ModelMetadata message. Does not implicitly {@link google.cloud.speech.v2.ModelMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.ModelMetadata + * @static + * @param {google.cloud.speech.v2.IModelMetadata} message ModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.modelFeatures != null && Object.hasOwnProperty.call(message, "modelFeatures")) + for (var keys = Object.keys(message.modelFeatures), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.speech.v2.ModelFeatures.encode(message.modelFeatures[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ModelMetadata message, length delimited. Does not implicitly {@link google.cloud.speech.v2.ModelMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.ModelMetadata + * @static + * @param {google.cloud.speech.v2.IModelMetadata} message ModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ModelMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.ModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.ModelMetadata} ModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.ModelMetadata(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (message.modelFeatures === $util.emptyObject) + message.modelFeatures = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.speech.v2.ModelFeatures.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.modelFeatures[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ModelMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.ModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.ModelMetadata} ModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ModelMetadata message. + * @function verify + * @memberof google.cloud.speech.v2.ModelMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ModelMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.modelFeatures != null && message.hasOwnProperty("modelFeatures")) { + if (!$util.isObject(message.modelFeatures)) + return "modelFeatures: object expected"; + var key = Object.keys(message.modelFeatures); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.speech.v2.ModelFeatures.verify(message.modelFeatures[key[i]]); + if (error) + return "modelFeatures." + error; + } + } + return null; + }; + + /** + * Creates a ModelMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.ModelMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.ModelMetadata} ModelMetadata + */ + ModelMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.ModelMetadata) + return object; + var message = new $root.google.cloud.speech.v2.ModelMetadata(); + if (object.modelFeatures) { + if (typeof object.modelFeatures !== "object") + throw TypeError(".google.cloud.speech.v2.ModelMetadata.modelFeatures: object expected"); + message.modelFeatures = {}; + for (var keys = Object.keys(object.modelFeatures), i = 0; i < keys.length; ++i) { + if (typeof object.modelFeatures[keys[i]] !== "object") + throw TypeError(".google.cloud.speech.v2.ModelMetadata.modelFeatures: object expected"); + message.modelFeatures[keys[i]] = $root.google.cloud.speech.v2.ModelFeatures.fromObject(object.modelFeatures[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a ModelMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.ModelMetadata + * @static + * @param {google.cloud.speech.v2.ModelMetadata} message ModelMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ModelMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.modelFeatures = {}; + var keys2; + if (message.modelFeatures && (keys2 = Object.keys(message.modelFeatures)).length) { + object.modelFeatures = {}; + for (var j = 0; j < keys2.length; ++j) + object.modelFeatures[keys2[j]] = $root.google.cloud.speech.v2.ModelFeatures.toObject(message.modelFeatures[keys2[j]], options); + } + return object; + }; + + /** + * Converts this ModelMetadata to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.ModelMetadata + * @instance + * @returns {Object.} JSON object + */ + ModelMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ModelMetadata + * @function getTypeUrl + * @memberof google.cloud.speech.v2.ModelMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ModelMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.ModelMetadata"; + }; + + return ModelMetadata; + })(); + + v2.LanguageMetadata = (function() { + + /** + * Properties of a LanguageMetadata. + * @memberof google.cloud.speech.v2 + * @interface ILanguageMetadata + * @property {Object.|null} [models] LanguageMetadata models + */ + + /** + * Constructs a new LanguageMetadata. + * @memberof google.cloud.speech.v2 + * @classdesc Represents a LanguageMetadata. + * @implements ILanguageMetadata + * @constructor + * @param {google.cloud.speech.v2.ILanguageMetadata=} [properties] Properties to set + */ + function LanguageMetadata(properties) { + this.models = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LanguageMetadata models. + * @member {Object.} models + * @memberof google.cloud.speech.v2.LanguageMetadata + * @instance + */ + LanguageMetadata.prototype.models = $util.emptyObject; + + /** + * Creates a new LanguageMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.LanguageMetadata + * @static + * @param {google.cloud.speech.v2.ILanguageMetadata=} [properties] Properties to set + * @returns {google.cloud.speech.v2.LanguageMetadata} LanguageMetadata instance + */ + LanguageMetadata.create = function create(properties) { + return new LanguageMetadata(properties); + }; + + /** + * Encodes the specified LanguageMetadata message. Does not implicitly {@link google.cloud.speech.v2.LanguageMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.LanguageMetadata + * @static + * @param {google.cloud.speech.v2.ILanguageMetadata} message LanguageMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LanguageMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.models != null && Object.hasOwnProperty.call(message, "models")) + for (var keys = Object.keys(message.models), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.speech.v2.ModelMetadata.encode(message.models[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified LanguageMetadata message, length delimited. Does not implicitly {@link google.cloud.speech.v2.LanguageMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.LanguageMetadata + * @static + * @param {google.cloud.speech.v2.ILanguageMetadata} message LanguageMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LanguageMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LanguageMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.LanguageMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.LanguageMetadata} LanguageMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LanguageMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.LanguageMetadata(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (message.models === $util.emptyObject) + message.models = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.speech.v2.ModelMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.models[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LanguageMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.LanguageMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.LanguageMetadata} LanguageMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LanguageMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LanguageMetadata message. + * @function verify + * @memberof google.cloud.speech.v2.LanguageMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LanguageMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.models != null && message.hasOwnProperty("models")) { + if (!$util.isObject(message.models)) + return "models: object expected"; + var key = Object.keys(message.models); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.speech.v2.ModelMetadata.verify(message.models[key[i]]); + if (error) + return "models." + error; + } + } + return null; + }; + + /** + * Creates a LanguageMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.LanguageMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.LanguageMetadata} LanguageMetadata + */ + LanguageMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.LanguageMetadata) + return object; + var message = new $root.google.cloud.speech.v2.LanguageMetadata(); + if (object.models) { + if (typeof object.models !== "object") + throw TypeError(".google.cloud.speech.v2.LanguageMetadata.models: object expected"); + message.models = {}; + for (var keys = Object.keys(object.models), i = 0; i < keys.length; ++i) { + if (typeof object.models[keys[i]] !== "object") + throw TypeError(".google.cloud.speech.v2.LanguageMetadata.models: object expected"); + message.models[keys[i]] = $root.google.cloud.speech.v2.ModelMetadata.fromObject(object.models[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a LanguageMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.LanguageMetadata + * @static + * @param {google.cloud.speech.v2.LanguageMetadata} message LanguageMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LanguageMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.models = {}; + var keys2; + if (message.models && (keys2 = Object.keys(message.models)).length) { + object.models = {}; + for (var j = 0; j < keys2.length; ++j) + object.models[keys2[j]] = $root.google.cloud.speech.v2.ModelMetadata.toObject(message.models[keys2[j]], options); + } + return object; + }; + + /** + * Converts this LanguageMetadata to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.LanguageMetadata + * @instance + * @returns {Object.} JSON object + */ + LanguageMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LanguageMetadata + * @function getTypeUrl + * @memberof google.cloud.speech.v2.LanguageMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LanguageMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.LanguageMetadata"; + }; + + return LanguageMetadata; + })(); + + v2.AccessMetadata = (function() { + + /** + * Properties of an AccessMetadata. + * @memberof google.cloud.speech.v2 + * @interface IAccessMetadata + * @property {google.cloud.speech.v2.AccessMetadata.ConstraintType|null} [constraintType] AccessMetadata constraintType + */ + + /** + * Constructs a new AccessMetadata. + * @memberof google.cloud.speech.v2 + * @classdesc Represents an AccessMetadata. + * @implements IAccessMetadata + * @constructor + * @param {google.cloud.speech.v2.IAccessMetadata=} [properties] Properties to set + */ + function AccessMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AccessMetadata constraintType. + * @member {google.cloud.speech.v2.AccessMetadata.ConstraintType} constraintType + * @memberof google.cloud.speech.v2.AccessMetadata + * @instance + */ + AccessMetadata.prototype.constraintType = 0; + + /** + * Creates a new AccessMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.AccessMetadata + * @static + * @param {google.cloud.speech.v2.IAccessMetadata=} [properties] Properties to set + * @returns {google.cloud.speech.v2.AccessMetadata} AccessMetadata instance + */ + AccessMetadata.create = function create(properties) { + return new AccessMetadata(properties); + }; + + /** + * Encodes the specified AccessMetadata message. Does not implicitly {@link google.cloud.speech.v2.AccessMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.AccessMetadata + * @static + * @param {google.cloud.speech.v2.IAccessMetadata} message AccessMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.constraintType != null && Object.hasOwnProperty.call(message, "constraintType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.constraintType); + return writer; + }; + + /** + * Encodes the specified AccessMetadata message, length delimited. Does not implicitly {@link google.cloud.speech.v2.AccessMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.AccessMetadata + * @static + * @param {google.cloud.speech.v2.IAccessMetadata} message AccessMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AccessMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.AccessMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.AccessMetadata} AccessMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.AccessMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.constraintType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AccessMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.AccessMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.AccessMetadata} AccessMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AccessMetadata message. + * @function verify + * @memberof google.cloud.speech.v2.AccessMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AccessMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.constraintType != null && message.hasOwnProperty("constraintType")) + switch (message.constraintType) { + default: + return "constraintType: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates an AccessMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.AccessMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.AccessMetadata} AccessMetadata + */ + AccessMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.AccessMetadata) + return object; + var message = new $root.google.cloud.speech.v2.AccessMetadata(); + switch (object.constraintType) { + default: + if (typeof object.constraintType === "number") { + message.constraintType = object.constraintType; + break; + } + break; + case "CONSTRAINT_TYPE_UNSPECIFIED": + case 0: + message.constraintType = 0; + break; + case "RESOURCE_LOCATIONS_ORG_POLICY_CREATE_CONSTRAINT": + case 1: + message.constraintType = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from an AccessMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.AccessMetadata + * @static + * @param {google.cloud.speech.v2.AccessMetadata} message AccessMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AccessMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.constraintType = options.enums === String ? "CONSTRAINT_TYPE_UNSPECIFIED" : 0; + if (message.constraintType != null && message.hasOwnProperty("constraintType")) + object.constraintType = options.enums === String ? $root.google.cloud.speech.v2.AccessMetadata.ConstraintType[message.constraintType] === undefined ? message.constraintType : $root.google.cloud.speech.v2.AccessMetadata.ConstraintType[message.constraintType] : message.constraintType; + return object; + }; + + /** + * Converts this AccessMetadata to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.AccessMetadata + * @instance + * @returns {Object.} JSON object + */ + AccessMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AccessMetadata + * @function getTypeUrl + * @memberof google.cloud.speech.v2.AccessMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccessMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.AccessMetadata"; + }; + + /** + * ConstraintType enum. + * @name google.cloud.speech.v2.AccessMetadata.ConstraintType + * @enum {number} + * @property {number} CONSTRAINT_TYPE_UNSPECIFIED=0 CONSTRAINT_TYPE_UNSPECIFIED value + * @property {number} RESOURCE_LOCATIONS_ORG_POLICY_CREATE_CONSTRAINT=1 RESOURCE_LOCATIONS_ORG_POLICY_CREATE_CONSTRAINT value + */ + AccessMetadata.ConstraintType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONSTRAINT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RESOURCE_LOCATIONS_ORG_POLICY_CREATE_CONSTRAINT"] = 1; + return values; + })(); + + return AccessMetadata; + })(); + + v2.LocationsMetadata = (function() { + + /** + * Properties of a LocationsMetadata. + * @memberof google.cloud.speech.v2 + * @interface ILocationsMetadata + * @property {google.cloud.speech.v2.ILanguageMetadata|null} [languages] LocationsMetadata languages + * @property {google.cloud.speech.v2.IAccessMetadata|null} [accessMetadata] LocationsMetadata accessMetadata + */ + + /** + * Constructs a new LocationsMetadata. + * @memberof google.cloud.speech.v2 + * @classdesc Represents a LocationsMetadata. + * @implements ILocationsMetadata + * @constructor + * @param {google.cloud.speech.v2.ILocationsMetadata=} [properties] Properties to set + */ + function LocationsMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LocationsMetadata languages. + * @member {google.cloud.speech.v2.ILanguageMetadata|null|undefined} languages + * @memberof google.cloud.speech.v2.LocationsMetadata + * @instance + */ + LocationsMetadata.prototype.languages = null; + + /** + * LocationsMetadata accessMetadata. + * @member {google.cloud.speech.v2.IAccessMetadata|null|undefined} accessMetadata + * @memberof google.cloud.speech.v2.LocationsMetadata + * @instance + */ + LocationsMetadata.prototype.accessMetadata = null; + + /** + * Creates a new LocationsMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v2.LocationsMetadata + * @static + * @param {google.cloud.speech.v2.ILocationsMetadata=} [properties] Properties to set + * @returns {google.cloud.speech.v2.LocationsMetadata} LocationsMetadata instance + */ + LocationsMetadata.create = function create(properties) { + return new LocationsMetadata(properties); + }; + + /** + * Encodes the specified LocationsMetadata message. Does not implicitly {@link google.cloud.speech.v2.LocationsMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v2.LocationsMetadata + * @static + * @param {google.cloud.speech.v2.ILocationsMetadata} message LocationsMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationsMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.languages != null && Object.hasOwnProperty.call(message, "languages")) + $root.google.cloud.speech.v2.LanguageMetadata.encode(message.languages, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.accessMetadata != null && Object.hasOwnProperty.call(message, "accessMetadata")) + $root.google.cloud.speech.v2.AccessMetadata.encode(message.accessMetadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LocationsMetadata message, length delimited. Does not implicitly {@link google.cloud.speech.v2.LocationsMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v2.LocationsMetadata + * @static + * @param {google.cloud.speech.v2.ILocationsMetadata} message LocationsMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationsMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LocationsMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v2.LocationsMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v2.LocationsMetadata} LocationsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationsMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v2.LocationsMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.languages = $root.google.cloud.speech.v2.LanguageMetadata.decode(reader, reader.uint32()); + break; + } + case 2: { + message.accessMetadata = $root.google.cloud.speech.v2.AccessMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LocationsMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v2.LocationsMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v2.LocationsMetadata} LocationsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationsMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LocationsMetadata message. + * @function verify + * @memberof google.cloud.speech.v2.LocationsMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LocationsMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.languages != null && message.hasOwnProperty("languages")) { + var error = $root.google.cloud.speech.v2.LanguageMetadata.verify(message.languages); + if (error) + return "languages." + error; + } + if (message.accessMetadata != null && message.hasOwnProperty("accessMetadata")) { + var error = $root.google.cloud.speech.v2.AccessMetadata.verify(message.accessMetadata); + if (error) + return "accessMetadata." + error; + } + return null; + }; + + /** + * Creates a LocationsMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v2.LocationsMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v2.LocationsMetadata} LocationsMetadata + */ + LocationsMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v2.LocationsMetadata) + return object; + var message = new $root.google.cloud.speech.v2.LocationsMetadata(); + if (object.languages != null) { + if (typeof object.languages !== "object") + throw TypeError(".google.cloud.speech.v2.LocationsMetadata.languages: object expected"); + message.languages = $root.google.cloud.speech.v2.LanguageMetadata.fromObject(object.languages); + } + if (object.accessMetadata != null) { + if (typeof object.accessMetadata !== "object") + throw TypeError(".google.cloud.speech.v2.LocationsMetadata.accessMetadata: object expected"); + message.accessMetadata = $root.google.cloud.speech.v2.AccessMetadata.fromObject(object.accessMetadata); + } + return message; + }; + + /** + * Creates a plain object from a LocationsMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v2.LocationsMetadata + * @static + * @param {google.cloud.speech.v2.LocationsMetadata} message LocationsMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LocationsMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.languages = null; + object.accessMetadata = null; + } + if (message.languages != null && message.hasOwnProperty("languages")) + object.languages = $root.google.cloud.speech.v2.LanguageMetadata.toObject(message.languages, options); + if (message.accessMetadata != null && message.hasOwnProperty("accessMetadata")) + object.accessMetadata = $root.google.cloud.speech.v2.AccessMetadata.toObject(message.accessMetadata, options); + return object; + }; + + /** + * Converts this LocationsMetadata to JSON. + * @function toJSON + * @memberof google.cloud.speech.v2.LocationsMetadata + * @instance + * @returns {Object.} JSON object + */ + LocationsMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LocationsMetadata + * @function getTypeUrl + * @memberof google.cloud.speech.v2.LocationsMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LocationsMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v2.LocationsMetadata"; + }; + + return LocationsMetadata; + })(); + + return v2; + })(); + + return speech; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.fullyDecodeReservedExpansion = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Http + * @function getTypeUrl + * @memberof google.api.Http + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Http"; + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; + + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.get = reader.string(); + break; + } + case 3: { + message.put = reader.string(); + break; + } + case 4: { + message.post = reader.string(); + break; + } + case 5: { + message["delete"] = reader.string(); + break; + } + case 6: { + message.patch = reader.string(); + break; + } + case 8: { + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + } + case 7: { + message.body = reader.string(); + break; + } + case 12: { + message.responseBody = reader.string(); + break; + } + case 11: { + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) + return object; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + return object; + }; + + /** + * Converts this HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpRule + * @function getTypeUrl + * @memberof google.api.HttpRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpRule"; + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomHttpPattern + * @function getTypeUrl + * @memberof google.api.CustomHttpPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CustomHttpPattern"; + }; + + return CustomHttpPattern; + })(); + + api.CommonLanguageSettings = (function() { + + /** + * Properties of a CommonLanguageSettings. + * @memberof google.api + * @interface ICommonLanguageSettings + * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri + * @property {Array.|null} [destinations] CommonLanguageSettings destinations + */ + + /** + * Constructs a new CommonLanguageSettings. + * @memberof google.api + * @classdesc Represents a CommonLanguageSettings. + * @implements ICommonLanguageSettings + * @constructor + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + */ + function CommonLanguageSettings(properties) { + this.destinations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommonLanguageSettings referenceDocsUri. + * @member {string} referenceDocsUri + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.referenceDocsUri = ""; + + /** + * CommonLanguageSettings destinations. + * @member {Array.} destinations + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.destinations = $util.emptyArray; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @function create + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings instance + */ + CommonLanguageSettings.create = function create(properties) { + return new CommonLanguageSettings(properties); + }; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.referenceDocsUri); + if (message.destinations != null && message.destinations.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.destinations.length; ++i) + writer.int32(message.destinations[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CommonLanguageSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.referenceDocsUri = reader.string(); + break; + } + case 2: { + if (!(message.destinations && message.destinations.length)) + message.destinations = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.destinations.push(reader.int32()); + } else + message.destinations.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommonLanguageSettings message. + * @function verify + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommonLanguageSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + if (!$util.isString(message.referenceDocsUri)) + return "referenceDocsUri: string expected"; + if (message.destinations != null && message.hasOwnProperty("destinations")) { + if (!Array.isArray(message.destinations)) + return "destinations: array expected"; + for (var i = 0; i < message.destinations.length; ++i) + switch (message.destinations[i]) { + default: + return "destinations: enum value[] expected"; + case 0: + case 10: + case 20: + break; + } + } + return null; + }; + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + */ + CommonLanguageSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CommonLanguageSettings) + return object; + var message = new $root.google.api.CommonLanguageSettings(); + if (object.referenceDocsUri != null) + message.referenceDocsUri = String(object.referenceDocsUri); + if (object.destinations) { + if (!Array.isArray(object.destinations)) + throw TypeError(".google.api.CommonLanguageSettings.destinations: array expected"); + message.destinations = []; + for (var i = 0; i < object.destinations.length; ++i) + switch (object.destinations[i]) { + default: + if (typeof object.destinations[i] === "number") { + message.destinations[i] = object.destinations[i]; + break; + } + case "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": + case 0: + message.destinations[i] = 0; + break; + case "GITHUB": + case 10: + message.destinations[i] = 10; + break; + case "PACKAGE_MANAGER": + case 20: + message.destinations[i] = 20; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommonLanguageSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.destinations = []; + if (options.defaults) + object.referenceDocsUri = ""; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + object.referenceDocsUri = message.referenceDocsUri; + if (message.destinations && message.destinations.length) { + object.destinations = []; + for (var j = 0; j < message.destinations.length; ++j) + object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; + } + return object; + }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @function toJSON + * @memberof google.api.CommonLanguageSettings + * @instance + * @returns {Object.} JSON object + */ + CommonLanguageSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommonLanguageSettings + * @function getTypeUrl + * @memberof google.api.CommonLanguageSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CommonLanguageSettings"; + }; + + return CommonLanguageSettings; + })(); + + api.ClientLibrarySettings = (function() { + + /** + * Properties of a ClientLibrarySettings. + * @memberof google.api + * @interface IClientLibrarySettings + * @property {string|null} [version] ClientLibrarySettings version + * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage + * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums + * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings + * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings + * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings + * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings + * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings + * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings + * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings + * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings + */ + + /** + * Constructs a new ClientLibrarySettings. + * @memberof google.api + * @classdesc Represents a ClientLibrarySettings. + * @implements IClientLibrarySettings + * @constructor + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + */ + function ClientLibrarySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClientLibrarySettings version. + * @member {string} version + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.version = ""; + + /** + * ClientLibrarySettings launchStage. + * @member {google.api.LaunchStage} launchStage + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.launchStage = 0; + + /** + * ClientLibrarySettings restNumericEnums. + * @member {boolean} restNumericEnums + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.restNumericEnums = false; + + /** + * ClientLibrarySettings javaSettings. + * @member {google.api.IJavaSettings|null|undefined} javaSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.javaSettings = null; + + /** + * ClientLibrarySettings cppSettings. + * @member {google.api.ICppSettings|null|undefined} cppSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.cppSettings = null; + + /** + * ClientLibrarySettings phpSettings. + * @member {google.api.IPhpSettings|null|undefined} phpSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.phpSettings = null; + + /** + * ClientLibrarySettings pythonSettings. + * @member {google.api.IPythonSettings|null|undefined} pythonSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.pythonSettings = null; + + /** + * ClientLibrarySettings nodeSettings. + * @member {google.api.INodeSettings|null|undefined} nodeSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.nodeSettings = null; + + /** + * ClientLibrarySettings dotnetSettings. + * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.dotnetSettings = null; + + /** + * ClientLibrarySettings rubySettings. + * @member {google.api.IRubySettings|null|undefined} rubySettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.rubySettings = null; + + /** + * ClientLibrarySettings goSettings. + * @member {google.api.IGoSettings|null|undefined} goSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.goSettings = null; + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @function create + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance + */ + ClientLibrarySettings.create = function create(properties) { + return new ClientLibrarySettings(properties); + }; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage); + if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums); + if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) + $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) + $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) + $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) + $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) + $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) + $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) + $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) + $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ClientLibrarySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.version = reader.string(); + break; + } + case 2: { + message.launchStage = reader.int32(); + break; + } + case 3: { + message.restNumericEnums = reader.bool(); + break; + } + case 21: { + message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32()); + break; + } + case 22: { + message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32()); + break; + } + case 23: { + message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32()); + break; + } + case 24: { + message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32()); + break; + } + case 25: { + message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32()); + break; + } + case 26: { + message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32()); + break; + } + case 27: { + message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32()); + break; + } + case 28: { + message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientLibrarySettings message. + * @function verify + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientLibrarySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + switch (message.launchStage) { + default: + return "launchStage: enum value expected"; + case 0: + case 6: + case 7: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + if (typeof message.restNumericEnums !== "boolean") + return "restNumericEnums: boolean expected"; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) { + var error = $root.google.api.JavaSettings.verify(message.javaSettings); + if (error) + return "javaSettings." + error; + } + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) { + var error = $root.google.api.CppSettings.verify(message.cppSettings); + if (error) + return "cppSettings." + error; + } + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) { + var error = $root.google.api.PhpSettings.verify(message.phpSettings); + if (error) + return "phpSettings." + error; + } + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) { + var error = $root.google.api.PythonSettings.verify(message.pythonSettings); + if (error) + return "pythonSettings." + error; + } + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) { + var error = $root.google.api.NodeSettings.verify(message.nodeSettings); + if (error) + return "nodeSettings." + error; + } + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) { + var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings); + if (error) + return "dotnetSettings." + error; + } + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) { + var error = $root.google.api.RubySettings.verify(message.rubySettings); + if (error) + return "rubySettings." + error; + } + if (message.goSettings != null && message.hasOwnProperty("goSettings")) { + var error = $root.google.api.GoSettings.verify(message.goSettings); + if (error) + return "goSettings." + error; + } + return null; + }; + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + */ + ClientLibrarySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ClientLibrarySettings) + return object; + var message = new $root.google.api.ClientLibrarySettings(); + if (object.version != null) + message.version = String(object.version); + switch (object.launchStage) { + default: + if (typeof object.launchStage === "number") { + message.launchStage = object.launchStage; + break; + } + break; + case "LAUNCH_STAGE_UNSPECIFIED": + case 0: + message.launchStage = 0; + break; + case "UNIMPLEMENTED": + case 6: + message.launchStage = 6; + break; + case "PRELAUNCH": + case 7: + message.launchStage = 7; + break; + case "EARLY_ACCESS": + case 1: + message.launchStage = 1; + break; + case "ALPHA": + case 2: + message.launchStage = 2; + break; + case "BETA": + case 3: + message.launchStage = 3; + break; + case "GA": + case 4: + message.launchStage = 4; + break; + case "DEPRECATED": + case 5: + message.launchStage = 5; + break; + } + if (object.restNumericEnums != null) + message.restNumericEnums = Boolean(object.restNumericEnums); + if (object.javaSettings != null) { + if (typeof object.javaSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); + message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings); + } + if (object.cppSettings != null) { + if (typeof object.cppSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); + message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings); + } + if (object.phpSettings != null) { + if (typeof object.phpSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); + message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings); + } + if (object.pythonSettings != null) { + if (typeof object.pythonSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); + message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings); + } + if (object.nodeSettings != null) { + if (typeof object.nodeSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); + message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings); + } + if (object.dotnetSettings != null) { + if (typeof object.dotnetSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); + message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings); + } + if (object.rubySettings != null) { + if (typeof object.rubySettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); + message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings); + } + if (object.goSettings != null) { + if (typeof object.goSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); + message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings); + } + return message; + }; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientLibrarySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + object.restNumericEnums = false; + object.javaSettings = null; + object.cppSettings = null; + object.phpSettings = null; + object.pythonSettings = null; + object.nodeSettings = null; + object.dotnetSettings = null; + object.rubySettings = null; + object.goSettings = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + object.restNumericEnums = message.restNumericEnums; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) + object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options); + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) + object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options); + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) + object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options); + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) + object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options); + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) + object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options); + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) + object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options); + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) + object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options); + if (message.goSettings != null && message.hasOwnProperty("goSettings")) + object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options); + return object; + }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @function toJSON + * @memberof google.api.ClientLibrarySettings + * @instance + * @returns {Object.} JSON object + */ + ClientLibrarySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientLibrarySettings + * @function getTypeUrl + * @memberof google.api.ClientLibrarySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ClientLibrarySettings"; + }; + + return ClientLibrarySettings; + })(); + + api.Publishing = (function() { + + /** + * Properties of a Publishing. + * @memberof google.api + * @interface IPublishing + * @property {Array.|null} [methodSettings] Publishing methodSettings + * @property {string|null} [newIssueUri] Publishing newIssueUri + * @property {string|null} [documentationUri] Publishing documentationUri + * @property {string|null} [apiShortName] Publishing apiShortName + * @property {string|null} [githubLabel] Publishing githubLabel + * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams + * @property {string|null} [docTagPrefix] Publishing docTagPrefix + * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization + * @property {Array.|null} [librarySettings] Publishing librarySettings + * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri + * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri + */ + + /** + * Constructs a new Publishing. + * @memberof google.api + * @classdesc Represents a Publishing. + * @implements IPublishing + * @constructor + * @param {google.api.IPublishing=} [properties] Properties to set + */ + function Publishing(properties) { + this.methodSettings = []; + this.codeownerGithubTeams = []; + this.librarySettings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Publishing methodSettings. + * @member {Array.} methodSettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.methodSettings = $util.emptyArray; + + /** + * Publishing newIssueUri. + * @member {string} newIssueUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.newIssueUri = ""; + + /** + * Publishing documentationUri. + * @member {string} documentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.documentationUri = ""; + + /** + * Publishing apiShortName. + * @member {string} apiShortName + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.apiShortName = ""; + + /** + * Publishing githubLabel. + * @member {string} githubLabel + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.githubLabel = ""; + + /** + * Publishing codeownerGithubTeams. + * @member {Array.} codeownerGithubTeams + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.codeownerGithubTeams = $util.emptyArray; + + /** + * Publishing docTagPrefix. + * @member {string} docTagPrefix + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.docTagPrefix = ""; + + /** + * Publishing organization. + * @member {google.api.ClientLibraryOrganization} organization + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.organization = 0; + + /** + * Publishing librarySettings. + * @member {Array.} librarySettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.librarySettings = $util.emptyArray; + + /** + * Publishing protoReferenceDocumentationUri. + * @member {string} protoReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.protoReferenceDocumentationUri = ""; + + /** + * Publishing restReferenceDocumentationUri. + * @member {string} restReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.restReferenceDocumentationUri = ""; + + /** + * Creates a new Publishing instance using the specified properties. + * @function create + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing=} [properties] Properties to set + * @returns {google.api.Publishing} Publishing instance + */ + Publishing.create = function create(properties) { + return new Publishing(properties); + }; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encode + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.methodSettings != null && message.methodSettings.length) + for (var i = 0; i < message.methodSettings.length; ++i) + $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) + writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri); + if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) + writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri); + if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) + writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName); + if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) + writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel); + if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length) + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]); + if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) + writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization); + if (message.librarySettings != null && message.librarySettings.length) + for (var i = 0; i < message.librarySettings.length; ++i) + $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); + if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) + writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); + if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) + writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); + return writer; + }; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @function decode + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Publishing(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.methodSettings && message.methodSettings.length)) + message.methodSettings = []; + message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32())); + break; + } + case 101: { + message.newIssueUri = reader.string(); + break; + } + case 102: { + message.documentationUri = reader.string(); + break; + } + case 103: { + message.apiShortName = reader.string(); + break; + } + case 104: { + message.githubLabel = reader.string(); + break; + } + case 105: { + if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) + message.codeownerGithubTeams = []; + message.codeownerGithubTeams.push(reader.string()); + break; + } + case 106: { + message.docTagPrefix = reader.string(); + break; + } + case 107: { + message.organization = reader.int32(); + break; + } + case 109: { + if (!(message.librarySettings && message.librarySettings.length)) + message.librarySettings = []; + message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32())); + break; + } + case 110: { + message.protoReferenceDocumentationUri = reader.string(); + break; + } + case 111: { + message.restReferenceDocumentationUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Publishing message. + * @function verify + * @memberof google.api.Publishing + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Publishing.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.methodSettings != null && message.hasOwnProperty("methodSettings")) { + if (!Array.isArray(message.methodSettings)) + return "methodSettings: array expected"; + for (var i = 0; i < message.methodSettings.length; ++i) { + var error = $root.google.api.MethodSettings.verify(message.methodSettings[i]); + if (error) + return "methodSettings." + error; + } + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + if (!$util.isString(message.newIssueUri)) + return "newIssueUri: string expected"; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + if (!$util.isString(message.documentationUri)) + return "documentationUri: string expected"; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + if (!$util.isString(message.apiShortName)) + return "apiShortName: string expected"; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + if (!$util.isString(message.githubLabel)) + return "githubLabel: string expected"; + if (message.codeownerGithubTeams != null && message.hasOwnProperty("codeownerGithubTeams")) { + if (!Array.isArray(message.codeownerGithubTeams)) + return "codeownerGithubTeams: array expected"; + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + if (!$util.isString(message.codeownerGithubTeams[i])) + return "codeownerGithubTeams: string[] expected"; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + if (!$util.isString(message.docTagPrefix)) + return "docTagPrefix: string expected"; + if (message.organization != null && message.hasOwnProperty("organization")) + switch (message.organization) { + default: + return "organization: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { + if (!Array.isArray(message.librarySettings)) + return "librarySettings: array expected"; + for (var i = 0; i < message.librarySettings.length; ++i) { + var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i]); + if (error) + return "librarySettings." + error; + } + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + if (!$util.isString(message.protoReferenceDocumentationUri)) + return "protoReferenceDocumentationUri: string expected"; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + if (!$util.isString(message.restReferenceDocumentationUri)) + return "restReferenceDocumentationUri: string expected"; + return null; + }; + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Publishing + * @static + * @param {Object.} object Plain object + * @returns {google.api.Publishing} Publishing + */ + Publishing.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Publishing) + return object; + var message = new $root.google.api.Publishing(); + if (object.methodSettings) { + if (!Array.isArray(object.methodSettings)) + throw TypeError(".google.api.Publishing.methodSettings: array expected"); + message.methodSettings = []; + for (var i = 0; i < object.methodSettings.length; ++i) { + if (typeof object.methodSettings[i] !== "object") + throw TypeError(".google.api.Publishing.methodSettings: object expected"); + message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i]); + } + } + if (object.newIssueUri != null) + message.newIssueUri = String(object.newIssueUri); + if (object.documentationUri != null) + message.documentationUri = String(object.documentationUri); + if (object.apiShortName != null) + message.apiShortName = String(object.apiShortName); + if (object.githubLabel != null) + message.githubLabel = String(object.githubLabel); + if (object.codeownerGithubTeams) { + if (!Array.isArray(object.codeownerGithubTeams)) + throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); + message.codeownerGithubTeams = []; + for (var i = 0; i < object.codeownerGithubTeams.length; ++i) + message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); + } + if (object.docTagPrefix != null) + message.docTagPrefix = String(object.docTagPrefix); + switch (object.organization) { + default: + if (typeof object.organization === "number") { + message.organization = object.organization; + break; + } + break; + case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": + case 0: + message.organization = 0; + break; + case "CLOUD": + case 1: + message.organization = 1; + break; + case "ADS": + case 2: + message.organization = 2; + break; + case "PHOTOS": + case 3: + message.organization = 3; + break; + case "STREET_VIEW": + case 4: + message.organization = 4; + break; + case "SHOPPING": + case 5: + message.organization = 5; + break; + case "GEO": + case 6: + message.organization = 6; + break; + case "GENERATIVE_AI": + case 7: + message.organization = 7; + break; + } + if (object.librarySettings) { + if (!Array.isArray(object.librarySettings)) + throw TypeError(".google.api.Publishing.librarySettings: array expected"); + message.librarySettings = []; + for (var i = 0; i < object.librarySettings.length; ++i) { + if (typeof object.librarySettings[i] !== "object") + throw TypeError(".google.api.Publishing.librarySettings: object expected"); + message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]); + } + } + if (object.protoReferenceDocumentationUri != null) + message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); + if (object.restReferenceDocumentationUri != null) + message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); + return message; + }; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Publishing + * @static + * @param {google.api.Publishing} message Publishing + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Publishing.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.methodSettings = []; + object.codeownerGithubTeams = []; + object.librarySettings = []; + } + if (options.defaults) { + object.newIssueUri = ""; + object.documentationUri = ""; + object.apiShortName = ""; + object.githubLabel = ""; + object.docTagPrefix = ""; + object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; + object.protoReferenceDocumentationUri = ""; + object.restReferenceDocumentationUri = ""; + } + if (message.methodSettings && message.methodSettings.length) { + object.methodSettings = []; + for (var j = 0; j < message.methodSettings.length; ++j) + object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options); + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + object.newIssueUri = message.newIssueUri; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + object.documentationUri = message.documentationUri; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + object.apiShortName = message.apiShortName; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + object.githubLabel = message.githubLabel; + if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { + object.codeownerGithubTeams = []; + for (var j = 0; j < message.codeownerGithubTeams.length; ++j) + object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + object.docTagPrefix = message.docTagPrefix; + if (message.organization != null && message.hasOwnProperty("organization")) + object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; + if (message.librarySettings && message.librarySettings.length) { + object.librarySettings = []; + for (var j = 0; j < message.librarySettings.length; ++j) + object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; + return object; + }; + + /** + * Converts this Publishing to JSON. + * @function toJSON + * @memberof google.api.Publishing + * @instance + * @returns {Object.} JSON object + */ + Publishing.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Publishing + * @function getTypeUrl + * @memberof google.api.Publishing + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Publishing"; + }; + + return Publishing; + })(); + + api.JavaSettings = (function() { + + /** + * Properties of a JavaSettings. + * @memberof google.api + * @interface IJavaSettings + * @property {string|null} [libraryPackage] JavaSettings libraryPackage + * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames + * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common + */ + + /** + * Constructs a new JavaSettings. + * @memberof google.api + * @classdesc Represents a JavaSettings. + * @implements IJavaSettings + * @constructor + * @param {google.api.IJavaSettings=} [properties] Properties to set + */ + function JavaSettings(properties) { + this.serviceClassNames = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JavaSettings libraryPackage. + * @member {string} libraryPackage + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.libraryPackage = ""; + + /** + * JavaSettings serviceClassNames. + * @member {Object.} serviceClassNames + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.serviceClassNames = $util.emptyObject; + + /** + * JavaSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.common = null; + + /** + * Creates a new JavaSettings instance using the specified properties. + * @function create + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings=} [properties] Properties to set + * @returns {google.api.JavaSettings} JavaSettings instance + */ + JavaSettings.create = function create(properties) { + return new JavaSettings(properties); + }; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encode + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage); + if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) + for (var keys = Object.keys(message.serviceClassNames), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.serviceClassNames[keys[i]]).ldelim(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.JavaSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.libraryPackage = reader.string(); + break; + } + case 2: { + if (message.serviceClassNames === $util.emptyObject) + message.serviceClassNames = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.serviceClassNames[key] = value; + break; + } + case 3: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JavaSettings message. + * @function verify + * @memberof google.api.JavaSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JavaSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + if (!$util.isString(message.libraryPackage)) + return "libraryPackage: string expected"; + if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) { + if (!$util.isObject(message.serviceClassNames)) + return "serviceClassNames: object expected"; + var key = Object.keys(message.serviceClassNames); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.serviceClassNames[key[i]])) + return "serviceClassNames: string{k:string} expected"; + } + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.JavaSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.JavaSettings} JavaSettings + */ + JavaSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.JavaSettings) + return object; + var message = new $root.google.api.JavaSettings(); + if (object.libraryPackage != null) + message.libraryPackage = String(object.libraryPackage); + if (object.serviceClassNames) { + if (typeof object.serviceClassNames !== "object") + throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); + message.serviceClassNames = {}; + for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) + message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); + } + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.JavaSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.JavaSettings + * @static + * @param {google.api.JavaSettings} message JavaSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JavaSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.serviceClassNames = {}; + if (options.defaults) { + object.libraryPackage = ""; + object.common = null; + } + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + object.libraryPackage = message.libraryPackage; + var keys2; + if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { + object.serviceClassNames = {}; + for (var j = 0; j < keys2.length; ++j) + object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; + } + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this JavaSettings to JSON. + * @function toJSON + * @memberof google.api.JavaSettings + * @instance + * @returns {Object.} JSON object + */ + JavaSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JavaSettings + * @function getTypeUrl + * @memberof google.api.JavaSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.JavaSettings"; + }; + + return JavaSettings; + })(); + + api.CppSettings = (function() { + + /** + * Properties of a CppSettings. + * @memberof google.api + * @interface ICppSettings + * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common + */ + + /** + * Constructs a new CppSettings. + * @memberof google.api + * @classdesc Represents a CppSettings. + * @implements ICppSettings + * @constructor + * @param {google.api.ICppSettings=} [properties] Properties to set + */ + function CppSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CppSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.CppSettings + * @instance + */ + CppSettings.prototype.common = null; + + /** + * Creates a new CppSettings instance using the specified properties. + * @function create + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings=} [properties] Properties to set + * @returns {google.api.CppSettings} CppSettings instance + */ + CppSettings.create = function create(properties) { + return new CppSettings(properties); + }; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CppSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CppSettings message. + * @function verify + * @memberof google.api.CppSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CppSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CppSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CppSettings} CppSettings + */ + CppSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CppSettings) + return object; + var message = new $root.google.api.CppSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.CppSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CppSettings + * @static + * @param {google.api.CppSettings} message CppSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CppSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this CppSettings to JSON. + * @function toJSON + * @memberof google.api.CppSettings + * @instance + * @returns {Object.} JSON object + */ + CppSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CppSettings + * @function getTypeUrl + * @memberof google.api.CppSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CppSettings"; + }; + + return CppSettings; + })(); + + api.PhpSettings = (function() { + + /** + * Properties of a PhpSettings. + * @memberof google.api + * @interface IPhpSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common + */ + + /** + * Constructs a new PhpSettings. + * @memberof google.api + * @classdesc Represents a PhpSettings. + * @implements IPhpSettings + * @constructor + * @param {google.api.IPhpSettings=} [properties] Properties to set + */ + function PhpSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PhpSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PhpSettings + * @instance + */ + PhpSettings.prototype.common = null; + + /** + * Creates a new PhpSettings instance using the specified properties. + * @function create + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings=} [properties] Properties to set + * @returns {google.api.PhpSettings} PhpSettings instance + */ + PhpSettings.create = function create(properties) { + return new PhpSettings(properties); + }; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PhpSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PhpSettings message. + * @function verify + * @memberof google.api.PhpSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PhpSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PhpSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PhpSettings} PhpSettings + */ + PhpSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PhpSettings) + return object; + var message = new $root.google.api.PhpSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PhpSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PhpSettings + * @static + * @param {google.api.PhpSettings} message PhpSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PhpSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PhpSettings to JSON. + * @function toJSON + * @memberof google.api.PhpSettings + * @instance + * @returns {Object.} JSON object + */ + PhpSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PhpSettings + * @function getTypeUrl + * @memberof google.api.PhpSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PhpSettings"; + }; + + return PhpSettings; + })(); + + api.PythonSettings = (function() { + + /** + * Properties of a PythonSettings. + * @memberof google.api + * @interface IPythonSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common + */ + + /** + * Constructs a new PythonSettings. + * @memberof google.api + * @classdesc Represents a PythonSettings. + * @implements IPythonSettings + * @constructor + * @param {google.api.IPythonSettings=} [properties] Properties to set + */ + function PythonSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PythonSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.common = null; + + /** + * Creates a new PythonSettings instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings=} [properties] Properties to set + * @returns {google.api.PythonSettings} PythonSettings instance + */ + PythonSettings.create = function create(properties) { + return new PythonSettings(properties); + }; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PythonSettings message. + * @function verify + * @memberof google.api.PythonSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PythonSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings} PythonSettings + */ + PythonSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PythonSettings) + return object; + var message = new $root.google.api.PythonSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PythonSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings + * @static + * @param {google.api.PythonSettings} message PythonSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PythonSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PythonSettings to JSON. + * @function toJSON + * @memberof google.api.PythonSettings + * @instance + * @returns {Object.} JSON object + */ + PythonSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PythonSettings + * @function getTypeUrl + * @memberof google.api.PythonSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings"; + }; + + return PythonSettings; + })(); + + api.NodeSettings = (function() { + + /** + * Properties of a NodeSettings. + * @memberof google.api + * @interface INodeSettings + * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common + */ + + /** + * Constructs a new NodeSettings. + * @memberof google.api + * @classdesc Represents a NodeSettings. + * @implements INodeSettings + * @constructor + * @param {google.api.INodeSettings=} [properties] Properties to set + */ + function NodeSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.NodeSettings + * @instance + */ + NodeSettings.prototype.common = null; + + /** + * Creates a new NodeSettings instance using the specified properties. + * @function create + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings=} [properties] Properties to set + * @returns {google.api.NodeSettings} NodeSettings instance + */ + NodeSettings.create = function create(properties) { + return new NodeSettings(properties); + }; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encode + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.NodeSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeSettings message. + * @function verify + * @memberof google.api.NodeSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.NodeSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.NodeSettings} NodeSettings + */ + NodeSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.NodeSettings) + return object; + var message = new $root.google.api.NodeSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.NodeSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.NodeSettings + * @static + * @param {google.api.NodeSettings} message NodeSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this NodeSettings to JSON. + * @function toJSON + * @memberof google.api.NodeSettings + * @instance + * @returns {Object.} JSON object + */ + NodeSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeSettings + * @function getTypeUrl + * @memberof google.api.NodeSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.NodeSettings"; + }; + + return NodeSettings; + })(); + + api.DotnetSettings = (function() { + + /** + * Properties of a DotnetSettings. + * @memberof google.api + * @interface IDotnetSettings + * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common + * @property {Object.|null} [renamedServices] DotnetSettings renamedServices + * @property {Object.|null} [renamedResources] DotnetSettings renamedResources + * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources + * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases + * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures + */ + + /** + * Constructs a new DotnetSettings. + * @memberof google.api + * @classdesc Represents a DotnetSettings. + * @implements IDotnetSettings + * @constructor + * @param {google.api.IDotnetSettings=} [properties] Properties to set + */ + function DotnetSettings(properties) { + this.renamedServices = {}; + this.renamedResources = {}; + this.ignoredResources = []; + this.forcedNamespaceAliases = []; + this.handwrittenSignatures = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DotnetSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.common = null; + + /** + * DotnetSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedServices = $util.emptyObject; + + /** + * DotnetSettings renamedResources. + * @member {Object.} renamedResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedResources = $util.emptyObject; + + /** + * DotnetSettings ignoredResources. + * @member {Array.} ignoredResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.ignoredResources = $util.emptyArray; + + /** + * DotnetSettings forcedNamespaceAliases. + * @member {Array.} forcedNamespaceAliases + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; + + /** + * DotnetSettings handwrittenSignatures. + * @member {Array.} handwrittenSignatures + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @function create + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings=} [properties] Properties to set + * @returns {google.api.DotnetSettings} DotnetSettings instance + */ + DotnetSettings.create = function create(properties) { + return new DotnetSettings(properties); + }; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encode + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); + if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) + for (var keys = Object.keys(message.renamedResources), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedResources[keys[i]]).ldelim(); + if (message.ignoredResources != null && message.ignoredResources.length) + for (var i = 0; i < message.ignoredResources.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]); + if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length) + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]); + if (message.handwrittenSignatures != null && message.handwrittenSignatures.length) + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]); + return writer; + }; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedServices[key] = value; + break; + } + case 3: { + if (message.renamedResources === $util.emptyObject) + message.renamedResources = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedResources[key] = value; + break; + } + case 4: { + if (!(message.ignoredResources && message.ignoredResources.length)) + message.ignoredResources = []; + message.ignoredResources.push(reader.string()); + break; + } + case 5: { + if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length)) + message.forcedNamespaceAliases = []; + message.forcedNamespaceAliases.push(reader.string()); + break; + } + case 6: { + if (!(message.handwrittenSignatures && message.handwrittenSignatures.length)) + message.handwrittenSignatures = []; + message.handwrittenSignatures.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DotnetSettings message. + * @function verify + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DotnetSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } + if (message.renamedResources != null && message.hasOwnProperty("renamedResources")) { + if (!$util.isObject(message.renamedResources)) + return "renamedResources: object expected"; + var key = Object.keys(message.renamedResources); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedResources[key[i]])) + return "renamedResources: string{k:string} expected"; + } + if (message.ignoredResources != null && message.hasOwnProperty("ignoredResources")) { + if (!Array.isArray(message.ignoredResources)) + return "ignoredResources: array expected"; + for (var i = 0; i < message.ignoredResources.length; ++i) + if (!$util.isString(message.ignoredResources[i])) + return "ignoredResources: string[] expected"; + } + if (message.forcedNamespaceAliases != null && message.hasOwnProperty("forcedNamespaceAliases")) { + if (!Array.isArray(message.forcedNamespaceAliases)) + return "forcedNamespaceAliases: array expected"; + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + if (!$util.isString(message.forcedNamespaceAliases[i])) + return "forcedNamespaceAliases: string[] expected"; + } + if (message.handwrittenSignatures != null && message.hasOwnProperty("handwrittenSignatures")) { + if (!Array.isArray(message.handwrittenSignatures)) + return "handwrittenSignatures: array expected"; + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + if (!$util.isString(message.handwrittenSignatures[i])) + return "handwrittenSignatures: string[] expected"; + } + return null; + }; + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.DotnetSettings} DotnetSettings + */ + DotnetSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.DotnetSettings) + return object; + var message = new $root.google.api.DotnetSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.DotnetSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + if (object.renamedServices) { + if (typeof object.renamedServices !== "object") + throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } + if (object.renamedResources) { + if (typeof object.renamedResources !== "object") + throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); + message.renamedResources = {}; + for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) + message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]); + } + if (object.ignoredResources) { + if (!Array.isArray(object.ignoredResources)) + throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected"); + message.ignoredResources = []; + for (var i = 0; i < object.ignoredResources.length; ++i) + message.ignoredResources[i] = String(object.ignoredResources[i]); + } + if (object.forcedNamespaceAliases) { + if (!Array.isArray(object.forcedNamespaceAliases)) + throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected"); + message.forcedNamespaceAliases = []; + for (var i = 0; i < object.forcedNamespaceAliases.length; ++i) + message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]); + } + if (object.handwrittenSignatures) { + if (!Array.isArray(object.handwrittenSignatures)) + throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected"); + message.handwrittenSignatures = []; + for (var i = 0; i < object.handwrittenSignatures.length; ++i) + message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]); + } + return message; + }; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.DotnetSettings} message DotnetSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DotnetSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ignoredResources = []; + object.forcedNamespaceAliases = []; + object.handwrittenSignatures = []; + } + if (options.objects || options.defaults) { + object.renamedServices = {}; + object.renamedResources = {}; + } + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } + if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) { + object.renamedResources = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]]; + } + if (message.ignoredResources && message.ignoredResources.length) { + object.ignoredResources = []; + for (var j = 0; j < message.ignoredResources.length; ++j) + object.ignoredResources[j] = message.ignoredResources[j]; + } + if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) { + object.forcedNamespaceAliases = []; + for (var j = 0; j < message.forcedNamespaceAliases.length; ++j) + object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j]; + } + if (message.handwrittenSignatures && message.handwrittenSignatures.length) { + object.handwrittenSignatures = []; + for (var j = 0; j < message.handwrittenSignatures.length; ++j) + object.handwrittenSignatures[j] = message.handwrittenSignatures[j]; + } + return object; + }; + + /** + * Converts this DotnetSettings to JSON. + * @function toJSON + * @memberof google.api.DotnetSettings + * @instance + * @returns {Object.} JSON object + */ + DotnetSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DotnetSettings + * @function getTypeUrl + * @memberof google.api.DotnetSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.DotnetSettings"; + }; + + return DotnetSettings; + })(); + + api.RubySettings = (function() { + + /** + * Properties of a RubySettings. + * @memberof google.api + * @interface IRubySettings + * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common + */ + + /** + * Constructs a new RubySettings. + * @memberof google.api + * @classdesc Represents a RubySettings. + * @implements IRubySettings + * @constructor + * @param {google.api.IRubySettings=} [properties] Properties to set + */ + function RubySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RubySettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.RubySettings + * @instance + */ + RubySettings.prototype.common = null; + + /** + * Creates a new RubySettings instance using the specified properties. + * @function create + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings=} [properties] Properties to set + * @returns {google.api.RubySettings} RubySettings instance + */ + RubySettings.create = function create(properties) { + return new RubySettings(properties); + }; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encode + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RubySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RubySettings message. + * @function verify + * @memberof google.api.RubySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RubySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.RubySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.RubySettings} RubySettings + */ + RubySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.RubySettings) + return object; + var message = new $root.google.api.RubySettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.RubySettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.RubySettings + * @static + * @param {google.api.RubySettings} message RubySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RubySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this RubySettings to JSON. + * @function toJSON + * @memberof google.api.RubySettings + * @instance + * @returns {Object.} JSON object + */ + RubySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RubySettings + * @function getTypeUrl + * @memberof google.api.RubySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.RubySettings"; + }; + + return RubySettings; + })(); + + api.GoSettings = (function() { + + /** + * Properties of a GoSettings. + * @memberof google.api + * @interface IGoSettings + * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common + */ + + /** + * Constructs a new GoSettings. + * @memberof google.api + * @classdesc Represents a GoSettings. + * @implements IGoSettings + * @constructor + * @param {google.api.IGoSettings=} [properties] Properties to set + */ + function GoSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GoSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.common = null; + + /** + * Creates a new GoSettings instance using the specified properties. + * @function create + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings=} [properties] Properties to set + * @returns {google.api.GoSettings} GoSettings instance + */ + GoSettings.create = function create(properties) { + return new GoSettings(properties); + }; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encode + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoSettings message. + * @function verify + * @memberof google.api.GoSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.GoSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.GoSettings} GoSettings + */ + GoSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.GoSettings) + return object; + var message = new $root.google.api.GoSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.GoSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.GoSettings + * @static + * @param {google.api.GoSettings} message GoSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this GoSettings to JSON. + * @function toJSON + * @memberof google.api.GoSettings + * @instance + * @returns {Object.} JSON object + */ + GoSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoSettings + * @function getTypeUrl + * @memberof google.api.GoSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.GoSettings"; + }; + + return GoSettings; + })(); + + api.MethodSettings = (function() { + + /** + * Properties of a MethodSettings. + * @memberof google.api + * @interface IMethodSettings + * @property {string|null} [selector] MethodSettings selector + * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning + * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields + */ + + /** + * Constructs a new MethodSettings. + * @memberof google.api + * @classdesc Represents a MethodSettings. + * @implements IMethodSettings + * @constructor + * @param {google.api.IMethodSettings=} [properties] Properties to set + */ + function MethodSettings(properties) { + this.autoPopulatedFields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodSettings selector. + * @member {string} selector + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.selector = ""; + + /** + * MethodSettings longRunning. + * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.longRunning = null; + + /** + * MethodSettings autoPopulatedFields. + * @member {Array.} autoPopulatedFields + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.autoPopulatedFields = $util.emptyArray; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings=} [properties] Properties to set + * @returns {google.api.MethodSettings} MethodSettings instance + */ + MethodSettings.create = function create(properties) { + return new MethodSettings(properties); + }; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) + $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.autoPopulatedFields != null && message.autoPopulatedFields.length) + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]); + return writer; + }; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.autoPopulatedFields && message.autoPopulatedFields.length)) + message.autoPopulatedFields = []; + message.autoPopulatedFields.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodSettings message. + * @function verify + * @memberof google.api.MethodSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) { + var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning); + if (error) + return "longRunning." + error; + } + if (message.autoPopulatedFields != null && message.hasOwnProperty("autoPopulatedFields")) { + if (!Array.isArray(message.autoPopulatedFields)) + return "autoPopulatedFields: array expected"; + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + if (!$util.isString(message.autoPopulatedFields[i])) + return "autoPopulatedFields: string[] expected"; + } + return null; + }; + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings} MethodSettings + */ + MethodSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings) + return object; + var message = new $root.google.api.MethodSettings(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.longRunning != null) { + if (typeof object.longRunning !== "object") + throw TypeError(".google.api.MethodSettings.longRunning: object expected"); + message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning); + } + if (object.autoPopulatedFields) { + if (!Array.isArray(object.autoPopulatedFields)) + throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected"); + message.autoPopulatedFields = []; + for (var i = 0; i < object.autoPopulatedFields.length; ++i) + message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]); + } + return message; + }; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings + * @static + * @param {google.api.MethodSettings} message MethodSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.autoPopulatedFields = []; + if (options.defaults) { + object.selector = ""; + object.longRunning = null; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) + object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options); + if (message.autoPopulatedFields && message.autoPopulatedFields.length) { + object.autoPopulatedFields = []; + for (var j = 0; j < message.autoPopulatedFields.length; ++j) + object.autoPopulatedFields[j] = message.autoPopulatedFields[j]; + } + return object; + }; + + /** + * Converts this MethodSettings to JSON. + * @function toJSON + * @memberof google.api.MethodSettings + * @instance + * @returns {Object.} JSON object + */ + MethodSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodSettings + * @function getTypeUrl + * @memberof google.api.MethodSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings"; + }; + + MethodSettings.LongRunning = (function() { + + /** + * Properties of a LongRunning. + * @memberof google.api.MethodSettings + * @interface ILongRunning + * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay + * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier + * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay + * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout + */ + + /** + * Constructs a new LongRunning. + * @memberof google.api.MethodSettings + * @classdesc Represents a LongRunning. + * @implements ILongRunning + * @constructor + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + */ + function LongRunning(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LongRunning initialPollDelay. + * @member {google.protobuf.IDuration|null|undefined} initialPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.initialPollDelay = null; + + /** + * LongRunning pollDelayMultiplier. + * @member {number} pollDelayMultiplier + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.pollDelayMultiplier = 0; + + /** + * LongRunning maxPollDelay. + * @member {google.protobuf.IDuration|null|undefined} maxPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.maxPollDelay = null; + + /** + * LongRunning totalPollTimeout. + * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.totalPollTimeout = null; + + /** + * Creates a new LongRunning instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + * @returns {google.api.MethodSettings.LongRunning} LongRunning instance + */ + LongRunning.create = function create(properties) { + return new LongRunning(properties); + }; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) + $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier); + if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) + $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) + $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings.LongRunning(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.pollDelayMultiplier = reader.float(); + break; + } + case 3: { + message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LongRunning message. + * @function verify + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LongRunning.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.initialPollDelay); + if (error) + return "initialPollDelay." + error; + } + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + if (typeof message.pollDelayMultiplier !== "number") + return "pollDelayMultiplier: number expected"; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.maxPollDelay); + if (error) + return "maxPollDelay." + error; + } + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout); + if (error) + return "totalPollTimeout." + error; + } + return null; + }; + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings.LongRunning} LongRunning + */ + LongRunning.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings.LongRunning) + return object; + var message = new $root.google.api.MethodSettings.LongRunning(); + if (object.initialPollDelay != null) { + if (typeof object.initialPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); + message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay); + } + if (object.pollDelayMultiplier != null) + message.pollDelayMultiplier = Number(object.pollDelayMultiplier); + if (object.maxPollDelay != null) { + if (typeof object.maxPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); + message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay); + } + if (object.totalPollTimeout != null) { + if (typeof object.totalPollTimeout !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); + message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout); + } + return message; + }; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.LongRunning} message LongRunning + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LongRunning.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.initialPollDelay = null; + object.pollDelayMultiplier = 0; + object.maxPollDelay = null; + object.totalPollTimeout = null; + } + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) + object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options); + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) + object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options); + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) + object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options); + return object; + }; + + /** + * Converts this LongRunning to JSON. + * @function toJSON + * @memberof google.api.MethodSettings.LongRunning + * @instance + * @returns {Object.} JSON object + */ + LongRunning.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LongRunning + * @function getTypeUrl + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; + }; + + return LongRunning; + })(); + + return MethodSettings; + })(); + + /** + * ClientLibraryOrganization enum. + * @name google.api.ClientLibraryOrganization + * @enum {number} + * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value + * @property {number} CLOUD=1 CLOUD value + * @property {number} ADS=2 ADS value + * @property {number} PHOTOS=3 PHOTOS value + * @property {number} STREET_VIEW=4 STREET_VIEW value + * @property {number} SHOPPING=5 SHOPPING value + * @property {number} GEO=6 GEO value + * @property {number} GENERATIVE_AI=7 GENERATIVE_AI value + */ + api.ClientLibraryOrganization = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD"] = 1; + values[valuesById[2] = "ADS"] = 2; + values[valuesById[3] = "PHOTOS"] = 3; + values[valuesById[4] = "STREET_VIEW"] = 4; + values[valuesById[5] = "SHOPPING"] = 5; + values[valuesById[6] = "GEO"] = 6; + values[valuesById[7] = "GENERATIVE_AI"] = 7; + return values; + })(); + + /** + * ClientLibraryDestination enum. + * @name google.api.ClientLibraryDestination + * @enum {number} + * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value + * @property {number} GITHUB=10 GITHUB value + * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value + */ + api.ClientLibraryDestination = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0; + values[valuesById[10] = "GITHUB"] = 10; + values[valuesById[20] = "PACKAGE_MANAGER"] = 20; + return values; + })(); + + /** + * LaunchStage enum. + * @name google.api.LaunchStage + * @enum {number} + * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value + * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value + * @property {number} PRELAUNCH=7 PRELAUNCH value + * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value + * @property {number} ALPHA=2 ALPHA value + * @property {number} BETA=3 BETA value + * @property {number} GA=4 GA value + * @property {number} DEPRECATED=5 DEPRECATED value + */ + api.LaunchStage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; + values[valuesById[6] = "UNIMPLEMENTED"] = 6; + values[valuesById[7] = "PRELAUNCH"] = 7; + values[valuesById[1] = "EARLY_ACCESS"] = 1; + values[valuesById[2] = "ALPHA"] = 2; + values[valuesById[3] = "BETA"] = 3; + values[valuesById[4] = "GA"] = 4; + values[valuesById[5] = "DEPRECATED"] = 5; + return values; + })(); + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {number} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value + * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value + * @property {number} IDENTIFIER=8 IDENTIFIER value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + values[valuesById[6] = "UNORDERED_LIST"] = 6; + values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; + values[valuesById[8] = "IDENTIFIER"] = 8; + return values; + })(); + + api.FieldInfo = (function() { + + /** + * Properties of a FieldInfo. + * @memberof google.api + * @interface IFieldInfo + * @property {google.api.FieldInfo.Format|null} [format] FieldInfo format + */ + + /** + * Constructs a new FieldInfo. + * @memberof google.api + * @classdesc Represents a FieldInfo. + * @implements IFieldInfo + * @constructor + * @param {google.api.IFieldInfo=} [properties] Properties to set + */ + function FieldInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldInfo format. + * @member {google.api.FieldInfo.Format} format + * @memberof google.api.FieldInfo + * @instance + */ + FieldInfo.prototype.format = 0; + + /** + * Creates a new FieldInfo instance using the specified properties. + * @function create + * @memberof google.api.FieldInfo + * @static + * @param {google.api.IFieldInfo=} [properties] Properties to set + * @returns {google.api.FieldInfo} FieldInfo instance + */ + FieldInfo.create = function create(properties) { + return new FieldInfo(properties); + }; + + /** + * Encodes the specified FieldInfo message. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @function encode + * @memberof google.api.FieldInfo + * @static + * @param {google.api.IFieldInfo} message FieldInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.format != null && Object.hasOwnProperty.call(message, "format")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.format); + return writer; + }; + + /** + * Encodes the specified FieldInfo message, length delimited. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.FieldInfo + * @static + * @param {google.api.IFieldInfo} message FieldInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldInfo message from the specified reader or buffer. + * @function decode + * @memberof google.api.FieldInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.FieldInfo} FieldInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.FieldInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.format = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.FieldInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.FieldInfo} FieldInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldInfo message. + * @function verify + * @memberof google.api.FieldInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.format != null && message.hasOwnProperty("format")) + switch (message.format) { + default: + return "format: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a FieldInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.FieldInfo + * @static + * @param {Object.} object Plain object + * @returns {google.api.FieldInfo} FieldInfo + */ + FieldInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.FieldInfo) + return object; + var message = new $root.google.api.FieldInfo(); + switch (object.format) { + default: + if (typeof object.format === "number") { + message.format = object.format; + break; + } + break; + case "FORMAT_UNSPECIFIED": + case 0: + message.format = 0; + break; + case "UUID4": + case 1: + message.format = 1; + break; + case "IPV4": + case 2: + message.format = 2; + break; + case "IPV6": + case 3: + message.format = 3; + break; + case "IPV4_OR_IPV6": + case 4: + message.format = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a FieldInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.FieldInfo + * @static + * @param {google.api.FieldInfo} message FieldInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.format = options.enums === String ? "FORMAT_UNSPECIFIED" : 0; + if (message.format != null && message.hasOwnProperty("format")) + object.format = options.enums === String ? $root.google.api.FieldInfo.Format[message.format] === undefined ? message.format : $root.google.api.FieldInfo.Format[message.format] : message.format; + return object; + }; + + /** + * Converts this FieldInfo to JSON. + * @function toJSON + * @memberof google.api.FieldInfo + * @instance + * @returns {Object.} JSON object + */ + FieldInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldInfo + * @function getTypeUrl + * @memberof google.api.FieldInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.FieldInfo"; + }; + + /** + * Format enum. + * @name google.api.FieldInfo.Format + * @enum {number} + * @property {number} FORMAT_UNSPECIFIED=0 FORMAT_UNSPECIFIED value + * @property {number} UUID4=1 UUID4 value + * @property {number} IPV4=2 IPV4 value + * @property {number} IPV6=3 IPV6 value + * @property {number} IPV4_OR_IPV6=4 IPV4_OR_IPV6 value + */ + FieldInfo.Format = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "UUID4"] = 1; + values[valuesById[2] = "IPV4"] = 2; + values[valuesById[3] = "IPV6"] = 3; + values[valuesById[4] = "IPV4_OR_IPV6"] = 4; + return values; + })(); + + return FieldInfo; + })(); + + api.ResourceDescriptor = (function() { + + /** + * Properties of a ResourceDescriptor. + * @memberof google.api + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular + * @property {Array.|null} [style] ResourceDescriptor style + */ + + /** + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor + * @constructor + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + */ + function ResourceDescriptor(properties) { + this.pattern = []; + this.style = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.type = ""; + + /** + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; + + /** + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; + + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; + + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; + + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; + + /** + * ResourceDescriptor style. + * @member {Array.} style + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.style = $util.emptyArray; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @function create + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + */ + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); + }; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.style != null && message.style.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.style.length; ++i) + writer.int32(message.style[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + } + case 3: { + message.nameField = reader.string(); + break; + } + case 4: { + message.history = reader.int32(); + break; + } + case 5: { + message.plural = reader.string(); + break; + } + case 6: { + message.singular = reader.string(); + break; + } + case 10: { + if (!(message.style && message.style.length)) + message.style = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.style.push(reader.int32()); + } else + message.style.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + if (message.style != null && message.hasOwnProperty("style")) { + if (!Array.isArray(message.style)) + return "style: array expected"; + for (var i = 0; i < message.style.length; ++i) + switch (message.style[i]) { + default: + return "style: enum value[] expected"; + case 0: + case 1: + break; + } + } + return null; + }; + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) + return object; + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + default: + if (typeof object.history === "number") { + message.history = object.history; + break; + } + break; + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + if (object.style) { + if (!Array.isArray(object.style)) + throw TypeError(".google.api.ResourceDescriptor.style: array expected"); + message.style = []; + for (var i = 0; i < object.style.length; ++i) + switch (object.style[i]) { + default: + if (typeof object.style[i] === "number") { + message.style[i] = object.style[i]; + break; + } + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pattern = []; + object.style = []; + } + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + if (message.style && message.style.length) { + object.style = []; + for (var j = 0; j < message.style.length; ++j) + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + } + return object; + }; + + /** + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + ResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceDescriptor + * @function getTypeUrl + * @memberof google.api.ResourceDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceDescriptor"; + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {number} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); + + /** + * Style enum. + * @name google.api.ResourceDescriptor.Style + * @enum {number} + * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value + * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value + */ + ResourceDescriptor.Style = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; + return values; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.childType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceReference message. + * @function verify + * @memberof google.api.ResourceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; + return null; + }; + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceReference} ResourceReference + */ + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) + return object; + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); + return message; + }; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceReference + * @static + * @param {google.api.ResourceReference} message ResourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.childType = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; + return object; + }; + + /** + * Converts this ResourceReference to JSON. + * @function toJSON + * @memberof google.api.ResourceReference + * @instance + * @returns {Object.} JSON object + */ + ResourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceReference + * @function getTypeUrl + * @memberof google.api.ResourceReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceReference"; + }; + + return ResourceReference; + })(); + + return api; + })(); + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorSet + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; + }; + + return FileDescriptorSet; + })(); + + /** + * Edition enum. + * @name google.protobuf.Edition + * @enum {number} + * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value + * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value + * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value + * @property {number} EDITION_2023=1000 EDITION_2023 value + * @property {number} EDITION_2024=1001 EDITION_2024 value + * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value + * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value + * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value + * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value + * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value + * @property {number} EDITION_MAX=2147483647 EDITION_MAX value + */ + protobuf.Edition = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EDITION_UNKNOWN"] = 0; + values[valuesById[998] = "EDITION_PROTO2"] = 998; + values[valuesById[999] = "EDITION_PROTO3"] = 999; + values[valuesById[1000] = "EDITION_2023"] = 1000; + values[valuesById[1001] = "EDITION_2024"] = 1001; + values[valuesById[1] = "EDITION_1_TEST_ONLY"] = 1; + values[valuesById[2] = "EDITION_2_TEST_ONLY"] = 2; + values[valuesById[99997] = "EDITION_99997_TEST_ONLY"] = 99997; + values[valuesById[99998] = "EDITION_99998_TEST_ONLY"] = 99998; + values[valuesById[99999] = "EDITION_99999_TEST_ONLY"] = 99999; + values[valuesById[2147483647] = "EDITION_MAX"] = 2147483647; + return values; + })(); + + protobuf.FileDescriptorProto = (function() { + + /** + * Properties of a FileDescriptorProto. + * @memberof google.protobuf + * @interface IFileDescriptorProto + * @property {string|null} [name] FileDescriptorProto name + * @property {string|null} ["package"] FileDescriptorProto package + * @property {Array.|null} [dependency] FileDescriptorProto dependency + * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency + * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [messageType] FileDescriptorProto messageType + * @property {Array.|null} [enumType] FileDescriptorProto enumType + * @property {Array.|null} [service] FileDescriptorProto service + * @property {Array.|null} [extension] FileDescriptorProto extension + * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options + * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo + * @property {string|null} [syntax] FileDescriptorProto syntax + * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition + */ + + /** + * Constructs a new FileDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto + * @constructor + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + */ + function FileDescriptorProto(properties) { + this.dependency = []; + this.publicDependency = []; + this.weakDependency = []; + this.messageType = []; + this.enumType = []; + this.service = []; + this.extension = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; + + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; + + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; + + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; + + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; + + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; + + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; + + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; + + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; + + /** + * FileDescriptorProto edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = 0; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message["package"] = reader.string(); + break; + } + case 3: { + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + } + case 10: { + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + } + case 11: { + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + } + case 4: { + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 8: { + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + } + case 12: { + message.syntax = reader.string(); + break; + } + case 14: { + message.edition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorProto message. + * @function verify + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message["package"] != null && message.hasOwnProperty("package")) + if (!$util.isString(message["package"])) + return "package: string expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + if (!Array.isArray(message.dependency)) + return "dependency: array expected"; + for (var i = 0; i < message.dependency.length; ++i) + if (!$util.isString(message.dependency[i])) + return "dependency: string[] expected"; + } + if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { + if (!Array.isArray(message.publicDependency)) + return "publicDependency: array expected"; + for (var i = 0; i < message.publicDependency.length; ++i) + if (!$util.isInteger(message.publicDependency[i])) + return "publicDependency: integer[] expected"; + } + if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { + if (!Array.isArray(message.weakDependency)) + return "weakDependency: array expected"; + for (var i = 0; i < message.weakDependency.length; ++i) + if (!$util.isInteger(message.weakDependency[i])) + return "weakDependency: integer[] expected"; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (!Array.isArray(message.messageType)) + return "messageType: array expected"; + for (var i = 0; i < message.messageType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); + if (error) + return "messageType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.service != null && message.hasOwnProperty("service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); + if (error) + return "service." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + */ + FileDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) + return object; + var message = new $root.google.protobuf.FileDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object["package"] != null) + message["package"] = String(object["package"]); + if (object.dependency) { + if (!Array.isArray(object.dependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); + message.dependency = []; + for (var i = 0; i < object.dependency.length; ++i) + message.dependency[i] = String(object.dependency[i]); + } + if (object.publicDependency) { + if (!Array.isArray(object.publicDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); + message.publicDependency = []; + for (var i = 0; i < object.publicDependency.length; ++i) + message.publicDependency[i] = object.publicDependency[i] | 0; + } + if (object.weakDependency) { + if (!Array.isArray(object.weakDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); + message.weakDependency = []; + for (var i = 0; i < object.weakDependency.length; ++i) + message.weakDependency[i] = object.weakDependency[i] | 0; + } + if (object.messageType) { + if (!Array.isArray(object.messageType)) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); + message.messageType = []; + for (var i = 0; i < object.messageType.length; ++i) { + if (typeof object.messageType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); + message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (typeof object.service[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); + message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options); + } + if (object.sourceCodeInfo != null) { + if (typeof object.sourceCodeInfo !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message["package"] != null && message.hasOwnProperty("package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = message.syntax; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + */ + + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; + + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; + + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; + + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; + + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; + + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; + + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; + + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescriptorProto message. + * @function verify + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.field != null && message.hasOwnProperty("field")) { + if (!Array.isArray(message.field)) + return "field: array expected"; + for (var i = 0; i < message.field.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); + if (error) + return "field." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.nestedType != null && message.hasOwnProperty("nestedType")) { + if (!Array.isArray(message.nestedType)) + return "nestedType: array expected"; + for (var i = 0; i < message.nestedType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); + if (error) + return "nestedType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { + if (!Array.isArray(message.extensionRange)) + return "extensionRange: array expected"; + for (var i = 0; i < message.extensionRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); + if (error) + return "extensionRange." + error; + } + } + if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { + if (!Array.isArray(message.oneofDecl)) + return "oneofDecl: array expected"; + for (var i = 0; i < message.oneofDecl.length; ++i) { + var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); + if (error) + return "oneofDecl." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MessageOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto} DescriptorProto + */ + DescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto) + return object; + var message = new $root.google.protobuf.DescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.field) { + if (!Array.isArray(object.field)) + throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); + message.field = []; + for (var i = 0; i < object.field.length; ++i) { + if (typeof object.field[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); + message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.nestedType) { + if (!Array.isArray(object.nestedType)) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); + message.nestedType = []; + for (var i = 0; i < object.nestedType.length; ++i) { + if (typeof object.nestedType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); + message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (typeof object.extensionRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (typeof object.oneofDecl[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto"; + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReservedRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + * @property {Array.|null} [declaration] ExtensionRangeOptions declaration + * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features + * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification + */ + + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + this.declaration = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ExtensionRangeOptions declaration. + * @member {Array.} declaration + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.declaration = $util.emptyArray; + + /** + * ExtensionRangeOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.features = null; + + /** + * ExtensionRangeOptions verification. + * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.verification = 1; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + */ + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.declaration != null && message.declaration.length) + for (var i = 0; i < message.declaration.length; ++i) + $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.declaration && message.declaration.length)) + message.declaration = []; + message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32())); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.verification = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message.declaration != null && message.hasOwnProperty("declaration")) { + if (!Array.isArray(message.declaration)) + return "declaration: array expected"; + for (var i = 0; i < message.declaration.length; ++i) { + var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i]); + if (error) + return "declaration." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.verification != null && message.hasOwnProperty("verification")) + switch (message.verification) { + default: + return "verification: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object.declaration) { + if (!Array.isArray(object.declaration)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); + message.declaration = []; + for (var i = 0; i < object.declaration.length; ++i) { + if (typeof object.declaration[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); + message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + switch (object.verification) { + case "DECLARATION": + case 0: + message.verification = 0; + break; + default: + if (typeof object.verification === "number") { + message.verification = object.verification; + break; + } + break; + case "UNVERIFIED": + case 1: + message.verification = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.declaration = []; + object.uninterpretedOption = []; + } + if (options.defaults) { + object.verification = options.enums === String ? "UNVERIFIED" : 1; + object.features = null; + } + if (message.declaration && message.declaration.length) { + object.declaration = []; + for (var j = 0; j < message.declaration.length; ++j) + object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); + } + if (message.verification != null && message.hasOwnProperty("verification")) + object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + * @returns {Object.} JSON object + */ + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; + }; + + ExtensionRangeOptions.Declaration = (function() { + + /** + * Properties of a Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @interface IDeclaration + * @property {number|null} [number] Declaration number + * @property {string|null} [fullName] Declaration fullName + * @property {string|null} [type] Declaration type + * @property {boolean|null} [reserved] Declaration reserved + * @property {boolean|null} [repeated] Declaration repeated + */ + + /** + * Constructs a new Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @classdesc Represents a Declaration. + * @implements IDeclaration + * @constructor + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + */ + function Declaration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Declaration number. + * @member {number} number + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.number = 0; + + /** + * Declaration fullName. + * @member {string} fullName + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.fullName = ""; + + /** + * Declaration type. + * @member {string} type + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.type = ""; + + /** + * Declaration reserved. + * @member {boolean} reserved + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.reserved = false; + + /** + * Declaration repeated. + * @member {boolean} repeated + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.repeated = false; + + /** + * Creates a new Declaration instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance + */ + Declaration.create = function create(properties) { + return new Declaration(properties); + }; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); + if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); + if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); + return writer; + }; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.number = reader.int32(); + break; + } + case 2: { + message.fullName = reader.string(); + break; + } + case 3: { + message.type = reader.string(); + break; + } + case 5: { + message.reserved = reader.bool(); + break; + } + case 6: { + message.repeated = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Declaration message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Declaration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.fullName != null && message.hasOwnProperty("fullName")) + if (!$util.isString(message.fullName)) + return "fullName: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.reserved != null && message.hasOwnProperty("reserved")) + if (typeof message.reserved !== "boolean") + return "reserved: boolean expected"; + if (message.repeated != null && message.hasOwnProperty("repeated")) + if (typeof message.repeated !== "boolean") + return "repeated: boolean expected"; + return null; + }; + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + */ + Declaration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + if (object.number != null) + message.number = object.number | 0; + if (object.fullName != null) + message.fullName = String(object.fullName); + if (object.type != null) + message.type = String(object.type); + if (object.reserved != null) + message.reserved = Boolean(object.reserved); + if (object.repeated != null) + message.repeated = Boolean(object.repeated); + return message; + }; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Declaration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.number = 0; + object.fullName = ""; + object.type = ""; + object.reserved = false; + object.repeated = false; + } + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.fullName != null && message.hasOwnProperty("fullName")) + object.fullName = message.fullName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.reserved != null && message.hasOwnProperty("reserved")) + object.reserved = message.reserved; + if (message.repeated != null && message.hasOwnProperty("repeated")) + object.repeated = message.repeated; + return object; + }; + + /** + * Converts this Declaration to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + * @returns {Object.} JSON object + */ + Declaration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Declaration + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"; + }; + + return Declaration; + })(); + + /** + * VerificationState enum. + * @name google.protobuf.ExtensionRangeOptions.VerificationState + * @enum {number} + * @property {number} DECLARATION=0 DECLARATION value + * @property {number} UNVERIFIED=1 UNVERIFIED value + */ + ExtensionRangeOptions.VerificationState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DECLARATION"] = 0; + values[valuesById[1] = "UNVERIFIED"] = 1; + return values; + })(); + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.number = reader.int32(); + break; + } + case 4: { + message.label = reader.int32(); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.typeName = reader.string(); + break; + } + case 2: { + message.extendee = reader.string(); + break; + } + case 7: { + message.defaultValue = reader.string(); + break; + } + case 9: { + message.oneofIndex = reader.int32(); + break; + } + case 10: { + message.jsonName = reader.string(); + break; + } + case 8: { + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + } + case 17: { + message.proto3Optional = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 3: + case 2: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + object.proto3Optional = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {number} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; + }; + + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + */ + + /** + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + */ + function EnumDescriptorProto(properties) { + this.value = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; + + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; + + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) { + var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); + if (error) + return "value." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + */ + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (typeof object.value[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); + message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumReservedRange message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumReservedRange + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.number = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); + if (error) + return "method." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (typeof object.method[i] !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.inputType = reader.string(); + break; + } + case 3: { + message.outputType = reader.string(); + break; + } + case 4: { + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.clientStreaming = reader.bool(); + break; + } + case 6: { + message.serverStreaming = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = message.inputType; + if (message.outputType != null && message.hasOwnProperty("outputType")) + object.outputType = message.outputType; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {google.protobuf.IFeatureSet|null} [features] FileOptions features + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.resourceDefinition"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = true; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.features = null; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.javaPackage = reader.string(); + break; + } + case 8: { + message.javaOuterClassname = reader.string(); + break; + } + case 10: { + message.javaMultipleFiles = reader.bool(); + break; + } + case 20: { + message.javaGenerateEqualsAndHash = reader.bool(); + break; + } + case 27: { + message.javaStringCheckUtf8 = reader.bool(); + break; + } + case 9: { + message.optimizeFor = reader.int32(); + break; + } + case 11: { + message.goPackage = reader.string(); + break; + } + case 16: { + message.ccGenericServices = reader.bool(); + break; + } + case 17: { + message.javaGenericServices = reader.bool(); + break; + } + case 18: { + message.pyGenericServices = reader.bool(); + break; + } + case 23: { + message.deprecated = reader.bool(); + break; + } + case 31: { + message.ccEnableArenas = reader.bool(); + break; + } + case 36: { + message.objcClassPrefix = reader.string(); + break; + } + case 37: { + message.csharpNamespace = reader.string(); + break; + } + case 39: { + message.swiftPrefix = reader.string(); + break; + } + case 40: { + message.phpClassPrefix = reader.string(); + break; + } + case 41: { + message.phpNamespace = reader.string(); + break; + } + case 44: { + message.phpMetadataNamespace = reader.string(); + break; + } + case 45: { + message.rubyPackage = reader.string(); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) + message[".google.api.resourceDefinition"] = []; + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { + if (!Array.isArray(message[".google.api.resourceDefinition"])) + return ".google.api.resourceDefinition: array expected"; + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); + if (error) + return ".google.api.resourceDefinition." + error; + } + } + return null; + }; + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + default: + if (typeof object.optimizeFor === "number") { + message.optimizeFor = object.optimizeFor; + break; + } + break; + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.ccEnableArenas != null) + message.ccEnableArenas = Boolean(object.ccEnableArenas); + if (object.objcClassPrefix != null) + message.objcClassPrefix = String(object.objcClassPrefix); + if (object.csharpNamespace != null) + message.csharpNamespace = String(object.csharpNamespace); + if (object.swiftPrefix != null) + message.swiftPrefix = String(object.swiftPrefix); + if (object.phpClassPrefix != null) + message.phpClassPrefix = String(object.phpClassPrefix); + if (object.phpNamespace != null) + message.phpNamespace = String(object.phpNamespace); + if (object.phpMetadataNamespace != null) + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + if (object.rubyPackage != null) + message.rubyPackage = String(object.rubyPackage); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FileOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resourceDefinition"]) { + if (!Array.isArray(object[".google.api.resourceDefinition"])) + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); + message[".google.api.resourceDefinition"] = []; + for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { + if (typeof object[".google.api.resourceDefinition"][i] !== "object") + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); + message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + object.features = null; + } + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { + object[".google.api.resourceDefinition"] = []; + for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} JSON object + */ + FileOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileOptions + * @function getTypeUrl + * @memberof google.protobuf.FileOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileOptions"; + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {number} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { + + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * MessageOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.features = null; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.messageSetWireFormat = reader.bool(); + break; + } + case 2: { + message.noStandardDescriptorAccessor = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 7: { + message.mapEntry = reader.bool(); + break; + } + case 11: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 12: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); + if (error) + return ".google.api.resource." + error; + } + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MessageOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resource"] != null) { + if (typeof object[".google.api.resource"] !== "object") + throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); + } + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + object[".google.api.resource"] = null; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); + return object; + }; + + /** + * Converts this MessageOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MessageOptions + * @instance + * @returns {Object.} JSON object + */ + MessageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessageOptions + * @function getTypeUrl + * @memberof google.protobuf.MessageOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MessageOptions"; + }; + + return MessageOptions; + })(); + + protobuf.FieldOptions = (function() { + + /** + * Properties of a FieldOptions. + * @memberof google.protobuf + * @interface IFieldOptions + * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype + * @property {boolean|null} [packed] FieldOptions packed + * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype + * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {boolean|null} [debugRedact] FieldOptions debugRedact + * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention + * @property {Array.|null} [targets] FieldOptions targets + * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults + * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IFieldInfo|null} [".google.api.fieldInfo"] FieldOptions .google.api.fieldInfo + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + */ + + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.targets = []; + this.editionDefaults = []; + this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; + + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; + + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; + + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; + + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; + + /** + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; + + /** + * FieldOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.debugRedact = false; + + /** + * FieldOptions retention. + * @member {google.protobuf.FieldOptions.OptionRetention} retention + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.retention = 0; + + /** + * FieldOptions targets. + * @member {Array.} targets + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.targets = $util.emptyArray; + + /** + * FieldOptions editionDefaults. + * @member {Array.} editionDefaults + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.editionDefaults = $util.emptyArray; + + /** + * FieldOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.features = null; + + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldInfo. + * @member {google.api.IFieldInfo|null|undefined} .google.api.fieldInfo + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldInfo"] = null; + + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact); + if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention); + if (message.targets != null && message.targets.length) + for (var i = 0; i < message.targets.length; ++i) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]); + if (message.editionDefaults != null && message.editionDefaults.length) + for (var i = 0; i < message.editionDefaults.length; ++i) + $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); + if (message[".google.api.fieldInfo"] != null && Object.hasOwnProperty.call(message, ".google.api.fieldInfo")) + $root.google.api.FieldInfo.encode(message[".google.api.fieldInfo"], writer.uint32(/* id 291403980, wireType 2 =*/2331231842).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.ctype = reader.int32(); + break; + } + case 2: { + message.packed = reader.bool(); + break; + } + case 6: { + message.jstype = reader.int32(); + break; + } + case 5: { + message.lazy = reader.bool(); + break; + } + case 15: { + message.unverifiedLazy = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 10: { + message.weak = reader.bool(); + break; + } + case 16: { + message.debugRedact = reader.bool(); + break; + } + case 17: { + message.retention = reader.int32(); + break; + } + case 19: { + if (!(message.targets && message.targets.length)) + message.targets = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.targets.push(reader.int32()); + } else + message.targets.push(reader.int32()); + break; + } + case 20: { + if (!(message.editionDefaults && message.editionDefaults.length)) + message.editionDefaults = []; + message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32())); + break; + } + case 21: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + } + case 291403980: { + message[".google.api.fieldInfo"] = $root.google.api.FieldInfo.decode(reader, reader.uint32()); + break; + } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + if (typeof message.unverifiedLazy !== "boolean") + return "unverifiedLazy: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.retention != null && message.hasOwnProperty("retention")) + switch (message.retention) { + default: + return "retention: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.targets != null && message.hasOwnProperty("targets")) { + if (!Array.isArray(message.targets)) + return "targets: array expected"; + for (var i = 0; i < message.targets.length; ++i) + switch (message.targets[i]) { + default: + return "targets: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + } + if (message.editionDefaults != null && message.hasOwnProperty("editionDefaults")) { + if (!Array.isArray(message.editionDefaults)) + return "editionDefaults: array expected"; + for (var i = 0; i < message.editionDefaults.length; ++i) { + var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i]); + if (error) + return "editionDefaults." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + } + if (message[".google.api.fieldInfo"] != null && message.hasOwnProperty(".google.api.fieldInfo")) { + var error = $root.google.api.FieldInfo.verify(message[".google.api.fieldInfo"]); + if (error) + return ".google.api.fieldInfo." + error; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + default: + if (typeof object.ctype === "number") { + message.ctype = object.ctype; + break; + } + break; + case "STRING": + case 0: + message.ctype = 0; + break; + case "CORD": + case 1: + message.ctype = 1; + break; + case "STRING_PIECE": + case 2: + message.ctype = 2; + break; + } + if (object.packed != null) + message.packed = Boolean(object.packed); + switch (object.jstype) { + default: + if (typeof object.jstype === "number") { + message.jstype = object.jstype; + break; + } + break; + case "JS_NORMAL": + case 0: + message.jstype = 0; + break; + case "JS_STRING": + case 1: + message.jstype = 1; + break; + case "JS_NUMBER": + case 2: + message.jstype = 2; + break; + } + if (object.lazy != null) + message.lazy = Boolean(object.lazy); + if (object.unverifiedLazy != null) + message.unverifiedLazy = Boolean(object.unverifiedLazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + switch (object.retention) { + default: + if (typeof object.retention === "number") { + message.retention = object.retention; + break; + } + break; + case "RETENTION_UNKNOWN": + case 0: + message.retention = 0; + break; + case "RETENTION_RUNTIME": + case 1: + message.retention = 1; + break; + case "RETENTION_SOURCE": + case 2: + message.retention = 2; + break; + } + if (object.targets) { + if (!Array.isArray(object.targets)) + throw TypeError(".google.protobuf.FieldOptions.targets: array expected"); + message.targets = []; + for (var i = 0; i < object.targets.length; ++i) + switch (object.targets[i]) { + default: + if (typeof object.targets[i] === "number") { + message.targets[i] = object.targets[i]; + break; + } + case "TARGET_TYPE_UNKNOWN": + case 0: + message.targets[i] = 0; + break; + case "TARGET_TYPE_FILE": + case 1: + message.targets[i] = 1; + break; + case "TARGET_TYPE_EXTENSION_RANGE": + case 2: + message.targets[i] = 2; + break; + case "TARGET_TYPE_MESSAGE": + case 3: + message.targets[i] = 3; + break; + case "TARGET_TYPE_FIELD": + case 4: + message.targets[i] = 4; + break; + case "TARGET_TYPE_ONEOF": + case 5: + message.targets[i] = 5; + break; + case "TARGET_TYPE_ENUM": + case 6: + message.targets[i] = 6; + break; + case "TARGET_TYPE_ENUM_ENTRY": + case 7: + message.targets[i] = 7; + break; + case "TARGET_TYPE_SERVICE": + case 8: + message.targets[i] = 8; + break; + case "TARGET_TYPE_METHOD": + case 9: + message.targets[i] = 9; + break; + } + } + if (object.editionDefaults) { + if (!Array.isArray(object.editionDefaults)) + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected"); + message.editionDefaults = []; + for (var i = 0; i < object.editionDefaults.length; ++i) { + if (typeof object.editionDefaults[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); + message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FieldOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; + case "IDENTIFIER": + case 8: + message[".google.api.fieldBehavior"][i] = 8; + break; + } + } + if (object[".google.api.fieldInfo"] != null) { + if (typeof object[".google.api.fieldInfo"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldInfo: object expected"); + message[".google.api.fieldInfo"] = $root.google.api.FieldInfo.fromObject(object[".google.api.fieldInfo"]); + } + if (object[".google.api.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + } + return message; + }; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.targets = []; + object.editionDefaults = []; + object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } + if (options.defaults) { + object.ctype = options.enums === String ? "STRING" : 0; + object.packed = false; + object.deprecated = false; + object.lazy = false; + object.jstype = options.enums === String ? "JS_NORMAL" : 0; + object.weak = false; + object.unverifiedLazy = false; + object.debugRedact = false; + object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; + object.features = null; + object[".google.api.resourceReference"] = null; + object[".google.api.fieldInfo"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + if (message.packed != null && message.hasOwnProperty("packed")) + object.packed = message.packed; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.lazy != null && message.hasOwnProperty("lazy")) + object.lazy = message.lazy; + if (message.jstype != null && message.hasOwnProperty("jstype")) + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + object.unverifiedLazy = message.unverifiedLazy; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.retention != null && message.hasOwnProperty("retention")) + object.retention = options.enums === String ? $root.google.protobuf.FieldOptions.OptionRetention[message.retention] === undefined ? message.retention : $root.google.protobuf.FieldOptions.OptionRetention[message.retention] : message.retention; + if (message.targets && message.targets.length) { + object.targets = []; + for (var j = 0; j < message.targets.length; ++j) + object.targets[j] = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] === undefined ? message.targets[j] : $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] : message.targets[j]; + } + if (message.editionDefaults && message.editionDefaults.length) { + object.editionDefaults = []; + for (var j = 0; j < message.editionDefaults.length; ++j) + object.editionDefaults[j] = $root.google.protobuf.FieldOptions.EditionDefault.toObject(message.editionDefaults[j], options); + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { + object[".google.api.fieldBehavior"] = []; + for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); + if (message[".google.api.fieldInfo"] != null && message.hasOwnProperty(".google.api.fieldInfo")) + object[".google.api.fieldInfo"] = $root.google.api.FieldInfo.toObject(message[".google.api.fieldInfo"], options); + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldOptions + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions"; + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + /** + * OptionRetention enum. + * @name google.protobuf.FieldOptions.OptionRetention + * @enum {number} + * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value + * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value + * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value + */ + FieldOptions.OptionRetention = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; + values[valuesById[1] = "RETENTION_RUNTIME"] = 1; + values[valuesById[2] = "RETENTION_SOURCE"] = 2; + return values; + })(); + + /** + * OptionTargetType enum. + * @name google.protobuf.FieldOptions.OptionTargetType + * @enum {number} + * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value + * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value + * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value + * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value + * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value + * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value + * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value + * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value + * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value + * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value + */ + FieldOptions.OptionTargetType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; + values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; + values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; + values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; + values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; + values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; + values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; + values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; + values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; + return values; + })(); + + FieldOptions.EditionDefault = (function() { + + /** + * Properties of an EditionDefault. + * @memberof google.protobuf.FieldOptions + * @interface IEditionDefault + * @property {google.protobuf.Edition|null} [edition] EditionDefault edition + * @property {string|null} [value] EditionDefault value + */ + + /** + * Constructs a new EditionDefault. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents an EditionDefault. + * @implements IEditionDefault + * @constructor + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + */ + function EditionDefault(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.edition = 0; + + /** + * EditionDefault value. + * @member {string} value + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.value = ""; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance + */ + EditionDefault.create = function create(properties) { + return new EditionDefault(properties); + }; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EditionDefault message. + * @function verify + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + */ + EditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) + return object; + var message = new $root.google.protobuf.FieldOptions.EditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this EditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + * @returns {Object.} JSON object + */ + EditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; + }; + + return EditionDefault; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.features = null; + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + var message = new $root.google.protobuf.OneofOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.OneofOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.features = null; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofOptions + * @function getTypeUrl + * @memberof google.protobuf.OneofOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofOptions"; + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * EnumOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.features = null; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.allowAlias = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 6: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 7: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumOptions"; + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features + * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.features = null; + + /** + * EnumValueOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.debugRedact = false; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.deprecated = reader.bool(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.debugRedact = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object.debugRedact = false; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.features = null; + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * ServiceOptions .google.api.apiVersion. + * @member {string} .google.api.apiVersion + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.apiVersion"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) + writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 34: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + case 525000001: { + message[".google.api.apiVersion"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + if (!$util.isString(message[".google.api.apiVersion"])) + return ".google.api.apiVersion: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + if (object[".google.api.apiVersion"] != null) + message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + object[".google.api.apiVersion"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {google.protobuf.IFeatureSet|null} [features] MethodOptions features + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo + */ + + /** + * Constructs a new MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions + * @constructor + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + */ + function MethodOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.features = null; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + + /** + * MethodOptions .google.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.longrunning.operationInfo"] = null; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance + */ + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) + $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 35: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + } + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } + case 1049: { + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { + var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); + if (error) + return ".google.longrunning.operationInfo." + error; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodOptions} MethodOptions + */ + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) + return object; + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MethodOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } + if (object[".google.longrunning.operationInfo"] != null) { + if (typeof object[".google.longrunning.operationInfo"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object.features = null; + object[".google.longrunning.operationInfo"] = null; + object[".google.api.http"] = null; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodOptions + * @function getTypeUrl + * @memberof google.protobuf.MethodOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + } + case 3: { + message.identifierValue = reader.string(); + break; + } + case 4: { + message.positiveIntValue = reader.uint64(); + break; + } + case 5: { + message.negativeIntValue = reader.int64(); + break; + } + case 6: { + message.doubleValue = reader.double(); + break; + } + case 7: { + message.stringValue = reader.bytes(); + break; + } + case 8: { + message.aggregateValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length >= 0) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.FeatureSet = (function() { + + /** + * Properties of a FeatureSet. + * @memberof google.protobuf + * @interface IFeatureSet + * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence + * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType + * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding + * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation + * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding + * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat + */ + + /** + * Constructs a new FeatureSet. + * @memberof google.protobuf + * @classdesc Represents a FeatureSet. + * @implements IFeatureSet + * @constructor + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + */ + function FeatureSet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSet fieldPresence. + * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.fieldPresence = 0; + + /** + * FeatureSet enumType. + * @member {google.protobuf.FeatureSet.EnumType} enumType + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enumType = 0; + + /** + * FeatureSet repeatedFieldEncoding. + * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.repeatedFieldEncoding = 0; + + /** + * FeatureSet utf8Validation. + * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.utf8Validation = 0; + + /** + * FeatureSet messageEncoding. + * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.messageEncoding = 0; + + /** + * FeatureSet jsonFormat. + * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.jsonFormat = 0; + + /** + * Creates a new FeatureSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet} FeatureSet instance + */ + FeatureSet.create = function create(properties) { + return new FeatureSet(properties); + }; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); + if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); + if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); + if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); + if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); + if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); + return writer; + }; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.fieldPresence = reader.int32(); + break; + } + case 2: { + message.enumType = reader.int32(); + break; + } + case 3: { + message.repeatedFieldEncoding = reader.int32(); + break; + } + case 4: { + message.utf8Validation = reader.int32(); + break; + } + case 5: { + message.messageEncoding = reader.int32(); + break; + } + case 6: { + message.jsonFormat = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSet message. + * @function verify + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + switch (message.fieldPresence) { + default: + return "fieldPresence: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.enumType != null && message.hasOwnProperty("enumType")) + switch (message.enumType) { + default: + return "enumType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + switch (message.repeatedFieldEncoding) { + default: + return "repeatedFieldEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + switch (message.utf8Validation) { + default: + return "utf8Validation: enum value expected"; + case 0: + case 2: + case 3: + break; + } + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + switch (message.messageEncoding) { + default: + return "messageEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + switch (message.jsonFormat) { + default: + return "jsonFormat: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet} FeatureSet + */ + FeatureSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSet) + return object; + var message = new $root.google.protobuf.FeatureSet(); + switch (object.fieldPresence) { + default: + if (typeof object.fieldPresence === "number") { + message.fieldPresence = object.fieldPresence; + break; + } + break; + case "FIELD_PRESENCE_UNKNOWN": + case 0: + message.fieldPresence = 0; + break; + case "EXPLICIT": + case 1: + message.fieldPresence = 1; + break; + case "IMPLICIT": + case 2: + message.fieldPresence = 2; + break; + case "LEGACY_REQUIRED": + case 3: + message.fieldPresence = 3; + break; + } + switch (object.enumType) { + default: + if (typeof object.enumType === "number") { + message.enumType = object.enumType; + break; + } + break; + case "ENUM_TYPE_UNKNOWN": + case 0: + message.enumType = 0; + break; + case "OPEN": + case 1: + message.enumType = 1; + break; + case "CLOSED": + case 2: + message.enumType = 2; + break; + } + switch (object.repeatedFieldEncoding) { + default: + if (typeof object.repeatedFieldEncoding === "number") { + message.repeatedFieldEncoding = object.repeatedFieldEncoding; + break; + } + break; + case "REPEATED_FIELD_ENCODING_UNKNOWN": + case 0: + message.repeatedFieldEncoding = 0; + break; + case "PACKED": + case 1: + message.repeatedFieldEncoding = 1; + break; + case "EXPANDED": + case 2: + message.repeatedFieldEncoding = 2; + break; + } + switch (object.utf8Validation) { + default: + if (typeof object.utf8Validation === "number") { + message.utf8Validation = object.utf8Validation; + break; + } + break; + case "UTF8_VALIDATION_UNKNOWN": + case 0: + message.utf8Validation = 0; + break; + case "VERIFY": + case 2: + message.utf8Validation = 2; + break; + case "NONE": + case 3: + message.utf8Validation = 3; + break; + } + switch (object.messageEncoding) { + default: + if (typeof object.messageEncoding === "number") { + message.messageEncoding = object.messageEncoding; + break; + } + break; + case "MESSAGE_ENCODING_UNKNOWN": + case 0: + message.messageEncoding = 0; + break; + case "LENGTH_PREFIXED": + case 1: + message.messageEncoding = 1; + break; + case "DELIMITED": + case 2: + message.messageEncoding = 2; + break; + } + switch (object.jsonFormat) { + default: + if (typeof object.jsonFormat === "number") { + message.jsonFormat = object.jsonFormat; + break; + } + break; + case "JSON_FORMAT_UNKNOWN": + case 0: + message.jsonFormat = 0; + break; + case "ALLOW": + case 1: + message.jsonFormat = 1; + break; + case "LEGACY_BEST_EFFORT": + case 2: + message.jsonFormat = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.FeatureSet} message FeatureSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; + object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; + object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; + object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; + object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; + object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; + } + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; + if (message.enumType != null && message.hasOwnProperty("enumType")) + object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType; + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding; + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation; + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; + return object; + }; + + /** + * Converts this FeatureSet to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet + * @instance + * @returns {Object.} JSON object + */ + FeatureSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSet + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet"; + }; + + /** + * FieldPresence enum. + * @name google.protobuf.FeatureSet.FieldPresence + * @enum {number} + * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value + * @property {number} EXPLICIT=1 EXPLICIT value + * @property {number} IMPLICIT=2 IMPLICIT value + * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value + */ + FeatureSet.FieldPresence = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; + values[valuesById[1] = "EXPLICIT"] = 1; + values[valuesById[2] = "IMPLICIT"] = 2; + values[valuesById[3] = "LEGACY_REQUIRED"] = 3; + return values; + })(); + + /** + * EnumType enum. + * @name google.protobuf.FeatureSet.EnumType + * @enum {number} + * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value + * @property {number} OPEN=1 OPEN value + * @property {number} CLOSED=2 CLOSED value + */ + FeatureSet.EnumType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "OPEN"] = 1; + values[valuesById[2] = "CLOSED"] = 2; + return values; + })(); + + /** + * RepeatedFieldEncoding enum. + * @name google.protobuf.FeatureSet.RepeatedFieldEncoding + * @enum {number} + * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value + * @property {number} PACKED=1 PACKED value + * @property {number} EXPANDED=2 EXPANDED value + */ + FeatureSet.RepeatedFieldEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "PACKED"] = 1; + values[valuesById[2] = "EXPANDED"] = 2; + return values; + })(); + + /** + * Utf8Validation enum. + * @name google.protobuf.FeatureSet.Utf8Validation + * @enum {number} + * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value + * @property {number} VERIFY=2 VERIFY value + * @property {number} NONE=3 NONE value + */ + FeatureSet.Utf8Validation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; + values[valuesById[2] = "VERIFY"] = 2; + values[valuesById[3] = "NONE"] = 3; + return values; + })(); + + /** + * MessageEncoding enum. + * @name google.protobuf.FeatureSet.MessageEncoding + * @enum {number} + * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value + * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value + * @property {number} DELIMITED=2 DELIMITED value + */ + FeatureSet.MessageEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "LENGTH_PREFIXED"] = 1; + values[valuesById[2] = "DELIMITED"] = 2; + return values; + })(); + + /** + * JsonFormat enum. + * @name google.protobuf.FeatureSet.JsonFormat + * @enum {number} + * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value + * @property {number} ALLOW=1 ALLOW value + * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value + */ + FeatureSet.JsonFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; + values[valuesById[1] = "ALLOW"] = 1; + values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; + return values; + })(); + + return FeatureSet; + })(); + + protobuf.FeatureSetDefaults = (function() { + + /** + * Properties of a FeatureSetDefaults. + * @memberof google.protobuf + * @interface IFeatureSetDefaults + * @property {Array.|null} [defaults] FeatureSetDefaults defaults + * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition + * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition + */ + + /** + * Constructs a new FeatureSetDefaults. + * @memberof google.protobuf + * @classdesc Represents a FeatureSetDefaults. + * @implements IFeatureSetDefaults + * @constructor + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + */ + function FeatureSetDefaults(properties) { + this.defaults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSetDefaults defaults. + * @member {Array.} defaults + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.defaults = $util.emptyArray; + + /** + * FeatureSetDefaults minimumEdition. + * @member {google.protobuf.Edition} minimumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.minimumEdition = 0; + + /** + * FeatureSetDefaults maximumEdition. + * @member {google.protobuf.Edition} maximumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.maximumEdition = 0; + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance + */ + FeatureSetDefaults.create = function create(properties) { + return new FeatureSetDefaults(properties); + }; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.defaults != null && message.defaults.length) + for (var i = 0; i < message.defaults.length; ++i) + $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); + if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); + return writer; + }; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.defaults && message.defaults.length)) + message.defaults = []; + message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32())); + break; + } + case 4: { + message.minimumEdition = reader.int32(); + break; + } + case 5: { + message.maximumEdition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetDefaults message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetDefaults.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.defaults != null && message.hasOwnProperty("defaults")) { + if (!Array.isArray(message.defaults)) + return "defaults: array expected"; + for (var i = 0; i < message.defaults.length; ++i) { + var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i]); + if (error) + return "defaults." + error; + } + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + switch (message.minimumEdition) { + default: + return "minimumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + switch (message.maximumEdition) { + default: + return "maximumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + */ + FeatureSetDefaults.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults(); + if (object.defaults) { + if (!Array.isArray(object.defaults)) + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected"); + message.defaults = []; + for (var i = 0; i < object.defaults.length; ++i) { + if (typeof object.defaults[i] !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected"); + message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i]); + } + } + switch (object.minimumEdition) { + default: + if (typeof object.minimumEdition === "number") { + message.minimumEdition = object.minimumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.minimumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.minimumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.minimumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.minimumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.minimumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.minimumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.minimumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.minimumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.minimumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.minimumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.minimumEdition = 2147483647; + break; + } + switch (object.maximumEdition) { + default: + if (typeof object.maximumEdition === "number") { + message.maximumEdition = object.maximumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.maximumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.maximumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.maximumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.maximumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.maximumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.maximumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.maximumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.maximumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.maximumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.maximumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.maximumEdition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetDefaults.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.defaults = []; + if (options.defaults) { + object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.defaults && message.defaults.length) { + object.defaults = []; + for (var j = 0; j < message.defaults.length; ++j) + object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options); + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; + return object; + }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults + * @instance + * @returns {Object.} JSON object + */ + FeatureSetDefaults.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetDefaults + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; + }; + + FeatureSetDefaults.FeatureSetEditionDefault = (function() { + + /** + * Properties of a FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @interface IFeatureSetEditionDefault + * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition + * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features + */ + + /** + * Constructs a new FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @classdesc Represents a FeatureSetEditionDefault. + * @implements IFeatureSetEditionDefault + * @constructor + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + */ + function FeatureSetEditionDefault(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSetEditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.edition = 0; + + /** + * FeatureSetEditionDefault features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.features = null; + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance + */ + FeatureSetEditionDefault.create = function create(properties) { + return new FeatureSetEditionDefault(properties); + }; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetEditionDefault message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetEditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + return null; + }; + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + */ + FeatureSetEditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetEditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.features = null; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + * @returns {Object.} JSON object + */ + FeatureSetEditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; + }; + + return FeatureSetEditionDefault; + })(); + + return FeatureSetDefaults; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + } + case 3: { + message.leadingComments = reader.string(); + break; + } + case 4: { + message.trailingComments = reader.string(); + break; + } + case 6: { + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + message.sourceFile = reader.string(); + break; + } + case 3: { + message.begin = reader.int32(); + break; + } + case 4: { + message.end = reader.int32(); + break; + } + case 5: { + message.semantic = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.semantic != null && message.hasOwnProperty("semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) + return object; + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof google.protobuf.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Duration"; + }; + + return Duration; + })(); + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + + return Any; + })(); + + protobuf.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + + return Empty; + })(); + + protobuf.FieldMask = (function() { + + /** + * Properties of a FieldMask. + * @memberof google.protobuf + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths + */ + + /** + * Constructs a new FieldMask. + * @memberof google.protobuf + * @classdesc Represents a FieldMask. + * @implements IFieldMask + * @constructor + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + */ + function FieldMask(properties) { + this.paths = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask + * @instance + */ + FieldMask.prototype.paths = $util.emptyArray; + + /** + * Creates a new FieldMask instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance + */ + FieldMask.create = function create(properties) { + return new FieldMask(properties); + }; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); + return writer; + }; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldMask message. + * @function verify + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldMask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } + return null; + }; + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldMask} FieldMask + */ + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) + return object; + var message = new $root.google.protobuf.FieldMask(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.protobuf.FieldMask.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + return message; + }; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.FieldMask} message FieldMask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldMask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + return object; + }; + + /** + * Converts this FieldMask to JSON. + * @function toJSON + * @memberof google.protobuf.FieldMask + * @instance + * @returns {Object.} JSON object + */ + FieldMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldMask + * @function getTypeUrl + * @memberof google.protobuf.FieldMask + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldMask"; + }; + + return FieldMask; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.protobuf.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Timestamp"; + }; + + return Timestamp; + })(); + + return protobuf; + })(); + + google.longrunning = (function() { + + /** + * Namespace longrunning. + * @memberof google + * @namespace + */ + var longrunning = {}; + + longrunning.Operations = (function() { + + /** + * Constructs a new Operations service. + * @memberof google.longrunning + * @classdesc Represents an Operations + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Operations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; + + /** + * Creates new Operations service using the specified rpc implementation. + * @function create + * @memberof google.longrunning.Operations + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Operations} RPC service. Useful where requests and/or responses are streamed. + */ + Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @memberof google.longrunning.Operations + * @typedef ListOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse + */ + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { + return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); + }, "name", { value: "ListOperations" }); + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @memberof google.longrunning.Operations + * @typedef GetOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { + return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "GetOperation" }); + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @memberof google.longrunning.Operations + * @typedef DeleteOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { + return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteOperation" }); + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @memberof google.longrunning.Operations + * @typedef CancelOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { + return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "CancelOperation" }); + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @memberof google.longrunning.Operations + * @typedef WaitOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { + return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "WaitOperation" }); + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Operations; + })(); + + longrunning.Operation = (function() { + + /** + * Properties of an Operation. + * @memberof google.longrunning + * @interface IOperation + * @property {string|null} [name] Operation name + * @property {google.protobuf.IAny|null} [metadata] Operation metadata + * @property {boolean|null} [done] Operation done + * @property {google.rpc.IStatus|null} [error] Operation error + * @property {google.protobuf.IAny|null} [response] Operation response + */ + + /** + * Constructs a new Operation. + * @memberof google.longrunning + * @classdesc Represents an Operation. + * @implements IOperation + * @constructor + * @param {google.longrunning.IOperation=} [properties] Properties to set + */ + function Operation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Operation name. + * @member {string} name + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.name = ""; + + /** + * Operation metadata. + * @member {google.protobuf.IAny|null|undefined} metadata + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.metadata = null; + + /** + * Operation done. + * @member {boolean} done + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.done = false; + + /** + * Operation error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.error = null; + + /** + * Operation response. + * @member {google.protobuf.IAny|null|undefined} response + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Operation result. + * @member {"error"|"response"|undefined} result + * @memberof google.longrunning.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["error", "response"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Operation instance using the specified properties. + * @function create + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation=} [properties] Properties to set + * @returns {google.longrunning.Operation} Operation instance + */ + Operation.create = function create(properties) { + return new Operation(properties); + }; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encode + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.done != null && Object.hasOwnProperty.call(message, "done")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + case 3: { + message.done = reader.bool(); + break; + } + case 4: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 5: { + message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Operation message. + * @function verify + * @memberof google.longrunning.Operation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Operation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Any.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.done != null && message.hasOwnProperty("done")) + if (typeof message.done !== "boolean") + return "done: boolean expected"; + if (message.error != null && message.hasOwnProperty("error")) { + properties.result = 1; + { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.response != null && message.hasOwnProperty("response")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.protobuf.Any.verify(message.response); + if (error) + return "response." + error; + } + } + return null; + }; + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.Operation + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.Operation} Operation + */ + Operation.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.Operation) + return object; + var message = new $root.google.longrunning.Operation(); + if (object.name != null) + message.name = String(object.name); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.longrunning.Operation.metadata: object expected"); + message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); + } + if (object.done != null) + message.done = Boolean(object.done); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.longrunning.Operation.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.longrunning.Operation.response: object expected"); + message.response = $root.google.protobuf.Any.fromObject(object.response); + } + return message; + }; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.Operation} message Operation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Operation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.metadata = null; + object.done = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); + if (message.done != null && message.hasOwnProperty("done")) + object.done = message.done; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; + } + if (message.response != null && message.hasOwnProperty("response")) { + object.response = $root.google.protobuf.Any.toObject(message.response, options); + if (options.oneofs) + object.result = "response"; + } + return object; + }; + + /** + * Converts this Operation to JSON. + * @function toJSON + * @memberof google.longrunning.Operation + * @instance + * @returns {Object.} JSON object + */ + Operation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Operation + * @function getTypeUrl + * @memberof google.longrunning.Operation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.Operation"; + }; + + return Operation; + })(); + + longrunning.GetOperationRequest = (function() { + + /** + * Properties of a GetOperationRequest. + * @memberof google.longrunning + * @interface IGetOperationRequest + * @property {string|null} [name] GetOperationRequest name + */ + + /** + * Constructs a new GetOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a GetOperationRequest. + * @implements IGetOperationRequest + * @constructor + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + */ + function GetOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetOperationRequest name. + * @member {string} name + * @memberof google.longrunning.GetOperationRequest + * @instance + */ + GetOperationRequest.prototype.name = ""; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance + */ + GetOperationRequest.create = function create(properties) { + return new GetOperationRequest(properties); + }; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOperationRequest message. + * @function verify + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + */ + GetOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.GetOperationRequest) + return object; + var message = new $root.google.longrunning.GetOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.GetOperationRequest} message GetOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.GetOperationRequest + * @instance + * @returns {Object.} JSON object + */ + GetOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; + }; + + return GetOperationRequest; + })(); + + longrunning.ListOperationsRequest = (function() { + + /** + * Properties of a ListOperationsRequest. + * @memberof google.longrunning + * @interface IListOperationsRequest + * @property {string|null} [name] ListOperationsRequest name + * @property {string|null} [filter] ListOperationsRequest filter + * @property {number|null} [pageSize] ListOperationsRequest pageSize + * @property {string|null} [pageToken] ListOperationsRequest pageToken + */ + + /** + * Constructs a new ListOperationsRequest. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsRequest. + * @implements IListOperationsRequest + * @constructor + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + */ + function ListOperationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsRequest name. + * @member {string} name + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.name = ""; + + /** + * ListOperationsRequest filter. + * @member {string} filter + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.filter = ""; + + /** + * ListOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageSize = 0; + + /** + * ListOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance + */ + ListOperationsRequest.create = function create(properties) { + return new ListOperationsRequest(properties); + }; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + return writer; + }; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 4: { + message.name = reader.string(); + break; + } + case 1: { + message.filter = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsRequest message. + * @function verify + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + */ + ListOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsRequest) + return object; + var message = new $root.google.longrunning.ListOperationsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.name = ""; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this ListOperationsRequest to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsRequest + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; + }; + + return ListOperationsRequest; + })(); + + longrunning.ListOperationsResponse = (function() { + + /** + * Properties of a ListOperationsResponse. + * @memberof google.longrunning + * @interface IListOperationsResponse + * @property {Array.|null} [operations] ListOperationsResponse operations + * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken + */ + + /** + * Constructs a new ListOperationsResponse. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsResponse. + * @implements IListOperationsResponse + * @constructor + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + */ + function ListOperationsResponse(properties) { + this.operations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsResponse operations. + * @member {Array.} operations + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.operations = $util.emptyArray; + + /** + * ListOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance + */ + ListOperationsResponse.create = function create(properties) { + return new ListOperationsResponse(properties); + }; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsResponse message. + * @function verify + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + */ + ListOperationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsResponse) + return object; + var message = new $root.google.longrunning.ListOperationsResponse(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); + message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListOperationsResponse to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListOperationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsResponse + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; + }; + + return ListOperationsResponse; + })(); + + longrunning.CancelOperationRequest = (function() { + + /** + * Properties of a CancelOperationRequest. + * @memberof google.longrunning + * @interface ICancelOperationRequest + * @property {string|null} [name] CancelOperationRequest name + */ + + /** + * Constructs a new CancelOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a CancelOperationRequest. + * @implements ICancelOperationRequest + * @constructor + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + */ + function CancelOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CancelOperationRequest name. + * @member {string} name + * @memberof google.longrunning.CancelOperationRequest + * @instance + */ + CancelOperationRequest.prototype.name = ""; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance + */ + CancelOperationRequest.create = function create(properties) { + return new CancelOperationRequest(properties); + }; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelOperationRequest message. + * @function verify + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + */ + CancelOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.CancelOperationRequest) + return object; + var message = new $root.google.longrunning.CancelOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this CancelOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.CancelOperationRequest + * @instance + * @returns {Object.} JSON object + */ + CancelOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; + }; + + return CancelOperationRequest; + })(); + + longrunning.DeleteOperationRequest = (function() { + + /** + * Properties of a DeleteOperationRequest. + * @memberof google.longrunning + * @interface IDeleteOperationRequest + * @property {string|null} [name] DeleteOperationRequest name + */ + + /** + * Constructs a new DeleteOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a DeleteOperationRequest. + * @implements IDeleteOperationRequest + * @constructor + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + */ + function DeleteOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteOperationRequest name. + * @member {string} name + * @memberof google.longrunning.DeleteOperationRequest + * @instance + */ + DeleteOperationRequest.prototype.name = ""; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance + */ + DeleteOperationRequest.create = function create(properties) { + return new DeleteOperationRequest(properties); + }; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteOperationRequest message. + * @function verify + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + */ + DeleteOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.DeleteOperationRequest) + return object; + var message = new $root.google.longrunning.DeleteOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.DeleteOperationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; + }; + + return DeleteOperationRequest; + })(); + + longrunning.WaitOperationRequest = (function() { + + /** + * Properties of a WaitOperationRequest. + * @memberof google.longrunning + * @interface IWaitOperationRequest + * @property {string|null} [name] WaitOperationRequest name + * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout + */ + + /** + * Constructs a new WaitOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a WaitOperationRequest. + * @implements IWaitOperationRequest + * @constructor + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + */ + function WaitOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WaitOperationRequest name. + * @member {string} name + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.name = ""; + + /** + * WaitOperationRequest timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.timeout = null; + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance + */ + WaitOperationRequest.create = function create(properties) { + return new WaitOperationRequest(properties); + }; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitOperationRequest message. + * @function verify + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + return null; + }; + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + */ + WaitOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.WaitOperationRequest) + return object; + var message = new $root.google.longrunning.WaitOperationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + return message; + }; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.timeout = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + return object; + }; + + /** + * Converts this WaitOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.WaitOperationRequest + * @instance + * @returns {Object.} JSON object + */ + WaitOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WaitOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; + }; + + return WaitOperationRequest; + })(); + + longrunning.OperationInfo = (function() { + + /** + * Properties of an OperationInfo. + * @memberof google.longrunning + * @interface IOperationInfo + * @property {string|null} [responseType] OperationInfo responseType + * @property {string|null} [metadataType] OperationInfo metadataType + */ + + /** + * Constructs a new OperationInfo. + * @memberof google.longrunning + * @classdesc Represents an OperationInfo. + * @implements IOperationInfo + * @constructor + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + */ + function OperationInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationInfo responseType. + * @member {string} responseType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.responseType = ""; + + /** + * OperationInfo metadataType. + * @member {string} metadataType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.metadataType = ""; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @function create + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + * @returns {google.longrunning.OperationInfo} OperationInfo instance + */ + OperationInfo.create = function create(properties) { + return new OperationInfo(properties); + }; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encode + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); + if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); + return writer; + }; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.responseType = reader.string(); + break; + } + case 2: { + message.metadataType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationInfo message. + * @function verify + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responseType != null && message.hasOwnProperty("responseType")) + if (!$util.isString(message.responseType)) + return "responseType: string expected"; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + if (!$util.isString(message.metadataType)) + return "metadataType: string expected"; + return null; + }; + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.OperationInfo} OperationInfo + */ + OperationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.OperationInfo) + return object; + var message = new $root.google.longrunning.OperationInfo(); + if (object.responseType != null) + message.responseType = String(object.responseType); + if (object.metadataType != null) + message.metadataType = String(object.metadataType); + return message; + }; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.OperationInfo} message OperationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.responseType = ""; + object.metadataType = ""; + } + if (message.responseType != null && message.hasOwnProperty("responseType")) + object.responseType = message.responseType; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + object.metadataType = message.metadataType; + return object; + }; + + /** + * Converts this OperationInfo to JSON. + * @function toJSON + * @memberof google.longrunning.OperationInfo + * @instance + * @returns {Object.} JSON object + */ + OperationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationInfo + * @function getTypeUrl + * @memberof google.longrunning.OperationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.OperationInfo"; + }; + + return OperationInfo; + })(); + + return longrunning; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + + return Status; + })(); + + return rpc; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/protos/protos.json b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/protos/protos.json new file mode 100644 index 00000000000..e038f61e9f3 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/protos/protos.json @@ -0,0 +1,4515 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "speech": { + "nested": { + "v2": { + "options": { + "go_package": "cloud.google.com/go/speech/apiv2/speechpb;speechpb", + "java_multiple_files": true, + "java_outer_classname": "LocationsMetadataProto", + "java_package": "com.google.cloud.speech.v2", + "(google.api.resource_definition).type": "cloudkms.googleapis.com/CryptoKeyVersion", + "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}" + }, + "nested": { + "Speech": { + "options": { + "(google.api.default_host)": "speech.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateRecognizer": { + "requestType": "CreateRecognizerRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*/locations/*}/recognizers", + "(google.api.http).body": "recognizer", + "(google.api.method_signature)": "parent,recognizer,recognizer_id", + "(google.longrunning.operation_info).response_type": "Recognizer", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*/locations/*}/recognizers", + "body": "recognizer" + } + }, + { + "(google.api.method_signature)": "parent,recognizer,recognizer_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Recognizer", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListRecognizers": { + "requestType": "ListRecognizersRequest", + "responseType": "ListRecognizersResponse", + "options": { + "(google.api.http).get": "/v2/{parent=projects/*/locations/*}/recognizers", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=projects/*/locations/*}/recognizers" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetRecognizer": { + "requestType": "GetRecognizerRequest", + "responseType": "Recognizer", + "options": { + "(google.api.http).get": "/v2/{name=projects/*/locations/*/recognizers/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=projects/*/locations/*/recognizers/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateRecognizer": { + "requestType": "UpdateRecognizerRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v2/{recognizer.name=projects/*/locations/*/recognizers/*}", + "(google.api.http).body": "recognizer", + "(google.api.method_signature)": "recognizer,update_mask", + "(google.longrunning.operation_info).response_type": "Recognizer", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2/{recognizer.name=projects/*/locations/*/recognizers/*}", + "body": "recognizer" + } + }, + { + "(google.api.method_signature)": "recognizer,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Recognizer", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteRecognizer": { + "requestType": "DeleteRecognizerRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v2/{name=projects/*/locations/*/recognizers/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "Recognizer", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2/{name=projects/*/locations/*/recognizers/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Recognizer", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UndeleteRecognizer": { + "requestType": "UndeleteRecognizerRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{name=projects/*/locations/*/recognizers/*}:undelete", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "Recognizer", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{name=projects/*/locations/*/recognizers/*}:undelete", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Recognizer", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "Recognize": { + "requestType": "RecognizeRequest", + "responseType": "RecognizeResponse", + "options": { + "(google.api.http).post": "/v2/{recognizer=projects/*/locations/*/recognizers/*}:recognize", + "(google.api.http).body": "*", + "(google.api.method_signature)": "recognizer,config,config_mask,uri" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{recognizer=projects/*/locations/*/recognizers/*}:recognize", + "body": "*" + } + }, + { + "(google.api.method_signature)": "recognizer,config,config_mask,content" + }, + { + "(google.api.method_signature)": "recognizer,config,config_mask,uri" + } + ] + }, + "StreamingRecognize": { + "requestType": "StreamingRecognizeRequest", + "requestStream": true, + "responseType": "StreamingRecognizeResponse", + "responseStream": true + }, + "BatchRecognize": { + "requestType": "BatchRecognizeRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{recognizer=projects/*/locations/*/recognizers/*}:batchRecognize", + "(google.api.http).body": "*", + "(google.api.method_signature)": "recognizer,config,config_mask,files", + "(google.longrunning.operation_info).response_type": "BatchRecognizeResponse", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{recognizer=projects/*/locations/*/recognizers/*}:batchRecognize", + "body": "*" + } + }, + { + "(google.api.method_signature)": "recognizer,config,config_mask,files" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "BatchRecognizeResponse", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "GetConfig": { + "requestType": "GetConfigRequest", + "responseType": "Config", + "options": { + "(google.api.http).get": "/v2/{name=projects/*/locations/*/config}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=projects/*/locations/*/config}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateConfig": { + "requestType": "UpdateConfigRequest", + "responseType": "Config", + "options": { + "(google.api.http).patch": "/v2/{config.name=projects/*/locations/*/config}", + "(google.api.http).body": "config", + "(google.api.method_signature)": "config,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2/{config.name=projects/*/locations/*/config}", + "body": "config" + } + }, + { + "(google.api.method_signature)": "config,update_mask" + } + ] + }, + "CreateCustomClass": { + "requestType": "CreateCustomClassRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*/locations/*}/customClasses", + "(google.api.http).body": "custom_class", + "(google.api.method_signature)": "parent,custom_class,custom_class_id", + "(google.longrunning.operation_info).response_type": "CustomClass", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*/locations/*}/customClasses", + "body": "custom_class" + } + }, + { + "(google.api.method_signature)": "parent,custom_class,custom_class_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "CustomClass", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListCustomClasses": { + "requestType": "ListCustomClassesRequest", + "responseType": "ListCustomClassesResponse", + "options": { + "(google.api.http).get": "/v2/{parent=projects/*/locations/*}/customClasses", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=projects/*/locations/*}/customClasses" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetCustomClass": { + "requestType": "GetCustomClassRequest", + "responseType": "CustomClass", + "options": { + "(google.api.http).get": "/v2/{name=projects/*/locations/*/customClasses/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=projects/*/locations/*/customClasses/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateCustomClass": { + "requestType": "UpdateCustomClassRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v2/{custom_class.name=projects/*/locations/*/customClasses/*}", + "(google.api.http).body": "custom_class", + "(google.api.method_signature)": "custom_class,update_mask", + "(google.longrunning.operation_info).response_type": "CustomClass", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2/{custom_class.name=projects/*/locations/*/customClasses/*}", + "body": "custom_class" + } + }, + { + "(google.api.method_signature)": "custom_class,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "CustomClass", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteCustomClass": { + "requestType": "DeleteCustomClassRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v2/{name=projects/*/locations/*/customClasses/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "CustomClass", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2/{name=projects/*/locations/*/customClasses/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "CustomClass", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UndeleteCustomClass": { + "requestType": "UndeleteCustomClassRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{name=projects/*/locations/*/customClasses/*}:undelete", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "CustomClass", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{name=projects/*/locations/*/customClasses/*}:undelete", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "CustomClass", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "CreatePhraseSet": { + "requestType": "CreatePhraseSetRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*/locations/*}/phraseSets", + "(google.api.http).body": "phrase_set", + "(google.api.method_signature)": "parent,phrase_set,phrase_set_id", + "(google.longrunning.operation_info).response_type": "PhraseSet", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*/locations/*}/phraseSets", + "body": "phrase_set" + } + }, + { + "(google.api.method_signature)": "parent,phrase_set,phrase_set_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "PhraseSet", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListPhraseSets": { + "requestType": "ListPhraseSetsRequest", + "responseType": "ListPhraseSetsResponse", + "options": { + "(google.api.http).get": "/v2/{parent=projects/*/locations/*}/phraseSets", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=projects/*/locations/*}/phraseSets" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetPhraseSet": { + "requestType": "GetPhraseSetRequest", + "responseType": "PhraseSet", + "options": { + "(google.api.http).get": "/v2/{name=projects/*/locations/*/phraseSets/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=projects/*/locations/*/phraseSets/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdatePhraseSet": { + "requestType": "UpdatePhraseSetRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v2/{phrase_set.name=projects/*/locations/*/phraseSets/*}", + "(google.api.http).body": "phrase_set", + "(google.api.method_signature)": "phrase_set,update_mask", + "(google.longrunning.operation_info).response_type": "PhraseSet", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2/{phrase_set.name=projects/*/locations/*/phraseSets/*}", + "body": "phrase_set" + } + }, + { + "(google.api.method_signature)": "phrase_set,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "PhraseSet", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeletePhraseSet": { + "requestType": "DeletePhraseSetRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v2/{name=projects/*/locations/*/phraseSets/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "PhraseSet", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2/{name=projects/*/locations/*/phraseSets/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "PhraseSet", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UndeletePhraseSet": { + "requestType": "UndeletePhraseSetRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{name=projects/*/locations/*/phraseSets/*}:undelete", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "PhraseSet", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{name=projects/*/locations/*/phraseSets/*}:undelete", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "PhraseSet", + "metadata_type": "OperationMetadata" + } + } + ] + } + } + }, + "CreateRecognizerRequest": { + "fields": { + "recognizer": { + "type": "Recognizer", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "validateOnly": { + "type": "bool", + "id": 2 + }, + "recognizerId": { + "type": "string", + "id": 3 + }, + "parent": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "speech.googleapis.com/Recognizer" + } + } + } + }, + "OperationMetadata": { + "oneofs": { + "request": { + "oneof": [ + "batchRecognizeRequest", + "createRecognizerRequest", + "updateRecognizerRequest", + "deleteRecognizerRequest", + "undeleteRecognizerRequest", + "createCustomClassRequest", + "updateCustomClassRequest", + "deleteCustomClassRequest", + "undeleteCustomClassRequest", + "createPhraseSetRequest", + "updatePhraseSetRequest", + "deletePhraseSetRequest", + "undeletePhraseSetRequest", + "updateConfigRequest" + ] + }, + "metadata": { + "oneof": [ + "batchRecognizeMetadata" + ] + } + }, + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "resource": { + "type": "string", + "id": 3 + }, + "method": { + "type": "string", + "id": 4 + }, + "kmsKeyName": { + "type": "string", + "id": 6, + "options": { + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } + }, + "kmsKeyVersionName": { + "type": "string", + "id": 7, + "options": { + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKeyVersion" + } + }, + "batchRecognizeRequest": { + "type": "BatchRecognizeRequest", + "id": 8 + }, + "createRecognizerRequest": { + "type": "CreateRecognizerRequest", + "id": 9 + }, + "updateRecognizerRequest": { + "type": "UpdateRecognizerRequest", + "id": 10 + }, + "deleteRecognizerRequest": { + "type": "DeleteRecognizerRequest", + "id": 11 + }, + "undeleteRecognizerRequest": { + "type": "UndeleteRecognizerRequest", + "id": 12 + }, + "createCustomClassRequest": { + "type": "CreateCustomClassRequest", + "id": 13 + }, + "updateCustomClassRequest": { + "type": "UpdateCustomClassRequest", + "id": 14 + }, + "deleteCustomClassRequest": { + "type": "DeleteCustomClassRequest", + "id": 15 + }, + "undeleteCustomClassRequest": { + "type": "UndeleteCustomClassRequest", + "id": 16 + }, + "createPhraseSetRequest": { + "type": "CreatePhraseSetRequest", + "id": 17 + }, + "updatePhraseSetRequest": { + "type": "UpdatePhraseSetRequest", + "id": 18 + }, + "deletePhraseSetRequest": { + "type": "DeletePhraseSetRequest", + "id": 19 + }, + "undeletePhraseSetRequest": { + "type": "UndeletePhraseSetRequest", + "id": 20 + }, + "updateConfigRequest": { + "type": "UpdateConfigRequest", + "id": 21, + "options": { + "deprecated": true + } + }, + "progressPercent": { + "type": "int32", + "id": 22 + }, + "batchRecognizeMetadata": { + "type": "BatchRecognizeMetadata", + "id": 23 + } + } + }, + "ListRecognizersRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "showDeleted": { + "type": "bool", + "id": 4 + } + } + }, + "ListRecognizersResponse": { + "fields": { + "recognizers": { + "rule": "repeated", + "type": "Recognizer", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetRecognizerRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "speech.googleapis.com/Recognizer" + } + } + } + }, + "UpdateRecognizerRequest": { + "fields": { + "recognizer": { + "type": "Recognizer", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + }, + "validateOnly": { + "type": "bool", + "id": 4 + } + } + }, + "DeleteRecognizerRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "speech.googleapis.com/Recognizer" + } + }, + "validateOnly": { + "type": "bool", + "id": 2 + }, + "allowMissing": { + "type": "bool", + "id": 4 + }, + "etag": { + "type": "string", + "id": 3 + } + } + }, + "UndeleteRecognizerRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "speech.googleapis.com/Recognizer" + } + }, + "validateOnly": { + "type": "bool", + "id": 3 + }, + "etag": { + "type": "string", + "id": 4 + } + } + }, + "Recognizer": { + "options": { + "(google.api.resource).type": "speech.googleapis.com/Recognizer", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/recognizers/{recognizer}", + "(google.api.resource).style": "DECLARATIVE_FRIENDLY" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "uid": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "displayName": { + "type": "string", + "id": 3 + }, + "model": { + "type": "string", + "id": 4, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "languageCodes": { + "rule": "repeated", + "type": "string", + "id": 17, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "defaultRecognitionConfig": { + "type": "RecognitionConfig", + "id": 6 + }, + "annotations": { + "keyType": "string", + "type": "string", + "id": 7 + }, + "state": { + "type": "State", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deleteTime": { + "type": "google.protobuf.Timestamp", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "reconciling": { + "type": "bool", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "kmsKeyName": { + "type": "string", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } + }, + "kmsKeyVersionName": { + "type": "string", + "id": 16, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKeyVersion" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 2, + "DELETED": 4 + } + } + } + }, + "AutoDetectDecodingConfig": { + "fields": {} + }, + "ExplicitDecodingConfig": { + "fields": { + "encoding": { + "type": "AudioEncoding", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "sampleRateHertz": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "audioChannelCount": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "AudioEncoding": { + "values": { + "AUDIO_ENCODING_UNSPECIFIED": 0, + "LINEAR16": 1, + "MULAW": 2, + "ALAW": 3, + "AMR": 4, + "AMR_WB": 5, + "FLAC": 6, + "MP3": 7, + "OGG_OPUS": 8, + "WEBM_OPUS": 9, + "MP4_AAC": 10, + "M4A_AAC": 11, + "MOV_AAC": 12 + } + } + } + }, + "SpeakerDiarizationConfig": { + "fields": { + "minSpeakerCount": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "maxSpeakerCount": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "RecognitionFeatures": { + "fields": { + "profanityFilter": { + "type": "bool", + "id": 1 + }, + "enableWordTimeOffsets": { + "type": "bool", + "id": 2 + }, + "enableWordConfidence": { + "type": "bool", + "id": 3 + }, + "enableAutomaticPunctuation": { + "type": "bool", + "id": 4 + }, + "enableSpokenPunctuation": { + "type": "bool", + "id": 14 + }, + "enableSpokenEmojis": { + "type": "bool", + "id": 15 + }, + "multiChannelMode": { + "type": "MultiChannelMode", + "id": 17 + }, + "diarizationConfig": { + "type": "SpeakerDiarizationConfig", + "id": 9 + }, + "maxAlternatives": { + "type": "int32", + "id": 16 + } + }, + "nested": { + "MultiChannelMode": { + "values": { + "MULTI_CHANNEL_MODE_UNSPECIFIED": 0, + "SEPARATE_RECOGNITION_PER_CHANNEL": 1 + } + } + } + }, + "TranscriptNormalization": { + "fields": { + "entries": { + "rule": "repeated", + "type": "Entry", + "id": 1 + } + }, + "nested": { + "Entry": { + "fields": { + "search": { + "type": "string", + "id": 1 + }, + "replace": { + "type": "string", + "id": 2 + }, + "caseSensitive": { + "type": "bool", + "id": 3 + } + } + } + } + }, + "TranslationConfig": { + "fields": { + "targetLanguage": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SpeechAdaptation": { + "fields": { + "phraseSets": { + "rule": "repeated", + "type": "AdaptationPhraseSet", + "id": 1 + }, + "customClasses": { + "rule": "repeated", + "type": "CustomClass", + "id": 2 + } + }, + "nested": { + "AdaptationPhraseSet": { + "oneofs": { + "value": { + "oneof": [ + "phraseSet", + "inlinePhraseSet" + ] + } + }, + "fields": { + "phraseSet": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "speech.googleapis.com/PhraseSet" + } + }, + "inlinePhraseSet": { + "type": "PhraseSet", + "id": 2 + } + } + } + } + }, + "RecognitionConfig": { + "oneofs": { + "decodingConfig": { + "oneof": [ + "autoDecodingConfig", + "explicitDecodingConfig" + ] + } + }, + "fields": { + "autoDecodingConfig": { + "type": "AutoDetectDecodingConfig", + "id": 7 + }, + "explicitDecodingConfig": { + "type": "ExplicitDecodingConfig", + "id": 8 + }, + "model": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "languageCodes": { + "rule": "repeated", + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "features": { + "type": "RecognitionFeatures", + "id": 2 + }, + "adaptation": { + "type": "SpeechAdaptation", + "id": 6 + }, + "transcriptNormalization": { + "type": "TranscriptNormalization", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "translationConfig": { + "type": "TranslationConfig", + "id": 15, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "RecognizeRequest": { + "oneofs": { + "audioSource": { + "oneof": [ + "content", + "uri" + ] + } + }, + "fields": { + "recognizer": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "speech.googleapis.com/Recognizer" + } + }, + "config": { + "type": "RecognitionConfig", + "id": 1 + }, + "configMask": { + "type": "google.protobuf.FieldMask", + "id": 8 + }, + "content": { + "type": "bytes", + "id": 5 + }, + "uri": { + "type": "string", + "id": 6 + } + } + }, + "RecognitionResponseMetadata": { + "fields": { + "requestId": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_info).format": "UUID4" + } + }, + "totalBilledDuration": { + "type": "google.protobuf.Duration", + "id": 6 + } + } + }, + "SpeechRecognitionAlternative": { + "fields": { + "transcript": { + "type": "string", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2 + }, + "words": { + "rule": "repeated", + "type": "WordInfo", + "id": 3 + } + } + }, + "WordInfo": { + "fields": { + "startOffset": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "endOffset": { + "type": "google.protobuf.Duration", + "id": 2 + }, + "word": { + "type": "string", + "id": 3 + }, + "confidence": { + "type": "float", + "id": 4 + }, + "speakerLabel": { + "type": "string", + "id": 6 + } + } + }, + "SpeechRecognitionResult": { + "fields": { + "alternatives": { + "rule": "repeated", + "type": "SpeechRecognitionAlternative", + "id": 1 + }, + "channelTag": { + "type": "int32", + "id": 2 + }, + "resultEndOffset": { + "type": "google.protobuf.Duration", + "id": 4 + }, + "languageCode": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "RecognizeResponse": { + "fields": { + "results": { + "rule": "repeated", + "type": "SpeechRecognitionResult", + "id": 3 + }, + "metadata": { + "type": "RecognitionResponseMetadata", + "id": 2 + } + } + }, + "StreamingRecognitionFeatures": { + "fields": { + "enableVoiceActivityEvents": { + "type": "bool", + "id": 1 + }, + "interimResults": { + "type": "bool", + "id": 2 + }, + "voiceActivityTimeout": { + "type": "VoiceActivityTimeout", + "id": 3 + } + }, + "nested": { + "VoiceActivityTimeout": { + "fields": { + "speechStartTimeout": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "speechEndTimeout": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + } + } + }, + "StreamingRecognitionConfig": { + "fields": { + "config": { + "type": "RecognitionConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "configMask": { + "type": "google.protobuf.FieldMask", + "id": 3 + }, + "streamingFeatures": { + "type": "StreamingRecognitionFeatures", + "id": 2 + } + } + }, + "StreamingRecognizeRequest": { + "oneofs": { + "streamingRequest": { + "oneof": [ + "streamingConfig", + "audio" + ] + } + }, + "fields": { + "recognizer": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "speech.googleapis.com/Recognizer" + } + }, + "streamingConfig": { + "type": "StreamingRecognitionConfig", + "id": 6 + }, + "audio": { + "type": "bytes", + "id": 5 + } + } + }, + "BatchRecognizeRequest": { + "fields": { + "recognizer": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "speech.googleapis.com/Recognizer" + } + }, + "config": { + "type": "RecognitionConfig", + "id": 4 + }, + "configMask": { + "type": "google.protobuf.FieldMask", + "id": 5 + }, + "files": { + "rule": "repeated", + "type": "BatchRecognizeFileMetadata", + "id": 3 + }, + "recognitionOutputConfig": { + "type": "RecognitionOutputConfig", + "id": 6 + }, + "processingStrategy": { + "type": "ProcessingStrategy", + "id": 7 + } + }, + "nested": { + "ProcessingStrategy": { + "values": { + "PROCESSING_STRATEGY_UNSPECIFIED": 0, + "DYNAMIC_BATCHING": 1 + } + } + } + }, + "GcsOutputConfig": { + "fields": { + "uri": { + "type": "string", + "id": 1 + } + } + }, + "InlineOutputConfig": { + "fields": {} + }, + "NativeOutputFileFormatConfig": { + "fields": {} + }, + "VttOutputFileFormatConfig": { + "fields": {} + }, + "SrtOutputFileFormatConfig": { + "fields": {} + }, + "OutputFormatConfig": { + "fields": { + "native": { + "type": "NativeOutputFileFormatConfig", + "id": 1 + }, + "vtt": { + "type": "VttOutputFileFormatConfig", + "id": 2 + }, + "srt": { + "type": "SrtOutputFileFormatConfig", + "id": 3 + } + } + }, + "RecognitionOutputConfig": { + "oneofs": { + "output": { + "oneof": [ + "gcsOutputConfig", + "inlineResponseConfig" + ] + } + }, + "fields": { + "gcsOutputConfig": { + "type": "GcsOutputConfig", + "id": 1 + }, + "inlineResponseConfig": { + "type": "InlineOutputConfig", + "id": 2 + }, + "outputFormatConfig": { + "type": "OutputFormatConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "BatchRecognizeResponse": { + "fields": { + "results": { + "keyType": "string", + "type": "BatchRecognizeFileResult", + "id": 1 + }, + "totalBilledDuration": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "BatchRecognizeResults": { + "fields": { + "results": { + "rule": "repeated", + "type": "SpeechRecognitionResult", + "id": 1 + }, + "metadata": { + "type": "RecognitionResponseMetadata", + "id": 2 + } + } + }, + "CloudStorageResult": { + "fields": { + "uri": { + "type": "string", + "id": 1 + }, + "vttFormatUri": { + "type": "string", + "id": 2 + }, + "srtFormatUri": { + "type": "string", + "id": 3 + } + } + }, + "InlineResult": { + "fields": { + "transcript": { + "type": "BatchRecognizeResults", + "id": 1 + }, + "vttCaptions": { + "type": "string", + "id": 2 + }, + "srtCaptions": { + "type": "string", + "id": 3 + } + } + }, + "BatchRecognizeFileResult": { + "oneofs": { + "result": { + "oneof": [ + "cloudStorageResult", + "inlineResult" + ] + } + }, + "fields": { + "error": { + "type": "google.rpc.Status", + "id": 2 + }, + "metadata": { + "type": "RecognitionResponseMetadata", + "id": 3 + }, + "cloudStorageResult": { + "type": "CloudStorageResult", + "id": 5 + }, + "inlineResult": { + "type": "InlineResult", + "id": 6 + }, + "uri": { + "type": "string", + "id": 1, + "options": { + "deprecated": true + } + }, + "transcript": { + "type": "BatchRecognizeResults", + "id": 4, + "options": { + "deprecated": true + } + } + } + }, + "BatchRecognizeTranscriptionMetadata": { + "fields": { + "progressPercent": { + "type": "int32", + "id": 1 + }, + "error": { + "type": "google.rpc.Status", + "id": 2 + }, + "uri": { + "type": "string", + "id": 3 + } + } + }, + "BatchRecognizeMetadata": { + "fields": { + "transcriptionMetadata": { + "keyType": "string", + "type": "BatchRecognizeTranscriptionMetadata", + "id": 1 + } + } + }, + "BatchRecognizeFileMetadata": { + "oneofs": { + "audioSource": { + "oneof": [ + "uri" + ] + } + }, + "fields": { + "uri": { + "type": "string", + "id": 1 + }, + "config": { + "type": "RecognitionConfig", + "id": 4 + }, + "configMask": { + "type": "google.protobuf.FieldMask", + "id": 5 + } + } + }, + "StreamingRecognitionResult": { + "fields": { + "alternatives": { + "rule": "repeated", + "type": "SpeechRecognitionAlternative", + "id": 1 + }, + "isFinal": { + "type": "bool", + "id": 2 + }, + "stability": { + "type": "float", + "id": 3 + }, + "resultEndOffset": { + "type": "google.protobuf.Duration", + "id": 4 + }, + "channelTag": { + "type": "int32", + "id": 5 + }, + "languageCode": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "StreamingRecognizeResponse": { + "fields": { + "results": { + "rule": "repeated", + "type": "StreamingRecognitionResult", + "id": 6 + }, + "speechEventType": { + "type": "SpeechEventType", + "id": 3 + }, + "speechEventOffset": { + "type": "google.protobuf.Duration", + "id": 7 + }, + "metadata": { + "type": "RecognitionResponseMetadata", + "id": 5 + } + }, + "nested": { + "SpeechEventType": { + "values": { + "SPEECH_EVENT_TYPE_UNSPECIFIED": 0, + "END_OF_SINGLE_UTTERANCE": 1, + "SPEECH_ACTIVITY_BEGIN": 2, + "SPEECH_ACTIVITY_END": 3 + } + } + } + }, + "Config": { + "options": { + "(google.api.resource).type": "speech.googleapis.com/Config", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/config" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "kmsKeyName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "GetConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "speech.googleapis.com/Config" + } + } + } + }, + "UpdateConfigRequest": { + "fields": { + "config": { + "type": "Config", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "CustomClass": { + "options": { + "(google.api.resource).type": "speech.googleapis.com/CustomClass", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/customClasses/{custom_class}", + "(google.api.resource).style": "DECLARATIVE_FRIENDLY" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "uid": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "displayName": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "items": { + "rule": "repeated", + "type": "ClassItem", + "id": 5 + }, + "state": { + "type": "State", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deleteTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "annotations": { + "keyType": "string", + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "reconciling": { + "type": "bool", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "kmsKeyName": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } + }, + "kmsKeyVersionName": { + "type": "string", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKeyVersion" + } + } + }, + "nested": { + "ClassItem": { + "fields": { + "value": { + "type": "string", + "id": 1 + } + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 2, + "DELETED": 4 + } + } + } + }, + "PhraseSet": { + "options": { + "(google.api.resource).type": "speech.googleapis.com/PhraseSet", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/phraseSets/{phrase_set}", + "(google.api.resource).style": "DECLARATIVE_FRIENDLY" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "uid": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "phrases": { + "rule": "repeated", + "type": "Phrase", + "id": 3 + }, + "boost": { + "type": "float", + "id": 4 + }, + "displayName": { + "type": "string", + "id": 5 + }, + "state": { + "type": "State", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deleteTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "annotations": { + "keyType": "string", + "type": "string", + "id": 10 + }, + "etag": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "reconciling": { + "type": "bool", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "kmsKeyName": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } + }, + "kmsKeyVersionName": { + "type": "string", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKeyVersion" + } + } + }, + "nested": { + "Phrase": { + "fields": { + "value": { + "type": "string", + "id": 1 + }, + "boost": { + "type": "float", + "id": 2 + } + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 2, + "DELETED": 4 + } + } + } + }, + "CreateCustomClassRequest": { + "fields": { + "customClass": { + "type": "CustomClass", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "validateOnly": { + "type": "bool", + "id": 2 + }, + "customClassId": { + "type": "string", + "id": 3 + }, + "parent": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "speech.googleapis.com/CustomClass" + } + } + } + }, + "ListCustomClassesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "showDeleted": { + "type": "bool", + "id": 4 + } + } + }, + "ListCustomClassesResponse": { + "fields": { + "customClasses": { + "rule": "repeated", + "type": "CustomClass", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetCustomClassRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "speech.googleapis.com/CustomClass" + } + } + } + }, + "UpdateCustomClassRequest": { + "fields": { + "customClass": { + "type": "CustomClass", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + }, + "validateOnly": { + "type": "bool", + "id": 4 + } + } + }, + "DeleteCustomClassRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "speech.googleapis.com/CustomClass" + } + }, + "validateOnly": { + "type": "bool", + "id": 2 + }, + "allowMissing": { + "type": "bool", + "id": 4 + }, + "etag": { + "type": "string", + "id": 3 + } + } + }, + "UndeleteCustomClassRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "speech.googleapis.com/CustomClass" + } + }, + "validateOnly": { + "type": "bool", + "id": 3 + }, + "etag": { + "type": "string", + "id": 4 + } + } + }, + "CreatePhraseSetRequest": { + "fields": { + "phraseSet": { + "type": "PhraseSet", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "validateOnly": { + "type": "bool", + "id": 2 + }, + "phraseSetId": { + "type": "string", + "id": 3 + }, + "parent": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "speech.googleapis.com/PhraseSet" + } + } + } + }, + "ListPhraseSetsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "showDeleted": { + "type": "bool", + "id": 4 + } + } + }, + "ListPhraseSetsResponse": { + "fields": { + "phraseSets": { + "rule": "repeated", + "type": "PhraseSet", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetPhraseSetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "speech.googleapis.com/PhraseSet" + } + } + } + }, + "UpdatePhraseSetRequest": { + "fields": { + "phraseSet": { + "type": "PhraseSet", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + }, + "validateOnly": { + "type": "bool", + "id": 4 + } + } + }, + "DeletePhraseSetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "speech.googleapis.com/PhraseSet" + } + }, + "validateOnly": { + "type": "bool", + "id": 2 + }, + "allowMissing": { + "type": "bool", + "id": 4 + }, + "etag": { + "type": "string", + "id": 3 + } + } + }, + "UndeletePhraseSetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "speech.googleapis.com/PhraseSet" + } + }, + "validateOnly": { + "type": "bool", + "id": 3 + }, + "etag": { + "type": "string", + "id": 4 + } + } + }, + "ModelFeature": { + "fields": { + "feature": { + "type": "string", + "id": 1 + }, + "releaseState": { + "type": "string", + "id": 2 + } + } + }, + "ModelFeatures": { + "fields": { + "modelFeature": { + "rule": "repeated", + "type": "ModelFeature", + "id": 1 + } + } + }, + "ModelMetadata": { + "fields": { + "modelFeatures": { + "keyType": "string", + "type": "ModelFeatures", + "id": 1 + } + } + }, + "LanguageMetadata": { + "fields": { + "models": { + "keyType": "string", + "type": "ModelMetadata", + "id": 1 + } + } + }, + "AccessMetadata": { + "fields": { + "constraintType": { + "type": "ConstraintType", + "id": 1 + } + }, + "nested": { + "ConstraintType": { + "values": { + "CONSTRAINT_TYPE_UNSPECIFIED": 0, + "RESOURCE_LOCATIONS_ORG_POLICY_CREATE_CONSTRAINT": 1 + } + } + } + }, + "LocationsMetadata": { + "fields": { + "languages": { + "type": "LanguageMetadata", + "id": 1 + }, + "accessMetadata": { + "type": "AccessMetadata", + "id": 2 + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "ResourceProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + }, + "apiVersion": { + "type": "string", + "id": 525000001, + "extend": "google.protobuf.ServiceOptions" + }, + "CommonLanguageSettings": { + "fields": { + "referenceDocsUri": { + "type": "string", + "id": 1, + "options": { + "deprecated": true + } + }, + "destinations": { + "rule": "repeated", + "type": "ClientLibraryDestination", + "id": 2 + } + } + }, + "ClientLibrarySettings": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "launchStage": { + "type": "LaunchStage", + "id": 2 + }, + "restNumericEnums": { + "type": "bool", + "id": 3 + }, + "javaSettings": { + "type": "JavaSettings", + "id": 21 + }, + "cppSettings": { + "type": "CppSettings", + "id": 22 + }, + "phpSettings": { + "type": "PhpSettings", + "id": 23 + }, + "pythonSettings": { + "type": "PythonSettings", + "id": 24 + }, + "nodeSettings": { + "type": "NodeSettings", + "id": 25 + }, + "dotnetSettings": { + "type": "DotnetSettings", + "id": 26 + }, + "rubySettings": { + "type": "RubySettings", + "id": 27 + }, + "goSettings": { + "type": "GoSettings", + "id": 28 + } + } + }, + "Publishing": { + "fields": { + "methodSettings": { + "rule": "repeated", + "type": "MethodSettings", + "id": 2 + }, + "newIssueUri": { + "type": "string", + "id": 101 + }, + "documentationUri": { + "type": "string", + "id": 102 + }, + "apiShortName": { + "type": "string", + "id": 103 + }, + "githubLabel": { + "type": "string", + "id": 104 + }, + "codeownerGithubTeams": { + "rule": "repeated", + "type": "string", + "id": 105 + }, + "docTagPrefix": { + "type": "string", + "id": 106 + }, + "organization": { + "type": "ClientLibraryOrganization", + "id": 107 + }, + "librarySettings": { + "rule": "repeated", + "type": "ClientLibrarySettings", + "id": 109 + }, + "protoReferenceDocumentationUri": { + "type": "string", + "id": 110 + }, + "restReferenceDocumentationUri": { + "type": "string", + "id": 111 + } + } + }, + "JavaSettings": { + "fields": { + "libraryPackage": { + "type": "string", + "id": 1 + }, + "serviceClassNames": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "common": { + "type": "CommonLanguageSettings", + "id": 3 + } + } + }, + "CppSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PhpSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PythonSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "NodeSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "DotnetSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "renamedResources": { + "keyType": "string", + "type": "string", + "id": 3 + }, + "ignoredResources": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "forcedNamespaceAliases": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "handwrittenSignatures": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + }, + "RubySettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "GoSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "MethodSettings": { + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "longRunning": { + "type": "LongRunning", + "id": 2 + }, + "autoPopulatedFields": { + "rule": "repeated", + "type": "string", + "id": 3 + } + }, + "nested": { + "LongRunning": { + "fields": { + "initialPollDelay": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "pollDelayMultiplier": { + "type": "float", + "id": 2 + }, + "maxPollDelay": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "totalPollTimeout": { + "type": "google.protobuf.Duration", + "id": 4 + } + } + } + } + }, + "ClientLibraryOrganization": { + "values": { + "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, + "CLOUD": 1, + "ADS": 2, + "PHOTOS": 3, + "STREET_VIEW": 4, + "SHOPPING": 5, + "GEO": 6, + "GENERATIVE_AI": 7 + } + }, + "ClientLibraryDestination": { + "values": { + "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, + "GITHUB": 10, + "PACKAGE_MANAGER": 20 + } + }, + "LaunchStage": { + "values": { + "LAUNCH_STAGE_UNSPECIFIED": 0, + "UNIMPLEMENTED": 6, + "PRELAUNCH": 7, + "EARLY_ACCESS": 1, + "ALPHA": 2, + "BETA": 3, + "GA": 4, + "DEPRECATED": 5 + } + }, + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions", + "options": { + "packed": false + } + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5, + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7, + "IDENTIFIER": 8 + } + }, + "fieldInfo": { + "type": "google.api.FieldInfo", + "id": 291403980, + "extend": "google.protobuf.FieldOptions" + }, + "FieldInfo": { + "fields": { + "format": { + "type": "Format", + "id": 1 + } + }, + "nested": { + "Format": { + "values": { + "FORMAT_UNSPECIFIED": 0, + "UUID4": 1, + "IPV4": 2, + "IPV6": 3, + "IPV4_OR_IPV6": 4 + } + } + } + }, + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "protobuf": { + "options": { + "go_package": "google.golang.org/protobuf/types/descriptorpb", + "java_package": "com.google.protobuf", + "java_outer_classname": "DescriptorProtos", + "csharp_namespace": "Google.Protobuf.Reflection", + "objc_class_prefix": "GPB", + "cc_enable_arenas": true, + "optimize_for": "SPEED" + }, + "nested": { + "FileDescriptorSet": { + "edition": "proto2", + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "Edition": { + "edition": "proto2", + "values": { + "EDITION_UNKNOWN": 0, + "EDITION_PROTO2": 998, + "EDITION_PROTO3": 999, + "EDITION_2023": 1000, + "EDITION_2024": 1001, + "EDITION_1_TEST_ONLY": 1, + "EDITION_2_TEST_ONLY": 2, + "EDITION_99997_TEST_ONLY": 99997, + "EDITION_99998_TEST_ONLY": 99998, + "EDITION_99999_TEST_ONLY": 99999, + "EDITION_MAX": 2147483647 + } + }, + "FileDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "package": { + "type": "string", + "id": 2 + }, + "dependency": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "publicDependency": { + "rule": "repeated", + "type": "int32", + "id": 10 + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11 + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + }, + "edition": { + "type": "Edition", + "id": 14 + } + } + }, + "DescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "ExtensionRangeOptions": { + "edition": "proto2", + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + }, + "declaration": { + "rule": "repeated", + "type": "Declaration", + "id": 2, + "options": { + "retention": "RETENTION_SOURCE" + } + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "verification": { + "type": "VerificationState", + "id": 3, + "options": { + "default": "UNVERIFIED", + "retention": "RETENTION_SOURCE" + } + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "Declaration": { + "fields": { + "number": { + "type": "int32", + "id": 1 + }, + "fullName": { + "type": "string", + "id": 2 + }, + "type": { + "type": "string", + "id": 3 + }, + "reserved": { + "type": "bool", + "id": 5 + }, + "repeated": { + "type": "bool", + "id": 6 + } + }, + "reserved": [ + [ + 4, + 4 + ] + ] + }, + "VerificationState": { + "values": { + "DECLARATION": 0, + "UNVERIFIED": 1 + } + } + } + }, + "FieldDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REPEATED": 3, + "LABEL_REQUIRED": 2 + } + } + } + }, + "OneofDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputType": { + "type": "string", + "id": 2 + }, + "outputType": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "clientStreaming": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "serverStreaming": { + "type": "bool", + "id": 6, + "options": { + "default": false + } + } + } + }, + "FileOptions": { + "edition": "proto2", + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 42, + 42 + ], + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "edition": "proto2", + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 11, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 12 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "edition": "proto2", + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "debugRedact": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "retention": { + "type": "OptionRetention", + "id": 17 + }, + "targets": { + "rule": "repeated", + "type": "OptionTargetType", + "id": 19 + }, + "editionDefaults": { + "rule": "repeated", + "type": "EditionDefault", + "id": 20 + }, + "features": { + "type": "FeatureSet", + "id": 21 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 18, + 18 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + }, + "OptionRetention": { + "values": { + "RETENTION_UNKNOWN": 0, + "RETENTION_RUNTIME": 1, + "RETENTION_SOURCE": 2 + } + }, + "OptionTargetType": { + "values": { + "TARGET_TYPE_UNKNOWN": 0, + "TARGET_TYPE_FILE": 1, + "TARGET_TYPE_EXTENSION_RANGE": 2, + "TARGET_TYPE_MESSAGE": 3, + "TARGET_TYPE_FIELD": 4, + "TARGET_TYPE_ONEOF": 5, + "TARGET_TYPE_ENUM": 6, + "TARGET_TYPE_ENUM_ENTRY": 7, + "TARGET_TYPE_SERVICE": 8, + "TARGET_TYPE_METHOD": 9 + } + }, + "EditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "value": { + "type": "string", + "id": 2 + } + } + } + } + }, + "OneofOptions": { + "edition": "proto2", + "fields": { + "features": { + "type": "FeatureSet", + "id": 1 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "edition": "proto2", + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 6, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "edition": "proto2", + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "features": { + "type": "FeatureSet", + "id": 2 + }, + "debugRedact": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "edition": "proto2", + "fields": { + "features": { + "type": "FeatureSet", + "id": 34 + }, + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "edition": "proto2", + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "features": { + "type": "FeatureSet", + "id": 35 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "edition": "proto2", + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "FeatureSet": { + "edition": "proto2", + "fields": { + "fieldPresence": { + "type": "FieldPresence", + "id": 1, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_2023", + "edition_defaults.value": "EXPLICIT" + } + }, + "enumType": { + "type": "EnumType", + "id": 2, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "OPEN" + } + }, + "repeatedFieldEncoding": { + "type": "RepeatedFieldEncoding", + "id": 3, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "PACKED" + } + }, + "utf8Validation": { + "type": "Utf8Validation", + "id": 4, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "VERIFY" + } + }, + "messageEncoding": { + "type": "MessageEncoding", + "id": 5, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO2", + "edition_defaults.value": "LENGTH_PREFIXED" + } + }, + "jsonFormat": { + "type": "JsonFormat", + "id": 6, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "ALLOW" + } + } + }, + "extensions": [ + [ + 1000, + 1000 + ], + [ + 1001, + 1001 + ], + [ + 1002, + 1002 + ], + [ + 9990, + 9990 + ], + [ + 9995, + 9999 + ], + [ + 10000, + 10000 + ] + ], + "reserved": [ + [ + 999, + 999 + ] + ], + "nested": { + "FieldPresence": { + "values": { + "FIELD_PRESENCE_UNKNOWN": 0, + "EXPLICIT": 1, + "IMPLICIT": 2, + "LEGACY_REQUIRED": 3 + } + }, + "EnumType": { + "values": { + "ENUM_TYPE_UNKNOWN": 0, + "OPEN": 1, + "CLOSED": 2 + } + }, + "RepeatedFieldEncoding": { + "values": { + "REPEATED_FIELD_ENCODING_UNKNOWN": 0, + "PACKED": 1, + "EXPANDED": 2 + } + }, + "Utf8Validation": { + "values": { + "UTF8_VALIDATION_UNKNOWN": 0, + "VERIFY": 2, + "NONE": 3 + } + }, + "MessageEncoding": { + "values": { + "MESSAGE_ENCODING_UNKNOWN": 0, + "LENGTH_PREFIXED": 1, + "DELIMITED": 2 + } + }, + "JsonFormat": { + "values": { + "JSON_FORMAT_UNKNOWN": 0, + "ALLOW": 1, + "LEGACY_BEST_EFFORT": 2 + } + } + } + }, + "FeatureSetDefaults": { + "edition": "proto2", + "fields": { + "defaults": { + "rule": "repeated", + "type": "FeatureSetEditionDefault", + "id": 1 + }, + "minimumEdition": { + "type": "Edition", + "id": 4 + }, + "maximumEdition": { + "type": "Edition", + "id": 5 + } + }, + "nested": { + "FeatureSetEditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "features": { + "type": "FeatureSet", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "edition": "proto2", + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1, + "options": { + "packed": true + } + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2, + "options": { + "packed": true + } + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "edition": "proto2", + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1, + "options": { + "packed": true + } + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } + } + } + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "cloud.google.com/go/longrunning/autogen/longrunningpb;longrunningpb", + "java_multiple_files": true, + "java_outer_classname": "OperationsProto", + "java_package": "com.google.longrunning", + "php_namespace": "Google\\LongRunning" + }, + "nested": { + "operationInfo": { + "type": "google.longrunning.OperationInfo", + "id": 1049, + "extend": "google.protobuf.MethodOptions" + }, + "Operations": { + "options": { + "(google.api.default_host)": "longrunning.googleapis.com" + }, + "methods": { + "ListOperations": { + "requestType": "ListOperationsRequest", + "responseType": "ListOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{name=operations}", + "(google.api.method_signature)": "name,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations}" + } + }, + { + "(google.api.method_signature)": "name,filter" + } + ] + }, + "GetOperation": { + "requestType": "GetOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).get": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteOperation": { + "requestType": "DeleteOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CancelOperation": { + "requestType": "CancelOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=operations/**}:cancel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=operations/**}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "WaitOperation": { + "requestType": "WaitOperationRequest", + "responseType": "Operation" + } + } + }, + "Operation": { + "oneofs": { + "result": { + "oneof": [ + "error", + "response" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "metadata": { + "type": "google.protobuf.Any", + "id": 2 + }, + "done": { + "type": "bool", + "id": 3 + }, + "error": { + "type": "google.rpc.Status", + "id": 4 + }, + "response": { + "type": "google.protobuf.Any", + "id": 5 + } + } + }, + "GetOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListOperationsRequest": { + "fields": { + "name": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListOperationsResponse": { + "fields": { + "operations": { + "rule": "repeated", + "type": "Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CancelOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DeleteOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "WaitOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "OperationInfo": { + "fields": { + "responseType": { + "type": "string", + "id": 1 + }, + "metadataType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/snippet_metadata_google.cloud.speech.v2.json b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/snippet_metadata_google.cloud.speech.v2.json new file mode 100644 index 00000000000..544187db993 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/snippet_metadata_google.cloud.speech.v2.json @@ -0,0 +1,1139 @@ +{ + "clientLibrary": { + "name": "nodejs-speech", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.speech.v2", + "version": "v2" + } + ] + }, + "snippets": [ + { + "regionTag": "speech_v2_generated_Speech_CreateRecognizer_async", + "title": "Speech createRecognizer Sample", + "origin": "API_DEFINITION", + "description": " Creates a [Recognizer][google.cloud.speech.v2.Recognizer].", + "canonical": true, + "file": "speech.create_recognizer.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateRecognizer", + "fullName": "google.cloud.speech.v2.Speech.CreateRecognizer", + "async": true, + "parameters": [ + { + "name": "recognizer", + "type": ".google.cloud.speech.v2.Recognizer" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "recognizer_id", + "type": "TYPE_STRING" + }, + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v2.SpeechClient" + }, + "method": { + "shortName": "CreateRecognizer", + "fullName": "google.cloud.speech.v2.Speech.CreateRecognizer", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v2.Speech" + } + } + } + }, + { + "regionTag": "speech_v2_generated_Speech_ListRecognizers_async", + "title": "Speech listRecognizers Sample", + "origin": "API_DEFINITION", + "description": " Lists Recognizers.", + "canonical": true, + "file": "speech.list_recognizers.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListRecognizers", + "fullName": "google.cloud.speech.v2.Speech.ListRecognizers", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "show_deleted", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.speech.v2.ListRecognizersResponse", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v2.SpeechClient" + }, + "method": { + "shortName": "ListRecognizers", + "fullName": "google.cloud.speech.v2.Speech.ListRecognizers", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v2.Speech" + } + } + } + }, + { + "regionTag": "speech_v2_generated_Speech_GetRecognizer_async", + "title": "Speech getRecognizer Sample", + "origin": "API_DEFINITION", + "description": " Returns the requested [Recognizer][google.cloud.speech.v2.Recognizer]. Fails with [NOT_FOUND][google.rpc.Code.NOT_FOUND] if the requested Recognizer doesn't exist.", + "canonical": true, + "file": "speech.get_recognizer.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetRecognizer", + "fullName": "google.cloud.speech.v2.Speech.GetRecognizer", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.speech.v2.Recognizer", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v2.SpeechClient" + }, + "method": { + "shortName": "GetRecognizer", + "fullName": "google.cloud.speech.v2.Speech.GetRecognizer", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v2.Speech" + } + } + } + }, + { + "regionTag": "speech_v2_generated_Speech_UpdateRecognizer_async", + "title": "Speech updateRecognizer Sample", + "origin": "API_DEFINITION", + "description": " Updates the [Recognizer][google.cloud.speech.v2.Recognizer].", + "canonical": true, + "file": "speech.update_recognizer.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateRecognizer", + "fullName": "google.cloud.speech.v2.Speech.UpdateRecognizer", + "async": true, + "parameters": [ + { + "name": "recognizer", + "type": ".google.cloud.speech.v2.Recognizer" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v2.SpeechClient" + }, + "method": { + "shortName": "UpdateRecognizer", + "fullName": "google.cloud.speech.v2.Speech.UpdateRecognizer", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v2.Speech" + } + } + } + }, + { + "regionTag": "speech_v2_generated_Speech_DeleteRecognizer_async", + "title": "Speech deleteRecognizer Sample", + "origin": "API_DEFINITION", + "description": " Deletes the [Recognizer][google.cloud.speech.v2.Recognizer].", + "canonical": true, + "file": "speech.delete_recognizer.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteRecognizer", + "fullName": "google.cloud.speech.v2.Speech.DeleteRecognizer", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v2.SpeechClient" + }, + "method": { + "shortName": "DeleteRecognizer", + "fullName": "google.cloud.speech.v2.Speech.DeleteRecognizer", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v2.Speech" + } + } + } + }, + { + "regionTag": "speech_v2_generated_Speech_UndeleteRecognizer_async", + "title": "Speech undeleteRecognizer Sample", + "origin": "API_DEFINITION", + "description": " Undeletes the [Recognizer][google.cloud.speech.v2.Recognizer].", + "canonical": true, + "file": "speech.undelete_recognizer.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UndeleteRecognizer", + "fullName": "google.cloud.speech.v2.Speech.UndeleteRecognizer", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v2.SpeechClient" + }, + "method": { + "shortName": "UndeleteRecognizer", + "fullName": "google.cloud.speech.v2.Speech.UndeleteRecognizer", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v2.Speech" + } + } + } + }, + { + "regionTag": "speech_v2_generated_Speech_Recognize_async", + "title": "Speech recognize Sample", + "origin": "API_DEFINITION", + "description": " Performs synchronous Speech recognition: receive results after all audio has been sent and processed.", + "canonical": true, + "file": "speech.recognize.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 99, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "Recognize", + "fullName": "google.cloud.speech.v2.Speech.Recognize", + "async": true, + "parameters": [ + { + "name": "recognizer", + "type": "TYPE_STRING" + }, + { + "name": "config", + "type": ".google.cloud.speech.v2.RecognitionConfig" + }, + { + "name": "config_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "content", + "type": "TYPE_BYTES" + }, + { + "name": "uri", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.speech.v2.RecognizeResponse", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v2.SpeechClient" + }, + "method": { + "shortName": "Recognize", + "fullName": "google.cloud.speech.v2.Speech.Recognize", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v2.Speech" + } + } + } + }, + { + "regionTag": "speech_v2_generated_Speech_StreamingRecognize_async", + "title": "Speech streamingRecognize Sample", + "origin": "API_DEFINITION", + "description": " Performs bidirectional streaming speech recognition: receive results while sending audio. This method is only available via the gRPC API (not REST).", + "canonical": true, + "file": "speech.streaming_recognize.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "StreamingRecognize", + "fullName": "google.cloud.speech.v2.Speech.StreamingRecognize", + "async": true, + "parameters": [ + { + "name": "recognizer", + "type": "TYPE_STRING" + }, + { + "name": "streaming_config", + "type": ".google.cloud.speech.v2.StreamingRecognitionConfig" + }, + { + "name": "audio", + "type": "TYPE_BYTES" + } + ], + "resultType": ".google.cloud.speech.v2.StreamingRecognizeResponse", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v2.SpeechClient" + }, + "method": { + "shortName": "StreamingRecognize", + "fullName": "google.cloud.speech.v2.Speech.StreamingRecognize", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v2.Speech" + } + } + } + }, + { + "regionTag": "speech_v2_generated_Speech_BatchRecognize_async", + "title": "Speech batchRecognize Sample", + "origin": "API_DEFINITION", + "description": " Performs batch asynchronous speech recognition: send a request with N audio files and receive a long running operation that can be polled to see when the transcriptions are finished.", + "canonical": true, + "file": "speech.batch_recognize.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 95, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchRecognize", + "fullName": "google.cloud.speech.v2.Speech.BatchRecognize", + "async": true, + "parameters": [ + { + "name": "recognizer", + "type": "TYPE_STRING" + }, + { + "name": "config", + "type": ".google.cloud.speech.v2.RecognitionConfig" + }, + { + "name": "config_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "files", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "recognition_output_config", + "type": ".google.cloud.speech.v2.RecognitionOutputConfig" + }, + { + "name": "processing_strategy", + "type": ".google.cloud.speech.v2.BatchRecognizeRequest.ProcessingStrategy" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v2.SpeechClient" + }, + "method": { + "shortName": "BatchRecognize", + "fullName": "google.cloud.speech.v2.Speech.BatchRecognize", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v2.Speech" + } + } + } + }, + { + "regionTag": "speech_v2_generated_Speech_GetConfig_async", + "title": "Speech getConfig Sample", + "origin": "API_DEFINITION", + "description": " Returns the requested [Config][google.cloud.speech.v2.Config].", + "canonical": true, + "file": "speech.get_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetConfig", + "fullName": "google.cloud.speech.v2.Speech.GetConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.speech.v2.Config", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v2.SpeechClient" + }, + "method": { + "shortName": "GetConfig", + "fullName": "google.cloud.speech.v2.Speech.GetConfig", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v2.Speech" + } + } + } + }, + { + "regionTag": "speech_v2_generated_Speech_UpdateConfig_async", + "title": "Speech updateConfig Sample", + "origin": "API_DEFINITION", + "description": " Updates the [Config][google.cloud.speech.v2.Config].", + "canonical": true, + "file": "speech.update_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateConfig", + "fullName": "google.cloud.speech.v2.Speech.UpdateConfig", + "async": true, + "parameters": [ + { + "name": "config", + "type": ".google.cloud.speech.v2.Config" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.speech.v2.Config", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v2.SpeechClient" + }, + "method": { + "shortName": "UpdateConfig", + "fullName": "google.cloud.speech.v2.Speech.UpdateConfig", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v2.Speech" + } + } + } + }, + { + "regionTag": "speech_v2_generated_Speech_CreateCustomClass_async", + "title": "Speech createCustomClass Sample", + "origin": "API_DEFINITION", + "description": " Creates a [CustomClass][google.cloud.speech.v2.CustomClass].", + "canonical": true, + "file": "speech.create_custom_class.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateCustomClass", + "fullName": "google.cloud.speech.v2.Speech.CreateCustomClass", + "async": true, + "parameters": [ + { + "name": "custom_class", + "type": ".google.cloud.speech.v2.CustomClass" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "custom_class_id", + "type": "TYPE_STRING" + }, + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v2.SpeechClient" + }, + "method": { + "shortName": "CreateCustomClass", + "fullName": "google.cloud.speech.v2.Speech.CreateCustomClass", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v2.Speech" + } + } + } + }, + { + "regionTag": "speech_v2_generated_Speech_ListCustomClasses_async", + "title": "Speech listCustomClasses Sample", + "origin": "API_DEFINITION", + "description": " Lists CustomClasses.", + "canonical": true, + "file": "speech.list_custom_classes.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListCustomClasses", + "fullName": "google.cloud.speech.v2.Speech.ListCustomClasses", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "show_deleted", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.speech.v2.ListCustomClassesResponse", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v2.SpeechClient" + }, + "method": { + "shortName": "ListCustomClasses", + "fullName": "google.cloud.speech.v2.Speech.ListCustomClasses", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v2.Speech" + } + } + } + }, + { + "regionTag": "speech_v2_generated_Speech_GetCustomClass_async", + "title": "Speech getCustomClass Sample", + "origin": "API_DEFINITION", + "description": " Returns the requested [CustomClass][google.cloud.speech.v2.CustomClass].", + "canonical": true, + "file": "speech.get_custom_class.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetCustomClass", + "fullName": "google.cloud.speech.v2.Speech.GetCustomClass", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.speech.v2.CustomClass", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v2.SpeechClient" + }, + "method": { + "shortName": "GetCustomClass", + "fullName": "google.cloud.speech.v2.Speech.GetCustomClass", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v2.Speech" + } + } + } + }, + { + "regionTag": "speech_v2_generated_Speech_UpdateCustomClass_async", + "title": "Speech updateCustomClass Sample", + "origin": "API_DEFINITION", + "description": " Updates the [CustomClass][google.cloud.speech.v2.CustomClass].", + "canonical": true, + "file": "speech.update_custom_class.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateCustomClass", + "fullName": "google.cloud.speech.v2.Speech.UpdateCustomClass", + "async": true, + "parameters": [ + { + "name": "custom_class", + "type": ".google.cloud.speech.v2.CustomClass" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v2.SpeechClient" + }, + "method": { + "shortName": "UpdateCustomClass", + "fullName": "google.cloud.speech.v2.Speech.UpdateCustomClass", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v2.Speech" + } + } + } + }, + { + "regionTag": "speech_v2_generated_Speech_DeleteCustomClass_async", + "title": "Speech deleteCustomClass Sample", + "origin": "API_DEFINITION", + "description": " Deletes the [CustomClass][google.cloud.speech.v2.CustomClass].", + "canonical": true, + "file": "speech.delete_custom_class.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteCustomClass", + "fullName": "google.cloud.speech.v2.Speech.DeleteCustomClass", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v2.SpeechClient" + }, + "method": { + "shortName": "DeleteCustomClass", + "fullName": "google.cloud.speech.v2.Speech.DeleteCustomClass", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v2.Speech" + } + } + } + }, + { + "regionTag": "speech_v2_generated_Speech_UndeleteCustomClass_async", + "title": "Speech undeleteCustomClass Sample", + "origin": "API_DEFINITION", + "description": " Undeletes the [CustomClass][google.cloud.speech.v2.CustomClass].", + "canonical": true, + "file": "speech.undelete_custom_class.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UndeleteCustomClass", + "fullName": "google.cloud.speech.v2.Speech.UndeleteCustomClass", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v2.SpeechClient" + }, + "method": { + "shortName": "UndeleteCustomClass", + "fullName": "google.cloud.speech.v2.Speech.UndeleteCustomClass", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v2.Speech" + } + } + } + }, + { + "regionTag": "speech_v2_generated_Speech_CreatePhraseSet_async", + "title": "Speech createPhraseSet Sample", + "origin": "API_DEFINITION", + "description": " Creates a [PhraseSet][google.cloud.speech.v2.PhraseSet].", + "canonical": true, + "file": "speech.create_phrase_set.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreatePhraseSet", + "fullName": "google.cloud.speech.v2.Speech.CreatePhraseSet", + "async": true, + "parameters": [ + { + "name": "phrase_set", + "type": ".google.cloud.speech.v2.PhraseSet" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "phrase_set_id", + "type": "TYPE_STRING" + }, + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v2.SpeechClient" + }, + "method": { + "shortName": "CreatePhraseSet", + "fullName": "google.cloud.speech.v2.Speech.CreatePhraseSet", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v2.Speech" + } + } + } + }, + { + "regionTag": "speech_v2_generated_Speech_ListPhraseSets_async", + "title": "Speech listPhraseSets Sample", + "origin": "API_DEFINITION", + "description": " Lists PhraseSets.", + "canonical": true, + "file": "speech.list_phrase_sets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListPhraseSets", + "fullName": "google.cloud.speech.v2.Speech.ListPhraseSets", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "show_deleted", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.speech.v2.ListPhraseSetsResponse", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v2.SpeechClient" + }, + "method": { + "shortName": "ListPhraseSets", + "fullName": "google.cloud.speech.v2.Speech.ListPhraseSets", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v2.Speech" + } + } + } + }, + { + "regionTag": "speech_v2_generated_Speech_GetPhraseSet_async", + "title": "Speech getPhraseSet Sample", + "origin": "API_DEFINITION", + "description": " Returns the requested [PhraseSet][google.cloud.speech.v2.PhraseSet].", + "canonical": true, + "file": "speech.get_phrase_set.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetPhraseSet", + "fullName": "google.cloud.speech.v2.Speech.GetPhraseSet", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.speech.v2.PhraseSet", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v2.SpeechClient" + }, + "method": { + "shortName": "GetPhraseSet", + "fullName": "google.cloud.speech.v2.Speech.GetPhraseSet", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v2.Speech" + } + } + } + }, + { + "regionTag": "speech_v2_generated_Speech_UpdatePhraseSet_async", + "title": "Speech updatePhraseSet Sample", + "origin": "API_DEFINITION", + "description": " Updates the [PhraseSet][google.cloud.speech.v2.PhraseSet].", + "canonical": true, + "file": "speech.update_phrase_set.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdatePhraseSet", + "fullName": "google.cloud.speech.v2.Speech.UpdatePhraseSet", + "async": true, + "parameters": [ + { + "name": "phrase_set", + "type": ".google.cloud.speech.v2.PhraseSet" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v2.SpeechClient" + }, + "method": { + "shortName": "UpdatePhraseSet", + "fullName": "google.cloud.speech.v2.Speech.UpdatePhraseSet", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v2.Speech" + } + } + } + }, + { + "regionTag": "speech_v2_generated_Speech_DeletePhraseSet_async", + "title": "Speech deletePhraseSet Sample", + "origin": "API_DEFINITION", + "description": " Deletes the [PhraseSet][google.cloud.speech.v2.PhraseSet].", + "canonical": true, + "file": "speech.delete_phrase_set.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeletePhraseSet", + "fullName": "google.cloud.speech.v2.Speech.DeletePhraseSet", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v2.SpeechClient" + }, + "method": { + "shortName": "DeletePhraseSet", + "fullName": "google.cloud.speech.v2.Speech.DeletePhraseSet", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v2.Speech" + } + } + } + }, + { + "regionTag": "speech_v2_generated_Speech_UndeletePhraseSet_async", + "title": "Speech undeletePhraseSet Sample", + "origin": "API_DEFINITION", + "description": " Undeletes the [PhraseSet][google.cloud.speech.v2.PhraseSet].", + "canonical": true, + "file": "speech.undelete_phrase_set.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UndeletePhraseSet", + "fullName": "google.cloud.speech.v2.Speech.UndeletePhraseSet", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v2.SpeechClient" + }, + "method": { + "shortName": "UndeletePhraseSet", + "fullName": "google.cloud.speech.v2.Speech.UndeletePhraseSet", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v2.Speech" + } + } + } + } + ] +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.batch_recognize.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.batch_recognize.js new file mode 100644 index 00000000000..87de5b6f9f0 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.batch_recognize.js @@ -0,0 +1,103 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(recognizer) { + // [START speech_v2_generated_Speech_BatchRecognize_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the Recognizer to use during recognition. The + * expected format is + * `projects/{project}/locations/{location}/recognizers/{recognizer}`. The + * {recognizer} segment may be set to `_` to use an empty implicit Recognizer. + */ + // const recognizer = 'abc123' + /** + * Features and audio metadata to use for the Automatic Speech Recognition. + * This field in combination with the + * config_mask google.cloud.speech.v2.BatchRecognizeRequest.config_mask + * field can be used to override parts of the + * default_recognition_config google.cloud.speech.v2.Recognizer.default_recognition_config + * of the Recognizer resource. + */ + // const config = {} + /** + * The list of fields in + * config google.cloud.speech.v2.BatchRecognizeRequest.config that override + * the values in the + * default_recognition_config google.cloud.speech.v2.Recognizer.default_recognition_config + * of the recognizer during this recognition request. If no mask is provided, + * all given fields in + * config google.cloud.speech.v2.BatchRecognizeRequest.config override the + * values in the recognizer for this recognition request. If a mask is + * provided, only the fields listed in the mask override the config in the + * recognizer for this recognition request. If a wildcard (`*`) is provided, + * config google.cloud.speech.v2.BatchRecognizeRequest.config completely + * overrides and replaces the config in the recognizer for this recognition + * request. + */ + // const configMask = {} + /** + * Audio files with file metadata for ASR. + * The maximum number of files allowed to be specified is 15. + */ + // const files = [1,2,3,4] + /** + * Configuration options for where to output the transcripts of each file. + */ + // const recognitionOutputConfig = {} + /** + * Processing strategy to use for this request. + */ + // const processingStrategy = {} + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v2; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callBatchRecognize() { + // Construct request + const request = { + recognizer, + }; + + // Run request + const [operation] = await speechClient.batchRecognize(request); + const [response] = await operation.promise(); + console.log(response); + } + + callBatchRecognize(); + // [END speech_v2_generated_Speech_BatchRecognize_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.create_custom_class.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.create_custom_class.js new file mode 100644 index 00000000000..84e001a85df --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.create_custom_class.js @@ -0,0 +1,80 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(customClass, parent) { + // [START speech_v2_generated_Speech_CreateCustomClass_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The CustomClass to create. + */ + // const customClass = {} + /** + * If set, validate the request and preview the CustomClass, but do not + * actually create it. + */ + // const validateOnly = true + /** + * The ID to use for the CustomClass, which will become the final component of + * the CustomClass's resource name. + * This value should be 4-63 characters, and valid characters + * are /[a-z][0-9]-/. + */ + // const customClassId = 'abc123' + /** + * Required. The project and location where this CustomClass will be created. + * The expected format is `projects/{project}/locations/{location}`. + */ + // const parent = 'abc123' + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v2; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callCreateCustomClass() { + // Construct request + const request = { + customClass, + parent, + }; + + // Run request + const [operation] = await speechClient.createCustomClass(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateCustomClass(); + // [END speech_v2_generated_Speech_CreateCustomClass_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.create_phrase_set.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.create_phrase_set.js new file mode 100644 index 00000000000..17a0804080d --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.create_phrase_set.js @@ -0,0 +1,80 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(phraseSet, parent) { + // [START speech_v2_generated_Speech_CreatePhraseSet_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The PhraseSet to create. + */ + // const phraseSet = {} + /** + * If set, validate the request and preview the PhraseSet, but do not + * actually create it. + */ + // const validateOnly = true + /** + * The ID to use for the PhraseSet, which will become the final component of + * the PhraseSet's resource name. + * This value should be 4-63 characters, and valid characters + * are /[a-z][0-9]-/. + */ + // const phraseSetId = 'abc123' + /** + * Required. The project and location where this PhraseSet will be created. + * The expected format is `projects/{project}/locations/{location}`. + */ + // const parent = 'abc123' + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v2; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callCreatePhraseSet() { + // Construct request + const request = { + phraseSet, + parent, + }; + + // Run request + const [operation] = await speechClient.createPhraseSet(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreatePhraseSet(); + // [END speech_v2_generated_Speech_CreatePhraseSet_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.create_recognizer.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.create_recognizer.js new file mode 100644 index 00000000000..7f884f990fc --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.create_recognizer.js @@ -0,0 +1,80 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(recognizer, parent) { + // [START speech_v2_generated_Speech_CreateRecognizer_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The Recognizer to create. + */ + // const recognizer = {} + /** + * If set, validate the request and preview the Recognizer, but do not + * actually create it. + */ + // const validateOnly = true + /** + * The ID to use for the Recognizer, which will become the final component of + * the Recognizer's resource name. + * This value should be 4-63 characters, and valid characters + * are /[a-z][0-9]-/. + */ + // const recognizerId = 'abc123' + /** + * Required. The project and location where this Recognizer will be created. + * The expected format is `projects/{project}/locations/{location}`. + */ + // const parent = 'abc123' + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v2; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callCreateRecognizer() { + // Construct request + const request = { + recognizer, + parent, + }; + + // Run request + const [operation] = await speechClient.createRecognizer(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateRecognizer(); + // [END speech_v2_generated_Speech_CreateRecognizer_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.delete_custom_class.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.delete_custom_class.js new file mode 100644 index 00000000000..844b34da68b --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.delete_custom_class.js @@ -0,0 +1,80 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START speech_v2_generated_Speech_DeleteCustomClass_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the CustomClass to delete. + * Format: + * `projects/{project}/locations/{location}/customClasses/{custom_class}` + */ + // const name = 'abc123' + /** + * If set, validate the request and preview the deleted CustomClass, but do + * not actually delete it. + */ + // const validateOnly = true + /** + * If set to true, and the CustomClass is not found, the request will succeed + * and be a no-op (no Operation is recorded in this case). + */ + // const allowMissing = true + /** + * This checksum is computed by the server based on the value of other + * fields. This may be sent on update, undelete, and delete requests to ensure + * the client has an up-to-date value before proceeding. + */ + // const etag = 'abc123' + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v2; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callDeleteCustomClass() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await speechClient.deleteCustomClass(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteCustomClass(); + // [END speech_v2_generated_Speech_DeleteCustomClass_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.delete_phrase_set.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.delete_phrase_set.js new file mode 100644 index 00000000000..2c2ee36a4e6 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.delete_phrase_set.js @@ -0,0 +1,79 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START speech_v2_generated_Speech_DeletePhraseSet_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the PhraseSet to delete. + * Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + */ + // const name = 'abc123' + /** + * If set, validate the request and preview the deleted PhraseSet, but do not + * actually delete it. + */ + // const validateOnly = true + /** + * If set to true, and the PhraseSet is not found, the request will succeed + * and be a no-op (no Operation is recorded in this case). + */ + // const allowMissing = true + /** + * This checksum is computed by the server based on the value of other + * fields. This may be sent on update, undelete, and delete requests to ensure + * the client has an up-to-date value before proceeding. + */ + // const etag = 'abc123' + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v2; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callDeletePhraseSet() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await speechClient.deletePhraseSet(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeletePhraseSet(); + // [END speech_v2_generated_Speech_DeletePhraseSet_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.delete_recognizer.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.delete_recognizer.js new file mode 100644 index 00000000000..8f464dd40da --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.delete_recognizer.js @@ -0,0 +1,79 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START speech_v2_generated_Speech_DeleteRecognizer_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the Recognizer to delete. + * Format: `projects/{project}/locations/{location}/recognizers/{recognizer}` + */ + // const name = 'abc123' + /** + * If set, validate the request and preview the deleted Recognizer, but do not + * actually delete it. + */ + // const validateOnly = true + /** + * If set to true, and the Recognizer is not found, the request will succeed + * and be a no-op (no Operation is recorded in this case). + */ + // const allowMissing = true + /** + * This checksum is computed by the server based on the value of other + * fields. This may be sent on update, undelete, and delete requests to ensure + * the client has an up-to-date value before proceeding. + */ + // const etag = 'abc123' + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v2; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callDeleteRecognizer() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await speechClient.deleteRecognizer(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteRecognizer(); + // [END speech_v2_generated_Speech_DeleteRecognizer_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.get_config.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.get_config.js new file mode 100644 index 00000000000..028ba882112 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.get_config.js @@ -0,0 +1,63 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START speech_v2_generated_Speech_GetConfig_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the config to retrieve. There is exactly one config + * resource per project per location. The expected format is + * `projects/{project}/locations/{location}/config`. + */ + // const name = 'abc123' + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v2; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callGetConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await speechClient.getConfig(request); + console.log(response); + } + + callGetConfig(); + // [END speech_v2_generated_Speech_GetConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.get_custom_class.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.get_custom_class.js new file mode 100644 index 00000000000..2d2ac465fd7 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.get_custom_class.js @@ -0,0 +1,62 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START speech_v2_generated_Speech_GetCustomClass_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the CustomClass to retrieve. The expected format is + * `projects/{project}/locations/{location}/customClasses/{custom_class}`. + */ + // const name = 'abc123' + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v2; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callGetCustomClass() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await speechClient.getCustomClass(request); + console.log(response); + } + + callGetCustomClass(); + // [END speech_v2_generated_Speech_GetCustomClass_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.get_phrase_set.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.get_phrase_set.js new file mode 100644 index 00000000000..e41eabf977e --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.get_phrase_set.js @@ -0,0 +1,62 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START speech_v2_generated_Speech_GetPhraseSet_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the PhraseSet to retrieve. The expected format is + * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`. + */ + // const name = 'abc123' + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v2; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callGetPhraseSet() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await speechClient.getPhraseSet(request); + console.log(response); + } + + callGetPhraseSet(); + // [END speech_v2_generated_Speech_GetPhraseSet_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.get_recognizer.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.get_recognizer.js new file mode 100644 index 00000000000..3cdbd55a1df --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.get_recognizer.js @@ -0,0 +1,62 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START speech_v2_generated_Speech_GetRecognizer_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the Recognizer to retrieve. The expected format is + * `projects/{project}/locations/{location}/recognizers/{recognizer}`. + */ + // const name = 'abc123' + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v2; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callGetRecognizer() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await speechClient.getRecognizer(request); + console.log(response); + } + + callGetRecognizer(); + // [END speech_v2_generated_Speech_GetRecognizer_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.list_custom_classes.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.list_custom_classes.js new file mode 100644 index 00000000000..cfb1fec8a53 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.list_custom_classes.js @@ -0,0 +1,84 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START speech_v2_generated_Speech_ListCustomClasses_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The project and location of CustomClass resources to list. The + * expected format is `projects/{project}/locations/{location}`. + */ + // const parent = 'abc123' + /** + * Number of results per requests. A valid page_size ranges from 0 to 100 + * inclusive. If the page_size is zero or unspecified, a page size of 5 will + * be chosen. If the page size exceeds 100, it will be coerced down to 100. + * Note that a call might return fewer results than the requested page size. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous + * ListCustomClasses google.cloud.speech.v2.Speech.ListCustomClasses call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to + * ListCustomClasses google.cloud.speech.v2.Speech.ListCustomClasses must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * Whether, or not, to show resources that have been deleted. + */ + // const showDeleted = true + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v2; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callListCustomClasses() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = speechClient.listCustomClassesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListCustomClasses(); + // [END speech_v2_generated_Speech_ListCustomClasses_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.list_phrase_sets.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.list_phrase_sets.js new file mode 100644 index 00000000000..ed1f045272b --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.list_phrase_sets.js @@ -0,0 +1,83 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START speech_v2_generated_Speech_ListPhraseSets_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The project and location of PhraseSet resources to list. The + * expected format is `projects/{project}/locations/{location}`. + */ + // const parent = 'abc123' + /** + * The maximum number of PhraseSets to return. The service may return fewer + * than this value. If unspecified, at most 5 PhraseSets will be returned. + * The maximum value is 100; values above 100 will be coerced to 100. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous + * ListPhraseSets google.cloud.speech.v2.Speech.ListPhraseSets call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to + * ListPhraseSets google.cloud.speech.v2.Speech.ListPhraseSets must match + * the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * Whether, or not, to show resources that have been deleted. + */ + // const showDeleted = true + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v2; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callListPhraseSets() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = speechClient.listPhraseSetsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListPhraseSets(); + // [END speech_v2_generated_Speech_ListPhraseSets_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.list_recognizers.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.list_recognizers.js new file mode 100644 index 00000000000..84d5190c9b5 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.list_recognizers.js @@ -0,0 +1,83 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START speech_v2_generated_Speech_ListRecognizers_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The project and location of Recognizers to list. The expected + * format is `projects/{project}/locations/{location}`. + */ + // const parent = 'abc123' + /** + * The maximum number of Recognizers to return. The service may return fewer + * than this value. If unspecified, at most 5 Recognizers will be returned. + * The maximum value is 100; values above 100 will be coerced to 100. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous + * ListRecognizers google.cloud.speech.v2.Speech.ListRecognizers call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to + * ListRecognizers google.cloud.speech.v2.Speech.ListRecognizers must match + * the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * Whether, or not, to show resources that have been deleted. + */ + // const showDeleted = true + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v2; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callListRecognizers() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = speechClient.listRecognizersAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListRecognizers(); + // [END speech_v2_generated_Speech_ListRecognizers_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.recognize.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.recognize.js new file mode 100644 index 00000000000..9d85603a46d --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.recognize.js @@ -0,0 +1,107 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(recognizer) { + // [START speech_v2_generated_Speech_Recognize_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the Recognizer to use during recognition. The + * expected format is + * `projects/{project}/locations/{location}/recognizers/{recognizer}`. The + * {recognizer} segment may be set to `_` to use an empty implicit Recognizer. + */ + // const recognizer = 'abc123' + /** + * Features and audio metadata to use for the Automatic Speech Recognition. + * This field in combination with the + * config_mask google.cloud.speech.v2.RecognizeRequest.config_mask field + * can be used to override parts of the + * default_recognition_config google.cloud.speech.v2.Recognizer.default_recognition_config + * of the Recognizer resource. + */ + // const config = {} + /** + * The list of fields in + * config google.cloud.speech.v2.RecognizeRequest.config that override the + * values in the + * default_recognition_config google.cloud.speech.v2.Recognizer.default_recognition_config + * of the recognizer during this recognition request. If no mask is provided, + * all non-default valued fields in + * config google.cloud.speech.v2.RecognizeRequest.config override the + * values in the recognizer for this recognition request. If a mask is + * provided, only the fields listed in the mask override the config in the + * recognizer for this recognition request. If a wildcard (`*`) is provided, + * config google.cloud.speech.v2.RecognizeRequest.config completely + * overrides and replaces the config in the recognizer for this recognition + * request. + */ + // const configMask = {} + /** + * The audio data bytes encoded as specified in + * RecognitionConfig google.cloud.speech.v2.RecognitionConfig. As + * with all bytes fields, proto buffers use a pure binary representation, + * whereas JSON representations use base64. + */ + // const content = Buffer.from('string') + /** + * URI that points to a file that contains audio data bytes as specified in + * RecognitionConfig google.cloud.speech.v2.RecognitionConfig. The file + * must not be compressed (for example, gzip). Currently, only Google Cloud + * Storage URIs are supported, which must be specified in the following + * format: `gs://bucket_name/object_name` (other URI formats return + * INVALID_ARGUMENT google.rpc.Code.INVALID_ARGUMENT). For more + * information, see Request + * URIs (https://cloud.google.com/storage/docs/reference-uris). + */ + // const uri = 'abc123' + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v2; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callRecognize() { + // Construct request + const request = { + recognizer, + }; + + // Run request + const response = await speechClient.recognize(request); + console.log(response); + } + + callRecognize(); + // [END speech_v2_generated_Speech_Recognize_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.streaming_recognize.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.streaming_recognize.js new file mode 100644 index 00000000000..e6a9e03be29 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.streaming_recognize.js @@ -0,0 +1,79 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(recognizer) { + // [START speech_v2_generated_Speech_StreamingRecognize_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the Recognizer to use during recognition. The + * expected format is + * `projects/{project}/locations/{location}/recognizers/{recognizer}`. The + * {recognizer} segment may be set to `_` to use an empty implicit Recognizer. + */ + // const recognizer = 'abc123' + /** + * StreamingRecognitionConfig to be used in this recognition attempt. + * If provided, it will override the default RecognitionConfig stored in the + * Recognizer. + */ + // const streamingConfig = {} + /** + * Inline audio bytes to be Recognized. + * Maximum size for this field is 15 KB per request. + */ + // const audio = Buffer.from('string') + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v2; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callStreamingRecognize() { + // Construct request + const request = { + recognizer, + }; + + // Run request + const stream = await speechClient.streamingRecognize(); + stream.on('data', (response) => { console.log(response) }); + stream.on('error', (err) => { throw(err) }); + stream.on('end', () => { /* API call completed */ }); + stream.write(request); + stream.end(); + } + + callStreamingRecognize(); + // [END speech_v2_generated_Speech_StreamingRecognize_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.undelete_custom_class.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.undelete_custom_class.js new file mode 100644 index 00000000000..73a28da90fa --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.undelete_custom_class.js @@ -0,0 +1,75 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START speech_v2_generated_Speech_UndeleteCustomClass_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the CustomClass to undelete. + * Format: + * `projects/{project}/locations/{location}/customClasses/{custom_class}` + */ + // const name = 'abc123' + /** + * If set, validate the request and preview the undeleted CustomClass, but do + * not actually undelete it. + */ + // const validateOnly = true + /** + * This checksum is computed by the server based on the value of other + * fields. This may be sent on update, undelete, and delete requests to ensure + * the client has an up-to-date value before proceeding. + */ + // const etag = 'abc123' + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v2; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callUndeleteCustomClass() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await speechClient.undeleteCustomClass(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUndeleteCustomClass(); + // [END speech_v2_generated_Speech_UndeleteCustomClass_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.undelete_phrase_set.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.undelete_phrase_set.js new file mode 100644 index 00000000000..0e507ce74b4 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.undelete_phrase_set.js @@ -0,0 +1,74 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START speech_v2_generated_Speech_UndeletePhraseSet_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the PhraseSet to undelete. + * Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + */ + // const name = 'abc123' + /** + * If set, validate the request and preview the undeleted PhraseSet, but do + * not actually undelete it. + */ + // const validateOnly = true + /** + * This checksum is computed by the server based on the value of other + * fields. This may be sent on update, undelete, and delete requests to ensure + * the client has an up-to-date value before proceeding. + */ + // const etag = 'abc123' + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v2; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callUndeletePhraseSet() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await speechClient.undeletePhraseSet(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUndeletePhraseSet(); + // [END speech_v2_generated_Speech_UndeletePhraseSet_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.undelete_recognizer.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.undelete_recognizer.js new file mode 100644 index 00000000000..c52274c303b --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.undelete_recognizer.js @@ -0,0 +1,74 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START speech_v2_generated_Speech_UndeleteRecognizer_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the Recognizer to undelete. + * Format: `projects/{project}/locations/{location}/recognizers/{recognizer}` + */ + // const name = 'abc123' + /** + * If set, validate the request and preview the undeleted Recognizer, but do + * not actually undelete it. + */ + // const validateOnly = true + /** + * This checksum is computed by the server based on the value of other + * fields. This may be sent on update, undelete, and delete requests to ensure + * the client has an up-to-date value before proceeding. + */ + // const etag = 'abc123' + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v2; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callUndeleteRecognizer() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await speechClient.undeleteRecognizer(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUndeleteRecognizer(); + // [END speech_v2_generated_Speech_UndeleteRecognizer_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.update_config.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.update_config.js new file mode 100644 index 00000000000..d75dcb59281 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.update_config.js @@ -0,0 +1,67 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(config) { + // [START speech_v2_generated_Speech_UpdateConfig_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The config to update. + * The config's `name` field is used to identify the config to be updated. + * The expected format is `projects/{project}/locations/{location}/config`. + */ + // const config = {} + /** + * The list of fields to be updated. + */ + // const updateMask = {} + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v2; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callUpdateConfig() { + // Construct request + const request = { + config, + }; + + // Run request + const response = await speechClient.updateConfig(request); + console.log(response); + } + + callUpdateConfig(); + // [END speech_v2_generated_Speech_UpdateConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.update_custom_class.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.update_custom_class.js new file mode 100644 index 00000000000..8671945fa95 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.update_custom_class.js @@ -0,0 +1,75 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(customClass) { + // [START speech_v2_generated_Speech_UpdateCustomClass_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The CustomClass to update. + * The CustomClass's `name` field is used to identify the CustomClass to + * update. Format: + * `projects/{project}/locations/{location}/customClasses/{custom_class}`. + */ + // const customClass = {} + /** + * The list of fields to be updated. If empty, all fields are considered for + * update. + */ + // const updateMask = {} + /** + * If set, validate the request and preview the updated CustomClass, but do + * not actually update it. + */ + // const validateOnly = true + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v2; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callUpdateCustomClass() { + // Construct request + const request = { + customClass, + }; + + // Run request + const [operation] = await speechClient.updateCustomClass(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateCustomClass(); + // [END speech_v2_generated_Speech_UpdateCustomClass_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.update_phrase_set.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.update_phrase_set.js new file mode 100644 index 00000000000..fabf80e21b0 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.update_phrase_set.js @@ -0,0 +1,74 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(phraseSet) { + // [START speech_v2_generated_Speech_UpdatePhraseSet_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The PhraseSet to update. + * The PhraseSet's `name` field is used to identify the PhraseSet to update. + * Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}`. + */ + // const phraseSet = {} + /** + * The list of fields to update. If empty, all non-default valued fields are + * considered for update. Use `*` to update the entire PhraseSet resource. + */ + // const updateMask = {} + /** + * If set, validate the request and preview the updated PhraseSet, but do not + * actually update it. + */ + // const validateOnly = true + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v2; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callUpdatePhraseSet() { + // Construct request + const request = { + phraseSet, + }; + + // Run request + const [operation] = await speechClient.updatePhraseSet(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdatePhraseSet(); + // [END speech_v2_generated_Speech_UpdatePhraseSet_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.update_recognizer.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.update_recognizer.js new file mode 100644 index 00000000000..cd10914e834 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/samples/generated/v2/speech.update_recognizer.js @@ -0,0 +1,74 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(recognizer) { + // [START speech_v2_generated_Speech_UpdateRecognizer_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The Recognizer to update. + * The Recognizer's `name` field is used to identify the Recognizer to update. + * Format: `projects/{project}/locations/{location}/recognizers/{recognizer}`. + */ + // const recognizer = {} + /** + * The list of fields to update. If empty, all non-default valued fields are + * considered for update. Use `*` to update the entire Recognizer resource. + */ + // const updateMask = {} + /** + * If set, validate the request and preview the updated Recognizer, but do not + * actually update it. + */ + // const validateOnly = true + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v2; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callUpdateRecognizer() { + // Construct request + const request = { + recognizer, + }; + + // Run request + const [operation] = await speechClient.updateRecognizer(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateRecognizer(); + // [END speech_v2_generated_Speech_UpdateRecognizer_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/src/index.ts b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/src/index.ts new file mode 100644 index 00000000000..8fdc44b9270 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/src/index.ts @@ -0,0 +1,25 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as v2 from './v2'; +const SpeechClient = v2.SpeechClient; +type SpeechClient = v2.SpeechClient; +export {v2, SpeechClient}; +export default {v2, SpeechClient}; +import * as protos from '../protos/protos'; +export {protos} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/src/v2/gapic_metadata.json b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/src/v2/gapic_metadata.json new file mode 100644 index 00000000000..9024d779705 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/src/v2/gapic_metadata.json @@ -0,0 +1,260 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.speech.v2", + "libraryPackage": "@google-cloud/speech", + "services": { + "Speech": { + "clients": { + "grpc": { + "libraryClient": "SpeechClient", + "rpcs": { + "GetRecognizer": { + "methods": [ + "getRecognizer" + ] + }, + "Recognize": { + "methods": [ + "recognize" + ] + }, + "GetConfig": { + "methods": [ + "getConfig" + ] + }, + "UpdateConfig": { + "methods": [ + "updateConfig" + ] + }, + "GetCustomClass": { + "methods": [ + "getCustomClass" + ] + }, + "GetPhraseSet": { + "methods": [ + "getPhraseSet" + ] + }, + "StreamingRecognize": { + "methods": [ + "streamingRecognize" + ] + }, + "CreateRecognizer": { + "methods": [ + "createRecognizer" + ] + }, + "UpdateRecognizer": { + "methods": [ + "updateRecognizer" + ] + }, + "DeleteRecognizer": { + "methods": [ + "deleteRecognizer" + ] + }, + "UndeleteRecognizer": { + "methods": [ + "undeleteRecognizer" + ] + }, + "BatchRecognize": { + "methods": [ + "batchRecognize" + ] + }, + "CreateCustomClass": { + "methods": [ + "createCustomClass" + ] + }, + "UpdateCustomClass": { + "methods": [ + "updateCustomClass" + ] + }, + "DeleteCustomClass": { + "methods": [ + "deleteCustomClass" + ] + }, + "UndeleteCustomClass": { + "methods": [ + "undeleteCustomClass" + ] + }, + "CreatePhraseSet": { + "methods": [ + "createPhraseSet" + ] + }, + "UpdatePhraseSet": { + "methods": [ + "updatePhraseSet" + ] + }, + "DeletePhraseSet": { + "methods": [ + "deletePhraseSet" + ] + }, + "UndeletePhraseSet": { + "methods": [ + "undeletePhraseSet" + ] + }, + "ListRecognizers": { + "methods": [ + "listRecognizers", + "listRecognizersStream", + "listRecognizersAsync" + ] + }, + "ListCustomClasses": { + "methods": [ + "listCustomClasses", + "listCustomClassesStream", + "listCustomClassesAsync" + ] + }, + "ListPhraseSets": { + "methods": [ + "listPhraseSets", + "listPhraseSetsStream", + "listPhraseSetsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "SpeechClient", + "rpcs": { + "GetRecognizer": { + "methods": [ + "getRecognizer" + ] + }, + "Recognize": { + "methods": [ + "recognize" + ] + }, + "GetConfig": { + "methods": [ + "getConfig" + ] + }, + "UpdateConfig": { + "methods": [ + "updateConfig" + ] + }, + "GetCustomClass": { + "methods": [ + "getCustomClass" + ] + }, + "GetPhraseSet": { + "methods": [ + "getPhraseSet" + ] + }, + "CreateRecognizer": { + "methods": [ + "createRecognizer" + ] + }, + "UpdateRecognizer": { + "methods": [ + "updateRecognizer" + ] + }, + "DeleteRecognizer": { + "methods": [ + "deleteRecognizer" + ] + }, + "UndeleteRecognizer": { + "methods": [ + "undeleteRecognizer" + ] + }, + "BatchRecognize": { + "methods": [ + "batchRecognize" + ] + }, + "CreateCustomClass": { + "methods": [ + "createCustomClass" + ] + }, + "UpdateCustomClass": { + "methods": [ + "updateCustomClass" + ] + }, + "DeleteCustomClass": { + "methods": [ + "deleteCustomClass" + ] + }, + "UndeleteCustomClass": { + "methods": [ + "undeleteCustomClass" + ] + }, + "CreatePhraseSet": { + "methods": [ + "createPhraseSet" + ] + }, + "UpdatePhraseSet": { + "methods": [ + "updatePhraseSet" + ] + }, + "DeletePhraseSet": { + "methods": [ + "deletePhraseSet" + ] + }, + "UndeletePhraseSet": { + "methods": [ + "undeletePhraseSet" + ] + }, + "ListRecognizers": { + "methods": [ + "listRecognizers", + "listRecognizersStream", + "listRecognizersAsync" + ] + }, + "ListCustomClasses": { + "methods": [ + "listCustomClasses", + "listCustomClassesStream", + "listCustomClassesAsync" + ] + }, + "ListPhraseSets": { + "methods": [ + "listPhraseSets", + "listPhraseSetsStream", + "listPhraseSetsAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/src/v2/index.ts b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/src/v2/index.ts new file mode 100644 index 00000000000..99820fa04f6 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/src/v2/index.ts @@ -0,0 +1,19 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {SpeechClient} from './speech_client'; diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/src/v2/speech_client.ts b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/src/v2/speech_client.ts new file mode 100644 index 00000000000..16e9d8877ba --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/src/v2/speech_client.ts @@ -0,0 +1,4074 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, LocationsClient, LocationProtos} from 'google-gax'; +import {Transform, PassThrough} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v2/speech_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './speech_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Enables speech transcription and resource management. + * @class + * @memberof v2 + */ +export class SpeechClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('speech'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + speechStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of SpeechClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new SpeechClient({fallback: true}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof SpeechClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'speech.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + configPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/config' + ), + cryptoKeyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}' + ), + cryptoKeyVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}' + ), + customClassPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/customClasses/{custom_class}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + phraseSetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/phraseSets/{phrase_set}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + recognizerPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/recognizers/{recognizer}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listRecognizers: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'recognizers'), + listCustomClasses: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'customClasses'), + listPhraseSets: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'phraseSets') + }; + + // Some of the methods on this service provide streaming responses. + // Provide descriptors for these. + this.descriptors.stream = { + streamingRecognize: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.BIDI_STREAMING, !!opts.fallback, !!opts.gaxServerStreamingRetries) + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/v2/{name=projects/*/locations/*}',},{selector: 'google.cloud.location.Locations.ListLocations',get: '/v2/{name=projects/*}/locations',},{selector: 'google.longrunning.Operations.CancelOperation',post: '/v2/{name=projects/*/locations/*/operations/*}:cancel',body: '*',},{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v2/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v2/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v2/{name=projects/*/locations/*}/operations',}]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); + const createRecognizerResponse = protoFilesRoot.lookup( + '.google.cloud.speech.v2.Recognizer') as gax.protobuf.Type; + const createRecognizerMetadata = protoFilesRoot.lookup( + '.google.cloud.speech.v2.OperationMetadata') as gax.protobuf.Type; + const updateRecognizerResponse = protoFilesRoot.lookup( + '.google.cloud.speech.v2.Recognizer') as gax.protobuf.Type; + const updateRecognizerMetadata = protoFilesRoot.lookup( + '.google.cloud.speech.v2.OperationMetadata') as gax.protobuf.Type; + const deleteRecognizerResponse = protoFilesRoot.lookup( + '.google.cloud.speech.v2.Recognizer') as gax.protobuf.Type; + const deleteRecognizerMetadata = protoFilesRoot.lookup( + '.google.cloud.speech.v2.OperationMetadata') as gax.protobuf.Type; + const undeleteRecognizerResponse = protoFilesRoot.lookup( + '.google.cloud.speech.v2.Recognizer') as gax.protobuf.Type; + const undeleteRecognizerMetadata = protoFilesRoot.lookup( + '.google.cloud.speech.v2.OperationMetadata') as gax.protobuf.Type; + const batchRecognizeResponse = protoFilesRoot.lookup( + '.google.cloud.speech.v2.BatchRecognizeResponse') as gax.protobuf.Type; + const batchRecognizeMetadata = protoFilesRoot.lookup( + '.google.cloud.speech.v2.OperationMetadata') as gax.protobuf.Type; + const createCustomClassResponse = protoFilesRoot.lookup( + '.google.cloud.speech.v2.CustomClass') as gax.protobuf.Type; + const createCustomClassMetadata = protoFilesRoot.lookup( + '.google.cloud.speech.v2.OperationMetadata') as gax.protobuf.Type; + const updateCustomClassResponse = protoFilesRoot.lookup( + '.google.cloud.speech.v2.CustomClass') as gax.protobuf.Type; + const updateCustomClassMetadata = protoFilesRoot.lookup( + '.google.cloud.speech.v2.OperationMetadata') as gax.protobuf.Type; + const deleteCustomClassResponse = protoFilesRoot.lookup( + '.google.cloud.speech.v2.CustomClass') as gax.protobuf.Type; + const deleteCustomClassMetadata = protoFilesRoot.lookup( + '.google.cloud.speech.v2.OperationMetadata') as gax.protobuf.Type; + const undeleteCustomClassResponse = protoFilesRoot.lookup( + '.google.cloud.speech.v2.CustomClass') as gax.protobuf.Type; + const undeleteCustomClassMetadata = protoFilesRoot.lookup( + '.google.cloud.speech.v2.OperationMetadata') as gax.protobuf.Type; + const createPhraseSetResponse = protoFilesRoot.lookup( + '.google.cloud.speech.v2.PhraseSet') as gax.protobuf.Type; + const createPhraseSetMetadata = protoFilesRoot.lookup( + '.google.cloud.speech.v2.OperationMetadata') as gax.protobuf.Type; + const updatePhraseSetResponse = protoFilesRoot.lookup( + '.google.cloud.speech.v2.PhraseSet') as gax.protobuf.Type; + const updatePhraseSetMetadata = protoFilesRoot.lookup( + '.google.cloud.speech.v2.OperationMetadata') as gax.protobuf.Type; + const deletePhraseSetResponse = protoFilesRoot.lookup( + '.google.cloud.speech.v2.PhraseSet') as gax.protobuf.Type; + const deletePhraseSetMetadata = protoFilesRoot.lookup( + '.google.cloud.speech.v2.OperationMetadata') as gax.protobuf.Type; + const undeletePhraseSetResponse = protoFilesRoot.lookup( + '.google.cloud.speech.v2.PhraseSet') as gax.protobuf.Type; + const undeletePhraseSetMetadata = protoFilesRoot.lookup( + '.google.cloud.speech.v2.OperationMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + createRecognizer: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createRecognizerResponse.decode.bind(createRecognizerResponse), + createRecognizerMetadata.decode.bind(createRecognizerMetadata)), + updateRecognizer: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateRecognizerResponse.decode.bind(updateRecognizerResponse), + updateRecognizerMetadata.decode.bind(updateRecognizerMetadata)), + deleteRecognizer: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteRecognizerResponse.decode.bind(deleteRecognizerResponse), + deleteRecognizerMetadata.decode.bind(deleteRecognizerMetadata)), + undeleteRecognizer: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + undeleteRecognizerResponse.decode.bind(undeleteRecognizerResponse), + undeleteRecognizerMetadata.decode.bind(undeleteRecognizerMetadata)), + batchRecognize: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + batchRecognizeResponse.decode.bind(batchRecognizeResponse), + batchRecognizeMetadata.decode.bind(batchRecognizeMetadata)), + createCustomClass: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createCustomClassResponse.decode.bind(createCustomClassResponse), + createCustomClassMetadata.decode.bind(createCustomClassMetadata)), + updateCustomClass: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateCustomClassResponse.decode.bind(updateCustomClassResponse), + updateCustomClassMetadata.decode.bind(updateCustomClassMetadata)), + deleteCustomClass: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteCustomClassResponse.decode.bind(deleteCustomClassResponse), + deleteCustomClassMetadata.decode.bind(deleteCustomClassMetadata)), + undeleteCustomClass: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + undeleteCustomClassResponse.decode.bind(undeleteCustomClassResponse), + undeleteCustomClassMetadata.decode.bind(undeleteCustomClassMetadata)), + createPhraseSet: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createPhraseSetResponse.decode.bind(createPhraseSetResponse), + createPhraseSetMetadata.decode.bind(createPhraseSetMetadata)), + updatePhraseSet: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updatePhraseSetResponse.decode.bind(updatePhraseSetResponse), + updatePhraseSetMetadata.decode.bind(updatePhraseSetMetadata)), + deletePhraseSet: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deletePhraseSetResponse.decode.bind(deletePhraseSetResponse), + deletePhraseSetMetadata.decode.bind(deletePhraseSetMetadata)), + undeletePhraseSet: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + undeletePhraseSetResponse.decode.bind(undeletePhraseSetResponse), + undeletePhraseSetMetadata.decode.bind(undeletePhraseSetMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.speech.v2.Speech', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.speechStub) { + return this.speechStub; + } + + // Put together the "service stub" for + // google.cloud.speech.v2.Speech. + this.speechStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.speech.v2.Speech') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.speech.v2.Speech, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const speechStubMethods = + ['createRecognizer', 'listRecognizers', 'getRecognizer', 'updateRecognizer', 'deleteRecognizer', 'undeleteRecognizer', 'recognize', 'streamingRecognize', 'batchRecognize', 'getConfig', 'updateConfig', 'createCustomClass', 'listCustomClasses', 'getCustomClass', 'updateCustomClass', 'deleteCustomClass', 'undeleteCustomClass', 'createPhraseSet', 'listPhraseSets', 'getPhraseSet', 'updatePhraseSet', 'deletePhraseSet', 'undeletePhraseSet']; + for (const methodName of speechStubMethods) { + const callPromise = this.speechStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + if (methodName in this.descriptors.stream) { + const stream = new PassThrough({objectMode: true}); + setImmediate(() => { + stream.emit('error', new this._gaxModule.GoogleError('The client has already been closed.')); + }); + return stream; + } + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.stream[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.speechStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'speech.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'speech.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Returns the requested + * {@link protos.google.cloud.speech.v2.Recognizer|Recognizer}. Fails with + * {@link protos.google.rpc.Code.NOT_FOUND|NOT_FOUND} if the requested Recognizer doesn't + * exist. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Recognizer to retrieve. The expected format is + * `projects/{project}/locations/{location}/recognizers/{recognizer}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.speech.v2.Recognizer|Recognizer}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.get_recognizer.js + * region_tag:speech_v2_generated_Speech_GetRecognizer_async + */ + getRecognizer( + request?: protos.google.cloud.speech.v2.IGetRecognizerRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.speech.v2.IRecognizer, + protos.google.cloud.speech.v2.IGetRecognizerRequest|undefined, {}|undefined + ]>; + getRecognizer( + request: protos.google.cloud.speech.v2.IGetRecognizerRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.speech.v2.IRecognizer, + protos.google.cloud.speech.v2.IGetRecognizerRequest|null|undefined, + {}|null|undefined>): void; + getRecognizer( + request: protos.google.cloud.speech.v2.IGetRecognizerRequest, + callback: Callback< + protos.google.cloud.speech.v2.IRecognizer, + protos.google.cloud.speech.v2.IGetRecognizerRequest|null|undefined, + {}|null|undefined>): void; + getRecognizer( + request?: protos.google.cloud.speech.v2.IGetRecognizerRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.speech.v2.IRecognizer, + protos.google.cloud.speech.v2.IGetRecognizerRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.speech.v2.IRecognizer, + protos.google.cloud.speech.v2.IGetRecognizerRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.speech.v2.IRecognizer, + protos.google.cloud.speech.v2.IGetRecognizerRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getRecognizer request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.speech.v2.IRecognizer, + protos.google.cloud.speech.v2.IGetRecognizerRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getRecognizer response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getRecognizer(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.speech.v2.IRecognizer, + protos.google.cloud.speech.v2.IGetRecognizerRequest|undefined, + {}|undefined + ]) => { + this._log.info('getRecognizer response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Performs synchronous Speech recognition: receive results after all audio + * has been sent and processed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.recognizer + * Required. The name of the Recognizer to use during recognition. The + * expected format is + * `projects/{project}/locations/{location}/recognizers/{recognizer}`. The + * {recognizer} segment may be set to `_` to use an empty implicit Recognizer. + * @param {google.cloud.speech.v2.RecognitionConfig} request.config + * Features and audio metadata to use for the Automatic Speech Recognition. + * This field in combination with the + * {@link protos.google.cloud.speech.v2.RecognizeRequest.config_mask|config_mask} field + * can be used to override parts of the + * {@link protos.google.cloud.speech.v2.Recognizer.default_recognition_config|default_recognition_config} + * of the Recognizer resource. + * @param {google.protobuf.FieldMask} request.configMask + * The list of fields in + * {@link protos.google.cloud.speech.v2.RecognizeRequest.config|config} that override the + * values in the + * {@link protos.google.cloud.speech.v2.Recognizer.default_recognition_config|default_recognition_config} + * of the recognizer during this recognition request. If no mask is provided, + * all non-default valued fields in + * {@link protos.google.cloud.speech.v2.RecognizeRequest.config|config} override the + * values in the recognizer for this recognition request. If a mask is + * provided, only the fields listed in the mask override the config in the + * recognizer for this recognition request. If a wildcard (`*`) is provided, + * {@link protos.google.cloud.speech.v2.RecognizeRequest.config|config} completely + * overrides and replaces the config in the recognizer for this recognition + * request. + * @param {Buffer} request.content + * The audio data bytes encoded as specified in + * {@link protos.google.cloud.speech.v2.RecognitionConfig|RecognitionConfig}. As + * with all bytes fields, proto buffers use a pure binary representation, + * whereas JSON representations use base64. + * @param {string} request.uri + * URI that points to a file that contains audio data bytes as specified in + * {@link protos.google.cloud.speech.v2.RecognitionConfig|RecognitionConfig}. The file + * must not be compressed (for example, gzip). Currently, only Google Cloud + * Storage URIs are supported, which must be specified in the following + * format: `gs://bucket_name/object_name` (other URI formats return + * {@link protos.google.rpc.Code.INVALID_ARGUMENT|INVALID_ARGUMENT}). For more + * information, see [Request + * URIs](https://cloud.google.com/storage/docs/reference-uris). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.speech.v2.RecognizeResponse|RecognizeResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.recognize.js + * region_tag:speech_v2_generated_Speech_Recognize_async + */ + recognize( + request?: protos.google.cloud.speech.v2.IRecognizeRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.speech.v2.IRecognizeResponse, + protos.google.cloud.speech.v2.IRecognizeRequest|undefined, {}|undefined + ]>; + recognize( + request: protos.google.cloud.speech.v2.IRecognizeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.speech.v2.IRecognizeResponse, + protos.google.cloud.speech.v2.IRecognizeRequest|null|undefined, + {}|null|undefined>): void; + recognize( + request: protos.google.cloud.speech.v2.IRecognizeRequest, + callback: Callback< + protos.google.cloud.speech.v2.IRecognizeResponse, + protos.google.cloud.speech.v2.IRecognizeRequest|null|undefined, + {}|null|undefined>): void; + recognize( + request?: protos.google.cloud.speech.v2.IRecognizeRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.speech.v2.IRecognizeResponse, + protos.google.cloud.speech.v2.IRecognizeRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.speech.v2.IRecognizeResponse, + protos.google.cloud.speech.v2.IRecognizeRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.speech.v2.IRecognizeResponse, + protos.google.cloud.speech.v2.IRecognizeRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'recognizer': request.recognizer ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('recognize request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.speech.v2.IRecognizeResponse, + protos.google.cloud.speech.v2.IRecognizeRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('recognize response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.recognize(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.speech.v2.IRecognizeResponse, + protos.google.cloud.speech.v2.IRecognizeRequest|undefined, + {}|undefined + ]) => { + this._log.info('recognize response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Returns the requested {@link protos.google.cloud.speech.v2.Config|Config}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the config to retrieve. There is exactly one config + * resource per project per location. The expected format is + * `projects/{project}/locations/{location}/config`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.speech.v2.Config|Config}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.get_config.js + * region_tag:speech_v2_generated_Speech_GetConfig_async + */ + getConfig( + request?: protos.google.cloud.speech.v2.IGetConfigRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.speech.v2.IConfig, + protos.google.cloud.speech.v2.IGetConfigRequest|undefined, {}|undefined + ]>; + getConfig( + request: protos.google.cloud.speech.v2.IGetConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.speech.v2.IConfig, + protos.google.cloud.speech.v2.IGetConfigRequest|null|undefined, + {}|null|undefined>): void; + getConfig( + request: protos.google.cloud.speech.v2.IGetConfigRequest, + callback: Callback< + protos.google.cloud.speech.v2.IConfig, + protos.google.cloud.speech.v2.IGetConfigRequest|null|undefined, + {}|null|undefined>): void; + getConfig( + request?: protos.google.cloud.speech.v2.IGetConfigRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.speech.v2.IConfig, + protos.google.cloud.speech.v2.IGetConfigRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.speech.v2.IConfig, + protos.google.cloud.speech.v2.IGetConfigRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.speech.v2.IConfig, + protos.google.cloud.speech.v2.IGetConfigRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getConfig request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.speech.v2.IConfig, + protos.google.cloud.speech.v2.IGetConfigRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getConfig(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.speech.v2.IConfig, + protos.google.cloud.speech.v2.IGetConfigRequest|undefined, + {}|undefined + ]) => { + this._log.info('getConfig response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Updates the {@link protos.google.cloud.speech.v2.Config|Config}. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.speech.v2.Config} request.config + * Required. The config to update. + * + * The config's `name` field is used to identify the config to be updated. + * The expected format is `projects/{project}/locations/{location}/config`. + * @param {google.protobuf.FieldMask} request.updateMask + * The list of fields to be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.speech.v2.Config|Config}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.update_config.js + * region_tag:speech_v2_generated_Speech_UpdateConfig_async + */ + updateConfig( + request?: protos.google.cloud.speech.v2.IUpdateConfigRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.speech.v2.IConfig, + protos.google.cloud.speech.v2.IUpdateConfigRequest|undefined, {}|undefined + ]>; + updateConfig( + request: protos.google.cloud.speech.v2.IUpdateConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.speech.v2.IConfig, + protos.google.cloud.speech.v2.IUpdateConfigRequest|null|undefined, + {}|null|undefined>): void; + updateConfig( + request: protos.google.cloud.speech.v2.IUpdateConfigRequest, + callback: Callback< + protos.google.cloud.speech.v2.IConfig, + protos.google.cloud.speech.v2.IUpdateConfigRequest|null|undefined, + {}|null|undefined>): void; + updateConfig( + request?: protos.google.cloud.speech.v2.IUpdateConfigRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.speech.v2.IConfig, + protos.google.cloud.speech.v2.IUpdateConfigRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.speech.v2.IConfig, + protos.google.cloud.speech.v2.IUpdateConfigRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.speech.v2.IConfig, + protos.google.cloud.speech.v2.IUpdateConfigRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'config.name': request.config!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateConfig request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.speech.v2.IConfig, + protos.google.cloud.speech.v2.IUpdateConfigRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateConfig(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.speech.v2.IConfig, + protos.google.cloud.speech.v2.IUpdateConfigRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateConfig response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Returns the requested + * {@link protos.google.cloud.speech.v2.CustomClass|CustomClass}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the CustomClass to retrieve. The expected format is + * `projects/{project}/locations/{location}/customClasses/{custom_class}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.speech.v2.CustomClass|CustomClass}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.get_custom_class.js + * region_tag:speech_v2_generated_Speech_GetCustomClass_async + */ + getCustomClass( + request?: protos.google.cloud.speech.v2.IGetCustomClassRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.speech.v2.ICustomClass, + protos.google.cloud.speech.v2.IGetCustomClassRequest|undefined, {}|undefined + ]>; + getCustomClass( + request: protos.google.cloud.speech.v2.IGetCustomClassRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.speech.v2.ICustomClass, + protos.google.cloud.speech.v2.IGetCustomClassRequest|null|undefined, + {}|null|undefined>): void; + getCustomClass( + request: protos.google.cloud.speech.v2.IGetCustomClassRequest, + callback: Callback< + protos.google.cloud.speech.v2.ICustomClass, + protos.google.cloud.speech.v2.IGetCustomClassRequest|null|undefined, + {}|null|undefined>): void; + getCustomClass( + request?: protos.google.cloud.speech.v2.IGetCustomClassRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.speech.v2.ICustomClass, + protos.google.cloud.speech.v2.IGetCustomClassRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.speech.v2.ICustomClass, + protos.google.cloud.speech.v2.IGetCustomClassRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.speech.v2.ICustomClass, + protos.google.cloud.speech.v2.IGetCustomClassRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getCustomClass request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.speech.v2.ICustomClass, + protos.google.cloud.speech.v2.IGetCustomClassRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getCustomClass response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getCustomClass(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.speech.v2.ICustomClass, + protos.google.cloud.speech.v2.IGetCustomClassRequest|undefined, + {}|undefined + ]) => { + this._log.info('getCustomClass response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Returns the requested + * {@link protos.google.cloud.speech.v2.PhraseSet|PhraseSet}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the PhraseSet to retrieve. The expected format is + * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.speech.v2.PhraseSet|PhraseSet}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.get_phrase_set.js + * region_tag:speech_v2_generated_Speech_GetPhraseSet_async + */ + getPhraseSet( + request?: protos.google.cloud.speech.v2.IGetPhraseSetRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.speech.v2.IPhraseSet, + protos.google.cloud.speech.v2.IGetPhraseSetRequest|undefined, {}|undefined + ]>; + getPhraseSet( + request: protos.google.cloud.speech.v2.IGetPhraseSetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.speech.v2.IPhraseSet, + protos.google.cloud.speech.v2.IGetPhraseSetRequest|null|undefined, + {}|null|undefined>): void; + getPhraseSet( + request: protos.google.cloud.speech.v2.IGetPhraseSetRequest, + callback: Callback< + protos.google.cloud.speech.v2.IPhraseSet, + protos.google.cloud.speech.v2.IGetPhraseSetRequest|null|undefined, + {}|null|undefined>): void; + getPhraseSet( + request?: protos.google.cloud.speech.v2.IGetPhraseSetRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.speech.v2.IPhraseSet, + protos.google.cloud.speech.v2.IGetPhraseSetRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.speech.v2.IPhraseSet, + protos.google.cloud.speech.v2.IGetPhraseSetRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.speech.v2.IPhraseSet, + protos.google.cloud.speech.v2.IGetPhraseSetRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getPhraseSet request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.speech.v2.IPhraseSet, + protos.google.cloud.speech.v2.IGetPhraseSetRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getPhraseSet response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getPhraseSet(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.speech.v2.IPhraseSet, + protos.google.cloud.speech.v2.IGetPhraseSetRequest|undefined, + {}|undefined + ]) => { + this._log.info('getPhraseSet response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } + +/** + * Performs bidirectional streaming speech recognition: receive results while + * sending audio. This method is only available via the gRPC API (not REST). + * + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which is both readable and writable. It accepts objects + * representing {@link protos.google.cloud.speech.v2.StreamingRecognizeRequest|StreamingRecognizeRequest} for write() method, and + * will emit objects representing {@link protos.google.cloud.speech.v2.StreamingRecognizeResponse|StreamingRecognizeResponse} on 'data' event asynchronously. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#bi-directional-streaming | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.streaming_recognize.js + * region_tag:speech_v2_generated_Speech_StreamingRecognize_async + */ + streamingRecognize( + options?: CallOptions): + gax.CancellableStream { + this.initialize().catch(err => {throw err}); + this._log.info('streamingRecognize stream %j', options); + return this.innerApiCalls.streamingRecognize(null, options); + } + +/** + * Creates a {@link protos.google.cloud.speech.v2.Recognizer|Recognizer}. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.speech.v2.Recognizer} request.recognizer + * Required. The Recognizer to create. + * @param {boolean} request.validateOnly + * If set, validate the request and preview the Recognizer, but do not + * actually create it. + * @param {string} request.recognizerId + * The ID to use for the Recognizer, which will become the final component of + * the Recognizer's resource name. + * + * This value should be 4-63 characters, and valid characters + * are /{@link protos.0-9|a-z}-/. + * @param {string} request.parent + * Required. The project and location where this Recognizer will be created. + * The expected format is `projects/{project}/locations/{location}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.create_recognizer.js + * region_tag:speech_v2_generated_Speech_CreateRecognizer_async + */ + createRecognizer( + request?: protos.google.cloud.speech.v2.ICreateRecognizerRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createRecognizer( + request: protos.google.cloud.speech.v2.ICreateRecognizerRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createRecognizer( + request: protos.google.cloud.speech.v2.ICreateRecognizerRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createRecognizer( + request?: protos.google.cloud.speech.v2.ICreateRecognizerRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createRecognizer response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createRecognizer request %j', request); + return this.innerApiCalls.createRecognizer(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createRecognizer response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `createRecognizer()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.create_recognizer.js + * region_tag:speech_v2_generated_Speech_CreateRecognizer_async + */ + async checkCreateRecognizerProgress(name: string): Promise>{ + this._log.info('createRecognizer long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createRecognizer, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates the {@link protos.google.cloud.speech.v2.Recognizer|Recognizer}. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.speech.v2.Recognizer} request.recognizer + * Required. The Recognizer to update. + * + * The Recognizer's `name` field is used to identify the Recognizer to update. + * Format: `projects/{project}/locations/{location}/recognizers/{recognizer}`. + * @param {google.protobuf.FieldMask} request.updateMask + * The list of fields to update. If empty, all non-default valued fields are + * considered for update. Use `*` to update the entire Recognizer resource. + * @param {boolean} request.validateOnly + * If set, validate the request and preview the updated Recognizer, but do not + * actually update it. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.update_recognizer.js + * region_tag:speech_v2_generated_Speech_UpdateRecognizer_async + */ + updateRecognizer( + request?: protos.google.cloud.speech.v2.IUpdateRecognizerRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateRecognizer( + request: protos.google.cloud.speech.v2.IUpdateRecognizerRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateRecognizer( + request: protos.google.cloud.speech.v2.IUpdateRecognizerRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateRecognizer( + request?: protos.google.cloud.speech.v2.IUpdateRecognizerRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'recognizer.name': request.recognizer!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateRecognizer response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateRecognizer request %j', request); + return this.innerApiCalls.updateRecognizer(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('updateRecognizer response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `updateRecognizer()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.update_recognizer.js + * region_tag:speech_v2_generated_Speech_UpdateRecognizer_async + */ + async checkUpdateRecognizerProgress(name: string): Promise>{ + this._log.info('updateRecognizer long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateRecognizer, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes the {@link protos.google.cloud.speech.v2.Recognizer|Recognizer}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Recognizer to delete. + * Format: `projects/{project}/locations/{location}/recognizers/{recognizer}` + * @param {boolean} request.validateOnly + * If set, validate the request and preview the deleted Recognizer, but do not + * actually delete it. + * @param {boolean} request.allowMissing + * If set to true, and the Recognizer is not found, the request will succeed + * and be a no-op (no Operation is recorded in this case). + * @param {string} request.etag + * This checksum is computed by the server based on the value of other + * fields. This may be sent on update, undelete, and delete requests to ensure + * the client has an up-to-date value before proceeding. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.delete_recognizer.js + * region_tag:speech_v2_generated_Speech_DeleteRecognizer_async + */ + deleteRecognizer( + request?: protos.google.cloud.speech.v2.IDeleteRecognizerRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteRecognizer( + request: protos.google.cloud.speech.v2.IDeleteRecognizerRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteRecognizer( + request: protos.google.cloud.speech.v2.IDeleteRecognizerRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteRecognizer( + request?: protos.google.cloud.speech.v2.IDeleteRecognizerRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteRecognizer response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteRecognizer request %j', request); + return this.innerApiCalls.deleteRecognizer(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deleteRecognizer response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `deleteRecognizer()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.delete_recognizer.js + * region_tag:speech_v2_generated_Speech_DeleteRecognizer_async + */ + async checkDeleteRecognizerProgress(name: string): Promise>{ + this._log.info('deleteRecognizer long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteRecognizer, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Undeletes the {@link protos.google.cloud.speech.v2.Recognizer|Recognizer}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Recognizer to undelete. + * Format: `projects/{project}/locations/{location}/recognizers/{recognizer}` + * @param {boolean} request.validateOnly + * If set, validate the request and preview the undeleted Recognizer, but do + * not actually undelete it. + * @param {string} request.etag + * This checksum is computed by the server based on the value of other + * fields. This may be sent on update, undelete, and delete requests to ensure + * the client has an up-to-date value before proceeding. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.undelete_recognizer.js + * region_tag:speech_v2_generated_Speech_UndeleteRecognizer_async + */ + undeleteRecognizer( + request?: protos.google.cloud.speech.v2.IUndeleteRecognizerRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + undeleteRecognizer( + request: protos.google.cloud.speech.v2.IUndeleteRecognizerRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + undeleteRecognizer( + request: protos.google.cloud.speech.v2.IUndeleteRecognizerRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + undeleteRecognizer( + request?: protos.google.cloud.speech.v2.IUndeleteRecognizerRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('undeleteRecognizer response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('undeleteRecognizer request %j', request); + return this.innerApiCalls.undeleteRecognizer(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('undeleteRecognizer response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `undeleteRecognizer()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.undelete_recognizer.js + * region_tag:speech_v2_generated_Speech_UndeleteRecognizer_async + */ + async checkUndeleteRecognizerProgress(name: string): Promise>{ + this._log.info('undeleteRecognizer long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.undeleteRecognizer, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Performs batch asynchronous speech recognition: send a request with N + * audio files and receive a long running operation that can be polled to see + * when the transcriptions are finished. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.recognizer + * Required. The name of the Recognizer to use during recognition. The + * expected format is + * `projects/{project}/locations/{location}/recognizers/{recognizer}`. The + * {recognizer} segment may be set to `_` to use an empty implicit Recognizer. + * @param {google.cloud.speech.v2.RecognitionConfig} request.config + * Features and audio metadata to use for the Automatic Speech Recognition. + * This field in combination with the + * {@link protos.google.cloud.speech.v2.BatchRecognizeRequest.config_mask|config_mask} + * field can be used to override parts of the + * {@link protos.google.cloud.speech.v2.Recognizer.default_recognition_config|default_recognition_config} + * of the Recognizer resource. + * @param {google.protobuf.FieldMask} request.configMask + * The list of fields in + * {@link protos.google.cloud.speech.v2.BatchRecognizeRequest.config|config} that override + * the values in the + * {@link protos.google.cloud.speech.v2.Recognizer.default_recognition_config|default_recognition_config} + * of the recognizer during this recognition request. If no mask is provided, + * all given fields in + * {@link protos.google.cloud.speech.v2.BatchRecognizeRequest.config|config} override the + * values in the recognizer for this recognition request. If a mask is + * provided, only the fields listed in the mask override the config in the + * recognizer for this recognition request. If a wildcard (`*`) is provided, + * {@link protos.google.cloud.speech.v2.BatchRecognizeRequest.config|config} completely + * overrides and replaces the config in the recognizer for this recognition + * request. + * @param {number[]} request.files + * Audio files with file metadata for ASR. + * The maximum number of files allowed to be specified is 15. + * @param {google.cloud.speech.v2.RecognitionOutputConfig} request.recognitionOutputConfig + * Configuration options for where to output the transcripts of each file. + * @param {google.cloud.speech.v2.BatchRecognizeRequest.ProcessingStrategy} request.processingStrategy + * Processing strategy to use for this request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.batch_recognize.js + * region_tag:speech_v2_generated_Speech_BatchRecognize_async + */ + batchRecognize( + request?: protos.google.cloud.speech.v2.IBatchRecognizeRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + batchRecognize( + request: protos.google.cloud.speech.v2.IBatchRecognizeRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + batchRecognize( + request: protos.google.cloud.speech.v2.IBatchRecognizeRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + batchRecognize( + request?: protos.google.cloud.speech.v2.IBatchRecognizeRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'recognizer': request.recognizer ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('batchRecognize response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('batchRecognize request %j', request); + return this.innerApiCalls.batchRecognize(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('batchRecognize response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `batchRecognize()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.batch_recognize.js + * region_tag:speech_v2_generated_Speech_BatchRecognize_async + */ + async checkBatchRecognizeProgress(name: string): Promise>{ + this._log.info('batchRecognize long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.batchRecognize, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Creates a {@link protos.google.cloud.speech.v2.CustomClass|CustomClass}. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.speech.v2.CustomClass} request.customClass + * Required. The CustomClass to create. + * @param {boolean} request.validateOnly + * If set, validate the request and preview the CustomClass, but do not + * actually create it. + * @param {string} request.customClassId + * The ID to use for the CustomClass, which will become the final component of + * the CustomClass's resource name. + * + * This value should be 4-63 characters, and valid characters + * are /{@link protos.0-9|a-z}-/. + * @param {string} request.parent + * Required. The project and location where this CustomClass will be created. + * The expected format is `projects/{project}/locations/{location}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.create_custom_class.js + * region_tag:speech_v2_generated_Speech_CreateCustomClass_async + */ + createCustomClass( + request?: protos.google.cloud.speech.v2.ICreateCustomClassRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createCustomClass( + request: protos.google.cloud.speech.v2.ICreateCustomClassRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createCustomClass( + request: protos.google.cloud.speech.v2.ICreateCustomClassRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createCustomClass( + request?: protos.google.cloud.speech.v2.ICreateCustomClassRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createCustomClass response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createCustomClass request %j', request); + return this.innerApiCalls.createCustomClass(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createCustomClass response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `createCustomClass()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.create_custom_class.js + * region_tag:speech_v2_generated_Speech_CreateCustomClass_async + */ + async checkCreateCustomClassProgress(name: string): Promise>{ + this._log.info('createCustomClass long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createCustomClass, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates the {@link protos.google.cloud.speech.v2.CustomClass|CustomClass}. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.speech.v2.CustomClass} request.customClass + * Required. The CustomClass to update. + * + * The CustomClass's `name` field is used to identify the CustomClass to + * update. Format: + * `projects/{project}/locations/{location}/customClasses/{custom_class}`. + * @param {google.protobuf.FieldMask} request.updateMask + * The list of fields to be updated. If empty, all fields are considered for + * update. + * @param {boolean} request.validateOnly + * If set, validate the request and preview the updated CustomClass, but do + * not actually update it. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.update_custom_class.js + * region_tag:speech_v2_generated_Speech_UpdateCustomClass_async + */ + updateCustomClass( + request?: protos.google.cloud.speech.v2.IUpdateCustomClassRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateCustomClass( + request: protos.google.cloud.speech.v2.IUpdateCustomClassRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateCustomClass( + request: protos.google.cloud.speech.v2.IUpdateCustomClassRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateCustomClass( + request?: protos.google.cloud.speech.v2.IUpdateCustomClassRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'custom_class.name': request.customClass!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateCustomClass response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateCustomClass request %j', request); + return this.innerApiCalls.updateCustomClass(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('updateCustomClass response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `updateCustomClass()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.update_custom_class.js + * region_tag:speech_v2_generated_Speech_UpdateCustomClass_async + */ + async checkUpdateCustomClassProgress(name: string): Promise>{ + this._log.info('updateCustomClass long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateCustomClass, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes the {@link protos.google.cloud.speech.v2.CustomClass|CustomClass}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the CustomClass to delete. + * Format: + * `projects/{project}/locations/{location}/customClasses/{custom_class}` + * @param {boolean} request.validateOnly + * If set, validate the request and preview the deleted CustomClass, but do + * not actually delete it. + * @param {boolean} request.allowMissing + * If set to true, and the CustomClass is not found, the request will succeed + * and be a no-op (no Operation is recorded in this case). + * @param {string} request.etag + * This checksum is computed by the server based on the value of other + * fields. This may be sent on update, undelete, and delete requests to ensure + * the client has an up-to-date value before proceeding. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.delete_custom_class.js + * region_tag:speech_v2_generated_Speech_DeleteCustomClass_async + */ + deleteCustomClass( + request?: protos.google.cloud.speech.v2.IDeleteCustomClassRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteCustomClass( + request: protos.google.cloud.speech.v2.IDeleteCustomClassRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteCustomClass( + request: protos.google.cloud.speech.v2.IDeleteCustomClassRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteCustomClass( + request?: protos.google.cloud.speech.v2.IDeleteCustomClassRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteCustomClass response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteCustomClass request %j', request); + return this.innerApiCalls.deleteCustomClass(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deleteCustomClass response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `deleteCustomClass()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.delete_custom_class.js + * region_tag:speech_v2_generated_Speech_DeleteCustomClass_async + */ + async checkDeleteCustomClassProgress(name: string): Promise>{ + this._log.info('deleteCustomClass long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteCustomClass, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Undeletes the {@link protos.google.cloud.speech.v2.CustomClass|CustomClass}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the CustomClass to undelete. + * Format: + * `projects/{project}/locations/{location}/customClasses/{custom_class}` + * @param {boolean} request.validateOnly + * If set, validate the request and preview the undeleted CustomClass, but do + * not actually undelete it. + * @param {string} request.etag + * This checksum is computed by the server based on the value of other + * fields. This may be sent on update, undelete, and delete requests to ensure + * the client has an up-to-date value before proceeding. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.undelete_custom_class.js + * region_tag:speech_v2_generated_Speech_UndeleteCustomClass_async + */ + undeleteCustomClass( + request?: protos.google.cloud.speech.v2.IUndeleteCustomClassRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + undeleteCustomClass( + request: protos.google.cloud.speech.v2.IUndeleteCustomClassRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + undeleteCustomClass( + request: protos.google.cloud.speech.v2.IUndeleteCustomClassRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + undeleteCustomClass( + request?: protos.google.cloud.speech.v2.IUndeleteCustomClassRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('undeleteCustomClass response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('undeleteCustomClass request %j', request); + return this.innerApiCalls.undeleteCustomClass(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('undeleteCustomClass response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `undeleteCustomClass()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.undelete_custom_class.js + * region_tag:speech_v2_generated_Speech_UndeleteCustomClass_async + */ + async checkUndeleteCustomClassProgress(name: string): Promise>{ + this._log.info('undeleteCustomClass long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.undeleteCustomClass, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Creates a {@link protos.google.cloud.speech.v2.PhraseSet|PhraseSet}. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.speech.v2.PhraseSet} request.phraseSet + * Required. The PhraseSet to create. + * @param {boolean} request.validateOnly + * If set, validate the request and preview the PhraseSet, but do not + * actually create it. + * @param {string} request.phraseSetId + * The ID to use for the PhraseSet, which will become the final component of + * the PhraseSet's resource name. + * + * This value should be 4-63 characters, and valid characters + * are /{@link protos.0-9|a-z}-/. + * @param {string} request.parent + * Required. The project and location where this PhraseSet will be created. + * The expected format is `projects/{project}/locations/{location}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.create_phrase_set.js + * region_tag:speech_v2_generated_Speech_CreatePhraseSet_async + */ + createPhraseSet( + request?: protos.google.cloud.speech.v2.ICreatePhraseSetRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createPhraseSet( + request: protos.google.cloud.speech.v2.ICreatePhraseSetRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createPhraseSet( + request: protos.google.cloud.speech.v2.ICreatePhraseSetRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createPhraseSet( + request?: protos.google.cloud.speech.v2.ICreatePhraseSetRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createPhraseSet response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createPhraseSet request %j', request); + return this.innerApiCalls.createPhraseSet(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createPhraseSet response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `createPhraseSet()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.create_phrase_set.js + * region_tag:speech_v2_generated_Speech_CreatePhraseSet_async + */ + async checkCreatePhraseSetProgress(name: string): Promise>{ + this._log.info('createPhraseSet long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createPhraseSet, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates the {@link protos.google.cloud.speech.v2.PhraseSet|PhraseSet}. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.speech.v2.PhraseSet} request.phraseSet + * Required. The PhraseSet to update. + * + * The PhraseSet's `name` field is used to identify the PhraseSet to update. + * Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}`. + * @param {google.protobuf.FieldMask} request.updateMask + * The list of fields to update. If empty, all non-default valued fields are + * considered for update. Use `*` to update the entire PhraseSet resource. + * @param {boolean} request.validateOnly + * If set, validate the request and preview the updated PhraseSet, but do not + * actually update it. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.update_phrase_set.js + * region_tag:speech_v2_generated_Speech_UpdatePhraseSet_async + */ + updatePhraseSet( + request?: protos.google.cloud.speech.v2.IUpdatePhraseSetRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updatePhraseSet( + request: protos.google.cloud.speech.v2.IUpdatePhraseSetRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updatePhraseSet( + request: protos.google.cloud.speech.v2.IUpdatePhraseSetRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updatePhraseSet( + request?: protos.google.cloud.speech.v2.IUpdatePhraseSetRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'phrase_set.name': request.phraseSet!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updatePhraseSet response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updatePhraseSet request %j', request); + return this.innerApiCalls.updatePhraseSet(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('updatePhraseSet response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `updatePhraseSet()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.update_phrase_set.js + * region_tag:speech_v2_generated_Speech_UpdatePhraseSet_async + */ + async checkUpdatePhraseSetProgress(name: string): Promise>{ + this._log.info('updatePhraseSet long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updatePhraseSet, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes the {@link protos.google.cloud.speech.v2.PhraseSet|PhraseSet}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the PhraseSet to delete. + * Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + * @param {boolean} request.validateOnly + * If set, validate the request and preview the deleted PhraseSet, but do not + * actually delete it. + * @param {boolean} request.allowMissing + * If set to true, and the PhraseSet is not found, the request will succeed + * and be a no-op (no Operation is recorded in this case). + * @param {string} request.etag + * This checksum is computed by the server based on the value of other + * fields. This may be sent on update, undelete, and delete requests to ensure + * the client has an up-to-date value before proceeding. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.delete_phrase_set.js + * region_tag:speech_v2_generated_Speech_DeletePhraseSet_async + */ + deletePhraseSet( + request?: protos.google.cloud.speech.v2.IDeletePhraseSetRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deletePhraseSet( + request: protos.google.cloud.speech.v2.IDeletePhraseSetRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deletePhraseSet( + request: protos.google.cloud.speech.v2.IDeletePhraseSetRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deletePhraseSet( + request?: protos.google.cloud.speech.v2.IDeletePhraseSetRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deletePhraseSet response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deletePhraseSet request %j', request); + return this.innerApiCalls.deletePhraseSet(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deletePhraseSet response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `deletePhraseSet()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.delete_phrase_set.js + * region_tag:speech_v2_generated_Speech_DeletePhraseSet_async + */ + async checkDeletePhraseSetProgress(name: string): Promise>{ + this._log.info('deletePhraseSet long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deletePhraseSet, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Undeletes the {@link protos.google.cloud.speech.v2.PhraseSet|PhraseSet}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the PhraseSet to undelete. + * Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + * @param {boolean} request.validateOnly + * If set, validate the request and preview the undeleted PhraseSet, but do + * not actually undelete it. + * @param {string} request.etag + * This checksum is computed by the server based on the value of other + * fields. This may be sent on update, undelete, and delete requests to ensure + * the client has an up-to-date value before proceeding. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.undelete_phrase_set.js + * region_tag:speech_v2_generated_Speech_UndeletePhraseSet_async + */ + undeletePhraseSet( + request?: protos.google.cloud.speech.v2.IUndeletePhraseSetRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + undeletePhraseSet( + request: protos.google.cloud.speech.v2.IUndeletePhraseSetRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + undeletePhraseSet( + request: protos.google.cloud.speech.v2.IUndeletePhraseSetRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + undeletePhraseSet( + request?: protos.google.cloud.speech.v2.IUndeletePhraseSetRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('undeletePhraseSet response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('undeletePhraseSet request %j', request); + return this.innerApiCalls.undeletePhraseSet(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('undeletePhraseSet response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `undeletePhraseSet()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.undelete_phrase_set.js + * region_tag:speech_v2_generated_Speech_UndeletePhraseSet_async + */ + async checkUndeletePhraseSetProgress(name: string): Promise>{ + this._log.info('undeletePhraseSet long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.undeletePhraseSet, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists Recognizers. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location of Recognizers to list. The expected + * format is `projects/{project}/locations/{location}`. + * @param {number} request.pageSize + * The maximum number of Recognizers to return. The service may return fewer + * than this value. If unspecified, at most 5 Recognizers will be returned. + * The maximum value is 100; values above 100 will be coerced to 100. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link protos.google.cloud.speech.v2.Speech.ListRecognizers|ListRecognizers} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link protos.google.cloud.speech.v2.Speech.ListRecognizers|ListRecognizers} must match + * the call that provided the page token. + * @param {boolean} request.showDeleted + * Whether, or not, to show resources that have been deleted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.speech.v2.Recognizer|Recognizer}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listRecognizersAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listRecognizers( + request?: protos.google.cloud.speech.v2.IListRecognizersRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.speech.v2.IRecognizer[], + protos.google.cloud.speech.v2.IListRecognizersRequest|null, + protos.google.cloud.speech.v2.IListRecognizersResponse + ]>; + listRecognizers( + request: protos.google.cloud.speech.v2.IListRecognizersRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.speech.v2.IListRecognizersRequest, + protos.google.cloud.speech.v2.IListRecognizersResponse|null|undefined, + protos.google.cloud.speech.v2.IRecognizer>): void; + listRecognizers( + request: protos.google.cloud.speech.v2.IListRecognizersRequest, + callback: PaginationCallback< + protos.google.cloud.speech.v2.IListRecognizersRequest, + protos.google.cloud.speech.v2.IListRecognizersResponse|null|undefined, + protos.google.cloud.speech.v2.IRecognizer>): void; + listRecognizers( + request?: protos.google.cloud.speech.v2.IListRecognizersRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.speech.v2.IListRecognizersRequest, + protos.google.cloud.speech.v2.IListRecognizersResponse|null|undefined, + protos.google.cloud.speech.v2.IRecognizer>, + callback?: PaginationCallback< + protos.google.cloud.speech.v2.IListRecognizersRequest, + protos.google.cloud.speech.v2.IListRecognizersResponse|null|undefined, + protos.google.cloud.speech.v2.IRecognizer>): + Promise<[ + protos.google.cloud.speech.v2.IRecognizer[], + protos.google.cloud.speech.v2.IListRecognizersRequest|null, + protos.google.cloud.speech.v2.IListRecognizersResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.speech.v2.IListRecognizersRequest, + protos.google.cloud.speech.v2.IListRecognizersResponse|null|undefined, + protos.google.cloud.speech.v2.IRecognizer>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listRecognizers values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listRecognizers request %j', request); + return this.innerApiCalls + .listRecognizers(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.speech.v2.IRecognizer[], + protos.google.cloud.speech.v2.IListRecognizersRequest|null, + protos.google.cloud.speech.v2.IListRecognizersResponse + ]) => { + this._log.info('listRecognizers values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listRecognizers`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location of Recognizers to list. The expected + * format is `projects/{project}/locations/{location}`. + * @param {number} request.pageSize + * The maximum number of Recognizers to return. The service may return fewer + * than this value. If unspecified, at most 5 Recognizers will be returned. + * The maximum value is 100; values above 100 will be coerced to 100. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link protos.google.cloud.speech.v2.Speech.ListRecognizers|ListRecognizers} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link protos.google.cloud.speech.v2.Speech.ListRecognizers|ListRecognizers} must match + * the call that provided the page token. + * @param {boolean} request.showDeleted + * Whether, or not, to show resources that have been deleted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.speech.v2.Recognizer|Recognizer} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listRecognizersAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listRecognizersStream( + request?: protos.google.cloud.speech.v2.IListRecognizersRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listRecognizers']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listRecognizers stream %j', request); + return this.descriptors.page.listRecognizers.createStream( + this.innerApiCalls.listRecognizers as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listRecognizers`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location of Recognizers to list. The expected + * format is `projects/{project}/locations/{location}`. + * @param {number} request.pageSize + * The maximum number of Recognizers to return. The service may return fewer + * than this value. If unspecified, at most 5 Recognizers will be returned. + * The maximum value is 100; values above 100 will be coerced to 100. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link protos.google.cloud.speech.v2.Speech.ListRecognizers|ListRecognizers} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link protos.google.cloud.speech.v2.Speech.ListRecognizers|ListRecognizers} must match + * the call that provided the page token. + * @param {boolean} request.showDeleted + * Whether, or not, to show resources that have been deleted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.speech.v2.Recognizer|Recognizer}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.list_recognizers.js + * region_tag:speech_v2_generated_Speech_ListRecognizers_async + */ + listRecognizersAsync( + request?: protos.google.cloud.speech.v2.IListRecognizersRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listRecognizers']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listRecognizers iterate %j', request); + return this.descriptors.page.listRecognizers.asyncIterate( + this.innerApiCalls['listRecognizers'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists CustomClasses. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location of CustomClass resources to list. The + * expected format is `projects/{project}/locations/{location}`. + * @param {number} request.pageSize + * Number of results per requests. A valid page_size ranges from 0 to 100 + * inclusive. If the page_size is zero or unspecified, a page size of 5 will + * be chosen. If the page size exceeds 100, it will be coerced down to 100. + * Note that a call might return fewer results than the requested page size. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link protos.google.cloud.speech.v2.Speech.ListCustomClasses|ListCustomClasses} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link protos.google.cloud.speech.v2.Speech.ListCustomClasses|ListCustomClasses} must + * match the call that provided the page token. + * @param {boolean} request.showDeleted + * Whether, or not, to show resources that have been deleted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.speech.v2.CustomClass|CustomClass}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listCustomClassesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listCustomClasses( + request?: protos.google.cloud.speech.v2.IListCustomClassesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.speech.v2.ICustomClass[], + protos.google.cloud.speech.v2.IListCustomClassesRequest|null, + protos.google.cloud.speech.v2.IListCustomClassesResponse + ]>; + listCustomClasses( + request: protos.google.cloud.speech.v2.IListCustomClassesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.speech.v2.IListCustomClassesRequest, + protos.google.cloud.speech.v2.IListCustomClassesResponse|null|undefined, + protos.google.cloud.speech.v2.ICustomClass>): void; + listCustomClasses( + request: protos.google.cloud.speech.v2.IListCustomClassesRequest, + callback: PaginationCallback< + protos.google.cloud.speech.v2.IListCustomClassesRequest, + protos.google.cloud.speech.v2.IListCustomClassesResponse|null|undefined, + protos.google.cloud.speech.v2.ICustomClass>): void; + listCustomClasses( + request?: protos.google.cloud.speech.v2.IListCustomClassesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.speech.v2.IListCustomClassesRequest, + protos.google.cloud.speech.v2.IListCustomClassesResponse|null|undefined, + protos.google.cloud.speech.v2.ICustomClass>, + callback?: PaginationCallback< + protos.google.cloud.speech.v2.IListCustomClassesRequest, + protos.google.cloud.speech.v2.IListCustomClassesResponse|null|undefined, + protos.google.cloud.speech.v2.ICustomClass>): + Promise<[ + protos.google.cloud.speech.v2.ICustomClass[], + protos.google.cloud.speech.v2.IListCustomClassesRequest|null, + protos.google.cloud.speech.v2.IListCustomClassesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.speech.v2.IListCustomClassesRequest, + protos.google.cloud.speech.v2.IListCustomClassesResponse|null|undefined, + protos.google.cloud.speech.v2.ICustomClass>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listCustomClasses values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listCustomClasses request %j', request); + return this.innerApiCalls + .listCustomClasses(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.speech.v2.ICustomClass[], + protos.google.cloud.speech.v2.IListCustomClassesRequest|null, + protos.google.cloud.speech.v2.IListCustomClassesResponse + ]) => { + this._log.info('listCustomClasses values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listCustomClasses`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location of CustomClass resources to list. The + * expected format is `projects/{project}/locations/{location}`. + * @param {number} request.pageSize + * Number of results per requests. A valid page_size ranges from 0 to 100 + * inclusive. If the page_size is zero or unspecified, a page size of 5 will + * be chosen. If the page size exceeds 100, it will be coerced down to 100. + * Note that a call might return fewer results than the requested page size. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link protos.google.cloud.speech.v2.Speech.ListCustomClasses|ListCustomClasses} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link protos.google.cloud.speech.v2.Speech.ListCustomClasses|ListCustomClasses} must + * match the call that provided the page token. + * @param {boolean} request.showDeleted + * Whether, or not, to show resources that have been deleted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.speech.v2.CustomClass|CustomClass} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listCustomClassesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listCustomClassesStream( + request?: protos.google.cloud.speech.v2.IListCustomClassesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listCustomClasses']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listCustomClasses stream %j', request); + return this.descriptors.page.listCustomClasses.createStream( + this.innerApiCalls.listCustomClasses as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listCustomClasses`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location of CustomClass resources to list. The + * expected format is `projects/{project}/locations/{location}`. + * @param {number} request.pageSize + * Number of results per requests. A valid page_size ranges from 0 to 100 + * inclusive. If the page_size is zero or unspecified, a page size of 5 will + * be chosen. If the page size exceeds 100, it will be coerced down to 100. + * Note that a call might return fewer results than the requested page size. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link protos.google.cloud.speech.v2.Speech.ListCustomClasses|ListCustomClasses} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link protos.google.cloud.speech.v2.Speech.ListCustomClasses|ListCustomClasses} must + * match the call that provided the page token. + * @param {boolean} request.showDeleted + * Whether, or not, to show resources that have been deleted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.speech.v2.CustomClass|CustomClass}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.list_custom_classes.js + * region_tag:speech_v2_generated_Speech_ListCustomClasses_async + */ + listCustomClassesAsync( + request?: protos.google.cloud.speech.v2.IListCustomClassesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listCustomClasses']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listCustomClasses iterate %j', request); + return this.descriptors.page.listCustomClasses.asyncIterate( + this.innerApiCalls['listCustomClasses'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists PhraseSets. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location of PhraseSet resources to list. The + * expected format is `projects/{project}/locations/{location}`. + * @param {number} request.pageSize + * The maximum number of PhraseSets to return. The service may return fewer + * than this value. If unspecified, at most 5 PhraseSets will be returned. + * The maximum value is 100; values above 100 will be coerced to 100. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link protos.google.cloud.speech.v2.Speech.ListPhraseSets|ListPhraseSets} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link protos.google.cloud.speech.v2.Speech.ListPhraseSets|ListPhraseSets} must match + * the call that provided the page token. + * @param {boolean} request.showDeleted + * Whether, or not, to show resources that have been deleted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.speech.v2.PhraseSet|PhraseSet}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listPhraseSetsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listPhraseSets( + request?: protos.google.cloud.speech.v2.IListPhraseSetsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.speech.v2.IPhraseSet[], + protos.google.cloud.speech.v2.IListPhraseSetsRequest|null, + protos.google.cloud.speech.v2.IListPhraseSetsResponse + ]>; + listPhraseSets( + request: protos.google.cloud.speech.v2.IListPhraseSetsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.speech.v2.IListPhraseSetsRequest, + protos.google.cloud.speech.v2.IListPhraseSetsResponse|null|undefined, + protos.google.cloud.speech.v2.IPhraseSet>): void; + listPhraseSets( + request: protos.google.cloud.speech.v2.IListPhraseSetsRequest, + callback: PaginationCallback< + protos.google.cloud.speech.v2.IListPhraseSetsRequest, + protos.google.cloud.speech.v2.IListPhraseSetsResponse|null|undefined, + protos.google.cloud.speech.v2.IPhraseSet>): void; + listPhraseSets( + request?: protos.google.cloud.speech.v2.IListPhraseSetsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.speech.v2.IListPhraseSetsRequest, + protos.google.cloud.speech.v2.IListPhraseSetsResponse|null|undefined, + protos.google.cloud.speech.v2.IPhraseSet>, + callback?: PaginationCallback< + protos.google.cloud.speech.v2.IListPhraseSetsRequest, + protos.google.cloud.speech.v2.IListPhraseSetsResponse|null|undefined, + protos.google.cloud.speech.v2.IPhraseSet>): + Promise<[ + protos.google.cloud.speech.v2.IPhraseSet[], + protos.google.cloud.speech.v2.IListPhraseSetsRequest|null, + protos.google.cloud.speech.v2.IListPhraseSetsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.speech.v2.IListPhraseSetsRequest, + protos.google.cloud.speech.v2.IListPhraseSetsResponse|null|undefined, + protos.google.cloud.speech.v2.IPhraseSet>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listPhraseSets values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listPhraseSets request %j', request); + return this.innerApiCalls + .listPhraseSets(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.speech.v2.IPhraseSet[], + protos.google.cloud.speech.v2.IListPhraseSetsRequest|null, + protos.google.cloud.speech.v2.IListPhraseSetsResponse + ]) => { + this._log.info('listPhraseSets values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listPhraseSets`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location of PhraseSet resources to list. The + * expected format is `projects/{project}/locations/{location}`. + * @param {number} request.pageSize + * The maximum number of PhraseSets to return. The service may return fewer + * than this value. If unspecified, at most 5 PhraseSets will be returned. + * The maximum value is 100; values above 100 will be coerced to 100. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link protos.google.cloud.speech.v2.Speech.ListPhraseSets|ListPhraseSets} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link protos.google.cloud.speech.v2.Speech.ListPhraseSets|ListPhraseSets} must match + * the call that provided the page token. + * @param {boolean} request.showDeleted + * Whether, or not, to show resources that have been deleted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.speech.v2.PhraseSet|PhraseSet} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listPhraseSetsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listPhraseSetsStream( + request?: protos.google.cloud.speech.v2.IListPhraseSetsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listPhraseSets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listPhraseSets stream %j', request); + return this.descriptors.page.listPhraseSets.createStream( + this.innerApiCalls.listPhraseSets as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listPhraseSets`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location of PhraseSet resources to list. The + * expected format is `projects/{project}/locations/{location}`. + * @param {number} request.pageSize + * The maximum number of PhraseSets to return. The service may return fewer + * than this value. If unspecified, at most 5 PhraseSets will be returned. + * The maximum value is 100; values above 100 will be coerced to 100. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link protos.google.cloud.speech.v2.Speech.ListPhraseSets|ListPhraseSets} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link protos.google.cloud.speech.v2.Speech.ListPhraseSets|ListPhraseSets} must match + * the call that provided the page token. + * @param {boolean} request.showDeleted + * Whether, or not, to show resources that have been deleted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.speech.v2.PhraseSet|PhraseSet}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.list_phrase_sets.js + * region_tag:speech_v2_generated_Speech_ListPhraseSets_async + */ + listPhraseSetsAsync( + request?: protos.google.cloud.speech.v2.IListPhraseSetsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listPhraseSets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listPhraseSets iterate %j', request); + return this.descriptors.page.listPhraseSets.asyncIterate( + this.innerApiCalls['listPhraseSets'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. Returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified config resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + configPath(project:string,location:string) { + return this.pathTemplates.configPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Config resource. + * + * @param {string} configName + * A fully-qualified path representing Config resource. + * @returns {string} A string representing the project. + */ + matchProjectFromConfigName(configName: string) { + return this.pathTemplates.configPathTemplate.match(configName).project; + } + + /** + * Parse the location from Config resource. + * + * @param {string} configName + * A fully-qualified path representing Config resource. + * @returns {string} A string representing the location. + */ + matchLocationFromConfigName(configName: string) { + return this.pathTemplates.configPathTemplate.match(configName).location; + } + + /** + * Return a fully-qualified cryptoKey resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} key_ring + * @param {string} crypto_key + * @returns {string} Resource name string. + */ + cryptoKeyPath(project:string,location:string,keyRing:string,cryptoKey:string) { + return this.pathTemplates.cryptoKeyPathTemplate.render({ + project: project, + location: location, + key_ring: keyRing, + crypto_key: cryptoKey, + }); + } + + /** + * Parse the project from CryptoKey resource. + * + * @param {string} cryptoKeyName + * A fully-qualified path representing CryptoKey resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCryptoKeyName(cryptoKeyName: string) { + return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName).project; + } + + /** + * Parse the location from CryptoKey resource. + * + * @param {string} cryptoKeyName + * A fully-qualified path representing CryptoKey resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCryptoKeyName(cryptoKeyName: string) { + return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName).location; + } + + /** + * Parse the key_ring from CryptoKey resource. + * + * @param {string} cryptoKeyName + * A fully-qualified path representing CryptoKey resource. + * @returns {string} A string representing the key_ring. + */ + matchKeyRingFromCryptoKeyName(cryptoKeyName: string) { + return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName).key_ring; + } + + /** + * Parse the crypto_key from CryptoKey resource. + * + * @param {string} cryptoKeyName + * A fully-qualified path representing CryptoKey resource. + * @returns {string} A string representing the crypto_key. + */ + matchCryptoKeyFromCryptoKeyName(cryptoKeyName: string) { + return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName).crypto_key; + } + + /** + * Return a fully-qualified cryptoKeyVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} key_ring + * @param {string} crypto_key + * @param {string} crypto_key_version + * @returns {string} Resource name string. + */ + cryptoKeyVersionPath(project:string,location:string,keyRing:string,cryptoKey:string,cryptoKeyVersion:string) { + return this.pathTemplates.cryptoKeyVersionPathTemplate.render({ + project: project, + location: location, + key_ring: keyRing, + crypto_key: cryptoKey, + crypto_key_version: cryptoKeyVersion, + }); + } + + /** + * Parse the project from CryptoKeyVersion resource. + * + * @param {string} cryptoKeyVersionName + * A fully-qualified path representing CryptoKeyVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCryptoKeyVersionName(cryptoKeyVersionName: string) { + return this.pathTemplates.cryptoKeyVersionPathTemplate.match(cryptoKeyVersionName).project; + } + + /** + * Parse the location from CryptoKeyVersion resource. + * + * @param {string} cryptoKeyVersionName + * A fully-qualified path representing CryptoKeyVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCryptoKeyVersionName(cryptoKeyVersionName: string) { + return this.pathTemplates.cryptoKeyVersionPathTemplate.match(cryptoKeyVersionName).location; + } + + /** + * Parse the key_ring from CryptoKeyVersion resource. + * + * @param {string} cryptoKeyVersionName + * A fully-qualified path representing CryptoKeyVersion resource. + * @returns {string} A string representing the key_ring. + */ + matchKeyRingFromCryptoKeyVersionName(cryptoKeyVersionName: string) { + return this.pathTemplates.cryptoKeyVersionPathTemplate.match(cryptoKeyVersionName).key_ring; + } + + /** + * Parse the crypto_key from CryptoKeyVersion resource. + * + * @param {string} cryptoKeyVersionName + * A fully-qualified path representing CryptoKeyVersion resource. + * @returns {string} A string representing the crypto_key. + */ + matchCryptoKeyFromCryptoKeyVersionName(cryptoKeyVersionName: string) { + return this.pathTemplates.cryptoKeyVersionPathTemplate.match(cryptoKeyVersionName).crypto_key; + } + + /** + * Parse the crypto_key_version from CryptoKeyVersion resource. + * + * @param {string} cryptoKeyVersionName + * A fully-qualified path representing CryptoKeyVersion resource. + * @returns {string} A string representing the crypto_key_version. + */ + matchCryptoKeyVersionFromCryptoKeyVersionName(cryptoKeyVersionName: string) { + return this.pathTemplates.cryptoKeyVersionPathTemplate.match(cryptoKeyVersionName).crypto_key_version; + } + + /** + * Return a fully-qualified customClass resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} custom_class + * @returns {string} Resource name string. + */ + customClassPath(project:string,location:string,customClass:string) { + return this.pathTemplates.customClassPathTemplate.render({ + project: project, + location: location, + custom_class: customClass, + }); + } + + /** + * Parse the project from CustomClass resource. + * + * @param {string} customClassName + * A fully-qualified path representing CustomClass resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCustomClassName(customClassName: string) { + return this.pathTemplates.customClassPathTemplate.match(customClassName).project; + } + + /** + * Parse the location from CustomClass resource. + * + * @param {string} customClassName + * A fully-qualified path representing CustomClass resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCustomClassName(customClassName: string) { + return this.pathTemplates.customClassPathTemplate.match(customClassName).location; + } + + /** + * Parse the custom_class from CustomClass resource. + * + * @param {string} customClassName + * A fully-qualified path representing CustomClass resource. + * @returns {string} A string representing the custom_class. + */ + matchCustomClassFromCustomClassName(customClassName: string) { + return this.pathTemplates.customClassPathTemplate.match(customClassName).custom_class; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified phraseSet resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} phrase_set + * @returns {string} Resource name string. + */ + phraseSetPath(project:string,location:string,phraseSet:string) { + return this.pathTemplates.phraseSetPathTemplate.render({ + project: project, + location: location, + phrase_set: phraseSet, + }); + } + + /** + * Parse the project from PhraseSet resource. + * + * @param {string} phraseSetName + * A fully-qualified path representing PhraseSet resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPhraseSetName(phraseSetName: string) { + return this.pathTemplates.phraseSetPathTemplate.match(phraseSetName).project; + } + + /** + * Parse the location from PhraseSet resource. + * + * @param {string} phraseSetName + * A fully-qualified path representing PhraseSet resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPhraseSetName(phraseSetName: string) { + return this.pathTemplates.phraseSetPathTemplate.match(phraseSetName).location; + } + + /** + * Parse the phrase_set from PhraseSet resource. + * + * @param {string} phraseSetName + * A fully-qualified path representing PhraseSet resource. + * @returns {string} A string representing the phrase_set. + */ + matchPhraseSetFromPhraseSetName(phraseSetName: string) { + return this.pathTemplates.phraseSetPathTemplate.match(phraseSetName).phrase_set; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project:string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified recognizer resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} recognizer + * @returns {string} Resource name string. + */ + recognizerPath(project:string,location:string,recognizer:string) { + return this.pathTemplates.recognizerPathTemplate.render({ + project: project, + location: location, + recognizer: recognizer, + }); + } + + /** + * Parse the project from Recognizer resource. + * + * @param {string} recognizerName + * A fully-qualified path representing Recognizer resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRecognizerName(recognizerName: string) { + return this.pathTemplates.recognizerPathTemplate.match(recognizerName).project; + } + + /** + * Parse the location from Recognizer resource. + * + * @param {string} recognizerName + * A fully-qualified path representing Recognizer resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRecognizerName(recognizerName: string) { + return this.pathTemplates.recognizerPathTemplate.match(recognizerName).location; + } + + /** + * Parse the recognizer from Recognizer resource. + * + * @param {string} recognizerName + * A fully-qualified path representing Recognizer resource. + * @returns {string} A string representing the recognizer. + */ + matchRecognizerFromRecognizerName(recognizerName: string) { + return this.pathTemplates.recognizerPathTemplate.match(recognizerName).recognizer; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.speechStub && !this._terminated) { + return this.speechStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch(err => {throw err}); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/src/v2/speech_client_config.json b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/src/v2/speech_client_config.json new file mode 100644 index 00000000000..3809c643739 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/src/v2/speech_client_config.json @@ -0,0 +1,141 @@ +{ + "interfaces": { + "google.cloud.speech.v2.Speech": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateRecognizer": { + "timeout_millis": 5000000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListRecognizers": { + "timeout_millis": 5000000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetRecognizer": { + "timeout_millis": 5000000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateRecognizer": { + "timeout_millis": 5000000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeleteRecognizer": { + "timeout_millis": 5000000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UndeleteRecognizer": { + "timeout_millis": 5000000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "Recognize": { + "timeout_millis": 5000000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "StreamingRecognize": { + "timeout_millis": 5000000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "BatchRecognize": { + "timeout_millis": 5000000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetConfig": { + "timeout_millis": 5000000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateConfig": { + "timeout_millis": 5000000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CreateCustomClass": { + "timeout_millis": 5000000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListCustomClasses": { + "timeout_millis": 5000000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetCustomClass": { + "timeout_millis": 5000000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateCustomClass": { + "timeout_millis": 5000000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeleteCustomClass": { + "timeout_millis": 5000000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UndeleteCustomClass": { + "timeout_millis": 5000000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CreatePhraseSet": { + "timeout_millis": 5000000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListPhraseSets": { + "timeout_millis": 5000000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetPhraseSet": { + "timeout_millis": 5000000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdatePhraseSet": { + "timeout_millis": 5000000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeletePhraseSet": { + "timeout_millis": 5000000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UndeletePhraseSet": { + "timeout_millis": 5000000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/src/v2/speech_proto_list.json b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/src/v2/speech_proto_list.json new file mode 100644 index 00000000000..024cfd7d41d --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/src/v2/speech_proto_list.json @@ -0,0 +1,4 @@ +[ + "../../protos/google/cloud/speech/v2/cloud_speech.proto", + "../../protos/google/cloud/speech/v2/locations_metadata.proto" +] diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/system-test/fixtures/sample/src/index.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..c09357f204a --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const speech = require('@google-cloud/speech'); + +function main() { + const speechClient = new speech.SpeechClient(); +} + +main(); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/system-test/fixtures/sample/src/index.ts b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..dd729963452 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {SpeechClient} from '@google-cloud/speech'; + +// check that the client class type name can be used +function doStuffWithSpeechClient(client: SpeechClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const speechClient = new SpeechClient(); + doStuffWithSpeechClient(speechClient); +} + +main(); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/system-test/install.ts b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/system-test/install.ts new file mode 100644 index 00000000000..2a505d6df0c --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/system-test/install.ts @@ -0,0 +1,49 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + + it('TypeScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() + } + }; + await packNTest(options); + }); + + it('JavaScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() + } + }; + await packNTest(options); + }); + +}); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/test/gapic_speech_v2.ts b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/test/gapic_speech_v2.ts new file mode 100644 index 00000000000..23703309b49 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/test/gapic_speech_v2.ts @@ -0,0 +1,4535 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as speechModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos, LocationProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubBidiStreamingCall(response?: ResponseType, error?: Error) { + const transformStub = error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + return sinon.stub().returns(mockStream); +} + +function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v2.SpeechClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new speechModule.v2.SpeechClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'speech.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new speechModule.v2.SpeechClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = speechModule.v2.SpeechClient.servicePath; + assert.strictEqual(servicePath, 'speech.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = speechModule.v2.SpeechClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'speech.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new speechModule.v2.SpeechClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'speech.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new speechModule.v2.SpeechClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'speech.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new speechModule.v2.SpeechClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'speech.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new speechModule.v2.SpeechClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'speech.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new speechModule.v2.SpeechClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = speechModule.v2.SpeechClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new speechModule.v2.SpeechClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new speechModule.v2.SpeechClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.speechStub, undefined); + await client.initialize(); + assert(client.speechStub); + }); + + it('has close method for the initialized client', done => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.speechStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.speechStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('getRecognizer', () => { + it('invokes getRecognizer without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.GetRecognizerRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.GetRecognizerRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v2.Recognizer() + ); + client.innerApiCalls.getRecognizer = stubSimpleCall(expectedResponse); + const [response] = await client.getRecognizer(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getRecognizer as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getRecognizer as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRecognizer without error using callback', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.GetRecognizerRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.GetRecognizerRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v2.Recognizer() + ); + client.innerApiCalls.getRecognizer = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getRecognizer( + request, + (err?: Error|null, result?: protos.google.cloud.speech.v2.IRecognizer|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getRecognizer as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getRecognizer as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRecognizer with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.GetRecognizerRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.GetRecognizerRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getRecognizer = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getRecognizer(request), expectedError); + const actualRequest = (client.innerApiCalls.getRecognizer as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getRecognizer as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRecognizer with closed client', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.GetRecognizerRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.GetRecognizerRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getRecognizer(request), expectedError); + }); + }); + + describe('recognize', () => { + it('invokes recognize without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.RecognizeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.RecognizeRequest', ['recognizer']); + request.recognizer = defaultValue1; + const expectedHeaderRequestParams = `recognizer=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v2.RecognizeResponse() + ); + client.innerApiCalls.recognize = stubSimpleCall(expectedResponse); + const [response] = await client.recognize(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.recognize as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.recognize as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes recognize without error using callback', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.RecognizeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.RecognizeRequest', ['recognizer']); + request.recognizer = defaultValue1; + const expectedHeaderRequestParams = `recognizer=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v2.RecognizeResponse() + ); + client.innerApiCalls.recognize = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.recognize( + request, + (err?: Error|null, result?: protos.google.cloud.speech.v2.IRecognizeResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.recognize as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.recognize as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes recognize with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.RecognizeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.RecognizeRequest', ['recognizer']); + request.recognizer = defaultValue1; + const expectedHeaderRequestParams = `recognizer=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.recognize = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.recognize(request), expectedError); + const actualRequest = (client.innerApiCalls.recognize as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.recognize as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes recognize with closed client', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.RecognizeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.RecognizeRequest', ['recognizer']); + request.recognizer = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.recognize(request), expectedError); + }); + }); + + describe('getConfig', () => { + it('invokes getConfig without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.GetConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.GetConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v2.Config() + ); + client.innerApiCalls.getConfig = stubSimpleCall(expectedResponse); + const [response] = await client.getConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConfig without error using callback', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.GetConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.GetConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v2.Config() + ); + client.innerApiCalls.getConfig = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getConfig( + request, + (err?: Error|null, result?: protos.google.cloud.speech.v2.IConfig|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConfig with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.GetConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.GetConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getConfig = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getConfig(request), expectedError); + const actualRequest = (client.innerApiCalls.getConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConfig with closed client', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.GetConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.GetConfigRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getConfig(request), expectedError); + }); + }); + + describe('updateConfig', () => { + it('invokes updateConfig without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.UpdateConfigRequest() + ); + request.config ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.UpdateConfigRequest', ['config', 'name']); + request.config.name = defaultValue1; + const expectedHeaderRequestParams = `config.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v2.Config() + ); + client.innerApiCalls.updateConfig = stubSimpleCall(expectedResponse); + const [response] = await client.updateConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateConfig without error using callback', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.UpdateConfigRequest() + ); + request.config ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.UpdateConfigRequest', ['config', 'name']); + request.config.name = defaultValue1; + const expectedHeaderRequestParams = `config.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v2.Config() + ); + client.innerApiCalls.updateConfig = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateConfig( + request, + (err?: Error|null, result?: protos.google.cloud.speech.v2.IConfig|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateConfig with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.UpdateConfigRequest() + ); + request.config ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.UpdateConfigRequest', ['config', 'name']); + request.config.name = defaultValue1; + const expectedHeaderRequestParams = `config.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateConfig = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateConfig(request), expectedError); + const actualRequest = (client.innerApiCalls.updateConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateConfig with closed client', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.UpdateConfigRequest() + ); + request.config ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.UpdateConfigRequest', ['config', 'name']); + request.config.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateConfig(request), expectedError); + }); + }); + + describe('getCustomClass', () => { + it('invokes getCustomClass without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.GetCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.GetCustomClassRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v2.CustomClass() + ); + client.innerApiCalls.getCustomClass = stubSimpleCall(expectedResponse); + const [response] = await client.getCustomClass(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCustomClass without error using callback', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.GetCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.GetCustomClassRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v2.CustomClass() + ); + client.innerApiCalls.getCustomClass = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getCustomClass( + request, + (err?: Error|null, result?: protos.google.cloud.speech.v2.ICustomClass|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCustomClass with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.GetCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.GetCustomClassRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getCustomClass = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getCustomClass(request), expectedError); + const actualRequest = (client.innerApiCalls.getCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCustomClass with closed client', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.GetCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.GetCustomClassRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getCustomClass(request), expectedError); + }); + }); + + describe('getPhraseSet', () => { + it('invokes getPhraseSet without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.GetPhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.GetPhraseSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v2.PhraseSet() + ); + client.innerApiCalls.getPhraseSet = stubSimpleCall(expectedResponse); + const [response] = await client.getPhraseSet(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getPhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getPhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPhraseSet without error using callback', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.GetPhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.GetPhraseSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v2.PhraseSet() + ); + client.innerApiCalls.getPhraseSet = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getPhraseSet( + request, + (err?: Error|null, result?: protos.google.cloud.speech.v2.IPhraseSet|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getPhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getPhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPhraseSet with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.GetPhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.GetPhraseSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getPhraseSet = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getPhraseSet(request), expectedError); + const actualRequest = (client.innerApiCalls.getPhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getPhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPhraseSet with closed client', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.GetPhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.GetPhraseSetRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getPhraseSet(request), expectedError); + }); + }); + + describe('createRecognizer', () => { + it('invokes createRecognizer without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.CreateRecognizerRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.CreateRecognizerRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createRecognizer = stubLongRunningCall(expectedResponse); + const [operation] = await client.createRecognizer(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createRecognizer as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createRecognizer as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createRecognizer without error using callback', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.CreateRecognizerRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.CreateRecognizerRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createRecognizer = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createRecognizer( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createRecognizer as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createRecognizer as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createRecognizer with call error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.CreateRecognizerRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.CreateRecognizerRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createRecognizer = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createRecognizer(request), expectedError); + const actualRequest = (client.innerApiCalls.createRecognizer as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createRecognizer as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createRecognizer with LRO error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.CreateRecognizerRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.CreateRecognizerRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createRecognizer = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createRecognizer(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createRecognizer as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createRecognizer as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateRecognizerProgress without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateRecognizerProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateRecognizerProgress with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateRecognizerProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateRecognizer', () => { + it('invokes updateRecognizer without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.UpdateRecognizerRequest() + ); + request.recognizer ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.UpdateRecognizerRequest', ['recognizer', 'name']); + request.recognizer.name = defaultValue1; + const expectedHeaderRequestParams = `recognizer.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateRecognizer = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateRecognizer(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateRecognizer as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateRecognizer as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateRecognizer without error using callback', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.UpdateRecognizerRequest() + ); + request.recognizer ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.UpdateRecognizerRequest', ['recognizer', 'name']); + request.recognizer.name = defaultValue1; + const expectedHeaderRequestParams = `recognizer.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateRecognizer = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateRecognizer( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateRecognizer as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateRecognizer as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateRecognizer with call error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.UpdateRecognizerRequest() + ); + request.recognizer ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.UpdateRecognizerRequest', ['recognizer', 'name']); + request.recognizer.name = defaultValue1; + const expectedHeaderRequestParams = `recognizer.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateRecognizer = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateRecognizer(request), expectedError); + const actualRequest = (client.innerApiCalls.updateRecognizer as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateRecognizer as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateRecognizer with LRO error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.UpdateRecognizerRequest() + ); + request.recognizer ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.UpdateRecognizerRequest', ['recognizer', 'name']); + request.recognizer.name = defaultValue1; + const expectedHeaderRequestParams = `recognizer.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateRecognizer = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateRecognizer(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateRecognizer as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateRecognizer as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateRecognizerProgress without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateRecognizerProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateRecognizerProgress with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpdateRecognizerProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteRecognizer', () => { + it('invokes deleteRecognizer without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.DeleteRecognizerRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.DeleteRecognizerRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteRecognizer = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteRecognizer(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteRecognizer as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteRecognizer as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteRecognizer without error using callback', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.DeleteRecognizerRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.DeleteRecognizerRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteRecognizer = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteRecognizer( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteRecognizer as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteRecognizer as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteRecognizer with call error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.DeleteRecognizerRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.DeleteRecognizerRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteRecognizer = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteRecognizer(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteRecognizer as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteRecognizer as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteRecognizer with LRO error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.DeleteRecognizerRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.DeleteRecognizerRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteRecognizer = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteRecognizer(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteRecognizer as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteRecognizer as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteRecognizerProgress without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteRecognizerProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteRecognizerProgress with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteRecognizerProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('undeleteRecognizer', () => { + it('invokes undeleteRecognizer without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.UndeleteRecognizerRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.UndeleteRecognizerRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.undeleteRecognizer = stubLongRunningCall(expectedResponse); + const [operation] = await client.undeleteRecognizer(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.undeleteRecognizer as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.undeleteRecognizer as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeleteRecognizer without error using callback', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.UndeleteRecognizerRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.UndeleteRecognizerRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.undeleteRecognizer = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.undeleteRecognizer( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.undeleteRecognizer as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.undeleteRecognizer as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeleteRecognizer with call error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.UndeleteRecognizerRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.UndeleteRecognizerRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.undeleteRecognizer = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.undeleteRecognizer(request), expectedError); + const actualRequest = (client.innerApiCalls.undeleteRecognizer as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.undeleteRecognizer as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeleteRecognizer with LRO error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.UndeleteRecognizerRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.UndeleteRecognizerRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.undeleteRecognizer = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.undeleteRecognizer(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.undeleteRecognizer as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.undeleteRecognizer as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUndeleteRecognizerProgress without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUndeleteRecognizerProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUndeleteRecognizerProgress with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUndeleteRecognizerProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('batchRecognize', () => { + it('invokes batchRecognize without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.BatchRecognizeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.BatchRecognizeRequest', ['recognizer']); + request.recognizer = defaultValue1; + const expectedHeaderRequestParams = `recognizer=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.batchRecognize = stubLongRunningCall(expectedResponse); + const [operation] = await client.batchRecognize(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.batchRecognize as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchRecognize as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchRecognize without error using callback', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.BatchRecognizeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.BatchRecognizeRequest', ['recognizer']); + request.recognizer = defaultValue1; + const expectedHeaderRequestParams = `recognizer=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.batchRecognize = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchRecognize( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.batchRecognize as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchRecognize as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchRecognize with call error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.BatchRecognizeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.BatchRecognizeRequest', ['recognizer']); + request.recognizer = defaultValue1; + const expectedHeaderRequestParams = `recognizer=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchRecognize = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.batchRecognize(request), expectedError); + const actualRequest = (client.innerApiCalls.batchRecognize as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchRecognize as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchRecognize with LRO error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.BatchRecognizeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.BatchRecognizeRequest', ['recognizer']); + request.recognizer = defaultValue1; + const expectedHeaderRequestParams = `recognizer=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchRecognize = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.batchRecognize(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.batchRecognize as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchRecognize as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkBatchRecognizeProgress without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkBatchRecognizeProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkBatchRecognizeProgress with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkBatchRecognizeProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('createCustomClass', () => { + it('invokes createCustomClass without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.CreateCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.CreateCustomClassRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createCustomClass = stubLongRunningCall(expectedResponse); + const [operation] = await client.createCustomClass(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCustomClass without error using callback', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.CreateCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.CreateCustomClassRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createCustomClass = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createCustomClass( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCustomClass with call error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.CreateCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.CreateCustomClassRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCustomClass = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createCustomClass(request), expectedError); + const actualRequest = (client.innerApiCalls.createCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCustomClass with LRO error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.CreateCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.CreateCustomClassRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCustomClass = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createCustomClass(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateCustomClassProgress without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateCustomClassProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateCustomClassProgress with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateCustomClassProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateCustomClass', () => { + it('invokes updateCustomClass without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.UpdateCustomClassRequest() + ); + request.customClass ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.UpdateCustomClassRequest', ['customClass', 'name']); + request.customClass.name = defaultValue1; + const expectedHeaderRequestParams = `custom_class.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateCustomClass = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateCustomClass(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCustomClass without error using callback', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.UpdateCustomClassRequest() + ); + request.customClass ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.UpdateCustomClassRequest', ['customClass', 'name']); + request.customClass.name = defaultValue1; + const expectedHeaderRequestParams = `custom_class.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateCustomClass = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateCustomClass( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCustomClass with call error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.UpdateCustomClassRequest() + ); + request.customClass ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.UpdateCustomClassRequest', ['customClass', 'name']); + request.customClass.name = defaultValue1; + const expectedHeaderRequestParams = `custom_class.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCustomClass = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateCustomClass(request), expectedError); + const actualRequest = (client.innerApiCalls.updateCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCustomClass with LRO error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.UpdateCustomClassRequest() + ); + request.customClass ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.UpdateCustomClassRequest', ['customClass', 'name']); + request.customClass.name = defaultValue1; + const expectedHeaderRequestParams = `custom_class.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCustomClass = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateCustomClass(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateCustomClassProgress without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateCustomClassProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateCustomClassProgress with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpdateCustomClassProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteCustomClass', () => { + it('invokes deleteCustomClass without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.DeleteCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.DeleteCustomClassRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteCustomClass = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteCustomClass(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCustomClass without error using callback', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.DeleteCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.DeleteCustomClassRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteCustomClass = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteCustomClass( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCustomClass with call error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.DeleteCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.DeleteCustomClassRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCustomClass = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteCustomClass(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCustomClass with LRO error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.DeleteCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.DeleteCustomClassRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCustomClass = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteCustomClass(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteCustomClassProgress without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteCustomClassProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteCustomClassProgress with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteCustomClassProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('undeleteCustomClass', () => { + it('invokes undeleteCustomClass without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.UndeleteCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.UndeleteCustomClassRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.undeleteCustomClass = stubLongRunningCall(expectedResponse); + const [operation] = await client.undeleteCustomClass(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.undeleteCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.undeleteCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeleteCustomClass without error using callback', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.UndeleteCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.UndeleteCustomClassRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.undeleteCustomClass = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.undeleteCustomClass( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.undeleteCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.undeleteCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeleteCustomClass with call error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.UndeleteCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.UndeleteCustomClassRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.undeleteCustomClass = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.undeleteCustomClass(request), expectedError); + const actualRequest = (client.innerApiCalls.undeleteCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.undeleteCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeleteCustomClass with LRO error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.UndeleteCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.UndeleteCustomClassRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.undeleteCustomClass = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.undeleteCustomClass(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.undeleteCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.undeleteCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUndeleteCustomClassProgress without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUndeleteCustomClassProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUndeleteCustomClassProgress with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUndeleteCustomClassProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('createPhraseSet', () => { + it('invokes createPhraseSet without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.CreatePhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.CreatePhraseSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createPhraseSet = stubLongRunningCall(expectedResponse); + const [operation] = await client.createPhraseSet(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createPhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createPhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPhraseSet without error using callback', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.CreatePhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.CreatePhraseSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createPhraseSet = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createPhraseSet( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createPhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createPhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPhraseSet with call error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.CreatePhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.CreatePhraseSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createPhraseSet = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createPhraseSet(request), expectedError); + const actualRequest = (client.innerApiCalls.createPhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createPhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPhraseSet with LRO error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.CreatePhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.CreatePhraseSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createPhraseSet = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createPhraseSet(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createPhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createPhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreatePhraseSetProgress without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreatePhraseSetProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreatePhraseSetProgress with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreatePhraseSetProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updatePhraseSet', () => { + it('invokes updatePhraseSet without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.UpdatePhraseSetRequest() + ); + request.phraseSet ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.UpdatePhraseSetRequest', ['phraseSet', 'name']); + request.phraseSet.name = defaultValue1; + const expectedHeaderRequestParams = `phrase_set.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updatePhraseSet = stubLongRunningCall(expectedResponse); + const [operation] = await client.updatePhraseSet(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updatePhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updatePhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updatePhraseSet without error using callback', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.UpdatePhraseSetRequest() + ); + request.phraseSet ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.UpdatePhraseSetRequest', ['phraseSet', 'name']); + request.phraseSet.name = defaultValue1; + const expectedHeaderRequestParams = `phrase_set.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updatePhraseSet = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updatePhraseSet( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updatePhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updatePhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updatePhraseSet with call error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.UpdatePhraseSetRequest() + ); + request.phraseSet ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.UpdatePhraseSetRequest', ['phraseSet', 'name']); + request.phraseSet.name = defaultValue1; + const expectedHeaderRequestParams = `phrase_set.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updatePhraseSet = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updatePhraseSet(request), expectedError); + const actualRequest = (client.innerApiCalls.updatePhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updatePhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updatePhraseSet with LRO error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.UpdatePhraseSetRequest() + ); + request.phraseSet ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.UpdatePhraseSetRequest', ['phraseSet', 'name']); + request.phraseSet.name = defaultValue1; + const expectedHeaderRequestParams = `phrase_set.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updatePhraseSet = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updatePhraseSet(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updatePhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updatePhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdatePhraseSetProgress without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdatePhraseSetProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdatePhraseSetProgress with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpdatePhraseSetProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deletePhraseSet', () => { + it('invokes deletePhraseSet without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.DeletePhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.DeletePhraseSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deletePhraseSet = stubLongRunningCall(expectedResponse); + const [operation] = await client.deletePhraseSet(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deletePhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deletePhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePhraseSet without error using callback', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.DeletePhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.DeletePhraseSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deletePhraseSet = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deletePhraseSet( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deletePhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deletePhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePhraseSet with call error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.DeletePhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.DeletePhraseSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deletePhraseSet = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deletePhraseSet(request), expectedError); + const actualRequest = (client.innerApiCalls.deletePhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deletePhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePhraseSet with LRO error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.DeletePhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.DeletePhraseSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deletePhraseSet = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deletePhraseSet(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deletePhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deletePhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeletePhraseSetProgress without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeletePhraseSetProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeletePhraseSetProgress with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeletePhraseSetProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('undeletePhraseSet', () => { + it('invokes undeletePhraseSet without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.UndeletePhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.UndeletePhraseSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.undeletePhraseSet = stubLongRunningCall(expectedResponse); + const [operation] = await client.undeletePhraseSet(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.undeletePhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.undeletePhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeletePhraseSet without error using callback', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.UndeletePhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.UndeletePhraseSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.undeletePhraseSet = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.undeletePhraseSet( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.undeletePhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.undeletePhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeletePhraseSet with call error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.UndeletePhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.UndeletePhraseSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.undeletePhraseSet = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.undeletePhraseSet(request), expectedError); + const actualRequest = (client.innerApiCalls.undeletePhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.undeletePhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeletePhraseSet with LRO error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.UndeletePhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.UndeletePhraseSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.undeletePhraseSet = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.undeletePhraseSet(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.undeletePhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.undeletePhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUndeletePhraseSetProgress without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUndeletePhraseSetProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUndeletePhraseSetProgress with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUndeletePhraseSetProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('streamingRecognize', () => { + it('invokes streamingRecognize without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.StreamingRecognizeRequest() + ); + + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v2.StreamingRecognizeResponse() + ); + client.innerApiCalls.streamingRecognize = stubBidiStreamingCall(expectedResponse); + const stream = client.streamingRecognize(); + const promise = new Promise((resolve, reject) => { + stream.on('data', (response: protos.google.cloud.speech.v2.StreamingRecognizeResponse) => { + resolve(response); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + stream.write(request); + stream.end(); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.streamingRecognize as SinonStub) + .getCall(0).calledWith(null)); + assert.deepStrictEqual(((stream as unknown as PassThrough) + ._transform as SinonStub).getCall(0).args[0], request); + }); + + it('invokes streamingRecognize with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.StreamingRecognizeRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.streamingRecognize = stubBidiStreamingCall(undefined, expectedError); + const stream = client.streamingRecognize(); + const promise = new Promise((resolve, reject) => { + stream.on('data', (response: protos.google.cloud.speech.v2.StreamingRecognizeResponse) => { + resolve(response); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + stream.write(request); + stream.end(); + }); + await assert.rejects(promise, expectedError); + assert((client.innerApiCalls.streamingRecognize as SinonStub) + .getCall(0).calledWith(null)); + assert.deepStrictEqual(((stream as unknown as PassThrough) + ._transform as SinonStub).getCall(0).args[0], request); + }); + }); + + describe('listRecognizers', () => { + it('invokes listRecognizers without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.ListRecognizersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.ListRecognizersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.speech.v2.Recognizer()), + generateSampleMessage(new protos.google.cloud.speech.v2.Recognizer()), + generateSampleMessage(new protos.google.cloud.speech.v2.Recognizer()), + ]; + client.innerApiCalls.listRecognizers = stubSimpleCall(expectedResponse); + const [response] = await client.listRecognizers(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listRecognizers as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listRecognizers as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRecognizers without error using callback', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.ListRecognizersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.ListRecognizersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.speech.v2.Recognizer()), + generateSampleMessage(new protos.google.cloud.speech.v2.Recognizer()), + generateSampleMessage(new protos.google.cloud.speech.v2.Recognizer()), + ]; + client.innerApiCalls.listRecognizers = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listRecognizers( + request, + (err?: Error|null, result?: protos.google.cloud.speech.v2.IRecognizer[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listRecognizers as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listRecognizers as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRecognizers with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.ListRecognizersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.ListRecognizersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listRecognizers = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listRecognizers(request), expectedError); + const actualRequest = (client.innerApiCalls.listRecognizers as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listRecognizers as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRecognizersStream without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.ListRecognizersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.ListRecognizersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.speech.v2.Recognizer()), + generateSampleMessage(new protos.google.cloud.speech.v2.Recognizer()), + generateSampleMessage(new protos.google.cloud.speech.v2.Recognizer()), + ]; + client.descriptors.page.listRecognizers.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listRecognizersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.speech.v2.Recognizer[] = []; + stream.on('data', (response: protos.google.cloud.speech.v2.Recognizer) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listRecognizers.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listRecognizers, request)); + assert( + (client.descriptors.page.listRecognizers.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listRecognizersStream with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.ListRecognizersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.ListRecognizersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listRecognizers.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listRecognizersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.speech.v2.Recognizer[] = []; + stream.on('data', (response: protos.google.cloud.speech.v2.Recognizer) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listRecognizers.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listRecognizers, request)); + assert( + (client.descriptors.page.listRecognizers.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listRecognizers without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.ListRecognizersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.ListRecognizersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.speech.v2.Recognizer()), + generateSampleMessage(new protos.google.cloud.speech.v2.Recognizer()), + generateSampleMessage(new protos.google.cloud.speech.v2.Recognizer()), + ]; + client.descriptors.page.listRecognizers.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.speech.v2.IRecognizer[] = []; + const iterable = client.listRecognizersAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listRecognizers.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listRecognizers.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listRecognizers with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.ListRecognizersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.ListRecognizersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listRecognizers.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listRecognizersAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.speech.v2.IRecognizer[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listRecognizers.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listRecognizers.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listCustomClasses', () => { + it('invokes listCustomClasses without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.ListCustomClassesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.ListCustomClassesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.speech.v2.CustomClass()), + generateSampleMessage(new protos.google.cloud.speech.v2.CustomClass()), + generateSampleMessage(new protos.google.cloud.speech.v2.CustomClass()), + ]; + client.innerApiCalls.listCustomClasses = stubSimpleCall(expectedResponse); + const [response] = await client.listCustomClasses(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listCustomClasses as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listCustomClasses as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCustomClasses without error using callback', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.ListCustomClassesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.ListCustomClassesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.speech.v2.CustomClass()), + generateSampleMessage(new protos.google.cloud.speech.v2.CustomClass()), + generateSampleMessage(new protos.google.cloud.speech.v2.CustomClass()), + ]; + client.innerApiCalls.listCustomClasses = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listCustomClasses( + request, + (err?: Error|null, result?: protos.google.cloud.speech.v2.ICustomClass[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listCustomClasses as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listCustomClasses as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCustomClasses with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.ListCustomClassesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.ListCustomClassesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listCustomClasses = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listCustomClasses(request), expectedError); + const actualRequest = (client.innerApiCalls.listCustomClasses as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listCustomClasses as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCustomClassesStream without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.ListCustomClassesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.ListCustomClassesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.speech.v2.CustomClass()), + generateSampleMessage(new protos.google.cloud.speech.v2.CustomClass()), + generateSampleMessage(new protos.google.cloud.speech.v2.CustomClass()), + ]; + client.descriptors.page.listCustomClasses.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listCustomClassesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.speech.v2.CustomClass[] = []; + stream.on('data', (response: protos.google.cloud.speech.v2.CustomClass) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listCustomClasses.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listCustomClasses, request)); + assert( + (client.descriptors.page.listCustomClasses.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listCustomClassesStream with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.ListCustomClassesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.ListCustomClassesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listCustomClasses.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listCustomClassesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.speech.v2.CustomClass[] = []; + stream.on('data', (response: protos.google.cloud.speech.v2.CustomClass) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listCustomClasses.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listCustomClasses, request)); + assert( + (client.descriptors.page.listCustomClasses.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listCustomClasses without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.ListCustomClassesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.ListCustomClassesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.speech.v2.CustomClass()), + generateSampleMessage(new protos.google.cloud.speech.v2.CustomClass()), + generateSampleMessage(new protos.google.cloud.speech.v2.CustomClass()), + ]; + client.descriptors.page.listCustomClasses.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.speech.v2.ICustomClass[] = []; + const iterable = client.listCustomClassesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listCustomClasses.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listCustomClasses.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listCustomClasses with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.ListCustomClassesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.ListCustomClassesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listCustomClasses.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listCustomClassesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.speech.v2.ICustomClass[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listCustomClasses.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listCustomClasses.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listPhraseSets', () => { + it('invokes listPhraseSets without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.ListPhraseSetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.ListPhraseSetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.speech.v2.PhraseSet()), + generateSampleMessage(new protos.google.cloud.speech.v2.PhraseSet()), + generateSampleMessage(new protos.google.cloud.speech.v2.PhraseSet()), + ]; + client.innerApiCalls.listPhraseSets = stubSimpleCall(expectedResponse); + const [response] = await client.listPhraseSets(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listPhraseSets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listPhraseSets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPhraseSets without error using callback', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.ListPhraseSetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.ListPhraseSetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.speech.v2.PhraseSet()), + generateSampleMessage(new protos.google.cloud.speech.v2.PhraseSet()), + generateSampleMessage(new protos.google.cloud.speech.v2.PhraseSet()), + ]; + client.innerApiCalls.listPhraseSets = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listPhraseSets( + request, + (err?: Error|null, result?: protos.google.cloud.speech.v2.IPhraseSet[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listPhraseSets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listPhraseSets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPhraseSets with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.ListPhraseSetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.ListPhraseSetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listPhraseSets = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listPhraseSets(request), expectedError); + const actualRequest = (client.innerApiCalls.listPhraseSets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listPhraseSets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPhraseSetsStream without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.ListPhraseSetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.ListPhraseSetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.speech.v2.PhraseSet()), + generateSampleMessage(new protos.google.cloud.speech.v2.PhraseSet()), + generateSampleMessage(new protos.google.cloud.speech.v2.PhraseSet()), + ]; + client.descriptors.page.listPhraseSets.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listPhraseSetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.speech.v2.PhraseSet[] = []; + stream.on('data', (response: protos.google.cloud.speech.v2.PhraseSet) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listPhraseSets.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listPhraseSets, request)); + assert( + (client.descriptors.page.listPhraseSets.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listPhraseSetsStream with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.ListPhraseSetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.ListPhraseSetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listPhraseSets.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listPhraseSetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.speech.v2.PhraseSet[] = []; + stream.on('data', (response: protos.google.cloud.speech.v2.PhraseSet) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listPhraseSets.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listPhraseSets, request)); + assert( + (client.descriptors.page.listPhraseSets.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listPhraseSets without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.ListPhraseSetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.ListPhraseSetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.speech.v2.PhraseSet()), + generateSampleMessage(new protos.google.cloud.speech.v2.PhraseSet()), + generateSampleMessage(new protos.google.cloud.speech.v2.PhraseSet()), + ]; + client.descriptors.page.listPhraseSets.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.speech.v2.IPhraseSet[] = []; + const iterable = client.listPhraseSetsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listPhraseSets.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listPhraseSets.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listPhraseSets with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.ListPhraseSetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.ListPhraseSetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listPhraseSets.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listPhraseSetsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.speech.v2.IPhraseSet[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listPhraseSets.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listPhraseSets.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation without error using callback', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.IOperation[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.IOperation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + describe('Path templates', () => { + + describe('config', async () => { + const fakePath = "/rendered/path/config"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.configPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.configPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('configPath', () => { + const result = client.configPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.configPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromConfigName', () => { + const result = client.matchProjectFromConfigName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.configPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromConfigName', () => { + const result = client.matchLocationFromConfigName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.configPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('cryptoKey', async () => { + const fakePath = "/rendered/path/cryptoKey"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + key_ring: "keyRingValue", + crypto_key: "cryptoKeyValue", + }; + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.cryptoKeyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.cryptoKeyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('cryptoKeyPath', () => { + const result = client.cryptoKeyPath("projectValue", "locationValue", "keyRingValue", "cryptoKeyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.cryptoKeyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromCryptoKeyName', () => { + const result = client.matchProjectFromCryptoKeyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromCryptoKeyName', () => { + const result = client.matchLocationFromCryptoKeyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchKeyRingFromCryptoKeyName', () => { + const result = client.matchKeyRingFromCryptoKeyName(fakePath); + assert.strictEqual(result, "keyRingValue"); + assert((client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCryptoKeyFromCryptoKeyName', () => { + const result = client.matchCryptoKeyFromCryptoKeyName(fakePath); + assert.strictEqual(result, "cryptoKeyValue"); + assert((client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('cryptoKeyVersion', async () => { + const fakePath = "/rendered/path/cryptoKeyVersion"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + key_ring: "keyRingValue", + crypto_key: "cryptoKeyValue", + crypto_key_version: "cryptoKeyVersionValue", + }; + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.cryptoKeyVersionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.cryptoKeyVersionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('cryptoKeyVersionPath', () => { + const result = client.cryptoKeyVersionPath("projectValue", "locationValue", "keyRingValue", "cryptoKeyValue", "cryptoKeyVersionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.cryptoKeyVersionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromCryptoKeyVersionName', () => { + const result = client.matchProjectFromCryptoKeyVersionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.cryptoKeyVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromCryptoKeyVersionName', () => { + const result = client.matchLocationFromCryptoKeyVersionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.cryptoKeyVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchKeyRingFromCryptoKeyVersionName', () => { + const result = client.matchKeyRingFromCryptoKeyVersionName(fakePath); + assert.strictEqual(result, "keyRingValue"); + assert((client.pathTemplates.cryptoKeyVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCryptoKeyFromCryptoKeyVersionName', () => { + const result = client.matchCryptoKeyFromCryptoKeyVersionName(fakePath); + assert.strictEqual(result, "cryptoKeyValue"); + assert((client.pathTemplates.cryptoKeyVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCryptoKeyVersionFromCryptoKeyVersionName', () => { + const result = client.matchCryptoKeyVersionFromCryptoKeyVersionName(fakePath); + assert.strictEqual(result, "cryptoKeyVersionValue"); + assert((client.pathTemplates.cryptoKeyVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('customClass', async () => { + const fakePath = "/rendered/path/customClass"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + custom_class: "customClassValue", + }; + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.customClassPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.customClassPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('customClassPath', () => { + const result = client.customClassPath("projectValue", "locationValue", "customClassValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.customClassPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromCustomClassName', () => { + const result = client.matchProjectFromCustomClassName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.customClassPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromCustomClassName', () => { + const result = client.matchLocationFromCustomClassName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.customClassPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCustomClassFromCustomClassName', () => { + const result = client.matchCustomClassFromCustomClassName(fakePath); + assert.strictEqual(result, "customClassValue"); + assert((client.pathTemplates.customClassPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', async () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('phraseSet', async () => { + const fakePath = "/rendered/path/phraseSet"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + phrase_set: "phraseSetValue", + }; + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.phraseSetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.phraseSetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('phraseSetPath', () => { + const result = client.phraseSetPath("projectValue", "locationValue", "phraseSetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.phraseSetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromPhraseSetName', () => { + const result = client.matchProjectFromPhraseSetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.phraseSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromPhraseSetName', () => { + const result = client.matchLocationFromPhraseSetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.phraseSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPhraseSetFromPhraseSetName', () => { + const result = client.matchPhraseSetFromPhraseSetName(fakePath); + assert.strictEqual(result, "phraseSetValue"); + assert((client.pathTemplates.phraseSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('project', async () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('recognizer', async () => { + const fakePath = "/rendered/path/recognizer"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + recognizer: "recognizerValue", + }; + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.recognizerPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.recognizerPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('recognizerPath', () => { + const result = client.recognizerPath("projectValue", "locationValue", "recognizerValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.recognizerPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromRecognizerName', () => { + const result = client.matchProjectFromRecognizerName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.recognizerPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromRecognizerName', () => { + const result = client.matchLocationFromRecognizerName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.recognizerPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRecognizerFromRecognizerName', () => { + const result = client.matchRecognizerFromRecognizerName(fakePath); + assert.strictEqual(result, "recognizerValue"); + assert((client.pathTemplates.recognizerPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/tsconfig.json b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/tsconfig.json new file mode 100644 index 00000000000..ca73e7bfc82 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/tsconfig.json @@ -0,0 +1,22 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2023", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts", + "src/**/*.json", + "samples/**/*.json", + "protos/protos.json" + ] +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/webpack.config.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/webpack.config.js new file mode 100644 index 00000000000..ab57f2ffb88 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech-nodejs/speech-v2-nodejs/webpack.config.js @@ -0,0 +1,64 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: 'Speech', + filename: './speech.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/ + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader' + }, + ], + }, + mode: 'production', +}; diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/.eslintignore b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/.eslintignore new file mode 100644 index 00000000000..cfc348ec4d1 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/.eslintrc.json b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/.gitignore b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/.gitignore new file mode 100644 index 00000000000..d4f03a0df2e --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/.gitignore @@ -0,0 +1,14 @@ +**/*.log +**/node_modules +/.coverage +/coverage +/.nyc_output +/docs/ +/out/ +/build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +package-lock.json +__pycache__ diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/.jsdoc.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/.jsdoc.js new file mode 100644 index 00000000000..51d12943d53 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/.jsdoc.js @@ -0,0 +1,55 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2025 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/speech', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/.mocharc.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/.mocharc.js new file mode 100644 index 00000000000..24e9d15257f --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/.mocharc.js @@ -0,0 +1,33 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/.prettierrc.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/.prettierrc.js new file mode 100644 index 00000000000..d89a632f90b --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/.prettierrc.js @@ -0,0 +1,22 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/README.md b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/README.md new file mode 100644 index 00000000000..deaf898f460 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/README.md @@ -0,0 +1,163 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "The comments you see below are used to generate those parts of the template in later states." +Google Cloud Platform logo + +[homepage]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-speech + +# [Speech: Nodejs Client][homepage] + +This library is considered to be in **preview**. This means it is still a +work-in-progress and under active development. Any release is subject to +backwards-incompatible changes at any time. + +[![npm version](https://img.shields.io/npm/v/@google-cloud/speech.svg)](https://www.npmjs.org/package/@google-cloud/speech) + +Speech client for Node.js + +[//]: # "partials.introduction" + +A comprehensive list of changes in each version may be found in +[the CHANGELOG]([homepage]/CHANGELOG.md). + +* [Speech Nodejs Client API Reference](https://cloud.google.com/nodejs/docs/reference/speech/latest) + + +Read more about the client libraries for Cloud APIs, including the older +Google APIs Client Libraries, in [Client Libraries Explained][explained]. + +[explained]: https://cloud.google.com/apis/docs/client-libraries-explained + +**Table of contents:** + +* [Quickstart](#quickstart) + * [Before you begin](#before-you-begin) + * [Installing the client library](#installing-the-client-library) + +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) + +## Quickstart +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Speech API][enable_api]. +1. [Set up authentication][auth] so you can access the + API from your local workstation. +### Installing the client library + +```bash +npm install @google-cloud/speech +``` + +[//]: # "partials.body" + +## Samples + +Samples are in the [`samples/`]([homepage]/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | +| --------------------------- | --------------------------------- | +| create custom class | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-speech/samples/generated/v1/adaptation.create_custom_class.js) | +| create phrase set | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-speech/samples/generated/v1/adaptation.create_phrase_set.js) | +| delete custom class | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-speech/samples/generated/v1/adaptation.delete_custom_class.js) | +| delete phrase set | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-speech/samples/generated/v1/adaptation.delete_phrase_set.js) | +| get custom class | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-speech/samples/generated/v1/adaptation.get_custom_class.js) | +| get phrase set | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-speech/samples/generated/v1/adaptation.get_phrase_set.js) | +| list custom classes | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-speech/samples/generated/v1/adaptation.list_custom_classes.js) | +| list phrase set | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-speech/samples/generated/v1/adaptation.list_phrase_set.js) | +| update custom class | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-speech/samples/generated/v1/adaptation.update_custom_class.js) | +| update phrase set | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-speech/samples/generated/v1/adaptation.update_phrase_set.js) | +| cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-speech/samples/generated/v1/snippet_metadata_google.cloud.speech.v1.json) | +| long running recognize | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-speech/samples/generated/v1/speech.long_running_recognize.js) | +| recognize | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-speech/samples/generated/v1/speech.recognize.js) | +| streaming recognize | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-speech/samples/generated/v1/speech.streaming_recognize.js) | +| create custom class | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-speech/samples/generated/v1p1beta1/adaptation.create_custom_class.js) | +| create phrase set | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-speech/samples/generated/v1p1beta1/adaptation.create_phrase_set.js) | +| delete custom class | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-speech/samples/generated/v1p1beta1/adaptation.delete_custom_class.js) | +| delete phrase set | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-speech/samples/generated/v1p1beta1/adaptation.delete_phrase_set.js) | +| get custom class | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-speech/samples/generated/v1p1beta1/adaptation.get_custom_class.js) | +| get phrase set | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-speech/samples/generated/v1p1beta1/adaptation.get_phrase_set.js) | +| list custom classes | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-speech/samples/generated/v1p1beta1/adaptation.list_custom_classes.js) | +| list phrase set | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-speech/samples/generated/v1p1beta1/adaptation.list_phrase_set.js) | +| update custom class | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-speech/samples/generated/v1p1beta1/adaptation.update_custom_class.js) | +| update phrase set | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-speech/samples/generated/v1p1beta1/adaptation.update_phrase_set.js) | +| cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-speech/samples/generated/v1p1beta1/snippet_metadata_google.cloud.speech.v1p1beta1.json) | +| long running recognize | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-speech/samples/generated/v1p1beta1/speech.long_running_recognize.js) | +| recognize | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-speech/samples/generated/v1p1beta1/speech.recognize.js) | +| streaming recognize | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-speech/samples/generated/v1p1beta1/speech.streaming_recognize.js) | +| cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-speech/samples/generated/v2/snippet_metadata_google.cloud.speech.v2.json) | +| batch recognize | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-speech/samples/generated/v2/speech.batch_recognize.js) | +| create custom class | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-speech/samples/generated/v2/speech.create_custom_class.js) | +| create phrase set | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-speech/samples/generated/v2/speech.create_phrase_set.js) | +| create recognizer | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-speech/samples/generated/v2/speech.create_recognizer.js) | +| delete custom class | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-speech/samples/generated/v2/speech.delete_custom_class.js) | +| delete phrase set | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-speech/samples/generated/v2/speech.delete_phrase_set.js) | +| delete recognizer | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-speech/samples/generated/v2/speech.delete_recognizer.js) | +| get config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-speech/samples/generated/v2/speech.get_config.js) | +| get custom class | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-speech/samples/generated/v2/speech.get_custom_class.js) | +| get phrase set | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-speech/samples/generated/v2/speech.get_phrase_set.js) | +| get recognizer | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-speech/samples/generated/v2/speech.get_recognizer.js) | +| list custom classes | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-speech/samples/generated/v2/speech.list_custom_classes.js) | +| list phrase sets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-speech/samples/generated/v2/speech.list_phrase_sets.js) | +| list recognizers | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-speech/samples/generated/v2/speech.list_recognizers.js) | +| recognize | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-speech/samples/generated/v2/speech.recognize.js) | +| streaming recognize | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-speech/samples/generated/v2/speech.streaming_recognize.js) | +| undelete custom class | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-speech/samples/generated/v2/speech.undelete_custom_class.js) | +| undelete phrase set | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-speech/samples/generated/v2/speech.undelete_phrase_set.js) | +| undelete recognizer | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-speech/samples/generated/v2/speech.undelete_recognizer.js) | +| update config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-speech/samples/generated/v2/speech.update_config.js) | +| update custom class | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-speech/samples/generated/v2/speech.update_custom_class.js) | +| update phrase set | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-speech/samples/generated/v2/speech.update_phrase_set.js) | +| update recognizer | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-speech/samples/generated/v2/speech.update_recognizer.js) | + + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://github.com/nodejs/release#release-schedule). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. +If you are using an end-of-life version of Node.js, we recommend that you update +as soon as possible to an actively supported LTS version. + +Google's client libraries support legacy versions of Node.js runtimes on a +best-efforts basis with the following warnings: + +* Legacy versions are not tested in continuous integration. +* Some security patches and features cannot be backported. +* Dependencies cannot be kept up-to-date. + +Client libraries targeting some end-of-life versions of Node.js are available, and +can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. +For example, `npm install @google-cloud/speech@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide]([homepage]/CONTRIBUTING.md). + +Please note that this `README.md` +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. + +## License + +Apache Version 2.0 + +See [LICENSE]([homepage]/LICENSE) + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=speech.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local \ No newline at end of file diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/package.json b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/package.json new file mode 100644 index 00000000000..2eb237195cb --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/package.json @@ -0,0 +1,59 @@ +{ + "name": "@google-cloud/speech", + "version": "0.1.0", + "description": "Speech client for Node.js", + "repository": "googleapis/nodejs-speech", + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google speech", + "speech", + "adaptation", + "speech" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test" + }, + "dependencies": { + "google-gax": "^5.1.1-rc.1" + }, + "devDependencies": { + "@types/mocha": "^10.0.10", + "@types/node": "^22.16.2", + "@types/sinon": "^17.0.4", + "c8": "^10.1.3", + "gapic-tools": "^1.0.2", + "gts": "^6.0.2", + "jsdoc": "^4.0.4", + "jsdoc-fresh": "^4.0.0", + "jsdoc-region-tag": "^3.0.0", + "mocha": "^11.7.1", + "pack-n-play": "^3.0.0", + "typescript": "5.8.3", + "sinon": "^21.0.0" + }, + "engines": { + "node": ">=v18" + } +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/protos/google/cloud/speech/v1/cloud_speech.proto b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/protos/google/cloud/speech/v1/cloud_speech.proto new file mode 100644 index 00000000000..6b62e4f94a9 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/protos/google/cloud/speech/v1/cloud_speech.proto @@ -0,0 +1,996 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.speech.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/cloud/speech/v1/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; +import "google/rpc/status.proto"; + +option cc_enable_arenas = true; +option go_package = "cloud.google.com/go/speech/apiv1/speechpb;speechpb"; +option java_multiple_files = true; +option java_outer_classname = "SpeechProto"; +option java_package = "com.google.cloud.speech.v1"; +option objc_class_prefix = "GCS"; + +// Service that implements Google Cloud Speech API. +service Speech { + option (google.api.default_host) = "speech.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Performs synchronous speech recognition: receive results after all audio + // has been sent and processed. + rpc Recognize(RecognizeRequest) returns (RecognizeResponse) { + option (google.api.http) = { + post: "/v1/speech:recognize" + body: "*" + }; + option (google.api.method_signature) = "config,audio"; + } + + // Performs asynchronous speech recognition: receive results via the + // google.longrunning.Operations interface. Returns either an + // `Operation.error` or an `Operation.response` which contains + // a `LongRunningRecognizeResponse` message. + // For more information on asynchronous speech recognition, see the + // [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). + rpc LongRunningRecognize(LongRunningRecognizeRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/speech:longrunningrecognize" + body: "*" + }; + option (google.api.method_signature) = "config,audio"; + option (google.longrunning.operation_info) = { + response_type: "LongRunningRecognizeResponse" + metadata_type: "LongRunningRecognizeMetadata" + }; + } + + // Performs bidirectional streaming speech recognition: receive results while + // sending audio. This method is only available via the gRPC API (not REST). + rpc StreamingRecognize(stream StreamingRecognizeRequest) + returns (stream StreamingRecognizeResponse) {} +} + +// The top-level message sent by the client for the `Recognize` method. +message RecognizeRequest { + // Required. Provides information to the recognizer that specifies how to + // process the request. + RecognitionConfig config = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The audio data to be recognized. + RecognitionAudio audio = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The top-level message sent by the client for the `LongRunningRecognize` +// method. +message LongRunningRecognizeRequest { + // Required. Provides information to the recognizer that specifies how to + // process the request. + RecognitionConfig config = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The audio data to be recognized. + RecognitionAudio audio = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Specifies an optional destination for the recognition results. + TranscriptOutputConfig output_config = 4 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Specifies an optional destination for the recognition results. +message TranscriptOutputConfig { + oneof output_type { + // Specifies a Cloud Storage URI for the recognition results. Must be + // specified in the format: `gs://bucket_name/object_name`, and the bucket + // must already exist. + string gcs_uri = 1; + } +} + +// The top-level message sent by the client for the `StreamingRecognize` method. +// Multiple `StreamingRecognizeRequest` messages are sent. The first message +// must contain a `streaming_config` message and must not contain +// `audio_content`. All subsequent messages must contain `audio_content` and +// must not contain a `streaming_config` message. +message StreamingRecognizeRequest { + // The streaming request, which is either a streaming config or audio content. + oneof streaming_request { + // Provides information to the recognizer that specifies how to process the + // request. The first `StreamingRecognizeRequest` message must contain a + // `streaming_config` message. + StreamingRecognitionConfig streaming_config = 1; + + // The audio data to be recognized. Sequential chunks of audio data are sent + // in sequential `StreamingRecognizeRequest` messages. The first + // `StreamingRecognizeRequest` message must not contain `audio_content` data + // and all subsequent `StreamingRecognizeRequest` messages must contain + // `audio_content` data. The audio bytes must be encoded as specified in + // `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a + // pure binary representation (not base64). See + // [content limits](https://cloud.google.com/speech-to-text/quotas#content). + bytes audio_content = 2; + } +} + +// Provides information to the recognizer that specifies how to process the +// request. +message StreamingRecognitionConfig { + // Events that a timeout can be set on for voice activity. + message VoiceActivityTimeout { + // Duration to timeout the stream if no speech begins. + google.protobuf.Duration speech_start_timeout = 1; + + // Duration to timeout the stream after speech ends. + google.protobuf.Duration speech_end_timeout = 2; + } + + // Required. Provides information to the recognizer that specifies how to + // process the request. + RecognitionConfig config = 1 [(google.api.field_behavior) = REQUIRED]; + + // If `false` or omitted, the recognizer will perform continuous + // recognition (continuing to wait for and process audio even if the user + // pauses speaking) until the client closes the input stream (gRPC API) or + // until the maximum time limit has been reached. May return multiple + // `StreamingRecognitionResult`s with the `is_final` flag set to `true`. + // + // If `true`, the recognizer will detect a single spoken utterance. When it + // detects that the user has paused or stopped speaking, it will return an + // `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no + // more than one `StreamingRecognitionResult` with the `is_final` flag set to + // `true`. + // + // The `single_utterance` field can only be used with specified models, + // otherwise an error is thrown. The `model` field in [`RecognitionConfig`][] + // must be set to: + // + // * `command_and_search` + // * `phone_call` AND additional field `useEnhanced`=`true` + // * The `model` field is left undefined. In this case the API auto-selects + // a model based on any other parameters that you set in + // `RecognitionConfig`. + bool single_utterance = 2; + + // If `true`, interim results (tentative hypotheses) may be + // returned as they become available (these interim results are indicated with + // the `is_final=false` flag). + // If `false` or omitted, only `is_final=true` result(s) are returned. + bool interim_results = 3; + + // If `true`, responses with voice activity speech events will be returned as + // they are detected. + bool enable_voice_activity_events = 5; + + // If set, the server will automatically close the stream after the specified + // duration has elapsed after the last VOICE_ACTIVITY speech event has been + // sent. The field `voice_activity_events` must also be set to true. + VoiceActivityTimeout voice_activity_timeout = 6; +} + +// Provides information to the recognizer that specifies how to process the +// request. +message RecognitionConfig { + // The encoding of the audio data sent in the request. + // + // All encodings support only 1 channel (mono) audio, unless the + // `audio_channel_count` and `enable_separate_recognition_per_channel` fields + // are set. + // + // For best results, the audio source should be captured and transmitted using + // a lossless encoding (`FLAC` or `LINEAR16`). The accuracy of the speech + // recognition can be reduced if lossy codecs are used to capture or transmit + // audio, particularly if background noise is present. Lossy codecs include + // `MULAW`, `AMR`, `AMR_WB`, `OGG_OPUS`, `SPEEX_WITH_HEADER_BYTE`, `MP3`, + // and `WEBM_OPUS`. + // + // The `FLAC` and `WAV` audio file formats include a header that describes the + // included audio content. You can request recognition for `WAV` files that + // contain either `LINEAR16` or `MULAW` encoded audio. + // If you send `FLAC` or `WAV` audio file format in + // your request, you do not need to specify an `AudioEncoding`; the audio + // encoding format is determined from the file header. If you specify + // an `AudioEncoding` when you send send `FLAC` or `WAV` audio, the + // encoding configuration must match the encoding described in the audio + // header; otherwise the request returns an + // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT] error + // code. + enum AudioEncoding { + // Not specified. + ENCODING_UNSPECIFIED = 0; + + // Uncompressed 16-bit signed little-endian samples (Linear PCM). + LINEAR16 = 1; + + // `FLAC` (Free Lossless Audio + // Codec) is the recommended encoding because it is + // lossless--therefore recognition is not compromised--and + // requires only about half the bandwidth of `LINEAR16`. `FLAC` stream + // encoding supports 16-bit and 24-bit samples, however, not all fields in + // `STREAMINFO` are supported. + FLAC = 2; + + // 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. + MULAW = 3; + + // Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000. + AMR = 4; + + // Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000. + AMR_WB = 5; + + // Opus encoded audio frames in Ogg container + // ([OggOpus](https://wiki.xiph.org/OggOpus)). + // `sample_rate_hertz` must be one of 8000, 12000, 16000, 24000, or 48000. + OGG_OPUS = 6; + + // Although the use of lossy encodings is not recommended, if a very low + // bitrate encoding is required, `OGG_OPUS` is highly preferred over + // Speex encoding. The [Speex](https://speex.org/) encoding supported by + // Cloud Speech API has a header byte in each block, as in MIME type + // `audio/x-speex-with-header-byte`. + // It is a variant of the RTP Speex encoding defined in + // [RFC 5574](https://tools.ietf.org/html/rfc5574). + // The stream is a sequence of blocks, one block per RTP packet. Each block + // starts with a byte containing the length of the block, in bytes, followed + // by one or more frames of Speex data, padded to an integral number of + // bytes (octets) as specified in RFC 5574. In other words, each RTP header + // is replaced with a single byte containing the block length. Only Speex + // wideband is supported. `sample_rate_hertz` must be 16000. + SPEEX_WITH_HEADER_BYTE = 7; + + // MP3 audio. MP3 encoding is a Beta feature and only available in + // v1p1beta1. Support all standard MP3 bitrates (which range from 32-320 + // kbps). When using this encoding, `sample_rate_hertz` has to match the + // sample rate of the file being used. + MP3 = 8; + + // Opus encoded audio frames in WebM container + // ([OggOpus](https://wiki.xiph.org/OggOpus)). `sample_rate_hertz` must be + // one of 8000, 12000, 16000, 24000, or 48000. + WEBM_OPUS = 9; + } + + // Encoding of audio data sent in all `RecognitionAudio` messages. + // This field is optional for `FLAC` and `WAV` audio files and required + // for all other audio formats. For details, see + // [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding]. + AudioEncoding encoding = 1; + + // Sample rate in Hertz of the audio data sent in all + // `RecognitionAudio` messages. Valid values are: 8000-48000. + // 16000 is optimal. For best results, set the sampling rate of the audio + // source to 16000 Hz. If that's not possible, use the native sample rate of + // the audio source (instead of re-sampling). + // This field is optional for FLAC and WAV audio files, but is + // required for all other audio formats. For details, see + // [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding]. + int32 sample_rate_hertz = 2; + + // The number of channels in the input audio data. + // ONLY set this for MULTI-CHANNEL recognition. + // Valid values for LINEAR16, OGG_OPUS and FLAC are `1`-`8`. + // Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`. + // If `0` or omitted, defaults to one channel (mono). + // Note: We only recognize the first channel by default. + // To perform independent recognition on each channel set + // `enable_separate_recognition_per_channel` to 'true'. + int32 audio_channel_count = 7; + + // This needs to be set to `true` explicitly and `audio_channel_count` > 1 + // to get each channel recognized separately. The recognition result will + // contain a `channel_tag` field to state which channel that result belongs + // to. If this is not true, we will only recognize the first channel. The + // request is billed cumulatively for all channels recognized: + // `audio_channel_count` multiplied by the length of the audio. + bool enable_separate_recognition_per_channel = 12; + + // Required. The language of the supplied audio as a + // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. + // Example: "en-US". + // See [Language + // Support](https://cloud.google.com/speech-to-text/docs/languages) for a list + // of the currently supported language codes. + string language_code = 3 [(google.api.field_behavior) = REQUIRED]; + + // A list of up to 3 additional + // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags, + // listing possible alternative languages of the supplied audio. + // See [Language + // Support](https://cloud.google.com/speech-to-text/docs/languages) for a list + // of the currently supported language codes. If alternative languages are + // listed, recognition result will contain recognition in the most likely + // language detected including the main language_code. The recognition result + // will include the language tag of the language detected in the audio. Note: + // This feature is only supported for Voice Command and Voice Search use cases + // and performance may vary for other use cases (e.g., phone call + // transcription). + repeated string alternative_language_codes = 18; + + // Maximum number of recognition hypotheses to be returned. + // Specifically, the maximum number of `SpeechRecognitionAlternative` messages + // within each `SpeechRecognitionResult`. + // The server may return fewer than `max_alternatives`. + // Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of + // one. If omitted, will return a maximum of one. + int32 max_alternatives = 4; + + // If set to `true`, the server will attempt to filter out + // profanities, replacing all but the initial character in each filtered word + // with asterisks, e.g. "f***". If set to `false` or omitted, profanities + // won't be filtered out. + bool profanity_filter = 5; + + // Speech adaptation configuration improves the accuracy of speech + // recognition. For more information, see the [speech + // adaptation](https://cloud.google.com/speech-to-text/docs/adaptation) + // documentation. + // When speech adaptation is set it supersedes the `speech_contexts` field. + SpeechAdaptation adaptation = 20; + + // Optional. Use transcription normalization to automatically replace parts of + // the transcript with phrases of your choosing. For StreamingRecognize, this + // normalization only applies to stable partial transcripts (stability > 0.8) + // and final transcripts. + TranscriptNormalization transcript_normalization = 24 + [(google.api.field_behavior) = OPTIONAL]; + + // Array of [SpeechContext][google.cloud.speech.v1.SpeechContext]. + // A means to provide context to assist the speech recognition. For more + // information, see + // [speech + // adaptation](https://cloud.google.com/speech-to-text/docs/adaptation). + repeated SpeechContext speech_contexts = 6; + + // If `true`, the top result includes a list of words and + // the start and end time offsets (timestamps) for those words. If + // `false`, no word-level time offset information is returned. The default is + // `false`. + bool enable_word_time_offsets = 8; + + // If `true`, the top result includes a list of words and the + // confidence for those words. If `false`, no word-level confidence + // information is returned. The default is `false`. + bool enable_word_confidence = 15; + + // If 'true', adds punctuation to recognition result hypotheses. + // This feature is only available in select languages. Setting this for + // requests in other languages has no effect at all. + // The default 'false' value does not add punctuation to result hypotheses. + bool enable_automatic_punctuation = 11; + + // The spoken punctuation behavior for the call + // If not set, uses default behavior based on model of choice + // e.g. command_and_search will enable spoken punctuation by default + // If 'true', replaces spoken punctuation with the corresponding symbols in + // the request. For example, "how are you question mark" becomes "how are + // you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation + // for support. If 'false', spoken punctuation is not replaced. + google.protobuf.BoolValue enable_spoken_punctuation = 22; + + // The spoken emoji behavior for the call + // If not set, uses default behavior based on model of choice + // If 'true', adds spoken emoji formatting for the request. This will replace + // spoken emojis with the corresponding Unicode symbols in the final + // transcript. If 'false', spoken emojis are not replaced. + google.protobuf.BoolValue enable_spoken_emojis = 23; + + // Config to enable speaker diarization and set additional + // parameters to make diarization better suited for your application. + // Note: When this is enabled, we send all the words from the beginning of the + // audio for the top alternative in every consecutive STREAMING responses. + // This is done in order to improve our speaker tags as our models learn to + // identify the speakers in the conversation over time. + // For non-streaming requests, the diarization results will be provided only + // in the top alternative of the FINAL SpeechRecognitionResult. + SpeakerDiarizationConfig diarization_config = 19; + + // Metadata regarding this request. + RecognitionMetadata metadata = 9; + + // Which model to select for the given request. Select the model + // best suited to your domain to get best results. If a model is not + // explicitly specified, then we auto-select a model based on the parameters + // in the RecognitionConfig. + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + //
ModelDescription
latest_longBest for long form content like media or conversation.
latest_shortBest for short form content like commands or single shot directed + // speech.
command_and_searchBest for short queries such as voice commands or voice search.
phone_callBest for audio that originated from a phone call (typically + // recorded at an 8khz sampling rate).
videoBest for audio that originated from video or includes multiple + // speakers. Ideally the audio is recorded at a 16khz or greater + // sampling rate. This is a premium model that costs more than the + // standard rate.
defaultBest for audio that is not one of the specific audio models. + // For example, long-form audio. Ideally the audio is high-fidelity, + // recorded at a 16khz or greater sampling rate.
medical_conversationBest for audio that originated from a conversation between a + // medical provider and patient.
medical_dictationBest for audio that originated from dictation notes by a medical + // provider.
+ string model = 13; + + // Set to true to use an enhanced model for speech recognition. + // If `use_enhanced` is set to true and the `model` field is not set, then + // an appropriate enhanced model is chosen if an enhanced model exists for + // the audio. + // + // If `use_enhanced` is true and an enhanced version of the specified model + // does not exist, then the speech is recognized using the standard version + // of the specified model. + bool use_enhanced = 14; +} + +// Config to enable speaker diarization. +message SpeakerDiarizationConfig { + // If 'true', enables speaker detection for each recognized word in + // the top alternative of the recognition result using a speaker_label + // provided in the WordInfo. + bool enable_speaker_diarization = 1; + + // Minimum number of speakers in the conversation. This range gives you more + // flexibility by allowing the system to automatically determine the correct + // number of speakers. If not set, the default value is 2. + int32 min_speaker_count = 2; + + // Maximum number of speakers in the conversation. This range gives you more + // flexibility by allowing the system to automatically determine the correct + // number of speakers. If not set, the default value is 6. + int32 max_speaker_count = 3; + + // Output only. Unused. + int32 speaker_tag = 5 + [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Description of audio data to be recognized. +message RecognitionMetadata { + option deprecated = true; + + // Use case categories that the audio recognition request can be described + // by. + enum InteractionType { + // Use case is either unknown or is something other than one of the other + // values below. + INTERACTION_TYPE_UNSPECIFIED = 0; + + // Multiple people in a conversation or discussion. For example in a + // meeting with two or more people actively participating. Typically + // all the primary people speaking would be in the same room (if not, + // see PHONE_CALL) + DISCUSSION = 1; + + // One or more persons lecturing or presenting to others, mostly + // uninterrupted. + PRESENTATION = 2; + + // A phone-call or video-conference in which two or more people, who are + // not in the same room, are actively participating. + PHONE_CALL = 3; + + // A recorded message intended for another person to listen to. + VOICEMAIL = 4; + + // Professionally produced audio (eg. TV Show, Podcast). + PROFESSIONALLY_PRODUCED = 5; + + // Transcribe spoken questions and queries into text. + VOICE_SEARCH = 6; + + // Transcribe voice commands, such as for controlling a device. + VOICE_COMMAND = 7; + + // Transcribe speech to text to create a written document, such as a + // text-message, email or report. + DICTATION = 8; + } + + // Enumerates the types of capture settings describing an audio file. + enum MicrophoneDistance { + // Audio type is not known. + MICROPHONE_DISTANCE_UNSPECIFIED = 0; + + // The audio was captured from a closely placed microphone. Eg. phone, + // dictaphone, or handheld microphone. Generally if there speaker is within + // 1 meter of the microphone. + NEARFIELD = 1; + + // The speaker if within 3 meters of the microphone. + MIDFIELD = 2; + + // The speaker is more than 3 meters away from the microphone. + FARFIELD = 3; + } + + // The original media the speech was recorded on. + enum OriginalMediaType { + // Unknown original media type. + ORIGINAL_MEDIA_TYPE_UNSPECIFIED = 0; + + // The speech data is an audio recording. + AUDIO = 1; + + // The speech data originally recorded on a video. + VIDEO = 2; + } + + // The type of device the speech was recorded with. + enum RecordingDeviceType { + // The recording device is unknown. + RECORDING_DEVICE_TYPE_UNSPECIFIED = 0; + + // Speech was recorded on a smartphone. + SMARTPHONE = 1; + + // Speech was recorded using a personal computer or tablet. + PC = 2; + + // Speech was recorded over a phone line. + PHONE_LINE = 3; + + // Speech was recorded in a vehicle. + VEHICLE = 4; + + // Speech was recorded outdoors. + OTHER_OUTDOOR_DEVICE = 5; + + // Speech was recorded indoors. + OTHER_INDOOR_DEVICE = 6; + } + + // The use case most closely describing the audio content to be recognized. + InteractionType interaction_type = 1; + + // The industry vertical to which this speech recognition request most + // closely applies. This is most indicative of the topics contained + // in the audio. Use the 6-digit NAICS code to identify the industry + // vertical - see https://www.naics.com/search/. + uint32 industry_naics_code_of_audio = 3; + + // The audio type that most closely describes the audio being recognized. + MicrophoneDistance microphone_distance = 4; + + // The original media the speech was recorded on. + OriginalMediaType original_media_type = 5; + + // The type of device the speech was recorded with. + RecordingDeviceType recording_device_type = 6; + + // The device used to make the recording. Examples 'Nexus 5X' or + // 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or + // 'Cardioid Microphone'. + string recording_device_name = 7; + + // Mime type of the original audio file. For example `audio/m4a`, + // `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`. + // A list of possible audio mime types is maintained at + // http://www.iana.org/assignments/media-types/media-types.xhtml#audio + string original_mime_type = 8; + + // Description of the content. Eg. "Recordings of federal supreme court + // hearings from 2012". + string audio_topic = 10; +} + +// Provides "hints" to the speech recognizer to favor specific words and phrases +// in the results. +message SpeechContext { + // A list of strings containing words and phrases "hints" so that + // the speech recognition is more likely to recognize them. This can be used + // to improve the accuracy for specific words and phrases, for example, if + // specific commands are typically spoken by the user. This can also be used + // to add additional words to the vocabulary of the recognizer. See + // [usage limits](https://cloud.google.com/speech-to-text/quotas#content). + // + // List items can also be set to classes for groups of words that represent + // common concepts that occur in natural language. For example, rather than + // providing phrase hints for every month of the year, using the $MONTH class + // improves the likelihood of correctly transcribing audio that includes + // months. + repeated string phrases = 1; + + // Hint Boost. Positive value will increase the probability that a specific + // phrase will be recognized over other similar sounding phrases. The higher + // the boost, the higher the chance of false positive recognition as well. + // Negative boost values would correspond to anti-biasing. Anti-biasing is not + // enabled, so negative boost will simply be ignored. Though `boost` can + // accept a wide range of positive values, most use cases are best served with + // values between 0 and 20. We recommend using a binary search approach to + // finding the optimal value for your use case. + float boost = 4; +} + +// Contains audio data in the encoding specified in the `RecognitionConfig`. +// Either `content` or `uri` must be supplied. Supplying both or neither +// returns [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. +// See [content limits](https://cloud.google.com/speech-to-text/quotas#content). +message RecognitionAudio { + // The audio source, which is either inline content or a Google Cloud + // Storage uri. + oneof audio_source { + // The audio data bytes encoded as specified in + // `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a + // pure binary representation, whereas JSON representations use base64. + bytes content = 1; + + // URI that points to a file that contains audio data bytes as specified in + // `RecognitionConfig`. The file must not be compressed (for example, gzip). + // Currently, only Google Cloud Storage URIs are + // supported, which must be specified in the following format: + // `gs://bucket_name/object_name` (other URI formats return + // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). + // For more information, see [Request + // URIs](https://cloud.google.com/storage/docs/reference-uris). + string uri = 2; + } +} + +// The only message returned to the client by the `Recognize` method. It +// contains the result as zero or more sequential `SpeechRecognitionResult` +// messages. +message RecognizeResponse { + // Sequential list of transcription results corresponding to + // sequential portions of audio. + repeated SpeechRecognitionResult results = 2; + + // When available, billed audio seconds for the corresponding request. + google.protobuf.Duration total_billed_time = 3; + + // Provides information on adaptation behavior in response + SpeechAdaptationInfo speech_adaptation_info = 7; + + // The ID associated with the request. This is a unique ID specific only to + // the given request. + int64 request_id = 8; +} + +// The only message returned to the client by the `LongRunningRecognize` method. +// It contains the result as zero or more sequential `SpeechRecognitionResult` +// messages. It is included in the `result.response` field of the `Operation` +// returned by the `GetOperation` call of the `google::longrunning::Operations` +// service. +message LongRunningRecognizeResponse { + // Sequential list of transcription results corresponding to + // sequential portions of audio. + repeated SpeechRecognitionResult results = 2; + + // When available, billed audio seconds for the corresponding request. + google.protobuf.Duration total_billed_time = 3; + + // Original output config if present in the request. + TranscriptOutputConfig output_config = 6; + + // If the transcript output fails this field contains the relevant error. + google.rpc.Status output_error = 7; + + // Provides information on speech adaptation behavior in response + SpeechAdaptationInfo speech_adaptation_info = 8; + + // The ID associated with the request. This is a unique ID specific only to + // the given request. + int64 request_id = 9; +} + +// Describes the progress of a long-running `LongRunningRecognize` call. It is +// included in the `metadata` field of the `Operation` returned by the +// `GetOperation` call of the `google::longrunning::Operations` service. +message LongRunningRecognizeMetadata { + // Approximate percentage of audio processed thus far. Guaranteed to be 100 + // when the audio is fully processed and the results are available. + int32 progress_percent = 1; + + // Time when the request was received. + google.protobuf.Timestamp start_time = 2; + + // Time of the most recent processing update. + google.protobuf.Timestamp last_update_time = 3; + + // Output only. The URI of the audio file being transcribed. Empty if the + // audio was sent as byte content. + string uri = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// `StreamingRecognizeResponse` is the only message returned to the client by +// `StreamingRecognize`. A series of zero or more `StreamingRecognizeResponse` +// messages are streamed back to the client. If there is no recognizable +// audio, and `single_utterance` is set to false, then no messages are streamed +// back to the client. +// +// Here's an example of a series of `StreamingRecognizeResponse`s that might be +// returned while processing audio: +// +// 1. results { alternatives { transcript: "tube" } stability: 0.01 } +// +// 2. results { alternatives { transcript: "to be a" } stability: 0.01 } +// +// 3. results { alternatives { transcript: "to be" } stability: 0.9 } +// results { alternatives { transcript: " or not to be" } stability: 0.01 } +// +// 4. results { alternatives { transcript: "to be or not to be" +// confidence: 0.92 } +// alternatives { transcript: "to bee or not to bee" } +// is_final: true } +// +// 5. results { alternatives { transcript: " that's" } stability: 0.01 } +// +// 6. results { alternatives { transcript: " that is" } stability: 0.9 } +// results { alternatives { transcript: " the question" } stability: 0.01 } +// +// 7. results { alternatives { transcript: " that is the question" +// confidence: 0.98 } +// alternatives { transcript: " that was the question" } +// is_final: true } +// +// Notes: +// +// - Only two of the above responses #4 and #7 contain final results; they are +// indicated by `is_final: true`. Concatenating these together generates the +// full transcript: "to be or not to be that is the question". +// +// - The others contain interim `results`. #3 and #6 contain two interim +// `results`: the first portion has a high stability and is less likely to +// change; the second portion has a low stability and is very likely to +// change. A UI designer might choose to show only high stability `results`. +// +// - The specific `stability` and `confidence` values shown above are only for +// illustrative purposes. Actual values may vary. +// +// - In each response, only one of these fields will be set: +// `error`, +// `speech_event_type`, or +// one or more (repeated) `results`. +message StreamingRecognizeResponse { + // Indicates the type of speech event. + enum SpeechEventType { + // No speech event specified. + SPEECH_EVENT_UNSPECIFIED = 0; + + // This event indicates that the server has detected the end of the user's + // speech utterance and expects no additional speech. Therefore, the server + // will not process additional audio (although it may subsequently return + // additional results). The client should stop sending additional audio + // data, half-close the gRPC connection, and wait for any additional results + // until the server closes the gRPC connection. This event is only sent if + // `single_utterance` was set to `true`, and is not used otherwise. + END_OF_SINGLE_UTTERANCE = 1; + + // This event indicates that the server has detected the beginning of human + // voice activity in the stream. This event can be returned multiple times + // if speech starts and stops repeatedly throughout the stream. This event + // is only sent if `voice_activity_events` is set to true. + SPEECH_ACTIVITY_BEGIN = 2; + + // This event indicates that the server has detected the end of human voice + // activity in the stream. This event can be returned multiple times if + // speech starts and stops repeatedly throughout the stream. This event is + // only sent if `voice_activity_events` is set to true. + SPEECH_ACTIVITY_END = 3; + + // This event indicates that the user-set timeout for speech activity begin + // or end has exceeded. Upon receiving this event, the client is expected to + // send a half close. Further audio will not be processed. + SPEECH_ACTIVITY_TIMEOUT = 4; + } + + // If set, returns a [google.rpc.Status][google.rpc.Status] message that + // specifies the error for the operation. + google.rpc.Status error = 1; + + // This repeated list contains zero or more results that + // correspond to consecutive portions of the audio currently being processed. + // It contains zero or one `is_final=true` result (the newly settled portion), + // followed by zero or more `is_final=false` results (the interim results). + repeated StreamingRecognitionResult results = 2; + + // Indicates the type of speech event. + SpeechEventType speech_event_type = 4; + + // Time offset between the beginning of the audio and event emission. + google.protobuf.Duration speech_event_time = 8; + + // When available, billed audio seconds for the stream. + // Set only if this is the last response in the stream. + google.protobuf.Duration total_billed_time = 5; + + // Provides information on adaptation behavior in response + SpeechAdaptationInfo speech_adaptation_info = 9; + + // The ID associated with the request. This is a unique ID specific only to + // the given request. + int64 request_id = 10; +} + +// A streaming speech recognition result corresponding to a portion of the audio +// that is currently being processed. +message StreamingRecognitionResult { + // May contain one or more recognition hypotheses (up to the + // maximum specified in `max_alternatives`). + // These alternatives are ordered in terms of accuracy, with the top (first) + // alternative being the most probable, as ranked by the recognizer. + repeated SpeechRecognitionAlternative alternatives = 1; + + // If `false`, this `StreamingRecognitionResult` represents an + // interim result that may change. If `true`, this is the final time the + // speech service will return this particular `StreamingRecognitionResult`, + // the recognizer will not return any further hypotheses for this portion of + // the transcript and corresponding audio. + bool is_final = 2; + + // An estimate of the likelihood that the recognizer will not + // change its guess about this interim result. Values range from 0.0 + // (completely unstable) to 1.0 (completely stable). + // This field is only provided for interim results (`is_final=false`). + // The default of 0.0 is a sentinel value indicating `stability` was not set. + float stability = 3; + + // Time offset of the end of this result relative to the + // beginning of the audio. + google.protobuf.Duration result_end_time = 4; + + // For multi-channel audio, this is the channel number corresponding to the + // recognized result for the audio from that channel. + // For audio_channel_count = N, its output values can range from '1' to 'N'. + int32 channel_tag = 5; + + // Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + // language tag of the language in this result. This language code was + // detected to have the most likelihood of being spoken in the audio. + string language_code = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A speech recognition result corresponding to a portion of the audio. +message SpeechRecognitionResult { + // May contain one or more recognition hypotheses (up to the + // maximum specified in `max_alternatives`). + // These alternatives are ordered in terms of accuracy, with the top (first) + // alternative being the most probable, as ranked by the recognizer. + repeated SpeechRecognitionAlternative alternatives = 1; + + // For multi-channel audio, this is the channel number corresponding to the + // recognized result for the audio from that channel. + // For audio_channel_count = N, its output values can range from '1' to 'N'. + int32 channel_tag = 2; + + // Time offset of the end of this result relative to the + // beginning of the audio. + google.protobuf.Duration result_end_time = 4; + + // Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + // language tag of the language in this result. This language code was + // detected to have the most likelihood of being spoken in the audio. + string language_code = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Alternative hypotheses (a.k.a. n-best list). +message SpeechRecognitionAlternative { + // Transcript text representing the words that the user spoke. + // In languages that use spaces to separate words, the transcript might have a + // leading space if it isn't the first result. You can concatenate each result + // to obtain the full transcript without using a separator. + string transcript = 1; + + // The confidence estimate between 0.0 and 1.0. A higher number + // indicates an estimated greater likelihood that the recognized words are + // correct. This field is set only for the top alternative of a non-streaming + // result or, of a streaming result where `is_final=true`. + // This field is not guaranteed to be accurate and users should not rely on it + // to be always provided. + // The default of 0.0 is a sentinel value indicating `confidence` was not set. + float confidence = 2; + + // A list of word-specific information for each recognized word. + // Note: When `enable_speaker_diarization` is true, you will see all the words + // from the beginning of the audio. + repeated WordInfo words = 3; +} + +// Word-specific information for recognized words. +message WordInfo { + // Time offset relative to the beginning of the audio, + // and corresponding to the start of the spoken word. + // This field is only set if `enable_word_time_offsets=true` and only + // in the top hypothesis. + // This is an experimental feature and the accuracy of the time offset can + // vary. + google.protobuf.Duration start_time = 1; + + // Time offset relative to the beginning of the audio, + // and corresponding to the end of the spoken word. + // This field is only set if `enable_word_time_offsets=true` and only + // in the top hypothesis. + // This is an experimental feature and the accuracy of the time offset can + // vary. + google.protobuf.Duration end_time = 2; + + // The word corresponding to this set of information. + string word = 3; + + // The confidence estimate between 0.0 and 1.0. A higher number + // indicates an estimated greater likelihood that the recognized words are + // correct. This field is set only for the top alternative of a non-streaming + // result or, of a streaming result where `is_final=true`. + // This field is not guaranteed to be accurate and users should not rely on it + // to be always provided. + // The default of 0.0 is a sentinel value indicating `confidence` was not set. + float confidence = 4; + + // Output only. A distinct integer value is assigned for every speaker within + // the audio. This field specifies which one of those speakers was detected to + // have spoken this word. Value ranges from '1' to diarization_speaker_count. + // speaker_tag is set if enable_speaker_diarization = 'true' and only for the + // top alternative. + // Note: Use speaker_label instead. + int32 speaker_tag = 5 + [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A label value assigned for every unique speaker within the + // audio. This field specifies which speaker was detected to have spoken this + // word. For some models, like medical_conversation this can be actual speaker + // role, for example "patient" or "provider", but generally this would be a + // number identifying a speaker. This field is only set if + // enable_speaker_diarization = 'true' and only for the top alternative. + string speaker_label = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Information on speech adaptation use in results +message SpeechAdaptationInfo { + // Whether there was a timeout when applying speech adaptation. If true, + // adaptation had no effect in the response transcript. + bool adaptation_timeout = 1; + + // If set, returns a message specifying which part of the speech adaptation + // request timed out. + string timeout_message = 4; +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/protos/google/cloud/speech/v1/cloud_speech_adaptation.proto b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/protos/google/cloud/speech/v1/cloud_speech_adaptation.proto new file mode 100644 index 00000000000..b9895c2d1bc --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/protos/google/cloud/speech/v1/cloud_speech_adaptation.proto @@ -0,0 +1,376 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.speech.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/speech/v1/resource.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option cc_enable_arenas = true; +option go_package = "cloud.google.com/go/speech/apiv1/speechpb;speechpb"; +option java_multiple_files = true; +option java_outer_classname = "SpeechAdaptationProto"; +option java_package = "com.google.cloud.speech.v1"; +option objc_class_prefix = "GCS"; + +// Service that implements Google Cloud Speech Adaptation API. +service Adaptation { + option (google.api.default_host) = "speech.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Create a set of phrase hints. Each item in the set can be a single word or + // a multi-word phrase. The items in the PhraseSet are favored by the + // recognition model when you send a call that includes the PhraseSet. + rpc CreatePhraseSet(CreatePhraseSetRequest) returns (PhraseSet) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/phraseSets" + body: "*" + }; + option (google.api.method_signature) = "parent,phrase_set,phrase_set_id"; + } + + // Get a phrase set. + rpc GetPhraseSet(GetPhraseSetRequest) returns (PhraseSet) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/phraseSets/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List phrase sets. + rpc ListPhraseSet(ListPhraseSetRequest) returns (ListPhraseSetResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/phraseSets" + }; + option (google.api.method_signature) = "parent"; + } + + // Update a phrase set. + rpc UpdatePhraseSet(UpdatePhraseSetRequest) returns (PhraseSet) { + option (google.api.http) = { + patch: "/v1/{phrase_set.name=projects/*/locations/*/phraseSets/*}" + body: "phrase_set" + }; + option (google.api.method_signature) = "phrase_set,update_mask"; + } + + // Delete a phrase set. + rpc DeletePhraseSet(DeletePhraseSetRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/phraseSets/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Create a custom class. + rpc CreateCustomClass(CreateCustomClassRequest) returns (CustomClass) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/customClasses" + body: "*" + }; + option (google.api.method_signature) = + "parent,custom_class,custom_class_id"; + } + + // Get a custom class. + rpc GetCustomClass(GetCustomClassRequest) returns (CustomClass) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/customClasses/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List custom classes. + rpc ListCustomClasses(ListCustomClassesRequest) + returns (ListCustomClassesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/customClasses" + }; + option (google.api.method_signature) = "parent"; + } + + // Update a custom class. + rpc UpdateCustomClass(UpdateCustomClassRequest) returns (CustomClass) { + option (google.api.http) = { + patch: "/v1/{custom_class.name=projects/*/locations/*/customClasses/*}" + body: "custom_class" + }; + option (google.api.method_signature) = "custom_class,update_mask"; + } + + // Delete a custom class. + rpc DeleteCustomClass(DeleteCustomClassRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/customClasses/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// Message sent by the client for the `CreatePhraseSet` method. +message CreatePhraseSetRequest { + // Required. The parent resource where this phrase set will be created. + // Format: + // + // `projects/{project}/locations/{location}` + // + // Speech-to-Text supports three locations: `global`, `us` (US North America), + // and `eu` (Europe). If you are calling the `speech.googleapis.com` + // endpoint, use the `global` location. To specify a region, use a + // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + // with matching `us` or `eu` location value. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "speech.googleapis.com/PhraseSet" + } + ]; + + // Required. The ID to use for the phrase set, which will become the final + // component of the phrase set's resource name. + // + // This value should restrict to letters, numbers, and hyphens, with the first + // character a letter, the last a letter or a number, and be 4-63 characters. + string phrase_set_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The phrase set to create. + PhraseSet phrase_set = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Message sent by the client for the `UpdatePhraseSet` method. +message UpdatePhraseSetRequest { + // Required. The phrase set to update. + // + // The phrase set's `name` field is used to identify the set to be + // updated. Format: + // + // `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + // + // Speech-to-Text supports three locations: `global`, `us` (US North America), + // and `eu` (Europe). If you are calling the `speech.googleapis.com` + // endpoint, use the `global` location. To specify a region, use a + // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + // with matching `us` or `eu` location value. + PhraseSet phrase_set = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Message sent by the client for the `GetPhraseSet` method. +message GetPhraseSetRequest { + // Required. The name of the phrase set to retrieve. Format: + // + // `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + // + // Speech-to-Text supports three locations: `global`, `us` (US North America), + // and `eu` (Europe). If you are calling the `speech.googleapis.com` + // endpoint, use the `global` location. To specify a region, use a + // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + // with matching `us` or `eu` location value. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "speech.googleapis.com/PhraseSet" + } + ]; +} + +// Message sent by the client for the `ListPhraseSet` method. +message ListPhraseSetRequest { + // Required. The parent, which owns this collection of phrase set. Format: + // + // `projects/{project}/locations/{location}` + // + // Speech-to-Text supports three locations: `global`, `us` (US North America), + // and `eu` (Europe). If you are calling the `speech.googleapis.com` + // endpoint, use the `global` location. To specify a region, use a + // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + // with matching `us` or `eu` location value. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "speech.googleapis.com/PhraseSet" + } + ]; + + // The maximum number of phrase sets to return. The service may return + // fewer than this value. If unspecified, at most 50 phrase sets will be + // returned. The maximum value is 1000; values above 1000 will be coerced to + // 1000. + int32 page_size = 2; + + // A page token, received from a previous `ListPhraseSet` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListPhraseSet` must + // match the call that provided the page token. + string page_token = 3; +} + +// Message returned to the client by the `ListPhraseSet` method. +message ListPhraseSetResponse { + // The phrase set. + repeated PhraseSet phrase_sets = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Message sent by the client for the `DeletePhraseSet` method. +message DeletePhraseSetRequest { + // Required. The name of the phrase set to delete. Format: + // + // `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "speech.googleapis.com/PhraseSet" + } + ]; +} + +// Message sent by the client for the `CreateCustomClass` method. +message CreateCustomClassRequest { + // Required. The parent resource where this custom class will be created. + // Format: + // + // `projects/{project}/locations/{location}/customClasses` + // + // Speech-to-Text supports three locations: `global`, `us` (US North America), + // and `eu` (Europe). If you are calling the `speech.googleapis.com` + // endpoint, use the `global` location. To specify a region, use a + // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + // with matching `us` or `eu` location value. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "speech.googleapis.com/CustomClass" + } + ]; + + // Required. The ID to use for the custom class, which will become the final + // component of the custom class' resource name. + // + // This value should restrict to letters, numbers, and hyphens, with the first + // character a letter, the last a letter or a number, and be 4-63 characters. + string custom_class_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The custom class to create. + CustomClass custom_class = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Message sent by the client for the `UpdateCustomClass` method. +message UpdateCustomClassRequest { + // Required. The custom class to update. + // + // The custom class's `name` field is used to identify the custom class to be + // updated. Format: + // + // `projects/{project}/locations/{location}/customClasses/{custom_class}` + // + // Speech-to-Text supports three locations: `global`, `us` (US North America), + // and `eu` (Europe). If you are calling the `speech.googleapis.com` + // endpoint, use the `global` location. To specify a region, use a + // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + // with matching `us` or `eu` location value. + CustomClass custom_class = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Message sent by the client for the `GetCustomClass` method. +message GetCustomClassRequest { + // Required. The name of the custom class to retrieve. Format: + // + // `projects/{project}/locations/{location}/customClasses/{custom_class}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "speech.googleapis.com/CustomClass" + } + ]; +} + +// Message sent by the client for the `ListCustomClasses` method. +message ListCustomClassesRequest { + // Required. The parent, which owns this collection of custom classes. Format: + // + // `projects/{project}/locations/{location}/customClasses` + // + // Speech-to-Text supports three locations: `global`, `us` (US North America), + // and `eu` (Europe). If you are calling the `speech.googleapis.com` + // endpoint, use the `global` location. To specify a region, use a + // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + // with matching `us` or `eu` location value. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "speech.googleapis.com/CustomClass" + } + ]; + + // The maximum number of custom classes to return. The service may return + // fewer than this value. If unspecified, at most 50 custom classes will be + // returned. The maximum value is 1000; values above 1000 will be coerced to + // 1000. + int32 page_size = 2; + + // A page token, received from a previous `ListCustomClass` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListCustomClass` must + // match the call that provided the page token. + string page_token = 3; +} + +// Message returned to the client by the `ListCustomClasses` method. +message ListCustomClassesResponse { + // The custom classes. + repeated CustomClass custom_classes = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Message sent by the client for the `DeleteCustomClass` method. +message DeleteCustomClassRequest { + // Required. The name of the custom class to delete. Format: + // + // `projects/{project}/locations/{location}/customClasses/{custom_class}` + // + // Speech-to-Text supports three locations: `global`, `us` (US North America), + // and `eu` (Europe). If you are calling the `speech.googleapis.com` + // endpoint, use the `global` location. To specify a region, use a + // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + // with matching `us` or `eu` location value. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "speech.googleapis.com/CustomClass" + } + ]; +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/protos/google/cloud/speech/v1/resource.proto b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/protos/google/cloud/speech/v1/resource.proto new file mode 100644 index 00000000000..b88b5d491c2 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/protos/google/cloud/speech/v1/resource.proto @@ -0,0 +1,173 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.speech.v1; + +import "google/api/resource.proto"; + +option cc_enable_arenas = true; +option go_package = "cloud.google.com/go/speech/apiv1/speechpb;speechpb"; +option java_multiple_files = true; +option java_outer_classname = "SpeechResourceProto"; +option java_package = "com.google.cloud.speech.v1"; +option objc_class_prefix = "GCS"; + +// A set of words or phrases that represents a common concept likely to appear +// in your audio, for example a list of passenger ship names. CustomClass items +// can be substituted into placeholders that you set in PhraseSet phrases. +message CustomClass { + option (google.api.resource) = { + type: "speech.googleapis.com/CustomClass" + pattern: "projects/{project}/locations/{location}/customClasses/{custom_class}" + }; + + // An item of the class. + message ClassItem { + // The class item's value. + string value = 1; + } + + // The resource name of the custom class. + string name = 1; + + // If this custom class is a resource, the custom_class_id is the resource id + // of the CustomClass. Case sensitive. + string custom_class_id = 2; + + // A collection of class items. + repeated ClassItem items = 3; +} + +// Provides "hints" to the speech recognizer to favor specific words and phrases +// in the results. +message PhraseSet { + option (google.api.resource) = { + type: "speech.googleapis.com/PhraseSet" + pattern: "projects/{project}/locations/{location}/phraseSets/{phrase_set}" + }; + + // A phrases containing words and phrase "hints" so that + // the speech recognition is more likely to recognize them. This can be used + // to improve the accuracy for specific words and phrases, for example, if + // specific commands are typically spoken by the user. This can also be used + // to add additional words to the vocabulary of the recognizer. See + // [usage limits](https://cloud.google.com/speech-to-text/quotas#content). + // + // List items can also include pre-built or custom classes containing groups + // of words that represent common concepts that occur in natural language. For + // example, rather than providing a phrase hint for every month of the + // year (e.g. "i was born in january", "i was born in febuary", ...), use the + // pre-built `$MONTH` class improves the likelihood of correctly transcribing + // audio that includes months (e.g. "i was born in $month"). + // To refer to pre-built classes, use the class' symbol prepended with `$` + // e.g. `$MONTH`. To refer to custom classes that were defined inline in the + // request, set the class's `custom_class_id` to a string unique to all class + // resources and inline classes. Then use the class' id wrapped in $`{...}` + // e.g. "${my-months}". To refer to custom classes resources, use the class' + // id wrapped in `${}` (e.g. `${my-months}`). + // + // Speech-to-Text supports three locations: `global`, `us` (US North America), + // and `eu` (Europe). If you are calling the `speech.googleapis.com` + // endpoint, use the `global` location. To specify a region, use a + // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + // with matching `us` or `eu` location value. + message Phrase { + // The phrase itself. + string value = 1; + + // Hint Boost. Overrides the boost set at the phrase set level. + // Positive value will increase the probability that a specific phrase will + // be recognized over other similar sounding phrases. The higher the boost, + // the higher the chance of false positive recognition as well. Negative + // boost will simply be ignored. Though `boost` can accept a wide range of + // positive values, most use cases are best served + // with values between 0 and 20. We recommend using a binary search approach + // to finding the optimal value for your use case as well as adding + // phrases both with and without boost to your requests. + float boost = 2; + } + + // The resource name of the phrase set. + string name = 1; + + // A list of word and phrases. + repeated Phrase phrases = 2; + + // Hint Boost. Positive value will increase the probability that a specific + // phrase will be recognized over other similar sounding phrases. The higher + // the boost, the higher the chance of false positive recognition as well. + // Negative boost values would correspond to anti-biasing. Anti-biasing is not + // enabled, so negative boost will simply be ignored. Though `boost` can + // accept a wide range of positive values, most use cases are best served with + // values between 0 (exclusive) and 20. We recommend using a binary search + // approach to finding the optimal value for your use case as well as adding + // phrases both with and without boost to your requests. + float boost = 4; +} + +// Speech adaptation configuration. +message SpeechAdaptation { + message ABNFGrammar { + // All declarations and rules of an ABNF grammar broken up into multiple + // strings that will end up concatenated. + repeated string abnf_strings = 1; + } + + // A collection of phrase sets. To specify the hints inline, leave the + // phrase set's `name` blank and fill in the rest of its fields. Any + // phrase set can use any custom class. + repeated PhraseSet phrase_sets = 1; + + // A collection of phrase set resource names to use. + repeated string phrase_set_references = 2 [(google.api.resource_reference) = { + type: "speech.googleapis.com/PhraseSet" + }]; + + // A collection of custom classes. To specify the classes inline, leave the + // class' `name` blank and fill in the rest of its fields, giving it a unique + // `custom_class_id`. Refer to the inline defined class in phrase hints by its + // `custom_class_id`. + repeated CustomClass custom_classes = 3; + + // Augmented Backus-Naur form (ABNF) is a standardized grammar notation + // comprised by a set of derivation rules. + // See specifications: https://www.w3.org/TR/speech-grammar + ABNFGrammar abnf_grammar = 4; +} + +// Transcription normalization configuration. Use transcription normalization +// to automatically replace parts of the transcript with phrases of your +// choosing. For StreamingRecognize, this normalization only applies to stable +// partial transcripts (stability > 0.8) and final transcripts. +message TranscriptNormalization { + // A single replacement configuration. + message Entry { + // What to replace. Max length is 100 characters. + string search = 1; + + // What to replace with. Max length is 100 characters. + string replace = 2; + + // Whether the search is case sensitive. + bool case_sensitive = 3; + } + + // A list of replacement entries. We will perform replacement with one entry + // at a time. For example, the second entry in ["cat" => "dog", "mountain cat" + // => "mountain dog"] will never be applied because we will always process the + // first entry before it. At most 100 entries. + repeated Entry entries = 1; +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/protos/google/cloud/speech/v1p1beta1/cloud_speech.proto b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/protos/google/cloud/speech/v1p1beta1/cloud_speech.proto new file mode 100644 index 00000000000..b493d61aa80 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/protos/google/cloud/speech/v1p1beta1/cloud_speech.proto @@ -0,0 +1,1023 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.speech.v1p1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/cloud/speech/v1p1beta1/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; +import "google/rpc/status.proto"; + +option go_package = "cloud.google.com/go/speech/apiv1p1beta1/speechpb;speechpb"; +option java_multiple_files = true; +option java_outer_classname = "SpeechProto"; +option java_package = "com.google.cloud.speech.v1p1beta1"; +option objc_class_prefix = "GCS"; + +// Service that implements Google Cloud Speech API. +service Speech { + option (google.api.default_host) = "speech.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Performs synchronous speech recognition: receive results after all audio + // has been sent and processed. + rpc Recognize(RecognizeRequest) returns (RecognizeResponse) { + option (google.api.http) = { + post: "/v1p1beta1/speech:recognize" + body: "*" + }; + option (google.api.method_signature) = "config,audio"; + } + + // Performs asynchronous speech recognition: receive results via the + // google.longrunning.Operations interface. Returns either an + // `Operation.error` or an `Operation.response` which contains + // a `LongRunningRecognizeResponse` message. + // For more information on asynchronous speech recognition, see the + // [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). + rpc LongRunningRecognize(LongRunningRecognizeRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1p1beta1/speech:longrunningrecognize" + body: "*" + }; + option (google.api.method_signature) = "config,audio"; + option (google.longrunning.operation_info) = { + response_type: "LongRunningRecognizeResponse" + metadata_type: "LongRunningRecognizeMetadata" + }; + } + + // Performs bidirectional streaming speech recognition: receive results while + // sending audio. This method is only available via the gRPC API (not REST). + rpc StreamingRecognize(stream StreamingRecognizeRequest) + returns (stream StreamingRecognizeResponse) {} +} + +// The top-level message sent by the client for the `Recognize` method. +message RecognizeRequest { + // Required. Provides information to the recognizer that specifies how to + // process the request. + RecognitionConfig config = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The audio data to be recognized. + RecognitionAudio audio = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The top-level message sent by the client for the `LongRunningRecognize` +// method. +message LongRunningRecognizeRequest { + // Required. Provides information to the recognizer that specifies how to + // process the request. + RecognitionConfig config = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The audio data to be recognized. + RecognitionAudio audio = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Specifies an optional destination for the recognition results. + TranscriptOutputConfig output_config = 4 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Specifies an optional destination for the recognition results. +message TranscriptOutputConfig { + oneof output_type { + // Specifies a Cloud Storage URI for the recognition results. Must be + // specified in the format: `gs://bucket_name/object_name`, and the bucket + // must already exist. + string gcs_uri = 1; + } +} + +// The top-level message sent by the client for the `StreamingRecognize` method. +// Multiple `StreamingRecognizeRequest` messages are sent. The first message +// must contain a `streaming_config` message and must not contain +// `audio_content`. All subsequent messages must contain `audio_content` and +// must not contain a `streaming_config` message. +message StreamingRecognizeRequest { + // The streaming request, which is either a streaming config or audio content. + oneof streaming_request { + // Provides information to the recognizer that specifies how to process the + // request. The first `StreamingRecognizeRequest` message must contain a + // `streaming_config` message. + StreamingRecognitionConfig streaming_config = 1; + + // The audio data to be recognized. Sequential chunks of audio data are sent + // in sequential `StreamingRecognizeRequest` messages. The first + // `StreamingRecognizeRequest` message must not contain `audio_content` data + // and all subsequent `StreamingRecognizeRequest` messages must contain + // `audio_content` data. The audio bytes must be encoded as specified in + // `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a + // pure binary representation (not base64). See + // [content limits](https://cloud.google.com/speech-to-text/quotas#content). + bytes audio_content = 2; + } +} + +// Provides information to the recognizer that specifies how to process the +// request. +message StreamingRecognitionConfig { + // Events that a timeout can be set on for voice activity. + message VoiceActivityTimeout { + // Duration to timeout the stream if no speech begins. + google.protobuf.Duration speech_start_timeout = 1; + + // Duration to timeout the stream after speech ends. + google.protobuf.Duration speech_end_timeout = 2; + } + + // Required. Provides information to the recognizer that specifies how to + // process the request. + RecognitionConfig config = 1 [(google.api.field_behavior) = REQUIRED]; + + // If `false` or omitted, the recognizer will perform continuous + // recognition (continuing to wait for and process audio even if the user + // pauses speaking) until the client closes the input stream (gRPC API) or + // until the maximum time limit has been reached. May return multiple + // `StreamingRecognitionResult`s with the `is_final` flag set to `true`. + // + // If `true`, the recognizer will detect a single spoken utterance. When it + // detects that the user has paused or stopped speaking, it will return an + // `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no + // more than one `StreamingRecognitionResult` with the `is_final` flag set to + // `true`. + // + // The `single_utterance` field can only be used with specified models, + // otherwise an error is thrown. The `model` field in + // [RecognitionConfig][google.cloud.speech.v1p1beta1.RecognitionConfig] must + // be set to: + // + // * `command_and_search` + // * `phone_call` AND additional field `useEnhanced`=`true` + // * The `model` field is left undefined. In this case the API auto-selects + // a model based on any other parameters that you set in + // `RecognitionConfig`. + bool single_utterance = 2; + + // If `true`, interim results (tentative hypotheses) may be + // returned as they become available (these interim results are indicated with + // the `is_final=false` flag). + // If `false` or omitted, only `is_final=true` result(s) are returned. + bool interim_results = 3; + + // If `true`, responses with voice activity speech events will be returned as + // they are detected. + bool enable_voice_activity_events = 5; + + // If set, the server will automatically close the stream after the specified + // duration has elapsed after the last VOICE_ACTIVITY speech event has been + // sent. The field `voice_activity_events` must also be set to true. + VoiceActivityTimeout voice_activity_timeout = 6; +} + +// Provides information to the recognizer that specifies how to process the +// request. +message RecognitionConfig { + // The encoding of the audio data sent in the request. + // + // All encodings support only 1 channel (mono) audio, unless the + // `audio_channel_count` and `enable_separate_recognition_per_channel` fields + // are set. + // + // For best results, the audio source should be captured and transmitted using + // a lossless encoding (`FLAC` or `LINEAR16`). The accuracy of the speech + // recognition can be reduced if lossy codecs are used to capture or transmit + // audio, particularly if background noise is present. Lossy codecs include + // `MULAW`, `AMR`, `AMR_WB`, `OGG_OPUS`, `SPEEX_WITH_HEADER_BYTE`, `MP3`, + // and `WEBM_OPUS`. + // + // The `FLAC` and `WAV` audio file formats include a header that describes the + // included audio content. You can request recognition for `WAV` files that + // contain either `LINEAR16` or `MULAW` encoded audio. + // If you send `FLAC` or `WAV` audio file format in + // your request, you do not need to specify an `AudioEncoding`; the audio + // encoding format is determined from the file header. If you specify + // an `AudioEncoding` when you send send `FLAC` or `WAV` audio, the + // encoding configuration must match the encoding described in the audio + // header; otherwise the request returns an + // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT] error + // code. + enum AudioEncoding { + // Not specified. + ENCODING_UNSPECIFIED = 0; + + // Uncompressed 16-bit signed little-endian samples (Linear PCM). + LINEAR16 = 1; + + // `FLAC` (Free Lossless Audio + // Codec) is the recommended encoding because it is + // lossless--therefore recognition is not compromised--and + // requires only about half the bandwidth of `LINEAR16`. `FLAC` stream + // encoding supports 16-bit and 24-bit samples, however, not all fields in + // `STREAMINFO` are supported. + FLAC = 2; + + // 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. + MULAW = 3; + + // Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000. + AMR = 4; + + // Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000. + AMR_WB = 5; + + // Opus encoded audio frames in Ogg container + // ([OggOpus](https://wiki.xiph.org/OggOpus)). + // `sample_rate_hertz` must be one of 8000, 12000, 16000, 24000, or 48000. + OGG_OPUS = 6; + + // Although the use of lossy encodings is not recommended, if a very low + // bitrate encoding is required, `OGG_OPUS` is highly preferred over + // Speex encoding. The [Speex](https://speex.org/) encoding supported by + // Cloud Speech API has a header byte in each block, as in MIME type + // `audio/x-speex-with-header-byte`. + // It is a variant of the RTP Speex encoding defined in + // [RFC 5574](https://tools.ietf.org/html/rfc5574). + // The stream is a sequence of blocks, one block per RTP packet. Each block + // starts with a byte containing the length of the block, in bytes, followed + // by one or more frames of Speex data, padded to an integral number of + // bytes (octets) as specified in RFC 5574. In other words, each RTP header + // is replaced with a single byte containing the block length. Only Speex + // wideband is supported. `sample_rate_hertz` must be 16000. + SPEEX_WITH_HEADER_BYTE = 7; + + // MP3 audio. MP3 encoding is a Beta feature and only available in + // v1p1beta1. Support all standard MP3 bitrates (which range from 32-320 + // kbps). When using this encoding, `sample_rate_hertz` has to match the + // sample rate of the file being used. + MP3 = 8; + + // Opus encoded audio frames in WebM container + // ([WebM](https://www.webmproject.org/docs/container/)). + // `sample_rate_hertz` must be one of 8000, 12000, 16000, 24000, or 48000. + WEBM_OPUS = 9; + + // 8-bit samples that compand 13-bit audio samples using G.711 PCMU/a-law. + ALAW = 10; + } + + // Encoding of audio data sent in all `RecognitionAudio` messages. + // This field is optional for `FLAC` and `WAV` audio files and required + // for all other audio formats. For details, see + // [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding]. + AudioEncoding encoding = 1; + + // Sample rate in Hertz of the audio data sent in all + // `RecognitionAudio` messages. Valid values are: 8000-48000. + // 16000 is optimal. For best results, set the sampling rate of the audio + // source to 16000 Hz. If that's not possible, use the native sample rate of + // the audio source (instead of re-sampling). + // This field is optional for FLAC and WAV audio files, but is + // required for all other audio formats. For details, see + // [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding]. + int32 sample_rate_hertz = 2; + + // The number of channels in the input audio data. + // ONLY set this for MULTI-CHANNEL recognition. + // Valid values for LINEAR16, OGG_OPUS and FLAC are `1`-`8`. + // Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`. + // If `0` or omitted, defaults to one channel (mono). + // Note: We only recognize the first channel by default. + // To perform independent recognition on each channel set + // `enable_separate_recognition_per_channel` to 'true'. + int32 audio_channel_count = 7; + + // This needs to be set to `true` explicitly and `audio_channel_count` > 1 + // to get each channel recognized separately. The recognition result will + // contain a `channel_tag` field to state which channel that result belongs + // to. If this is not true, we will only recognize the first channel. The + // request is billed cumulatively for all channels recognized: + // `audio_channel_count` multiplied by the length of the audio. + bool enable_separate_recognition_per_channel = 12; + + // Required. The language of the supplied audio as a + // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. + // Example: "en-US". + // See [Language + // Support](https://cloud.google.com/speech-to-text/docs/languages) for a list + // of the currently supported language codes. + string language_code = 3 [(google.api.field_behavior) = REQUIRED]; + + // A list of up to 3 additional + // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags, + // listing possible alternative languages of the supplied audio. + // See [Language + // Support](https://cloud.google.com/speech-to-text/docs/languages) for a list + // of the currently supported language codes. If alternative languages are + // listed, recognition result will contain recognition in the most likely + // language detected including the main language_code. The recognition result + // will include the language tag of the language detected in the audio. Note: + // This feature is only supported for Voice Command and Voice Search use cases + // and performance may vary for other use cases (e.g., phone call + // transcription). + repeated string alternative_language_codes = 18; + + // Maximum number of recognition hypotheses to be returned. + // Specifically, the maximum number of `SpeechRecognitionAlternative` messages + // within each `SpeechRecognitionResult`. + // The server may return fewer than `max_alternatives`. + // Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of + // one. If omitted, will return a maximum of one. + int32 max_alternatives = 4; + + // If set to `true`, the server will attempt to filter out + // profanities, replacing all but the initial character in each filtered word + // with asterisks, e.g. "f***". If set to `false` or omitted, profanities + // won't be filtered out. + bool profanity_filter = 5; + + // Speech adaptation configuration improves the accuracy of speech + // recognition. For more information, see the [speech + // adaptation](https://cloud.google.com/speech-to-text/docs/adaptation) + // documentation. + // When speech adaptation is set it supersedes the `speech_contexts` field. + SpeechAdaptation adaptation = 20; + + // Optional. Use transcription normalization to automatically replace parts of + // the transcript with phrases of your choosing. For StreamingRecognize, this + // normalization only applies to stable partial transcripts (stability > 0.8) + // and final transcripts. + TranscriptNormalization transcript_normalization = 24 + [(google.api.field_behavior) = OPTIONAL]; + + // Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext]. + // A means to provide context to assist the speech recognition. For more + // information, see + // [speech + // adaptation](https://cloud.google.com/speech-to-text/docs/adaptation). + repeated SpeechContext speech_contexts = 6; + + // If `true`, the top result includes a list of words and + // the start and end time offsets (timestamps) for those words. If + // `false`, no word-level time offset information is returned. The default is + // `false`. + bool enable_word_time_offsets = 8; + + // If `true`, the top result includes a list of words and the + // confidence for those words. If `false`, no word-level confidence + // information is returned. The default is `false`. + bool enable_word_confidence = 15; + + // If 'true', adds punctuation to recognition result hypotheses. + // This feature is only available in select languages. Setting this for + // requests in other languages has no effect at all. + // The default 'false' value does not add punctuation to result hypotheses. + bool enable_automatic_punctuation = 11; + + // The spoken punctuation behavior for the call + // If not set, uses default behavior based on model of choice + // e.g. command_and_search will enable spoken punctuation by default + // If 'true', replaces spoken punctuation with the corresponding symbols in + // the request. For example, "how are you question mark" becomes "how are + // you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation + // for support. If 'false', spoken punctuation is not replaced. + google.protobuf.BoolValue enable_spoken_punctuation = 22; + + // The spoken emoji behavior for the call + // If not set, uses default behavior based on model of choice + // If 'true', adds spoken emoji formatting for the request. This will replace + // spoken emojis with the corresponding Unicode symbols in the final + // transcript. If 'false', spoken emojis are not replaced. + google.protobuf.BoolValue enable_spoken_emojis = 23; + + // If 'true', enables speaker detection for each recognized word in + // the top alternative of the recognition result using a speaker_label + // provided in the WordInfo. + // Note: Use diarization_config instead. + bool enable_speaker_diarization = 16 [deprecated = true]; + + // If set, specifies the estimated number of speakers in the conversation. + // Defaults to '2'. Ignored unless enable_speaker_diarization is set to true. + // Note: Use diarization_config instead. + int32 diarization_speaker_count = 17 [deprecated = true]; + + // Config to enable speaker diarization and set additional + // parameters to make diarization better suited for your application. + // Note: When this is enabled, we send all the words from the beginning of the + // audio for the top alternative in every consecutive STREAMING responses. + // This is done in order to improve our speaker tags as our models learn to + // identify the speakers in the conversation over time. + // For non-streaming requests, the diarization results will be provided only + // in the top alternative of the FINAL SpeechRecognitionResult. + SpeakerDiarizationConfig diarization_config = 19; + + // Metadata regarding this request. + RecognitionMetadata metadata = 9; + + // Which model to select for the given request. Select the model + // best suited to your domain to get best results. If a model is not + // explicitly specified, then we auto-select a model based on the parameters + // in the RecognitionConfig. + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + //
ModelDescription
latest_longBest for long form content like media or conversation.
latest_shortBest for short form content like commands or single shot directed + // speech.
command_and_searchBest for short queries such as voice commands or voice search.
phone_callBest for audio that originated from a phone call (typically + // recorded at an 8khz sampling rate).
videoBest for audio that originated from video or includes multiple + // speakers. Ideally the audio is recorded at a 16khz or greater + // sampling rate. This is a premium model that costs more than the + // standard rate.
defaultBest for audio that is not one of the specific audio models. + // For example, long-form audio. Ideally the audio is high-fidelity, + // recorded at a 16khz or greater sampling rate.
medical_conversationBest for audio that originated from a conversation between a + // medical provider and patient.
medical_dictationBest for audio that originated from dictation notes by a medical + // provider.
+ string model = 13; + + // Set to true to use an enhanced model for speech recognition. + // If `use_enhanced` is set to true and the `model` field is not set, then + // an appropriate enhanced model is chosen if an enhanced model exists for + // the audio. + // + // If `use_enhanced` is true and an enhanced version of the specified model + // does not exist, then the speech is recognized using the standard version + // of the specified model. + bool use_enhanced = 14; +} + +// Config to enable speaker diarization. +message SpeakerDiarizationConfig { + // If 'true', enables speaker detection for each recognized word in + // the top alternative of the recognition result using a speaker_label + // provided in the WordInfo. + bool enable_speaker_diarization = 1; + + // Minimum number of speakers in the conversation. This range gives you more + // flexibility by allowing the system to automatically determine the correct + // number of speakers. If not set, the default value is 2. + int32 min_speaker_count = 2; + + // Maximum number of speakers in the conversation. This range gives you more + // flexibility by allowing the system to automatically determine the correct + // number of speakers. If not set, the default value is 6. + int32 max_speaker_count = 3; + + // Output only. Unused. + int32 speaker_tag = 5 + [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Description of audio data to be recognized. +message RecognitionMetadata { + option deprecated = true; + + // Use case categories that the audio recognition request can be described + // by. + enum InteractionType { + // Use case is either unknown or is something other than one of the other + // values below. + INTERACTION_TYPE_UNSPECIFIED = 0; + + // Multiple people in a conversation or discussion. For example in a + // meeting with two or more people actively participating. Typically + // all the primary people speaking would be in the same room (if not, + // see PHONE_CALL) + DISCUSSION = 1; + + // One or more persons lecturing or presenting to others, mostly + // uninterrupted. + PRESENTATION = 2; + + // A phone-call or video-conference in which two or more people, who are + // not in the same room, are actively participating. + PHONE_CALL = 3; + + // A recorded message intended for another person to listen to. + VOICEMAIL = 4; + + // Professionally produced audio (eg. TV Show, Podcast). + PROFESSIONALLY_PRODUCED = 5; + + // Transcribe spoken questions and queries into text. + VOICE_SEARCH = 6; + + // Transcribe voice commands, such as for controlling a device. + VOICE_COMMAND = 7; + + // Transcribe speech to text to create a written document, such as a + // text-message, email or report. + DICTATION = 8; + } + + // Enumerates the types of capture settings describing an audio file. + enum MicrophoneDistance { + // Audio type is not known. + MICROPHONE_DISTANCE_UNSPECIFIED = 0; + + // The audio was captured from a closely placed microphone. Eg. phone, + // dictaphone, or handheld microphone. Generally if there speaker is within + // 1 meter of the microphone. + NEARFIELD = 1; + + // The speaker if within 3 meters of the microphone. + MIDFIELD = 2; + + // The speaker is more than 3 meters away from the microphone. + FARFIELD = 3; + } + + // The original media the speech was recorded on. + enum OriginalMediaType { + // Unknown original media type. + ORIGINAL_MEDIA_TYPE_UNSPECIFIED = 0; + + // The speech data is an audio recording. + AUDIO = 1; + + // The speech data originally recorded on a video. + VIDEO = 2; + } + + // The type of device the speech was recorded with. + enum RecordingDeviceType { + // The recording device is unknown. + RECORDING_DEVICE_TYPE_UNSPECIFIED = 0; + + // Speech was recorded on a smartphone. + SMARTPHONE = 1; + + // Speech was recorded using a personal computer or tablet. + PC = 2; + + // Speech was recorded over a phone line. + PHONE_LINE = 3; + + // Speech was recorded in a vehicle. + VEHICLE = 4; + + // Speech was recorded outdoors. + OTHER_OUTDOOR_DEVICE = 5; + + // Speech was recorded indoors. + OTHER_INDOOR_DEVICE = 6; + } + + // The use case most closely describing the audio content to be recognized. + InteractionType interaction_type = 1; + + // The industry vertical to which this speech recognition request most + // closely applies. This is most indicative of the topics contained + // in the audio. Use the 6-digit NAICS code to identify the industry + // vertical - see https://www.naics.com/search/. + uint32 industry_naics_code_of_audio = 3; + + // The audio type that most closely describes the audio being recognized. + MicrophoneDistance microphone_distance = 4; + + // The original media the speech was recorded on. + OriginalMediaType original_media_type = 5; + + // The type of device the speech was recorded with. + RecordingDeviceType recording_device_type = 6; + + // The device used to make the recording. Examples 'Nexus 5X' or + // 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or + // 'Cardioid Microphone'. + string recording_device_name = 7; + + // Mime type of the original audio file. For example `audio/m4a`, + // `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`. + // A list of possible audio mime types is maintained at + // http://www.iana.org/assignments/media-types/media-types.xhtml#audio + string original_mime_type = 8; + + // Obfuscated (privacy-protected) ID of the user, to identify number of + // unique users using the service. + int64 obfuscated_id = 9 [deprecated = true]; + + // Description of the content. Eg. "Recordings of federal supreme court + // hearings from 2012". + string audio_topic = 10; +} + +// Provides "hints" to the speech recognizer to favor specific words and phrases +// in the results. +message SpeechContext { + // A list of strings containing words and phrases "hints" so that + // the speech recognition is more likely to recognize them. This can be used + // to improve the accuracy for specific words and phrases, for example, if + // specific commands are typically spoken by the user. This can also be used + // to add additional words to the vocabulary of the recognizer. See + // [usage limits](https://cloud.google.com/speech-to-text/quotas#content). + // + // List items can also be set to classes for groups of words that represent + // common concepts that occur in natural language. For example, rather than + // providing phrase hints for every month of the year, using the $MONTH class + // improves the likelihood of correctly transcribing audio that includes + // months. + repeated string phrases = 1; + + // Hint Boost. Positive value will increase the probability that a specific + // phrase will be recognized over other similar sounding phrases. The higher + // the boost, the higher the chance of false positive recognition as well. + // Negative boost values would correspond to anti-biasing. Anti-biasing is not + // enabled, so negative boost will simply be ignored. Though `boost` can + // accept a wide range of positive values, most use cases are best served with + // values between 0 and 20. We recommend using a binary search approach to + // finding the optimal value for your use case. + float boost = 4; +} + +// Contains audio data in the encoding specified in the `RecognitionConfig`. +// Either `content` or `uri` must be supplied. Supplying both or neither +// returns [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. +// See [content limits](https://cloud.google.com/speech-to-text/quotas#content). +message RecognitionAudio { + // The audio source, which is either inline content or a Google Cloud + // Storage uri. + oneof audio_source { + // The audio data bytes encoded as specified in + // `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a + // pure binary representation, whereas JSON representations use base64. + bytes content = 1; + + // URI that points to a file that contains audio data bytes as specified in + // `RecognitionConfig`. The file must not be compressed (for example, gzip). + // Currently, only Google Cloud Storage URIs are + // supported, which must be specified in the following format: + // `gs://bucket_name/object_name` (other URI formats return + // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). + // For more information, see [Request + // URIs](https://cloud.google.com/storage/docs/reference-uris). + string uri = 2; + } +} + +// The only message returned to the client by the `Recognize` method. It +// contains the result as zero or more sequential `SpeechRecognitionResult` +// messages. +message RecognizeResponse { + // Sequential list of transcription results corresponding to + // sequential portions of audio. + repeated SpeechRecognitionResult results = 2; + + // When available, billed audio seconds for the corresponding request. + google.protobuf.Duration total_billed_time = 3; + + // Provides information on adaptation behavior in response + SpeechAdaptationInfo speech_adaptation_info = 7; + + // The ID associated with the request. This is a unique ID specific only to + // the given request. + int64 request_id = 8; + + // Whether request used legacy asr models (was not automatically migrated to + // use conformer models). + bool using_legacy_models = 9; +} + +// The only message returned to the client by the `LongRunningRecognize` method. +// It contains the result as zero or more sequential `SpeechRecognitionResult` +// messages. It is included in the `result.response` field of the `Operation` +// returned by the `GetOperation` call of the `google::longrunning::Operations` +// service. +message LongRunningRecognizeResponse { + // Sequential list of transcription results corresponding to + // sequential portions of audio. + repeated SpeechRecognitionResult results = 2; + + // When available, billed audio seconds for the corresponding request. + google.protobuf.Duration total_billed_time = 3; + + // Original output config if present in the request. + TranscriptOutputConfig output_config = 6; + + // If the transcript output fails this field contains the relevant error. + google.rpc.Status output_error = 7; + + // Provides information on speech adaptation behavior in response + SpeechAdaptationInfo speech_adaptation_info = 8; + + // The ID associated with the request. This is a unique ID specific only to + // the given request. + int64 request_id = 9; +} + +// Describes the progress of a long-running `LongRunningRecognize` call. It is +// included in the `metadata` field of the `Operation` returned by the +// `GetOperation` call of the `google::longrunning::Operations` service. +message LongRunningRecognizeMetadata { + // Approximate percentage of audio processed thus far. Guaranteed to be 100 + // when the audio is fully processed and the results are available. + int32 progress_percent = 1; + + // Time when the request was received. + google.protobuf.Timestamp start_time = 2; + + // Time of the most recent processing update. + google.protobuf.Timestamp last_update_time = 3; + + // Output only. The URI of the audio file being transcribed. Empty if the + // audio was sent as byte content. + string uri = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A copy of the TranscriptOutputConfig if it was set in the + // request. + TranscriptOutputConfig output_config = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// `StreamingRecognizeResponse` is the only message returned to the client by +// `StreamingRecognize`. A series of zero or more `StreamingRecognizeResponse` +// messages are streamed back to the client. If there is no recognizable +// audio, and `single_utterance` is set to false, then no messages are streamed +// back to the client. +// +// Here's an example of a series of `StreamingRecognizeResponse`s that might be +// returned while processing audio: +// +// 1. results { alternatives { transcript: "tube" } stability: 0.01 } +// +// 2. results { alternatives { transcript: "to be a" } stability: 0.01 } +// +// 3. results { alternatives { transcript: "to be" } stability: 0.9 } +// results { alternatives { transcript: " or not to be" } stability: 0.01 } +// +// 4. results { alternatives { transcript: "to be or not to be" +// confidence: 0.92 } +// alternatives { transcript: "to bee or not to bee" } +// is_final: true } +// +// 5. results { alternatives { transcript: " that's" } stability: 0.01 } +// +// 6. results { alternatives { transcript: " that is" } stability: 0.9 } +// results { alternatives { transcript: " the question" } stability: 0.01 } +// +// 7. results { alternatives { transcript: " that is the question" +// confidence: 0.98 } +// alternatives { transcript: " that was the question" } +// is_final: true } +// +// Notes: +// +// - Only two of the above responses #4 and #7 contain final results; they are +// indicated by `is_final: true`. Concatenating these together generates the +// full transcript: "to be or not to be that is the question". +// +// - The others contain interim `results`. #3 and #6 contain two interim +// `results`: the first portion has a high stability and is less likely to +// change; the second portion has a low stability and is very likely to +// change. A UI designer might choose to show only high stability `results`. +// +// - The specific `stability` and `confidence` values shown above are only for +// illustrative purposes. Actual values may vary. +// +// - In each response, only one of these fields will be set: +// `error`, +// `speech_event_type`, or +// one or more (repeated) `results`. +message StreamingRecognizeResponse { + // Indicates the type of speech event. + enum SpeechEventType { + // No speech event specified. + SPEECH_EVENT_UNSPECIFIED = 0; + + // This event indicates that the server has detected the end of the user's + // speech utterance and expects no additional speech. Therefore, the server + // will not process additional audio (although it may subsequently return + // additional results). The client should stop sending additional audio + // data, half-close the gRPC connection, and wait for any additional results + // until the server closes the gRPC connection. This event is only sent if + // `single_utterance` was set to `true`, and is not used otherwise. + END_OF_SINGLE_UTTERANCE = 1; + + // This event indicates that the server has detected the beginning of human + // voice activity in the stream. This event can be returned multiple times + // if speech starts and stops repeatedly throughout the stream. This event + // is only sent if `voice_activity_events` is set to true. + SPEECH_ACTIVITY_BEGIN = 2; + + // This event indicates that the server has detected the end of human voice + // activity in the stream. This event can be returned multiple times if + // speech starts and stops repeatedly throughout the stream. This event is + // only sent if `voice_activity_events` is set to true. + SPEECH_ACTIVITY_END = 3; + + // This event indicates that the user-set timeout for speech activity begin + // or end has exceeded. Upon receiving this event, the client is expected to + // send a half close. Further audio will not be processed. + SPEECH_ACTIVITY_TIMEOUT = 4; + } + + // If set, returns a [google.rpc.Status][google.rpc.Status] message that + // specifies the error for the operation. + google.rpc.Status error = 1; + + // This repeated list contains zero or more results that + // correspond to consecutive portions of the audio currently being processed. + // It contains zero or one `is_final=true` result (the newly settled portion), + // followed by zero or more `is_final=false` results (the interim results). + repeated StreamingRecognitionResult results = 2; + + // Indicates the type of speech event. + SpeechEventType speech_event_type = 4; + + // Time offset between the beginning of the audio and event emission. + google.protobuf.Duration speech_event_time = 8; + + // When available, billed audio seconds for the stream. + // Set only if this is the last response in the stream. + google.protobuf.Duration total_billed_time = 5; + + // Provides information on adaptation behavior in response + SpeechAdaptationInfo speech_adaptation_info = 9; + + // The ID associated with the request. This is a unique ID specific only to + // the given request. + int64 request_id = 10; +} + +// A streaming speech recognition result corresponding to a portion of the audio +// that is currently being processed. +message StreamingRecognitionResult { + // May contain one or more recognition hypotheses (up to the + // maximum specified in `max_alternatives`). + // These alternatives are ordered in terms of accuracy, with the top (first) + // alternative being the most probable, as ranked by the recognizer. + repeated SpeechRecognitionAlternative alternatives = 1; + + // If `false`, this `StreamingRecognitionResult` represents an + // interim result that may change. If `true`, this is the final time the + // speech service will return this particular `StreamingRecognitionResult`, + // the recognizer will not return any further hypotheses for this portion of + // the transcript and corresponding audio. + bool is_final = 2; + + // An estimate of the likelihood that the recognizer will not + // change its guess about this interim result. Values range from 0.0 + // (completely unstable) to 1.0 (completely stable). + // This field is only provided for interim results (`is_final=false`). + // The default of 0.0 is a sentinel value indicating `stability` was not set. + float stability = 3; + + // Time offset of the end of this result relative to the + // beginning of the audio. + google.protobuf.Duration result_end_time = 4; + + // For multi-channel audio, this is the channel number corresponding to the + // recognized result for the audio from that channel. + // For audio_channel_count = N, its output values can range from '1' to 'N'. + int32 channel_tag = 5; + + // Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + // language tag of the language in this result. This language code was + // detected to have the most likelihood of being spoken in the audio. + string language_code = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A speech recognition result corresponding to a portion of the audio. +message SpeechRecognitionResult { + // May contain one or more recognition hypotheses (up to the + // maximum specified in `max_alternatives`). + // These alternatives are ordered in terms of accuracy, with the top (first) + // alternative being the most probable, as ranked by the recognizer. + repeated SpeechRecognitionAlternative alternatives = 1; + + // For multi-channel audio, this is the channel number corresponding to the + // recognized result for the audio from that channel. + // For audio_channel_count = N, its output values can range from '1' to 'N'. + int32 channel_tag = 2; + + // Time offset of the end of this result relative to the + // beginning of the audio. + google.protobuf.Duration result_end_time = 4; + + // Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + // language tag of the language in this result. This language code was + // detected to have the most likelihood of being spoken in the audio. + string language_code = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Alternative hypotheses (a.k.a. n-best list). +message SpeechRecognitionAlternative { + // Transcript text representing the words that the user spoke. + // In languages that use spaces to separate words, the transcript might have a + // leading space if it isn't the first result. You can concatenate each result + // to obtain the full transcript without using a separator. + string transcript = 1; + + // The confidence estimate between 0.0 and 1.0. A higher number + // indicates an estimated greater likelihood that the recognized words are + // correct. This field is set only for the top alternative of a non-streaming + // result or, of a streaming result where `is_final=true`. + // This field is not guaranteed to be accurate and users should not rely on it + // to be always provided. + // The default of 0.0 is a sentinel value indicating `confidence` was not set. + float confidence = 2; + + // A list of word-specific information for each recognized word. + // Note: When `enable_speaker_diarization` is true, you will see all the words + // from the beginning of the audio. + repeated WordInfo words = 3; +} + +// Word-specific information for recognized words. +message WordInfo { + // Time offset relative to the beginning of the audio, + // and corresponding to the start of the spoken word. + // This field is only set if `enable_word_time_offsets=true` and only + // in the top hypothesis. + // This is an experimental feature and the accuracy of the time offset can + // vary. + google.protobuf.Duration start_time = 1; + + // Time offset relative to the beginning of the audio, + // and corresponding to the end of the spoken word. + // This field is only set if `enable_word_time_offsets=true` and only + // in the top hypothesis. + // This is an experimental feature and the accuracy of the time offset can + // vary. + google.protobuf.Duration end_time = 2; + + // The word corresponding to this set of information. + string word = 3; + + // The confidence estimate between 0.0 and 1.0. A higher number + // indicates an estimated greater likelihood that the recognized words are + // correct. This field is set only for the top alternative of a non-streaming + // result or, of a streaming result where `is_final=true`. + // This field is not guaranteed to be accurate and users should not rely on it + // to be always provided. + // The default of 0.0 is a sentinel value indicating `confidence` was not set. + float confidence = 4; + + // Output only. A distinct integer value is assigned for every speaker within + // the audio. This field specifies which one of those speakers was detected to + // have spoken this word. Value ranges from '1' to diarization_speaker_count. + // speaker_tag is set if enable_speaker_diarization = 'true' and only for the + // top alternative. + // Note: Use speaker_label instead. + int32 speaker_tag = 5 + [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A label value assigned for every unique speaker within the + // audio. This field specifies which speaker was detected to have spoken this + // word. For some models, like medical_conversation this can be actual speaker + // role, for example "patient" or "provider", but generally this would be a + // number identifying a speaker. This field is only set if + // enable_speaker_diarization = 'true' and only for the top alternative. + string speaker_label = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Information on speech adaptation use in results +message SpeechAdaptationInfo { + // Whether there was a timeout when applying speech adaptation. If true, + // adaptation had no effect in the response transcript. + bool adaptation_timeout = 1; + + // If set, returns a message specifying which part of the speech adaptation + // request timed out. + string timeout_message = 4; +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/protos/google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/protos/google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto new file mode 100644 index 00000000000..ad42cf576d2 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/protos/google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto @@ -0,0 +1,375 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.speech.v1p1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/speech/v1p1beta1/resource.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option go_package = "cloud.google.com/go/speech/apiv1p1beta1/speechpb;speechpb"; +option java_multiple_files = true; +option java_outer_classname = "SpeechAdaptationProto"; +option java_package = "com.google.cloud.speech.v1p1beta1"; +option objc_class_prefix = "GCS"; + +// Service that implements Google Cloud Speech Adaptation API. +service Adaptation { + option (google.api.default_host) = "speech.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Create a set of phrase hints. Each item in the set can be a single word or + // a multi-word phrase. The items in the PhraseSet are favored by the + // recognition model when you send a call that includes the PhraseSet. + rpc CreatePhraseSet(CreatePhraseSetRequest) returns (PhraseSet) { + option (google.api.http) = { + post: "/v1p1beta1/{parent=projects/*/locations/*}/phraseSets" + body: "*" + }; + option (google.api.method_signature) = "parent,phrase_set,phrase_set_id"; + } + + // Get a phrase set. + rpc GetPhraseSet(GetPhraseSetRequest) returns (PhraseSet) { + option (google.api.http) = { + get: "/v1p1beta1/{name=projects/*/locations/*/phraseSets/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List phrase sets. + rpc ListPhraseSet(ListPhraseSetRequest) returns (ListPhraseSetResponse) { + option (google.api.http) = { + get: "/v1p1beta1/{parent=projects/*/locations/*}/phraseSets" + }; + option (google.api.method_signature) = "parent"; + } + + // Update a phrase set. + rpc UpdatePhraseSet(UpdatePhraseSetRequest) returns (PhraseSet) { + option (google.api.http) = { + patch: "/v1p1beta1/{phrase_set.name=projects/*/locations/*/phraseSets/*}" + body: "phrase_set" + }; + option (google.api.method_signature) = "phrase_set,update_mask"; + } + + // Delete a phrase set. + rpc DeletePhraseSet(DeletePhraseSetRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1p1beta1/{name=projects/*/locations/*/phraseSets/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Create a custom class. + rpc CreateCustomClass(CreateCustomClassRequest) returns (CustomClass) { + option (google.api.http) = { + post: "/v1p1beta1/{parent=projects/*/locations/*}/customClasses" + body: "*" + }; + option (google.api.method_signature) = + "parent,custom_class,custom_class_id"; + } + + // Get a custom class. + rpc GetCustomClass(GetCustomClassRequest) returns (CustomClass) { + option (google.api.http) = { + get: "/v1p1beta1/{name=projects/*/locations/*/customClasses/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List custom classes. + rpc ListCustomClasses(ListCustomClassesRequest) + returns (ListCustomClassesResponse) { + option (google.api.http) = { + get: "/v1p1beta1/{parent=projects/*/locations/*}/customClasses" + }; + option (google.api.method_signature) = "parent"; + } + + // Update a custom class. + rpc UpdateCustomClass(UpdateCustomClassRequest) returns (CustomClass) { + option (google.api.http) = { + patch: "/v1p1beta1/{custom_class.name=projects/*/locations/*/customClasses/*}" + body: "custom_class" + }; + option (google.api.method_signature) = "custom_class,update_mask"; + } + + // Delete a custom class. + rpc DeleteCustomClass(DeleteCustomClassRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1p1beta1/{name=projects/*/locations/*/customClasses/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// Message sent by the client for the `CreatePhraseSet` method. +message CreatePhraseSetRequest { + // Required. The parent resource where this phrase set will be created. + // Format: + // + // `projects/{project}/locations/{location}` + // + // Speech-to-Text supports three locations: `global`, `us` (US North America), + // and `eu` (Europe). If you are calling the `speech.googleapis.com` + // endpoint, use the `global` location. To specify a region, use a + // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + // with matching `us` or `eu` location value. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "speech.googleapis.com/PhraseSet" + } + ]; + + // Required. The ID to use for the phrase set, which will become the final + // component of the phrase set's resource name. + // + // This value should restrict to letters, numbers, and hyphens, with the first + // character a letter, the last a letter or a number, and be 4-63 characters. + string phrase_set_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The phrase set to create. + PhraseSet phrase_set = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Message sent by the client for the `UpdatePhraseSet` method. +message UpdatePhraseSetRequest { + // Required. The phrase set to update. + // + // The phrase set's `name` field is used to identify the set to be + // updated. Format: + // + // `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + // + // Speech-to-Text supports three locations: `global`, `us` (US North America), + // and `eu` (Europe). If you are calling the `speech.googleapis.com` + // endpoint, use the `global` location. To specify a region, use a + // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + // with matching `us` or `eu` location value. + PhraseSet phrase_set = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Message sent by the client for the `GetPhraseSet` method. +message GetPhraseSetRequest { + // Required. The name of the phrase set to retrieve. Format: + // + // `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + // + // Speech-to-Text supports three locations: `global`, `us` (US North America), + // and `eu` (Europe). If you are calling the `speech.googleapis.com` + // endpoint, use the `global` location. To specify a region, use a + // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + // with matching `us` or `eu` location value. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "speech.googleapis.com/PhraseSet" + } + ]; +} + +// Message sent by the client for the `ListPhraseSet` method. +message ListPhraseSetRequest { + // Required. The parent, which owns this collection of phrase set. Format: + // + // `projects/{project}/locations/{location}` + // + // Speech-to-Text supports three locations: `global`, `us` (US North America), + // and `eu` (Europe). If you are calling the `speech.googleapis.com` + // endpoint, use the `global` location. To specify a region, use a + // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + // with matching `us` or `eu` location value. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "speech.googleapis.com/PhraseSet" + } + ]; + + // The maximum number of phrase sets to return. The service may return + // fewer than this value. If unspecified, at most 50 phrase sets will be + // returned. The maximum value is 1000; values above 1000 will be coerced to + // 1000. + int32 page_size = 2; + + // A page token, received from a previous `ListPhraseSet` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListPhraseSet` must + // match the call that provided the page token. + string page_token = 3; +} + +// Message returned to the client by the `ListPhraseSet` method. +message ListPhraseSetResponse { + // The phrase set. + repeated PhraseSet phrase_sets = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Message sent by the client for the `DeletePhraseSet` method. +message DeletePhraseSetRequest { + // Required. The name of the phrase set to delete. Format: + // + // `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "speech.googleapis.com/PhraseSet" + } + ]; +} + +// Message sent by the client for the `CreateCustomClass` method. +message CreateCustomClassRequest { + // Required. The parent resource where this custom class will be created. + // Format: + // + // `projects/{project}/locations/{location}/customClasses` + // + // Speech-to-Text supports three locations: `global`, `us` (US North America), + // and `eu` (Europe). If you are calling the `speech.googleapis.com` + // endpoint, use the `global` location. To specify a region, use a + // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + // with matching `us` or `eu` location value. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "speech.googleapis.com/CustomClass" + } + ]; + + // Required. The ID to use for the custom class, which will become the final + // component of the custom class' resource name. + // + // This value should restrict to letters, numbers, and hyphens, with the first + // character a letter, the last a letter or a number, and be 4-63 characters. + string custom_class_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The custom class to create. + CustomClass custom_class = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Message sent by the client for the `UpdateCustomClass` method. +message UpdateCustomClassRequest { + // Required. The custom class to update. + // + // The custom class's `name` field is used to identify the custom class to be + // updated. Format: + // + // `projects/{project}/locations/{location}/customClasses/{custom_class}` + // + // Speech-to-Text supports three locations: `global`, `us` (US North America), + // and `eu` (Europe). If you are calling the `speech.googleapis.com` + // endpoint, use the `global` location. To specify a region, use a + // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + // with matching `us` or `eu` location value. + CustomClass custom_class = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Message sent by the client for the `GetCustomClass` method. +message GetCustomClassRequest { + // Required. The name of the custom class to retrieve. Format: + // + // `projects/{project}/locations/{location}/customClasses/{custom_class}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "speech.googleapis.com/CustomClass" + } + ]; +} + +// Message sent by the client for the `ListCustomClasses` method. +message ListCustomClassesRequest { + // Required. The parent, which owns this collection of custom classes. Format: + // + // `projects/{project}/locations/{location}/customClasses` + // + // Speech-to-Text supports three locations: `global`, `us` (US North America), + // and `eu` (Europe). If you are calling the `speech.googleapis.com` + // endpoint, use the `global` location. To specify a region, use a + // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + // with matching `us` or `eu` location value. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "speech.googleapis.com/CustomClass" + } + ]; + + // The maximum number of custom classes to return. The service may return + // fewer than this value. If unspecified, at most 50 custom classes will be + // returned. The maximum value is 1000; values above 1000 will be coerced to + // 1000. + int32 page_size = 2; + + // A page token, received from a previous `ListCustomClass` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListCustomClass` must + // match the call that provided the page token. + string page_token = 3; +} + +// Message returned to the client by the `ListCustomClasses` method. +message ListCustomClassesResponse { + // The custom classes. + repeated CustomClass custom_classes = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Message sent by the client for the `DeleteCustomClass` method. +message DeleteCustomClassRequest { + // Required. The name of the custom class to delete. Format: + // + // `projects/{project}/locations/{location}/customClasses/{custom_class}` + // + // Speech-to-Text supports three locations: `global`, `us` (US North America), + // and `eu` (Europe). If you are calling the `speech.googleapis.com` + // endpoint, use the `global` location. To specify a region, use a + // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + // with matching `us` or `eu` location value. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "speech.googleapis.com/CustomClass" + } + ]; +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/protos/google/cloud/speech/v1p1beta1/resource.proto b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/protos/google/cloud/speech/v1p1beta1/resource.proto new file mode 100644 index 00000000000..bd75f30fcab --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/protos/google/cloud/speech/v1p1beta1/resource.proto @@ -0,0 +1,330 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.speech.v1p1beta1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/speech/apiv1p1beta1/speechpb;speechpb"; +option java_multiple_files = true; +option java_outer_classname = "SpeechResourceProto"; +option java_package = "com.google.cloud.speech.v1p1beta1"; +option objc_class_prefix = "GCS"; +option (google.api.resource_definition) = { + type: "cloudkms.googleapis.com/CryptoKey" + pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}" +}; +option (google.api.resource_definition) = { + type: "cloudkms.googleapis.com/CryptoKeyVersion" + pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}" +}; + +// A set of words or phrases that represents a common concept likely to appear +// in your audio, for example a list of passenger ship names. CustomClass items +// can be substituted into placeholders that you set in PhraseSet phrases. +message CustomClass { + option (google.api.resource) = { + type: "speech.googleapis.com/CustomClass" + pattern: "projects/{project}/locations/{location}/customClasses/{custom_class}" + }; + + // An item of the class. + message ClassItem { + // The class item's value. + string value = 1; + } + + // Set of states that define the lifecycle of a CustomClass. + enum State { + // Unspecified state. This is only used/useful for distinguishing + // unset values. + STATE_UNSPECIFIED = 0; + + // The normal and active state. + ACTIVE = 2; + + // This CustomClass has been deleted. + DELETED = 4; + } + + // The resource name of the custom class. + string name = 1; + + // If this custom class is a resource, the custom_class_id is the resource id + // of the CustomClass. Case sensitive. + string custom_class_id = 2; + + // A collection of class items. + repeated ClassItem items = 3; + + // Output only. The [KMS key + // name](https://cloud.google.com/kms/docs/resource-hierarchy#keys) with which + // the content of the ClassItem is encrypted. The expected format is + // `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`. + string kms_key_name = 6 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + } + ]; + + // Output only. The [KMS key version + // name](https://cloud.google.com/kms/docs/resource-hierarchy#key_versions) + // with which content of the ClassItem is encrypted. The expected format is + // `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}`. + string kms_key_version_name = 7 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKeyVersion" + } + ]; + + // Output only. System-assigned unique identifier for the CustomClass. + // This field is not used. + string uid = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. User-settable, human-readable name for the CustomClass. Must + // be 63 characters or less. This field is not used. + string display_name = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The CustomClass lifecycle state. + // This field is not used. + State state = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which this resource was requested for deletion. + // This field is not used. + google.protobuf.Timestamp delete_time = 11 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which this resource will be purged. + // This field is not used. + google.protobuf.Timestamp expire_time = 12 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Allows users to store small amounts of arbitrary data. + // Both the key and the value must be 63 characters or less each. + // At most 100 annotations. + // This field is not used. + map annotations = 13 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. This checksum is computed by the server based on the value of + // other fields. This may be sent on update, undelete, and delete requests to + // ensure the client has an up-to-date value before proceeding. This field is + // not used. + string etag = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Whether or not this CustomClass is in the process of being + // updated. This field is not used. + bool reconciling = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Provides "hints" to the speech recognizer to favor specific words and phrases +// in the results. +message PhraseSet { + option (google.api.resource) = { + type: "speech.googleapis.com/PhraseSet" + pattern: "projects/{project}/locations/{location}/phraseSets/{phrase_set}" + }; + + // A phrases containing words and phrase "hints" so that + // the speech recognition is more likely to recognize them. This can be used + // to improve the accuracy for specific words and phrases, for example, if + // specific commands are typically spoken by the user. This can also be used + // to add additional words to the vocabulary of the recognizer. See + // [usage limits](https://cloud.google.com/speech-to-text/quotas#content). + // + // List items can also include pre-built or custom classes containing groups + // of words that represent common concepts that occur in natural language. For + // example, rather than providing a phrase hint for every month of the + // year (e.g. "i was born in january", "i was born in febuary", ...), use the + // pre-built `$MONTH` class improves the likelihood of correctly transcribing + // audio that includes months (e.g. "i was born in $month"). + // To refer to pre-built classes, use the class' symbol prepended with `$` + // e.g. `$MONTH`. To refer to custom classes that were defined inline in the + // request, set the class's `custom_class_id` to a string unique to all class + // resources and inline classes. Then use the class' id wrapped in $`{...}` + // e.g. "${my-months}". To refer to custom classes resources, use the class' + // id wrapped in `${}` (e.g. `${my-months}`). + // + // Speech-to-Text supports three locations: `global`, `us` (US North America), + // and `eu` (Europe). If you are calling the `speech.googleapis.com` + // endpoint, use the `global` location. To specify a region, use a + // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + // with matching `us` or `eu` location value. + message Phrase { + // The phrase itself. + string value = 1; + + // Hint Boost. Overrides the boost set at the phrase set level. + // Positive value will increase the probability that a specific phrase will + // be recognized over other similar sounding phrases. The higher the boost, + // the higher the chance of false positive recognition as well. Negative + // boost will simply be ignored. Though `boost` can accept a wide range of + // positive values, most use cases are best served + // with values between 0 and 20. We recommend using a binary search approach + // to finding the optimal value for your use case as well as adding + // phrases both with and without boost to your requests. + float boost = 2; + } + + // Set of states that define the lifecycle of a CustomClass. + enum State { + // Unspecified state. This is only used/useful for distinguishing + // unset values. + STATE_UNSPECIFIED = 0; + + // The normal and active state. + ACTIVE = 2; + + // This CustomClass has been deleted. + DELETED = 4; + } + + // The resource name of the phrase set. + string name = 1; + + // A list of word and phrases. + repeated Phrase phrases = 2; + + // Hint Boost. Positive value will increase the probability that a specific + // phrase will be recognized over other similar sounding phrases. The higher + // the boost, the higher the chance of false positive recognition as well. + // Negative boost values would correspond to anti-biasing. Anti-biasing is not + // enabled, so negative boost will simply be ignored. Though `boost` can + // accept a wide range of positive values, most use cases are best served with + // values between 0 (exclusive) and 20. We recommend using a binary search + // approach to finding the optimal value for your use case as well as adding + // phrases both with and without boost to your requests. + float boost = 4; + + // Output only. The [KMS key + // name](https://cloud.google.com/kms/docs/resource-hierarchy#keys) with which + // the content of the PhraseSet is encrypted. The expected format is + // `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`. + string kms_key_name = 7 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + } + ]; + + // Output only. The [KMS key version + // name](https://cloud.google.com/kms/docs/resource-hierarchy#key_versions) + // with which content of the PhraseSet is encrypted. The expected format is + // `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}`. + string kms_key_version_name = 8 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKeyVersion" + } + ]; + + // Output only. System-assigned unique identifier for the PhraseSet. + // This field is not used. + string uid = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. User-settable, human-readable name for the PhraseSet. Must be + // 63 characters or less. This field is not used. + string display_name = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The CustomClass lifecycle state. + // This field is not used. + State state = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which this resource was requested for deletion. + // This field is not used. + google.protobuf.Timestamp delete_time = 12 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which this resource will be purged. + // This field is not used. + google.protobuf.Timestamp expire_time = 13 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Allows users to store small amounts of arbitrary data. + // Both the key and the value must be 63 characters or less each. + // At most 100 annotations. + // This field is not used. + map annotations = 14 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. This checksum is computed by the server based on the value of + // other fields. This may be sent on update, undelete, and delete requests to + // ensure the client has an up-to-date value before proceeding. This field is + // not used. + string etag = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Whether or not this PhraseSet is in the process of being + // updated. This field is not used. + bool reconciling = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Speech adaptation configuration. +message SpeechAdaptation { + message ABNFGrammar { + // All declarations and rules of an ABNF grammar broken up into multiple + // strings that will end up concatenated. + repeated string abnf_strings = 1; + } + + // A collection of phrase sets. To specify the hints inline, leave the + // phrase set's `name` blank and fill in the rest of its fields. Any + // phrase set can use any custom class. + repeated PhraseSet phrase_sets = 1; + + // A collection of phrase set resource names to use. + repeated string phrase_set_references = 2 [(google.api.resource_reference) = { + type: "speech.googleapis.com/PhraseSet" + }]; + + // A collection of custom classes. To specify the classes inline, leave the + // class' `name` blank and fill in the rest of its fields, giving it a unique + // `custom_class_id`. Refer to the inline defined class in phrase hints by its + // `custom_class_id`. + repeated CustomClass custom_classes = 3; + + // Augmented Backus-Naur form (ABNF) is a standardized grammar notation + // comprised by a set of derivation rules. + // See specifications: https://www.w3.org/TR/speech-grammar + ABNFGrammar abnf_grammar = 4; +} + +// Transcription normalization configuration. Use transcription normalization +// to automatically replace parts of the transcript with phrases of your +// choosing. For StreamingRecognize, this normalization only applies to stable +// partial transcripts (stability > 0.8) and final transcripts. +message TranscriptNormalization { + // A single replacement configuration. + message Entry { + // What to replace. Max length is 100 characters. + string search = 1; + + // What to replace with. Max length is 100 characters. + string replace = 2; + + // Whether the search is case sensitive. + bool case_sensitive = 3; + } + + // A list of replacement entries. We will perform replacement with one entry + // at a time. For example, the second entry in ["cat" => "dog", "mountain cat" + // => "mountain dog"] will never be applied because we will always process the + // first entry before it. At most 100 entries. + repeated Entry entries = 1; +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/protos/google/cloud/speech/v2/cloud_speech.proto b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/protos/google/cloud/speech/v2/cloud_speech.proto new file mode 100644 index 00000000000..cf4b28c3afb --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/protos/google/cloud/speech/v2/cloud_speech.proto @@ -0,0 +1,2232 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.speech.v2; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option go_package = "cloud.google.com/go/speech/apiv2/speechpb;speechpb"; +option java_multiple_files = true; +option java_outer_classname = "CloudSpeechProto"; +option java_package = "com.google.cloud.speech.v2"; +option (google.api.resource_definition) = { + type: "cloudkms.googleapis.com/CryptoKey" + pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}" +}; +option (google.api.resource_definition) = { + type: "cloudkms.googleapis.com/CryptoKeyVersion" + pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}" +}; + +// Enables speech transcription and resource management. +service Speech { + option (google.api.default_host) = "speech.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a [Recognizer][google.cloud.speech.v2.Recognizer]. + rpc CreateRecognizer(CreateRecognizerRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{parent=projects/*/locations/*}/recognizers" + body: "recognizer" + }; + option (google.api.method_signature) = "parent,recognizer,recognizer_id"; + option (google.longrunning.operation_info) = { + response_type: "Recognizer" + metadata_type: "OperationMetadata" + }; + } + + // Lists Recognizers. + rpc ListRecognizers(ListRecognizersRequest) + returns (ListRecognizersResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*/locations/*}/recognizers" + }; + option (google.api.method_signature) = "parent"; + } + + // Returns the requested + // [Recognizer][google.cloud.speech.v2.Recognizer]. Fails with + // [NOT_FOUND][google.rpc.Code.NOT_FOUND] if the requested Recognizer doesn't + // exist. + rpc GetRecognizer(GetRecognizerRequest) returns (Recognizer) { + option (google.api.http) = { + get: "/v2/{name=projects/*/locations/*/recognizers/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates the [Recognizer][google.cloud.speech.v2.Recognizer]. + rpc UpdateRecognizer(UpdateRecognizerRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v2/{recognizer.name=projects/*/locations/*/recognizers/*}" + body: "recognizer" + }; + option (google.api.method_signature) = "recognizer,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Recognizer" + metadata_type: "OperationMetadata" + }; + } + + // Deletes the [Recognizer][google.cloud.speech.v2.Recognizer]. + rpc DeleteRecognizer(DeleteRecognizerRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v2/{name=projects/*/locations/*/recognizers/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Recognizer" + metadata_type: "OperationMetadata" + }; + } + + // Undeletes the [Recognizer][google.cloud.speech.v2.Recognizer]. + rpc UndeleteRecognizer(UndeleteRecognizerRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{name=projects/*/locations/*/recognizers/*}:undelete" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Recognizer" + metadata_type: "OperationMetadata" + }; + } + + // Performs synchronous Speech recognition: receive results after all audio + // has been sent and processed. + rpc Recognize(RecognizeRequest) returns (RecognizeResponse) { + option (google.api.http) = { + post: "/v2/{recognizer=projects/*/locations/*/recognizers/*}:recognize" + body: "*" + }; + option (google.api.method_signature) = + "recognizer,config,config_mask,content"; + option (google.api.method_signature) = "recognizer,config,config_mask,uri"; + } + + // Performs bidirectional streaming speech recognition: receive results while + // sending audio. This method is only available via the gRPC API (not REST). + rpc StreamingRecognize(stream StreamingRecognizeRequest) + returns (stream StreamingRecognizeResponse) {} + + // Performs batch asynchronous speech recognition: send a request with N + // audio files and receive a long running operation that can be polled to see + // when the transcriptions are finished. + rpc BatchRecognize(BatchRecognizeRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{recognizer=projects/*/locations/*/recognizers/*}:batchRecognize" + body: "*" + }; + option (google.api.method_signature) = + "recognizer,config,config_mask,files"; + option (google.longrunning.operation_info) = { + response_type: "BatchRecognizeResponse" + metadata_type: "OperationMetadata" + }; + } + + // Returns the requested [Config][google.cloud.speech.v2.Config]. + rpc GetConfig(GetConfigRequest) returns (Config) { + option (google.api.http) = { + get: "/v2/{name=projects/*/locations/*/config}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates the [Config][google.cloud.speech.v2.Config]. + rpc UpdateConfig(UpdateConfigRequest) returns (Config) { + option (google.api.http) = { + patch: "/v2/{config.name=projects/*/locations/*/config}" + body: "config" + }; + option (google.api.method_signature) = "config,update_mask"; + } + + // Creates a [CustomClass][google.cloud.speech.v2.CustomClass]. + rpc CreateCustomClass(CreateCustomClassRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{parent=projects/*/locations/*}/customClasses" + body: "custom_class" + }; + option (google.api.method_signature) = + "parent,custom_class,custom_class_id"; + option (google.longrunning.operation_info) = { + response_type: "CustomClass" + metadata_type: "OperationMetadata" + }; + } + + // Lists CustomClasses. + rpc ListCustomClasses(ListCustomClassesRequest) + returns (ListCustomClassesResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*/locations/*}/customClasses" + }; + option (google.api.method_signature) = "parent"; + } + + // Returns the requested + // [CustomClass][google.cloud.speech.v2.CustomClass]. + rpc GetCustomClass(GetCustomClassRequest) returns (CustomClass) { + option (google.api.http) = { + get: "/v2/{name=projects/*/locations/*/customClasses/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates the [CustomClass][google.cloud.speech.v2.CustomClass]. + rpc UpdateCustomClass(UpdateCustomClassRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v2/{custom_class.name=projects/*/locations/*/customClasses/*}" + body: "custom_class" + }; + option (google.api.method_signature) = "custom_class,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "CustomClass" + metadata_type: "OperationMetadata" + }; + } + + // Deletes the [CustomClass][google.cloud.speech.v2.CustomClass]. + rpc DeleteCustomClass(DeleteCustomClassRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v2/{name=projects/*/locations/*/customClasses/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "CustomClass" + metadata_type: "OperationMetadata" + }; + } + + // Undeletes the [CustomClass][google.cloud.speech.v2.CustomClass]. + rpc UndeleteCustomClass(UndeleteCustomClassRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{name=projects/*/locations/*/customClasses/*}:undelete" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "CustomClass" + metadata_type: "OperationMetadata" + }; + } + + // Creates a [PhraseSet][google.cloud.speech.v2.PhraseSet]. + rpc CreatePhraseSet(CreatePhraseSetRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{parent=projects/*/locations/*}/phraseSets" + body: "phrase_set" + }; + option (google.api.method_signature) = "parent,phrase_set,phrase_set_id"; + option (google.longrunning.operation_info) = { + response_type: "PhraseSet" + metadata_type: "OperationMetadata" + }; + } + + // Lists PhraseSets. + rpc ListPhraseSets(ListPhraseSetsRequest) returns (ListPhraseSetsResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*/locations/*}/phraseSets" + }; + option (google.api.method_signature) = "parent"; + } + + // Returns the requested + // [PhraseSet][google.cloud.speech.v2.PhraseSet]. + rpc GetPhraseSet(GetPhraseSetRequest) returns (PhraseSet) { + option (google.api.http) = { + get: "/v2/{name=projects/*/locations/*/phraseSets/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates the [PhraseSet][google.cloud.speech.v2.PhraseSet]. + rpc UpdatePhraseSet(UpdatePhraseSetRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v2/{phrase_set.name=projects/*/locations/*/phraseSets/*}" + body: "phrase_set" + }; + option (google.api.method_signature) = "phrase_set,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "PhraseSet" + metadata_type: "OperationMetadata" + }; + } + + // Deletes the [PhraseSet][google.cloud.speech.v2.PhraseSet]. + rpc DeletePhraseSet(DeletePhraseSetRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v2/{name=projects/*/locations/*/phraseSets/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "PhraseSet" + metadata_type: "OperationMetadata" + }; + } + + // Undeletes the [PhraseSet][google.cloud.speech.v2.PhraseSet]. + rpc UndeletePhraseSet(UndeletePhraseSetRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{name=projects/*/locations/*/phraseSets/*}:undelete" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "PhraseSet" + metadata_type: "OperationMetadata" + }; + } +} + +// Request message for the +// [CreateRecognizer][google.cloud.speech.v2.Speech.CreateRecognizer] method. +message CreateRecognizerRequest { + // Required. The Recognizer to create. + Recognizer recognizer = 1 [(google.api.field_behavior) = REQUIRED]; + + // If set, validate the request and preview the Recognizer, but do not + // actually create it. + bool validate_only = 2; + + // The ID to use for the Recognizer, which will become the final component of + // the Recognizer's resource name. + // + // This value should be 4-63 characters, and valid characters + // are /[a-z][0-9]-/. + string recognizer_id = 3; + + // Required. The project and location where this Recognizer will be created. + // The expected format is `projects/{project}/locations/{location}`. + string parent = 4 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "speech.googleapis.com/Recognizer" + } + ]; +} + +// Represents the metadata of a long-running operation. +message OperationMetadata { + // The time the operation was created. + google.protobuf.Timestamp create_time = 1; + + // The time the operation was last updated. + google.protobuf.Timestamp update_time = 2; + + // The resource path for the target of the operation. + string resource = 3; + + // The method that triggered the operation. + string method = 4; + + // The [KMS key + // name](https://cloud.google.com/kms/docs/resource-hierarchy#keys) with which + // the content of the Operation is encrypted. The expected format is + // `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`. + string kms_key_name = 6 [(google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + }]; + + // The [KMS key version + // name](https://cloud.google.com/kms/docs/resource-hierarchy#key_versions) + // with which content of the Operation is encrypted. The expected format is + // `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}`. + string kms_key_version_name = 7 [(google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKeyVersion" + }]; + + // The request that spawned the Operation. + oneof request { + // The BatchRecognizeRequest that spawned the Operation. + BatchRecognizeRequest batch_recognize_request = 8; + + // The CreateRecognizerRequest that spawned the Operation. + CreateRecognizerRequest create_recognizer_request = 9; + + // The UpdateRecognizerRequest that spawned the Operation. + UpdateRecognizerRequest update_recognizer_request = 10; + + // The DeleteRecognizerRequest that spawned the Operation. + DeleteRecognizerRequest delete_recognizer_request = 11; + + // The UndeleteRecognizerRequest that spawned the Operation. + UndeleteRecognizerRequest undelete_recognizer_request = 12; + + // The CreateCustomClassRequest that spawned the Operation. + CreateCustomClassRequest create_custom_class_request = 13; + + // The UpdateCustomClassRequest that spawned the Operation. + UpdateCustomClassRequest update_custom_class_request = 14; + + // The DeleteCustomClassRequest that spawned the Operation. + DeleteCustomClassRequest delete_custom_class_request = 15; + + // The UndeleteCustomClassRequest that spawned the Operation. + UndeleteCustomClassRequest undelete_custom_class_request = 16; + + // The CreatePhraseSetRequest that spawned the Operation. + CreatePhraseSetRequest create_phrase_set_request = 17; + + // The UpdatePhraseSetRequest that spawned the Operation. + UpdatePhraseSetRequest update_phrase_set_request = 18; + + // The DeletePhraseSetRequest that spawned the Operation. + DeletePhraseSetRequest delete_phrase_set_request = 19; + + // The UndeletePhraseSetRequest that spawned the Operation. + UndeletePhraseSetRequest undelete_phrase_set_request = 20; + + // The UpdateConfigRequest that spawned the Operation. + UpdateConfigRequest update_config_request = 21 [deprecated = true]; + } + + // The percent progress of the Operation. Values can range from 0-100. If the + // value is 100, then the operation is finished. + int32 progress_percent = 22; + + // Specific metadata per RPC. + oneof metadata { + // Metadata specific to the BatchRecognize method. + BatchRecognizeMetadata batch_recognize_metadata = 23; + } +} + +// Request message for the +// [ListRecognizers][google.cloud.speech.v2.Speech.ListRecognizers] method. +message ListRecognizersRequest { + // Required. The project and location of Recognizers to list. The expected + // format is `projects/{project}/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // The maximum number of Recognizers to return. The service may return fewer + // than this value. If unspecified, at most 5 Recognizers will be returned. + // The maximum value is 100; values above 100 will be coerced to 100. + int32 page_size = 2; + + // A page token, received from a previous + // [ListRecognizers][google.cloud.speech.v2.Speech.ListRecognizers] call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // [ListRecognizers][google.cloud.speech.v2.Speech.ListRecognizers] must match + // the call that provided the page token. + string page_token = 3; + + // Whether, or not, to show resources that have been deleted. + bool show_deleted = 4; +} + +// Response message for the +// [ListRecognizers][google.cloud.speech.v2.Speech.ListRecognizers] method. +message ListRecognizersResponse { + // The list of requested Recognizers. + repeated Recognizer recognizers = 1; + + // A token, which can be sent as + // [page_token][google.cloud.speech.v2.ListRecognizersRequest.page_token] to + // retrieve the next page. If this field is omitted, there are no subsequent + // pages. This token expires after 72 hours. + string next_page_token = 2; +} + +// Request message for the +// [GetRecognizer][google.cloud.speech.v2.Speech.GetRecognizer] method. +message GetRecognizerRequest { + // Required. The name of the Recognizer to retrieve. The expected format is + // `projects/{project}/locations/{location}/recognizers/{recognizer}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "speech.googleapis.com/Recognizer" + } + ]; +} + +// Request message for the +// [UpdateRecognizer][google.cloud.speech.v2.Speech.UpdateRecognizer] method. +message UpdateRecognizerRequest { + // Required. The Recognizer to update. + // + // The Recognizer's `name` field is used to identify the Recognizer to update. + // Format: `projects/{project}/locations/{location}/recognizers/{recognizer}`. + Recognizer recognizer = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to update. If empty, all non-default valued fields are + // considered for update. Use `*` to update the entire Recognizer resource. + google.protobuf.FieldMask update_mask = 2; + + // If set, validate the request and preview the updated Recognizer, but do not + // actually update it. + bool validate_only = 4; +} + +// Request message for the +// [DeleteRecognizer][google.cloud.speech.v2.Speech.DeleteRecognizer] method. +message DeleteRecognizerRequest { + // Required. The name of the Recognizer to delete. + // Format: `projects/{project}/locations/{location}/recognizers/{recognizer}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "speech.googleapis.com/Recognizer" + } + ]; + + // If set, validate the request and preview the deleted Recognizer, but do not + // actually delete it. + bool validate_only = 2; + + // If set to true, and the Recognizer is not found, the request will succeed + // and be a no-op (no Operation is recorded in this case). + bool allow_missing = 4; + + // This checksum is computed by the server based on the value of other + // fields. This may be sent on update, undelete, and delete requests to ensure + // the client has an up-to-date value before proceeding. + string etag = 3; +} + +// Request message for the +// [UndeleteRecognizer][google.cloud.speech.v2.Speech.UndeleteRecognizer] +// method. +message UndeleteRecognizerRequest { + // Required. The name of the Recognizer to undelete. + // Format: `projects/{project}/locations/{location}/recognizers/{recognizer}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "speech.googleapis.com/Recognizer" + } + ]; + + // If set, validate the request and preview the undeleted Recognizer, but do + // not actually undelete it. + bool validate_only = 3; + + // This checksum is computed by the server based on the value of other + // fields. This may be sent on update, undelete, and delete requests to ensure + // the client has an up-to-date value before proceeding. + string etag = 4; +} + +// A Recognizer message. Stores recognition configuration and metadata. +message Recognizer { + option (google.api.resource) = { + type: "speech.googleapis.com/Recognizer" + pattern: "projects/{project}/locations/{location}/recognizers/{recognizer}" + style: DECLARATIVE_FRIENDLY + }; + + // Set of states that define the lifecycle of a Recognizer. + enum State { + // The default value. This value is used if the state is omitted. + STATE_UNSPECIFIED = 0; + + // The Recognizer is active and ready for use. + ACTIVE = 2; + + // This Recognizer has been deleted. + DELETED = 4; + } + + // Output only. Identifier. The resource name of the Recognizer. + // Format: `projects/{project}/locations/{location}/recognizers/{recognizer}`. + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = IDENTIFIER + ]; + + // Output only. System-assigned unique identifier for the Recognizer. + string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // User-settable, human-readable name for the Recognizer. Must be 63 + // characters or less. + string display_name = 3; + + // Optional. This field is now deprecated. Prefer the + // [`model`][google.cloud.speech.v2.RecognitionConfig.model] field in the + // [`RecognitionConfig`][google.cloud.speech.v2.RecognitionConfig] message. + // + // Which model to use for recognition requests. Select the model best suited + // to your domain to get best results. + // + // Guidance for choosing which model to use can be found in the [Transcription + // Models + // Documentation](https://cloud.google.com/speech-to-text/v2/docs/transcription-model) + // and the models supported in each region can be found in the [Table Of + // Supported + // Models](https://cloud.google.com/speech-to-text/v2/docs/speech-to-text-supported-languages). + string model = 4 [deprecated = true, (google.api.field_behavior) = OPTIONAL]; + + // Optional. This field is now deprecated. Prefer the + // [`language_codes`][google.cloud.speech.v2.RecognitionConfig.language_codes] + // field in the + // [`RecognitionConfig`][google.cloud.speech.v2.RecognitionConfig] message. + // + // The language of the supplied audio as a + // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. + // + // Supported languages for each model are listed in the [Table of Supported + // Models](https://cloud.google.com/speech-to-text/v2/docs/speech-to-text-supported-languages). + // + // If additional languages are provided, recognition result will contain + // recognition in the most likely language detected. The recognition result + // will include the language tag of the language detected in the audio. + // When you create or update a Recognizer, these values are + // stored in normalized BCP-47 form. For example, "en-us" is stored as + // "en-US". + repeated string language_codes = 17 + [deprecated = true, (google.api.field_behavior) = OPTIONAL]; + + // Default configuration to use for requests with this Recognizer. + // This can be overwritten by inline configuration in the + // [RecognizeRequest.config][google.cloud.speech.v2.RecognizeRequest.config] + // field. + RecognitionConfig default_recognition_config = 6; + + // Allows users to store small amounts of arbitrary data. + // Both the key and the value must be 63 characters or less each. + // At most 100 annotations. + map annotations = 7; + + // Output only. The Recognizer lifecycle state. + State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Creation time. + google.protobuf.Timestamp create_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The most recent time this Recognizer was modified. + google.protobuf.Timestamp update_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which this Recognizer was requested for deletion. + google.protobuf.Timestamp delete_time = 11 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which this Recognizer will be purged. + google.protobuf.Timestamp expire_time = 14 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. This checksum is computed by the server based on the value of + // other fields. This may be sent on update, undelete, and delete requests to + // ensure the client has an up-to-date value before proceeding. + string etag = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Whether or not this Recognizer is in the process of being + // updated. + bool reconciling = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The [KMS key + // name](https://cloud.google.com/kms/docs/resource-hierarchy#keys) with which + // the Recognizer is encrypted. The expected format is + // `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`. + string kms_key_name = 15 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + } + ]; + + // Output only. The [KMS key version + // name](https://cloud.google.com/kms/docs/resource-hierarchy#key_versions) + // with which the Recognizer is encrypted. The expected format is + // `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}`. + string kms_key_version_name = 16 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKeyVersion" + } + ]; +} + +// Automatically detected decoding parameters. +// Supported for the following encodings: +// +// * WAV_LINEAR16: 16-bit signed little-endian PCM samples in a WAV container. +// +// * WAV_MULAW: 8-bit companded mulaw samples in a WAV container. +// +// * WAV_ALAW: 8-bit companded alaw samples in a WAV container. +// +// * RFC4867_5_AMR: AMR frames with an rfc4867.5 header. +// +// * RFC4867_5_AMRWB: AMR-WB frames with an rfc4867.5 header. +// +// * FLAC: FLAC frames in the "native FLAC" container format. +// +// * MP3: MPEG audio frames with optional (ignored) ID3 metadata. +// +// * OGG_OPUS: Opus audio frames in an Ogg container. +// +// * WEBM_OPUS: Opus audio frames in a WebM container. +// +// * MP4_AAC: AAC audio frames in an MP4 container. +// +// * M4A_AAC: AAC audio frames in an M4A container. +// +// * MOV_AAC: AAC audio frames in an MOV container. +message AutoDetectDecodingConfig {} + +// Explicitly specified decoding parameters. +message ExplicitDecodingConfig { + // Supported audio data encodings. + enum AudioEncoding { + // Default value. This value is unused. + AUDIO_ENCODING_UNSPECIFIED = 0; + + // Headerless 16-bit signed little-endian PCM samples. + LINEAR16 = 1; + + // Headerless 8-bit companded mulaw samples. + MULAW = 2; + + // Headerless 8-bit companded alaw samples. + ALAW = 3; + + // AMR frames with an rfc4867.5 header. + AMR = 4; + + // AMR-WB frames with an rfc4867.5 header. + AMR_WB = 5; + + // FLAC frames in the "native FLAC" container format. + FLAC = 6; + + // MPEG audio frames with optional (ignored) ID3 metadata. + MP3 = 7; + + // Opus audio frames in an Ogg container. + OGG_OPUS = 8; + + // Opus audio frames in a WebM container. + WEBM_OPUS = 9; + + // AAC audio frames in an MP4 container. + MP4_AAC = 10; + + // AAC audio frames in an M4A container. + M4A_AAC = 11; + + // AAC audio frames in an MOV container. + MOV_AAC = 12; + } + + // Required. Encoding of the audio data sent for recognition. + AudioEncoding encoding = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Sample rate in Hertz of the audio data sent for recognition. + // Valid values are: 8000-48000. 16000 is optimal. For best results, set the + // sampling rate of the audio source to 16000 Hz. If that's not possible, use + // the native sample rate of the audio source (instead of re-sampling). + // Note that this field is marked as OPTIONAL for backward compatibility + // reasons. It is (and has always been) effectively REQUIRED. + int32 sample_rate_hertz = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Number of channels present in the audio data sent for + // recognition. Note that this field is marked as OPTIONAL for backward + // compatibility reasons. It is (and has always been) effectively REQUIRED. + // + // The maximum allowed value is 8. + int32 audio_channel_count = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Configuration to enable speaker diarization. +message SpeakerDiarizationConfig { + // Required. Minimum number of speakers in the conversation. This range gives + // you more flexibility by allowing the system to automatically determine the + // correct number of speakers. + // + // To fix the number of speakers detected in the audio, set + // `min_speaker_count` = `max_speaker_count`. + int32 min_speaker_count = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Maximum number of speakers in the conversation. Valid values are: + // 1-6. Must be >= `min_speaker_count`. This range gives you more flexibility + // by allowing the system to automatically determine the correct number of + // speakers. + int32 max_speaker_count = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Available recognition features. +message RecognitionFeatures { + // Options for how to recognize multi-channel audio. + enum MultiChannelMode { + // Default value for the multi-channel mode. If the audio contains + // multiple channels, only the first channel will be transcribed; other + // channels will be ignored. + MULTI_CHANNEL_MODE_UNSPECIFIED = 0; + + // If selected, each channel in the provided audio is transcribed + // independently. This cannot be selected if the selected + // [model][google.cloud.speech.v2.Recognizer.model] is `latest_short`. + SEPARATE_RECOGNITION_PER_CHANNEL = 1; + } + + // If set to `true`, the server will attempt to filter out profanities, + // replacing all but the initial character in each filtered word with + // asterisks, for instance, "f***". If set to `false` or omitted, profanities + // won't be filtered out. + bool profanity_filter = 1; + + // If `true`, the top result includes a list of words and the start and end + // time offsets (timestamps) for those words. If `false`, no word-level time + // offset information is returned. The default is `false`. + bool enable_word_time_offsets = 2; + + // If `true`, the top result includes a list of words and the confidence for + // those words. If `false`, no word-level confidence information is returned. + // The default is `false`. + bool enable_word_confidence = 3; + + // If `true`, adds punctuation to recognition result hypotheses. This feature + // is only available in select languages. The default `false` value does not + // add punctuation to result hypotheses. + bool enable_automatic_punctuation = 4; + + // The spoken punctuation behavior for the call. If `true`, replaces spoken + // punctuation with the corresponding symbols in the request. For example, + // "how are you question mark" becomes "how are you?". See + // https://cloud.google.com/speech-to-text/docs/spoken-punctuation for + // support. If `false`, spoken punctuation is not replaced. + bool enable_spoken_punctuation = 14; + + // The spoken emoji behavior for the call. If `true`, adds spoken emoji + // formatting for the request. This will replace spoken emojis with the + // corresponding Unicode symbols in the final transcript. If `false`, spoken + // emojis are not replaced. + bool enable_spoken_emojis = 15; + + // Mode for recognizing multi-channel audio. + MultiChannelMode multi_channel_mode = 17; + + // Configuration to enable speaker diarization and set additional + // parameters to make diarization better suited for your application. + // When this is enabled, we send all the words from the beginning of the + // audio for the top alternative in every consecutive STREAMING responses. + // This is done in order to improve our speaker tags as our models learn to + // identify the speakers in the conversation over time. + // For non-streaming requests, the diarization results will be provided only + // in the top alternative of the FINAL SpeechRecognitionResult. + SpeakerDiarizationConfig diarization_config = 9; + + // Maximum number of recognition hypotheses to be returned. + // The server may return fewer than `max_alternatives`. + // Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of + // one. If omitted, will return a maximum of one. + int32 max_alternatives = 16; +} + +// Transcription normalization configuration. Use transcription normalization +// to automatically replace parts of the transcript with phrases of your +// choosing. For StreamingRecognize, this normalization only applies to stable +// partial transcripts (stability > 0.8) and final transcripts. +message TranscriptNormalization { + // A single replacement configuration. + message Entry { + // What to replace. Max length is 100 characters. + string search = 1; + + // What to replace with. Max length is 100 characters. + string replace = 2; + + // Whether the search is case sensitive. + bool case_sensitive = 3; + } + + // A list of replacement entries. We will perform replacement with one entry + // at a time. For example, the second entry in ["cat" => "dog", "mountain cat" + // => "mountain dog"] will never be applied because we will always process the + // first entry before it. At most 100 entries. + repeated Entry entries = 1; +} + +// Translation configuration. Use to translate the given audio into text for the +// desired language. +message TranslationConfig { + // Required. The language code to translate to. + string target_language = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Provides "hints" to the speech recognizer to favor specific words and phrases +// in the results. PhraseSets can be specified as an inline resource, or a +// reference to an existing PhraseSet resource. +message SpeechAdaptation { + // A biasing PhraseSet, which can be either a string referencing the name of + // an existing PhraseSets resource, or an inline definition of a PhraseSet. + message AdaptationPhraseSet { + oneof value { + // The name of an existing PhraseSet resource. The user must have read + // access to the resource and it must not be deleted. + string phrase_set = 1 [(google.api.resource_reference) = { + type: "speech.googleapis.com/PhraseSet" + }]; + + // An inline defined PhraseSet. + PhraseSet inline_phrase_set = 2; + } + } + + // A list of inline or referenced PhraseSets. + repeated AdaptationPhraseSet phrase_sets = 1; + + // A list of inline CustomClasses. Existing CustomClass resources can be + // referenced directly in a PhraseSet. + repeated CustomClass custom_classes = 2; +} + +// Provides information to the Recognizer that specifies how to process the +// recognition request. +message RecognitionConfig { + // Decoding parameters for audio being sent for recognition. + oneof decoding_config { + // Automatically detect decoding parameters. + // Preferred for supported formats. + AutoDetectDecodingConfig auto_decoding_config = 7; + + // Explicitly specified decoding parameters. + // Required if using headerless PCM audio (linear16, mulaw, alaw). + ExplicitDecodingConfig explicit_decoding_config = 8; + } + + // Optional. Which model to use for recognition requests. Select the model + // best suited to your domain to get best results. + // + // Guidance for choosing which model to use can be found in the [Transcription + // Models + // Documentation](https://cloud.google.com/speech-to-text/v2/docs/transcription-model) + // and the models supported in each region can be found in the [Table Of + // Supported + // Models](https://cloud.google.com/speech-to-text/v2/docs/speech-to-text-supported-languages). + string model = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The language of the supplied audio as a + // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. + // Language tags are normalized to BCP-47 before they are used eg "en-us" + // becomes "en-US". + // + // Supported languages for each model are listed in the [Table of Supported + // Models](https://cloud.google.com/speech-to-text/v2/docs/speech-to-text-supported-languages). + // + // If additional languages are provided, recognition result will contain + // recognition in the most likely language detected. The recognition result + // will include the language tag of the language detected in the audio. + repeated string language_codes = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Speech recognition features to enable. + RecognitionFeatures features = 2; + + // Speech adaptation context that weights recognizer predictions for specific + // words and phrases. + SpeechAdaptation adaptation = 6; + + // Optional. Use transcription normalization to automatically replace parts of + // the transcript with phrases of your choosing. For StreamingRecognize, this + // normalization only applies to stable partial transcripts (stability > 0.8) + // and final transcripts. + TranscriptNormalization transcript_normalization = 11 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Optional configuration used to automatically run translation on + // the given audio to the desired language for supported models. + TranslationConfig translation_config = 15 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for the +// [Recognize][google.cloud.speech.v2.Speech.Recognize] method. Either +// `content` or `uri` must be supplied. Supplying both or neither returns +// [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. See [content +// limits](https://cloud.google.com/speech-to-text/quotas#content). +message RecognizeRequest { + // Required. The name of the Recognizer to use during recognition. The + // expected format is + // `projects/{project}/locations/{location}/recognizers/{recognizer}`. The + // {recognizer} segment may be set to `_` to use an empty implicit Recognizer. + string recognizer = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "speech.googleapis.com/Recognizer" + } + ]; + + // Features and audio metadata to use for the Automatic Speech Recognition. + // This field in combination with the + // [config_mask][google.cloud.speech.v2.RecognizeRequest.config_mask] field + // can be used to override parts of the + // [default_recognition_config][google.cloud.speech.v2.Recognizer.default_recognition_config] + // of the Recognizer resource. + RecognitionConfig config = 1; + + // The list of fields in + // [config][google.cloud.speech.v2.RecognizeRequest.config] that override the + // values in the + // [default_recognition_config][google.cloud.speech.v2.Recognizer.default_recognition_config] + // of the recognizer during this recognition request. If no mask is provided, + // all non-default valued fields in + // [config][google.cloud.speech.v2.RecognizeRequest.config] override the + // values in the recognizer for this recognition request. If a mask is + // provided, only the fields listed in the mask override the config in the + // recognizer for this recognition request. If a wildcard (`*`) is provided, + // [config][google.cloud.speech.v2.RecognizeRequest.config] completely + // overrides and replaces the config in the recognizer for this recognition + // request. + google.protobuf.FieldMask config_mask = 8; + + // The audio source, which is either inline content or a Google Cloud + // Storage URI. + oneof audio_source { + // The audio data bytes encoded as specified in + // [RecognitionConfig][google.cloud.speech.v2.RecognitionConfig]. As + // with all bytes fields, proto buffers use a pure binary representation, + // whereas JSON representations use base64. + bytes content = 5; + + // URI that points to a file that contains audio data bytes as specified in + // [RecognitionConfig][google.cloud.speech.v2.RecognitionConfig]. The file + // must not be compressed (for example, gzip). Currently, only Google Cloud + // Storage URIs are supported, which must be specified in the following + // format: `gs://bucket_name/object_name` (other URI formats return + // [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more + // information, see [Request + // URIs](https://cloud.google.com/storage/docs/reference-uris). + string uri = 6; + } +} + +// Metadata about the recognition request and response. +message RecognitionResponseMetadata { + // Global request identifier auto-generated by the API. + string request_id = 9 [(google.api.field_info).format = UUID4]; + + // When available, billed audio seconds for the corresponding request. + google.protobuf.Duration total_billed_duration = 6; +} + +// Alternative hypotheses (a.k.a. n-best list). +message SpeechRecognitionAlternative { + // Transcript text representing the words that the user spoke. + string transcript = 1; + + // The confidence estimate between 0.0 and 1.0. A higher number + // indicates an estimated greater likelihood that the recognized words are + // correct. This field is set only for the top alternative of a non-streaming + // result or, of a streaming result where + // [is_final][google.cloud.speech.v2.StreamingRecognitionResult.is_final] is + // set to `true`. This field is not guaranteed to be accurate and users should + // not rely on it to be always provided. The default of 0.0 is a sentinel + // value indicating `confidence` was not set. + float confidence = 2; + + // A list of word-specific information for each recognized word. + // When the + // [SpeakerDiarizationConfig][google.cloud.speech.v2.SpeakerDiarizationConfig] + // is set, you will see all the words from the beginning of the audio. + repeated WordInfo words = 3; +} + +// Word-specific information for recognized words. +message WordInfo { + // Time offset relative to the beginning of the audio, + // and corresponding to the start of the spoken word. + // This field is only set if + // [enable_word_time_offsets][google.cloud.speech.v2.RecognitionFeatures.enable_word_time_offsets] + // is `true` and only in the top hypothesis. This is an experimental feature + // and the accuracy of the time offset can vary. + google.protobuf.Duration start_offset = 1; + + // Time offset relative to the beginning of the audio, + // and corresponding to the end of the spoken word. + // This field is only set if + // [enable_word_time_offsets][google.cloud.speech.v2.RecognitionFeatures.enable_word_time_offsets] + // is `true` and only in the top hypothesis. This is an experimental feature + // and the accuracy of the time offset can vary. + google.protobuf.Duration end_offset = 2; + + // The word corresponding to this set of information. + string word = 3; + + // The confidence estimate between 0.0 and 1.0. A higher number + // indicates an estimated greater likelihood that the recognized words are + // correct. This field is set only for the top alternative of a non-streaming + // result or, of a streaming result where + // [is_final][google.cloud.speech.v2.StreamingRecognitionResult.is_final] is + // set to `true`. This field is not guaranteed to be accurate and users should + // not rely on it to be always provided. The default of 0.0 is a sentinel + // value indicating `confidence` was not set. + float confidence = 4; + + // A distinct label is assigned for every speaker within the audio. This field + // specifies which one of those speakers was detected to have spoken this + // word. `speaker_label` is set if + // [SpeakerDiarizationConfig][google.cloud.speech.v2.SpeakerDiarizationConfig] + // is given and only in the top alternative. + string speaker_label = 6; +} + +// A speech recognition result corresponding to a portion of the audio. +message SpeechRecognitionResult { + // May contain one or more recognition hypotheses. These alternatives are + // ordered in terms of accuracy, with the top (first) alternative being the + // most probable, as ranked by the recognizer. + repeated SpeechRecognitionAlternative alternatives = 1; + + // For multi-channel audio, this is the channel number corresponding to the + // recognized result for the audio from that channel. + // For `audio_channel_count` = `N`, its output values can range from `1` to + // `N`. + int32 channel_tag = 2; + + // Time offset of the end of this result relative to the beginning of the + // audio. + google.protobuf.Duration result_end_offset = 4; + + // Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + // language tag of the language in this result. This language code was + // detected to have the most likelihood of being spoken in the audio. + string language_code = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Response message for the +// [Recognize][google.cloud.speech.v2.Speech.Recognize] method. +message RecognizeResponse { + // Sequential list of transcription results corresponding to sequential + // portions of audio. + repeated SpeechRecognitionResult results = 3; + + // Metadata about the recognition. + RecognitionResponseMetadata metadata = 2; +} + +// Available recognition features specific to streaming recognition requests. +message StreamingRecognitionFeatures { + // Events that a timeout can be set on for voice activity. + message VoiceActivityTimeout { + // Duration to timeout the stream if no speech begins. If this is set and + // no speech is detected in this duration at the start of the stream, the + // server will close the stream. + google.protobuf.Duration speech_start_timeout = 1; + + // Duration to timeout the stream after speech ends. If this is set and no + // speech is detected in this duration after speech was detected, the server + // will close the stream. + google.protobuf.Duration speech_end_timeout = 2; + } + + // If `true`, responses with voice activity speech events will be returned as + // they are detected. + bool enable_voice_activity_events = 1; + + // Whether or not to stream interim results to the client. If set to true, + // interim results will be streamed to the client. Otherwise, only the final + // response will be streamed back. + bool interim_results = 2; + + // If set, the server will automatically close the stream after the specified + // duration has elapsed after the last VOICE_ACTIVITY speech event has been + // sent. The field `voice_activity_events` must also be set to true. + VoiceActivityTimeout voice_activity_timeout = 3; +} + +// Provides configuration information for the StreamingRecognize request. +message StreamingRecognitionConfig { + // Required. Features and audio metadata to use for the Automatic Speech + // Recognition. This field in combination with the + // [config_mask][google.cloud.speech.v2.StreamingRecognitionConfig.config_mask] + // field can be used to override parts of the + // [default_recognition_config][google.cloud.speech.v2.Recognizer.default_recognition_config] + // of the Recognizer resource. + RecognitionConfig config = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields in + // [config][google.cloud.speech.v2.StreamingRecognitionConfig.config] that + // override the values in the + // [default_recognition_config][google.cloud.speech.v2.Recognizer.default_recognition_config] + // of the recognizer during this recognition request. If no mask is provided, + // all non-default valued fields in + // [config][google.cloud.speech.v2.StreamingRecognitionConfig.config] override + // the values in the Recognizer for this recognition request. If a mask is + // provided, only the fields listed in the mask override the config in the + // Recognizer for this recognition request. If a wildcard (`*`) is provided, + // [config][google.cloud.speech.v2.StreamingRecognitionConfig.config] + // completely overrides and replaces the config in the recognizer for this + // recognition request. + google.protobuf.FieldMask config_mask = 3; + + // Speech recognition features to enable specific to streaming audio + // recognition requests. + StreamingRecognitionFeatures streaming_features = 2; +} + +// Request message for the +// [StreamingRecognize][google.cloud.speech.v2.Speech.StreamingRecognize] +// method. Multiple +// [StreamingRecognizeRequest][google.cloud.speech.v2.StreamingRecognizeRequest] +// messages are sent in one call. +// +// If the [Recognizer][google.cloud.speech.v2.Recognizer] referenced by +// [recognizer][google.cloud.speech.v2.StreamingRecognizeRequest.recognizer] +// contains a fully specified request configuration then the stream may only +// contain messages with only +// [audio][google.cloud.speech.v2.StreamingRecognizeRequest.audio] set. +// +// Otherwise the first message must contain a +// [recognizer][google.cloud.speech.v2.StreamingRecognizeRequest.recognizer] and +// a +// [streaming_config][google.cloud.speech.v2.StreamingRecognizeRequest.streaming_config] +// message that together fully specify the request configuration and must not +// contain [audio][google.cloud.speech.v2.StreamingRecognizeRequest.audio]. All +// subsequent messages must only have +// [audio][google.cloud.speech.v2.StreamingRecognizeRequest.audio] set. +message StreamingRecognizeRequest { + // Required. The name of the Recognizer to use during recognition. The + // expected format is + // `projects/{project}/locations/{location}/recognizers/{recognizer}`. The + // {recognizer} segment may be set to `_` to use an empty implicit Recognizer. + string recognizer = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "speech.googleapis.com/Recognizer" + } + ]; + + oneof streaming_request { + // StreamingRecognitionConfig to be used in this recognition attempt. + // If provided, it will override the default RecognitionConfig stored in the + // Recognizer. + StreamingRecognitionConfig streaming_config = 6; + + // Inline audio bytes to be Recognized. + // Maximum size for this field is 15 KB per request. + bytes audio = 5; + } +} + +// Request message for the +// [BatchRecognize][google.cloud.speech.v2.Speech.BatchRecognize] +// method. +message BatchRecognizeRequest { + // Possible processing strategies for batch requests. + enum ProcessingStrategy { + // Default value for the processing strategy. The request is processed as + // soon as its received. + PROCESSING_STRATEGY_UNSPECIFIED = 0; + + // If selected, processes the request during lower utilization periods for a + // price discount. The request is fulfilled within 24 hours. + DYNAMIC_BATCHING = 1; + } + + // Required. The name of the Recognizer to use during recognition. The + // expected format is + // `projects/{project}/locations/{location}/recognizers/{recognizer}`. The + // {recognizer} segment may be set to `_` to use an empty implicit Recognizer. + string recognizer = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "speech.googleapis.com/Recognizer" + } + ]; + + // Features and audio metadata to use for the Automatic Speech Recognition. + // This field in combination with the + // [config_mask][google.cloud.speech.v2.BatchRecognizeRequest.config_mask] + // field can be used to override parts of the + // [default_recognition_config][google.cloud.speech.v2.Recognizer.default_recognition_config] + // of the Recognizer resource. + RecognitionConfig config = 4; + + // The list of fields in + // [config][google.cloud.speech.v2.BatchRecognizeRequest.config] that override + // the values in the + // [default_recognition_config][google.cloud.speech.v2.Recognizer.default_recognition_config] + // of the recognizer during this recognition request. If no mask is provided, + // all given fields in + // [config][google.cloud.speech.v2.BatchRecognizeRequest.config] override the + // values in the recognizer for this recognition request. If a mask is + // provided, only the fields listed in the mask override the config in the + // recognizer for this recognition request. If a wildcard (`*`) is provided, + // [config][google.cloud.speech.v2.BatchRecognizeRequest.config] completely + // overrides and replaces the config in the recognizer for this recognition + // request. + google.protobuf.FieldMask config_mask = 5; + + // Audio files with file metadata for ASR. + // The maximum number of files allowed to be specified is 15. + repeated BatchRecognizeFileMetadata files = 3; + + // Configuration options for where to output the transcripts of each file. + RecognitionOutputConfig recognition_output_config = 6; + + // Processing strategy to use for this request. + ProcessingStrategy processing_strategy = 7; +} + +// Output configurations for Cloud Storage. +message GcsOutputConfig { + // The Cloud Storage URI prefix with which recognition results will be + // written. + string uri = 1; +} + +// Output configurations for inline response. +message InlineOutputConfig {} + +// Output configurations for serialized `BatchRecognizeResults` protos. +message NativeOutputFileFormatConfig {} + +// Output configurations for [WebVTT](https://www.w3.org/TR/webvtt1/) formatted +// subtitle file. +message VttOutputFileFormatConfig {} + +// Output configurations [SubRip +// Text](https://www.matroska.org/technical/subtitles.html#srt-subtitles) +// formatted subtitle file. +message SrtOutputFileFormatConfig {} + +// Configuration for the format of the results stored to `output`. +message OutputFormatConfig { + // Configuration for the native output format. If this field is set or if no + // other output format field is set, then transcripts will be written to the + // sink in the native format. + NativeOutputFileFormatConfig native = 1; + + // Configuration for the VTT output format. If this field is set, then + // transcripts will be written to the sink in the VTT format. + VttOutputFileFormatConfig vtt = 2; + + // Configuration for the SRT output format. If this field is set, then + // transcripts will be written to the sink in the SRT format. + SrtOutputFileFormatConfig srt = 3; +} + +// Configuration options for the output(s) of recognition. +message RecognitionOutputConfig { + oneof output { + // If this message is populated, recognition results are written to the + // provided Google Cloud Storage URI. + GcsOutputConfig gcs_output_config = 1; + + // If this message is populated, recognition results are provided in the + // [BatchRecognizeResponse][google.cloud.speech.v2.BatchRecognizeResponse] + // message of the Operation when completed. This is only supported when + // calling [BatchRecognize][google.cloud.speech.v2.Speech.BatchRecognize] + // with just one audio file. + InlineOutputConfig inline_response_config = 2; + } + + // Optional. Configuration for the format of the results stored to `output`. + // If unspecified transcripts will be written in the `NATIVE` format only. + OutputFormatConfig output_format_config = 3 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [BatchRecognize][google.cloud.speech.v2.Speech.BatchRecognize] that is +// packaged into a longrunning [Operation][google.longrunning.Operation]. +message BatchRecognizeResponse { + // Map from filename to the final result for that file. + map results = 1; + + // When available, billed audio seconds for the corresponding request. + google.protobuf.Duration total_billed_duration = 2; +} + +// Output type for Cloud Storage of BatchRecognize transcripts. Though this +// proto isn't returned in this API anywhere, the Cloud Storage transcripts will +// be this proto serialized and should be parsed as such. +message BatchRecognizeResults { + // Sequential list of transcription results corresponding to sequential + // portions of audio. + repeated SpeechRecognitionResult results = 1; + + // Metadata about the recognition. + RecognitionResponseMetadata metadata = 2; +} + +// Final results written to Cloud Storage. +message CloudStorageResult { + // The Cloud Storage URI to which recognition results were written. + string uri = 1; + + // The Cloud Storage URI to which recognition results were written as VTT + // formatted captions. This is populated only when `VTT` output is requested. + string vtt_format_uri = 2; + + // The Cloud Storage URI to which recognition results were written as SRT + // formatted captions. This is populated only when `SRT` output is requested. + string srt_format_uri = 3; +} + +// Final results returned inline in the recognition response. +message InlineResult { + // The transcript for the audio file. + BatchRecognizeResults transcript = 1; + + // The transcript for the audio file as VTT formatted captions. This is + // populated only when `VTT` output is requested. + string vtt_captions = 2; + + // The transcript for the audio file as SRT formatted captions. This is + // populated only when `SRT` output is requested. + string srt_captions = 3; +} + +// Final results for a single file. +message BatchRecognizeFileResult { + // Error if one was encountered. + google.rpc.Status error = 2; + + RecognitionResponseMetadata metadata = 3; + + oneof result { + // Recognition results written to Cloud Storage. This is + // populated only when + // [GcsOutputConfig][google.cloud.speech.v2.GcsOutputConfig] is set in + // the + // [RecognitionOutputConfig][[google.cloud.speech.v2.RecognitionOutputConfig]. + CloudStorageResult cloud_storage_result = 5; + + // Recognition results. This is populated only when + // [InlineOutputConfig][google.cloud.speech.v2.InlineOutputConfig] is set in + // the + // [RecognitionOutputConfig][[google.cloud.speech.v2.RecognitionOutputConfig]. + InlineResult inline_result = 6; + } + + // Deprecated. Use `cloud_storage_result.native_format_uri` instead. + string uri = 1 [deprecated = true]; + + // Deprecated. Use `inline_result.transcript` instead. + BatchRecognizeResults transcript = 4 [deprecated = true]; +} + +// Metadata about transcription for a single file (for example, progress +// percent). +message BatchRecognizeTranscriptionMetadata { + // How much of the file has been transcribed so far. + int32 progress_percent = 1; + + // Error if one was encountered. + google.rpc.Status error = 2; + + // The Cloud Storage URI to which recognition results will be written. + string uri = 3; +} + +// Operation metadata for +// [BatchRecognize][google.cloud.speech.v2.Speech.BatchRecognize]. +message BatchRecognizeMetadata { + // Map from provided filename to the transcription metadata for that file. + map transcription_metadata = 1; +} + +// Metadata about a single file in a batch for BatchRecognize. +message BatchRecognizeFileMetadata { + // The audio source, which is a Google Cloud Storage URI. + oneof audio_source { + // Cloud Storage URI for the audio file. + string uri = 1; + } + + // Features and audio metadata to use for the Automatic Speech Recognition. + // This field in combination with the + // [config_mask][google.cloud.speech.v2.BatchRecognizeFileMetadata.config_mask] + // field can be used to override parts of the + // [default_recognition_config][google.cloud.speech.v2.Recognizer.default_recognition_config] + // of the Recognizer resource as well as the + // [config][google.cloud.speech.v2.BatchRecognizeRequest.config] at the + // request level. + RecognitionConfig config = 4; + + // The list of fields in + // [config][google.cloud.speech.v2.BatchRecognizeFileMetadata.config] that + // override the values in the + // [default_recognition_config][google.cloud.speech.v2.Recognizer.default_recognition_config] + // of the recognizer during this recognition request. If no mask is provided, + // all non-default valued fields in + // [config][google.cloud.speech.v2.BatchRecognizeFileMetadata.config] override + // the values in the recognizer for this recognition request. If a mask is + // provided, only the fields listed in the mask override the config in the + // recognizer for this recognition request. If a wildcard (`*`) is provided, + // [config][google.cloud.speech.v2.BatchRecognizeFileMetadata.config] + // completely overrides and replaces the config in the recognizer for this + // recognition request. + google.protobuf.FieldMask config_mask = 5; +} + +// A streaming speech recognition result corresponding to a portion of the audio +// that is currently being processed. +message StreamingRecognitionResult { + // May contain one or more recognition hypotheses. These alternatives are + // ordered in terms of accuracy, with the top (first) alternative being the + // most probable, as ranked by the recognizer. + repeated SpeechRecognitionAlternative alternatives = 1; + + // If `false`, this + // [StreamingRecognitionResult][google.cloud.speech.v2.StreamingRecognitionResult] + // represents an interim result that may change. If `true`, this is the final + // time the speech service will return this particular + // [StreamingRecognitionResult][google.cloud.speech.v2.StreamingRecognitionResult], + // the recognizer will not return any further hypotheses for this portion of + // the transcript and corresponding audio. + bool is_final = 2; + + // An estimate of the likelihood that the recognizer will not change its guess + // about this interim result. Values range from 0.0 (completely unstable) + // to 1.0 (completely stable). This field is only provided for interim results + // ([is_final][google.cloud.speech.v2.StreamingRecognitionResult.is_final]=`false`). + // The default of 0.0 is a sentinel value indicating `stability` was not set. + float stability = 3; + + // Time offset of the end of this result relative to the beginning of the + // audio. + google.protobuf.Duration result_end_offset = 4; + + // For multi-channel audio, this is the channel number corresponding to the + // recognized result for the audio from that channel. + // For + // `audio_channel_count` = `N`, its output values can range from `1` to `N`. + int32 channel_tag = 5; + + // Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + // language tag of the language in this result. This language code was + // detected to have the most likelihood of being spoken in the audio. + string language_code = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// `StreamingRecognizeResponse` is the only message returned to the client by +// `StreamingRecognize`. A series of zero or more `StreamingRecognizeResponse` +// messages are streamed back to the client. If there is no recognizable +// audio then no messages are streamed back to the client. +// +// Here are some examples of `StreamingRecognizeResponse`s that might +// be returned while processing audio: +// +// 1. results { alternatives { transcript: "tube" } stability: 0.01 } +// +// 2. results { alternatives { transcript: "to be a" } stability: 0.01 } +// +// 3. results { alternatives { transcript: "to be" } stability: 0.9 } +// results { alternatives { transcript: " or not to be" } stability: 0.01 } +// +// 4. results { alternatives { transcript: "to be or not to be" +// confidence: 0.92 } +// alternatives { transcript: "to bee or not to bee" } +// is_final: true } +// +// 5. results { alternatives { transcript: " that's" } stability: 0.01 } +// +// 6. results { alternatives { transcript: " that is" } stability: 0.9 } +// results { alternatives { transcript: " the question" } stability: 0.01 } +// +// 7. results { alternatives { transcript: " that is the question" +// confidence: 0.98 } +// alternatives { transcript: " that was the question" } +// is_final: true } +// +// Notes: +// +// - Only two of the above responses #4 and #7 contain final results; they are +// indicated by `is_final: true`. Concatenating these together generates the +// full transcript: "to be or not to be that is the question". +// +// - The others contain interim `results`. #3 and #6 contain two interim +// `results`: the first portion has a high stability and is less likely to +// change; the second portion has a low stability and is very likely to +// change. A UI designer might choose to show only high stability `results`. +// +// - The specific `stability` and `confidence` values shown above are only for +// illustrative purposes. Actual values may vary. +// +// - In each response, only one of these fields will be set: +// `error`, +// `speech_event_type`, or +// one or more (repeated) `results`. +message StreamingRecognizeResponse { + // Indicates the type of speech event. + enum SpeechEventType { + // No speech event specified. + SPEECH_EVENT_TYPE_UNSPECIFIED = 0; + + // This event indicates that the server has detected the end of the user's + // speech utterance and expects no additional speech. Therefore, the server + // will not process additional audio and will close the gRPC bidirectional + // stream. This event is only sent if there was a force cutoff due to + // silence being detected early. This event is only available through the + // `latest_short` [model][google.cloud.speech.v2.Recognizer.model]. + END_OF_SINGLE_UTTERANCE = 1; + + // This event indicates that the server has detected the beginning of human + // voice activity in the stream. This event can be returned multiple times + // if speech starts and stops repeatedly throughout the stream. This event + // is only sent if `voice_activity_events` is set to true. + SPEECH_ACTIVITY_BEGIN = 2; + + // This event indicates that the server has detected the end of human voice + // activity in the stream. This event can be returned multiple times if + // speech starts and stops repeatedly throughout the stream. This event is + // only sent if `voice_activity_events` is set to true. + SPEECH_ACTIVITY_END = 3; + } + + // This repeated list contains zero or more results that + // correspond to consecutive portions of the audio currently being processed. + // It contains zero or one + // [is_final][google.cloud.speech.v2.StreamingRecognitionResult.is_final]=`true` + // result (the newly settled portion), followed by zero or more + // [is_final][google.cloud.speech.v2.StreamingRecognitionResult.is_final]=`false` + // results (the interim results). + repeated StreamingRecognitionResult results = 6; + + // Indicates the type of speech event. + SpeechEventType speech_event_type = 3; + + // Time offset between the beginning of the audio and event emission. + google.protobuf.Duration speech_event_offset = 7; + + // Metadata about the recognition. + RecognitionResponseMetadata metadata = 5; +} + +// Message representing the config for the Speech-to-Text API. This includes an +// optional [KMS key](https://cloud.google.com/kms/docs/resource-hierarchy#keys) +// with which incoming data will be encrypted. +message Config { + option (google.api.resource) = { + type: "speech.googleapis.com/Config" + pattern: "projects/{project}/locations/{location}/config" + }; + + // Output only. Identifier. The name of the config resource. There is exactly + // one config resource per project per location. The expected format is + // `projects/{project}/locations/{location}/config`. + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = IDENTIFIER + ]; + + // Optional. An optional [KMS key + // name](https://cloud.google.com/kms/docs/resource-hierarchy#keys) that if + // present, will be used to encrypt Speech-to-Text resources at-rest. Updating + // this key will not encrypt existing resources using this key; only new + // resources will be encrypted using this key. The expected format is + // `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`. + string kms_key_name = 2 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + } + ]; + + // Output only. The most recent time this resource was modified. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for the +// [GetConfig][google.cloud.speech.v2.Speech.GetConfig] method. +message GetConfigRequest { + // Required. The name of the config to retrieve. There is exactly one config + // resource per project per location. The expected format is + // `projects/{project}/locations/{location}/config`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "speech.googleapis.com/Config" } + ]; +} + +// Request message for the +// [UpdateConfig][google.cloud.speech.v2.Speech.UpdateConfig] method. +message UpdateConfigRequest { + // Required. The config to update. + // + // The config's `name` field is used to identify the config to be updated. + // The expected format is `projects/{project}/locations/{location}/config`. + Config config = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// CustomClass for biasing in speech recognition. Used to define a set of words +// or phrases that represents a common concept or theme likely to appear in your +// audio, for example a list of passenger ship names. +message CustomClass { + option (google.api.resource) = { + type: "speech.googleapis.com/CustomClass" + pattern: "projects/{project}/locations/{location}/customClasses/{custom_class}" + style: DECLARATIVE_FRIENDLY + }; + + // An item of the class. + message ClassItem { + // The class item's value. + string value = 1; + } + + // Set of states that define the lifecycle of a CustomClass. + enum State { + // Unspecified state. This is only used/useful for distinguishing + // unset values. + STATE_UNSPECIFIED = 0; + + // The normal and active state. + ACTIVE = 2; + + // This CustomClass has been deleted. + DELETED = 4; + } + + // Output only. Identifier. The resource name of the CustomClass. + // Format: + // `projects/{project}/locations/{location}/customClasses/{custom_class}`. + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = IDENTIFIER + ]; + + // Output only. System-assigned unique identifier for the CustomClass. + string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. User-settable, human-readable name for the CustomClass. Must be + // 63 characters or less. + string display_name = 4 [(google.api.field_behavior) = OPTIONAL]; + + // A collection of class items. + repeated ClassItem items = 5; + + // Output only. The CustomClass lifecycle state. + State state = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Creation time. + google.protobuf.Timestamp create_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The most recent time this resource was modified. + google.protobuf.Timestamp update_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which this resource was requested for deletion. + google.protobuf.Timestamp delete_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which this resource will be purged. + google.protobuf.Timestamp expire_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Allows users to store small amounts of arbitrary data. + // Both the key and the value must be 63 characters or less each. + // At most 100 annotations. + map annotations = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. This checksum is computed by the server based on the value of + // other fields. This may be sent on update, undelete, and delete requests to + // ensure the client has an up-to-date value before proceeding. + string etag = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Whether or not this CustomClass is in the process of being + // updated. + bool reconciling = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The [KMS key + // name](https://cloud.google.com/kms/docs/resource-hierarchy#keys) with which + // the CustomClass is encrypted. The expected format is + // `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`. + string kms_key_name = 13 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + } + ]; + + // Output only. The [KMS key version + // name](https://cloud.google.com/kms/docs/resource-hierarchy#key_versions) + // with which the CustomClass is encrypted. The expected format is + // `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}`. + string kms_key_version_name = 14 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKeyVersion" + } + ]; +} + +// PhraseSet for biasing in speech recognition. A PhraseSet is used to provide +// "hints" to the speech recognizer to favor specific words and phrases in the +// results. +message PhraseSet { + option (google.api.resource) = { + type: "speech.googleapis.com/PhraseSet" + pattern: "projects/{project}/locations/{location}/phraseSets/{phrase_set}" + style: DECLARATIVE_FRIENDLY + }; + + // A Phrase contains words and phrase "hints" so that the speech recognition + // is more likely to recognize them. This can be used to improve the accuracy + // for specific words and phrases, for example, if specific commands are + // typically spoken by the user. This can also be used to add additional words + // to the vocabulary of the recognizer. + // + // List items can also include CustomClass references containing groups of + // words that represent common concepts that occur in natural language. + message Phrase { + // The phrase itself. + string value = 1; + + // Hint Boost. Overrides the boost set at the phrase set level. + // Positive value will increase the probability that a specific phrase will + // be recognized over other similar sounding phrases. The higher the boost, + // the higher the chance of false positive recognition as well. Negative + // boost values would correspond to anti-biasing. Anti-biasing is not + // enabled, so negative boost values will return an error. Boost values must + // be between 0 and 20. Any values outside that range will return an error. + // We recommend using a binary search approach to finding the optimal value + // for your use case as well as adding phrases both with and without boost + // to your requests. + float boost = 2; + } + + // Set of states that define the lifecycle of a PhraseSet. + enum State { + // Unspecified state. This is only used/useful for distinguishing + // unset values. + STATE_UNSPECIFIED = 0; + + // The normal and active state. + ACTIVE = 2; + + // This PhraseSet has been deleted. + DELETED = 4; + } + + // Output only. Identifier. The resource name of the PhraseSet. + // Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}`. + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = IDENTIFIER + ]; + + // Output only. System-assigned unique identifier for the PhraseSet. + string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // A list of word and phrases. + repeated Phrase phrases = 3; + + // Hint Boost. Positive value will increase the probability that a specific + // phrase will be recognized over other similar sounding phrases. The higher + // the boost, the higher the chance of false positive recognition as well. + // Valid `boost` values are between 0 (exclusive) and 20. We recommend using a + // binary search approach to finding the optimal value for your use case as + // well as adding phrases both with and without boost to your requests. + float boost = 4; + + // User-settable, human-readable name for the PhraseSet. Must be 63 + // characters or less. + string display_name = 5; + + // Output only. The PhraseSet lifecycle state. + State state = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Creation time. + google.protobuf.Timestamp create_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The most recent time this resource was modified. + google.protobuf.Timestamp update_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which this resource was requested for deletion. + google.protobuf.Timestamp delete_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which this resource will be purged. + google.protobuf.Timestamp expire_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Allows users to store small amounts of arbitrary data. + // Both the key and the value must be 63 characters or less each. + // At most 100 annotations. + map annotations = 10; + + // Output only. This checksum is computed by the server based on the value of + // other fields. This may be sent on update, undelete, and delete requests to + // ensure the client has an up-to-date value before proceeding. + string etag = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Whether or not this PhraseSet is in the process of being + // updated. + bool reconciling = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The [KMS key + // name](https://cloud.google.com/kms/docs/resource-hierarchy#keys) with which + // the PhraseSet is encrypted. The expected format is + // `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`. + string kms_key_name = 13 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + } + ]; + + // Output only. The [KMS key version + // name](https://cloud.google.com/kms/docs/resource-hierarchy#key_versions) + // with which the PhraseSet is encrypted. The expected format is + // `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}`. + string kms_key_version_name = 14 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKeyVersion" + } + ]; +} + +// Request message for the +// [CreateCustomClass][google.cloud.speech.v2.Speech.CreateCustomClass] method. +message CreateCustomClassRequest { + // Required. The CustomClass to create. + CustomClass custom_class = 1 [(google.api.field_behavior) = REQUIRED]; + + // If set, validate the request and preview the CustomClass, but do not + // actually create it. + bool validate_only = 2; + + // The ID to use for the CustomClass, which will become the final component of + // the CustomClass's resource name. + // + // This value should be 4-63 characters, and valid characters + // are /[a-z][0-9]-/. + string custom_class_id = 3; + + // Required. The project and location where this CustomClass will be created. + // The expected format is `projects/{project}/locations/{location}`. + string parent = 4 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "speech.googleapis.com/CustomClass" + } + ]; +} + +// Request message for the +// [ListCustomClasses][google.cloud.speech.v2.Speech.ListCustomClasses] method. +message ListCustomClassesRequest { + // Required. The project and location of CustomClass resources to list. The + // expected format is `projects/{project}/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Number of results per requests. A valid page_size ranges from 0 to 100 + // inclusive. If the page_size is zero or unspecified, a page size of 5 will + // be chosen. If the page size exceeds 100, it will be coerced down to 100. + // Note that a call might return fewer results than the requested page size. + int32 page_size = 2; + + // A page token, received from a previous + // [ListCustomClasses][google.cloud.speech.v2.Speech.ListCustomClasses] call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // [ListCustomClasses][google.cloud.speech.v2.Speech.ListCustomClasses] must + // match the call that provided the page token. + string page_token = 3; + + // Whether, or not, to show resources that have been deleted. + bool show_deleted = 4; +} + +// Response message for the +// [ListCustomClasses][google.cloud.speech.v2.Speech.ListCustomClasses] method. +message ListCustomClassesResponse { + // The list of requested CustomClasses. + repeated CustomClass custom_classes = 1; + + // A token, which can be sent as + // [page_token][google.cloud.speech.v2.ListCustomClassesRequest.page_token] to + // retrieve the next page. If this field is omitted, there are no subsequent + // pages. This token expires after 72 hours. + string next_page_token = 2; +} + +// Request message for the +// [GetCustomClass][google.cloud.speech.v2.Speech.GetCustomClass] method. +message GetCustomClassRequest { + // Required. The name of the CustomClass to retrieve. The expected format is + // `projects/{project}/locations/{location}/customClasses/{custom_class}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "speech.googleapis.com/CustomClass" + } + ]; +} + +// Request message for the +// [UpdateCustomClass][google.cloud.speech.v2.Speech.UpdateCustomClass] method. +message UpdateCustomClassRequest { + // Required. The CustomClass to update. + // + // The CustomClass's `name` field is used to identify the CustomClass to + // update. Format: + // `projects/{project}/locations/{location}/customClasses/{custom_class}`. + CustomClass custom_class = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to be updated. If empty, all fields are considered for + // update. + google.protobuf.FieldMask update_mask = 2; + + // If set, validate the request and preview the updated CustomClass, but do + // not actually update it. + bool validate_only = 4; +} + +// Request message for the +// [DeleteCustomClass][google.cloud.speech.v2.Speech.DeleteCustomClass] method. +message DeleteCustomClassRequest { + // Required. The name of the CustomClass to delete. + // Format: + // `projects/{project}/locations/{location}/customClasses/{custom_class}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "speech.googleapis.com/CustomClass" + } + ]; + + // If set, validate the request and preview the deleted CustomClass, but do + // not actually delete it. + bool validate_only = 2; + + // If set to true, and the CustomClass is not found, the request will succeed + // and be a no-op (no Operation is recorded in this case). + bool allow_missing = 4; + + // This checksum is computed by the server based on the value of other + // fields. This may be sent on update, undelete, and delete requests to ensure + // the client has an up-to-date value before proceeding. + string etag = 3; +} + +// Request message for the +// [UndeleteCustomClass][google.cloud.speech.v2.Speech.UndeleteCustomClass] +// method. +message UndeleteCustomClassRequest { + // Required. The name of the CustomClass to undelete. + // Format: + // `projects/{project}/locations/{location}/customClasses/{custom_class}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "speech.googleapis.com/CustomClass" + } + ]; + + // If set, validate the request and preview the undeleted CustomClass, but do + // not actually undelete it. + bool validate_only = 3; + + // This checksum is computed by the server based on the value of other + // fields. This may be sent on update, undelete, and delete requests to ensure + // the client has an up-to-date value before proceeding. + string etag = 4; +} + +// Request message for the +// [CreatePhraseSet][google.cloud.speech.v2.Speech.CreatePhraseSet] method. +message CreatePhraseSetRequest { + // Required. The PhraseSet to create. + PhraseSet phrase_set = 1 [(google.api.field_behavior) = REQUIRED]; + + // If set, validate the request and preview the PhraseSet, but do not + // actually create it. + bool validate_only = 2; + + // The ID to use for the PhraseSet, which will become the final component of + // the PhraseSet's resource name. + // + // This value should be 4-63 characters, and valid characters + // are /[a-z][0-9]-/. + string phrase_set_id = 3; + + // Required. The project and location where this PhraseSet will be created. + // The expected format is `projects/{project}/locations/{location}`. + string parent = 4 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "speech.googleapis.com/PhraseSet" + } + ]; +} + +// Request message for the +// [ListPhraseSets][google.cloud.speech.v2.Speech.ListPhraseSets] method. +message ListPhraseSetsRequest { + // Required. The project and location of PhraseSet resources to list. The + // expected format is `projects/{project}/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // The maximum number of PhraseSets to return. The service may return fewer + // than this value. If unspecified, at most 5 PhraseSets will be returned. + // The maximum value is 100; values above 100 will be coerced to 100. + int32 page_size = 2; + + // A page token, received from a previous + // [ListPhraseSets][google.cloud.speech.v2.Speech.ListPhraseSets] call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // [ListPhraseSets][google.cloud.speech.v2.Speech.ListPhraseSets] must match + // the call that provided the page token. + string page_token = 3; + + // Whether, or not, to show resources that have been deleted. + bool show_deleted = 4; +} + +// Response message for the +// [ListPhraseSets][google.cloud.speech.v2.Speech.ListPhraseSets] method. +message ListPhraseSetsResponse { + // The list of requested PhraseSets. + repeated PhraseSet phrase_sets = 1; + + // A token, which can be sent as + // [page_token][google.cloud.speech.v2.ListPhraseSetsRequest.page_token] to + // retrieve the next page. If this field is omitted, there are no subsequent + // pages. This token expires after 72 hours. + string next_page_token = 2; +} + +// Request message for the +// [GetPhraseSet][google.cloud.speech.v2.Speech.GetPhraseSet] method. +message GetPhraseSetRequest { + // Required. The name of the PhraseSet to retrieve. The expected format is + // `projects/{project}/locations/{location}/phraseSets/{phrase_set}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "speech.googleapis.com/PhraseSet" + } + ]; +} + +// Request message for the +// [UpdatePhraseSet][google.cloud.speech.v2.Speech.UpdatePhraseSet] method. +message UpdatePhraseSetRequest { + // Required. The PhraseSet to update. + // + // The PhraseSet's `name` field is used to identify the PhraseSet to update. + // Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}`. + PhraseSet phrase_set = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to update. If empty, all non-default valued fields are + // considered for update. Use `*` to update the entire PhraseSet resource. + google.protobuf.FieldMask update_mask = 2; + + // If set, validate the request and preview the updated PhraseSet, but do not + // actually update it. + bool validate_only = 4; +} + +// Request message for the +// [DeletePhraseSet][google.cloud.speech.v2.Speech.DeletePhraseSet] method. +message DeletePhraseSetRequest { + // Required. The name of the PhraseSet to delete. + // Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "speech.googleapis.com/PhraseSet" + } + ]; + + // If set, validate the request and preview the deleted PhraseSet, but do not + // actually delete it. + bool validate_only = 2; + + // If set to true, and the PhraseSet is not found, the request will succeed + // and be a no-op (no Operation is recorded in this case). + bool allow_missing = 4; + + // This checksum is computed by the server based on the value of other + // fields. This may be sent on update, undelete, and delete requests to ensure + // the client has an up-to-date value before proceeding. + string etag = 3; +} + +// Request message for the +// [UndeletePhraseSet][google.cloud.speech.v2.Speech.UndeletePhraseSet] +// method. +message UndeletePhraseSetRequest { + // Required. The name of the PhraseSet to undelete. + // Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "speech.googleapis.com/PhraseSet" + } + ]; + + // If set, validate the request and preview the undeleted PhraseSet, but do + // not actually undelete it. + bool validate_only = 3; + + // This checksum is computed by the server based on the value of other + // fields. This may be sent on update, undelete, and delete requests to ensure + // the client has an up-to-date value before proceeding. + string etag = 4; +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/protos/google/cloud/speech/v2/locations_metadata.proto b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/protos/google/cloud/speech/v2/locations_metadata.proto new file mode 100644 index 00000000000..f747b76e733 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/protos/google/cloud/speech/v2/locations_metadata.proto @@ -0,0 +1,80 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.speech.v2; + +option go_package = "cloud.google.com/go/speech/apiv2/speechpb;speechpb"; +option java_multiple_files = true; +option java_outer_classname = "LocationsMetadataProto"; +option java_package = "com.google.cloud.speech.v2"; + +// Representes a singular feature of a model. If the feature is `recognizer`, +// the release_state of the feature represents the release_state of the model +message ModelFeature { + // The name of the feature (Note: the feature can be `recognizer`) + string feature = 1; + + // The release state of the feature + string release_state = 2; +} + +// Represents the collection of features belonging to a model +message ModelFeatures { + // Repeated field that contains all features of the model + repeated ModelFeature model_feature = 1; +} + +// The metadata about the models in a given region for a specific locale. +// Currently this is just the features of the model +message ModelMetadata { + // Map of the model name -> features of that model + map model_features = 1; +} + +// The metadata about locales available in a given region. Currently this is +// just the models that are available for each locale +message LanguageMetadata { + // Map of locale (language code) -> models + map models = 1; +} + +// The access metadata for a particular region. This can be applied if the org +// policy for the given project disallows a particular region. +message AccessMetadata { + // Describes the different types of constraints that can be applied on a + // region. + enum ConstraintType { + // Unspecified constraint applied. + CONSTRAINT_TYPE_UNSPECIFIED = 0; + + // The project's org policy disallows the given region. + RESOURCE_LOCATIONS_ORG_POLICY_CREATE_CONSTRAINT = 1; + } + + // Describes the different types of constraints that are applied. + ConstraintType constraint_type = 1; +} + +// Main metadata for the Locations API for STT V2. Currently this is just the +// metadata about locales, models, and features +message LocationsMetadata { + // Information about available locales, models, and features represented in + // the hierarchical structure of locales -> models -> features + LanguageMetadata languages = 1; + + // Information about access metadata for the region and given project. + AccessMetadata access_metadata = 2; +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/protos/protos.d.ts b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/protos/protos.d.ts new file mode 100644 index 00000000000..7130a2cc16f --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/protos/protos.d.ts @@ -0,0 +1,13586 @@ +// 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. + +import type {protobuf as $protobuf} from "google-gax"; +import Long = require("long"); +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace speech. */ + namespace speech { + + /** Namespace v1. */ + namespace v1 { + + /** Represents a Speech */ + class Speech extends $protobuf.rpc.Service { + + /** + * Constructs a new Speech service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Speech service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Speech; + + /** + * Calls Recognize. + * @param request RecognizeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RecognizeResponse + */ + public recognize(request: google.cloud.speech.v1.IRecognizeRequest, callback: google.cloud.speech.v1.Speech.RecognizeCallback): void; + + /** + * Calls Recognize. + * @param request RecognizeRequest message or plain object + * @returns Promise + */ + public recognize(request: google.cloud.speech.v1.IRecognizeRequest): Promise; + + /** + * Calls LongRunningRecognize. + * @param request LongRunningRecognizeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public longRunningRecognize(request: google.cloud.speech.v1.ILongRunningRecognizeRequest, callback: google.cloud.speech.v1.Speech.LongRunningRecognizeCallback): void; + + /** + * Calls LongRunningRecognize. + * @param request LongRunningRecognizeRequest message or plain object + * @returns Promise + */ + public longRunningRecognize(request: google.cloud.speech.v1.ILongRunningRecognizeRequest): Promise; + + /** + * Calls StreamingRecognize. + * @param request StreamingRecognizeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and StreamingRecognizeResponse + */ + public streamingRecognize(request: google.cloud.speech.v1.IStreamingRecognizeRequest, callback: google.cloud.speech.v1.Speech.StreamingRecognizeCallback): void; + + /** + * Calls StreamingRecognize. + * @param request StreamingRecognizeRequest message or plain object + * @returns Promise + */ + public streamingRecognize(request: google.cloud.speech.v1.IStreamingRecognizeRequest): Promise; + } + + namespace Speech { + + /** + * Callback as used by {@link google.cloud.speech.v1.Speech|recognize}. + * @param error Error, if any + * @param [response] RecognizeResponse + */ + type RecognizeCallback = (error: (Error|null), response?: google.cloud.speech.v1.RecognizeResponse) => void; + + /** + * Callback as used by {@link google.cloud.speech.v1.Speech|longRunningRecognize}. + * @param error Error, if any + * @param [response] Operation + */ + type LongRunningRecognizeCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.speech.v1.Speech|streamingRecognize}. + * @param error Error, if any + * @param [response] StreamingRecognizeResponse + */ + type StreamingRecognizeCallback = (error: (Error|null), response?: google.cloud.speech.v1.StreamingRecognizeResponse) => void; + } + + /** Properties of a RecognizeRequest. */ + interface IRecognizeRequest { + + /** RecognizeRequest config */ + config?: (google.cloud.speech.v1.IRecognitionConfig|null); + + /** RecognizeRequest audio */ + audio?: (google.cloud.speech.v1.IRecognitionAudio|null); + } + + /** Represents a RecognizeRequest. */ + class RecognizeRequest implements IRecognizeRequest { + + /** + * Constructs a new RecognizeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.IRecognizeRequest); + + /** RecognizeRequest config. */ + public config?: (google.cloud.speech.v1.IRecognitionConfig|null); + + /** RecognizeRequest audio. */ + public audio?: (google.cloud.speech.v1.IRecognitionAudio|null); + + /** + * Creates a new RecognizeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RecognizeRequest instance + */ + public static create(properties?: google.cloud.speech.v1.IRecognizeRequest): google.cloud.speech.v1.RecognizeRequest; + + /** + * Encodes the specified RecognizeRequest message. Does not implicitly {@link google.cloud.speech.v1.RecognizeRequest.verify|verify} messages. + * @param message RecognizeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.IRecognizeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RecognizeRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.RecognizeRequest.verify|verify} messages. + * @param message RecognizeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.IRecognizeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RecognizeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RecognizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.RecognizeRequest; + + /** + * Decodes a RecognizeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RecognizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.RecognizeRequest; + + /** + * Verifies a RecognizeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RecognizeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RecognizeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.RecognizeRequest; + + /** + * Creates a plain object from a RecognizeRequest message. Also converts values to other types if specified. + * @param message RecognizeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.RecognizeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RecognizeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RecognizeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LongRunningRecognizeRequest. */ + interface ILongRunningRecognizeRequest { + + /** LongRunningRecognizeRequest config */ + config?: (google.cloud.speech.v1.IRecognitionConfig|null); + + /** LongRunningRecognizeRequest audio */ + audio?: (google.cloud.speech.v1.IRecognitionAudio|null); + + /** LongRunningRecognizeRequest outputConfig */ + outputConfig?: (google.cloud.speech.v1.ITranscriptOutputConfig|null); + } + + /** Represents a LongRunningRecognizeRequest. */ + class LongRunningRecognizeRequest implements ILongRunningRecognizeRequest { + + /** + * Constructs a new LongRunningRecognizeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.ILongRunningRecognizeRequest); + + /** LongRunningRecognizeRequest config. */ + public config?: (google.cloud.speech.v1.IRecognitionConfig|null); + + /** LongRunningRecognizeRequest audio. */ + public audio?: (google.cloud.speech.v1.IRecognitionAudio|null); + + /** LongRunningRecognizeRequest outputConfig. */ + public outputConfig?: (google.cloud.speech.v1.ITranscriptOutputConfig|null); + + /** + * Creates a new LongRunningRecognizeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns LongRunningRecognizeRequest instance + */ + public static create(properties?: google.cloud.speech.v1.ILongRunningRecognizeRequest): google.cloud.speech.v1.LongRunningRecognizeRequest; + + /** + * Encodes the specified LongRunningRecognizeRequest message. Does not implicitly {@link google.cloud.speech.v1.LongRunningRecognizeRequest.verify|verify} messages. + * @param message LongRunningRecognizeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.ILongRunningRecognizeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LongRunningRecognizeRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.LongRunningRecognizeRequest.verify|verify} messages. + * @param message LongRunningRecognizeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.ILongRunningRecognizeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LongRunningRecognizeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LongRunningRecognizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.LongRunningRecognizeRequest; + + /** + * Decodes a LongRunningRecognizeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LongRunningRecognizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.LongRunningRecognizeRequest; + + /** + * Verifies a LongRunningRecognizeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LongRunningRecognizeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LongRunningRecognizeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.LongRunningRecognizeRequest; + + /** + * Creates a plain object from a LongRunningRecognizeRequest message. Also converts values to other types if specified. + * @param message LongRunningRecognizeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.LongRunningRecognizeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LongRunningRecognizeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LongRunningRecognizeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TranscriptOutputConfig. */ + interface ITranscriptOutputConfig { + + /** TranscriptOutputConfig gcsUri */ + gcsUri?: (string|null); + } + + /** Represents a TranscriptOutputConfig. */ + class TranscriptOutputConfig implements ITranscriptOutputConfig { + + /** + * Constructs a new TranscriptOutputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.ITranscriptOutputConfig); + + /** TranscriptOutputConfig gcsUri. */ + public gcsUri?: (string|null); + + /** TranscriptOutputConfig outputType. */ + public outputType?: "gcsUri"; + + /** + * Creates a new TranscriptOutputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns TranscriptOutputConfig instance + */ + public static create(properties?: google.cloud.speech.v1.ITranscriptOutputConfig): google.cloud.speech.v1.TranscriptOutputConfig; + + /** + * Encodes the specified TranscriptOutputConfig message. Does not implicitly {@link google.cloud.speech.v1.TranscriptOutputConfig.verify|verify} messages. + * @param message TranscriptOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.ITranscriptOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TranscriptOutputConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v1.TranscriptOutputConfig.verify|verify} messages. + * @param message TranscriptOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.ITranscriptOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TranscriptOutputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TranscriptOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.TranscriptOutputConfig; + + /** + * Decodes a TranscriptOutputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TranscriptOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.TranscriptOutputConfig; + + /** + * Verifies a TranscriptOutputConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TranscriptOutputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TranscriptOutputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.TranscriptOutputConfig; + + /** + * Creates a plain object from a TranscriptOutputConfig message. Also converts values to other types if specified. + * @param message TranscriptOutputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.TranscriptOutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TranscriptOutputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TranscriptOutputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StreamingRecognizeRequest. */ + interface IStreamingRecognizeRequest { + + /** StreamingRecognizeRequest streamingConfig */ + streamingConfig?: (google.cloud.speech.v1.IStreamingRecognitionConfig|null); + + /** StreamingRecognizeRequest audioContent */ + audioContent?: (Uint8Array|Buffer|string|null); + } + + /** Represents a StreamingRecognizeRequest. */ + class StreamingRecognizeRequest implements IStreamingRecognizeRequest { + + /** + * Constructs a new StreamingRecognizeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.IStreamingRecognizeRequest); + + /** StreamingRecognizeRequest streamingConfig. */ + public streamingConfig?: (google.cloud.speech.v1.IStreamingRecognitionConfig|null); + + /** StreamingRecognizeRequest audioContent. */ + public audioContent?: (Uint8Array|Buffer|string|null); + + /** StreamingRecognizeRequest streamingRequest. */ + public streamingRequest?: ("streamingConfig"|"audioContent"); + + /** + * Creates a new StreamingRecognizeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingRecognizeRequest instance + */ + public static create(properties?: google.cloud.speech.v1.IStreamingRecognizeRequest): google.cloud.speech.v1.StreamingRecognizeRequest; + + /** + * Encodes the specified StreamingRecognizeRequest message. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognizeRequest.verify|verify} messages. + * @param message StreamingRecognizeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.IStreamingRecognizeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamingRecognizeRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognizeRequest.verify|verify} messages. + * @param message StreamingRecognizeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.IStreamingRecognizeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamingRecognizeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingRecognizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.StreamingRecognizeRequest; + + /** + * Decodes a StreamingRecognizeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingRecognizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.StreamingRecognizeRequest; + + /** + * Verifies a StreamingRecognizeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamingRecognizeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingRecognizeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.StreamingRecognizeRequest; + + /** + * Creates a plain object from a StreamingRecognizeRequest message. Also converts values to other types if specified. + * @param message StreamingRecognizeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.StreamingRecognizeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamingRecognizeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamingRecognizeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StreamingRecognitionConfig. */ + interface IStreamingRecognitionConfig { + + /** StreamingRecognitionConfig config */ + config?: (google.cloud.speech.v1.IRecognitionConfig|null); + + /** StreamingRecognitionConfig singleUtterance */ + singleUtterance?: (boolean|null); + + /** StreamingRecognitionConfig interimResults */ + interimResults?: (boolean|null); + + /** StreamingRecognitionConfig enableVoiceActivityEvents */ + enableVoiceActivityEvents?: (boolean|null); + + /** StreamingRecognitionConfig voiceActivityTimeout */ + voiceActivityTimeout?: (google.cloud.speech.v1.StreamingRecognitionConfig.IVoiceActivityTimeout|null); + } + + /** Represents a StreamingRecognitionConfig. */ + class StreamingRecognitionConfig implements IStreamingRecognitionConfig { + + /** + * Constructs a new StreamingRecognitionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.IStreamingRecognitionConfig); + + /** StreamingRecognitionConfig config. */ + public config?: (google.cloud.speech.v1.IRecognitionConfig|null); + + /** StreamingRecognitionConfig singleUtterance. */ + public singleUtterance: boolean; + + /** StreamingRecognitionConfig interimResults. */ + public interimResults: boolean; + + /** StreamingRecognitionConfig enableVoiceActivityEvents. */ + public enableVoiceActivityEvents: boolean; + + /** StreamingRecognitionConfig voiceActivityTimeout. */ + public voiceActivityTimeout?: (google.cloud.speech.v1.StreamingRecognitionConfig.IVoiceActivityTimeout|null); + + /** + * Creates a new StreamingRecognitionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingRecognitionConfig instance + */ + public static create(properties?: google.cloud.speech.v1.IStreamingRecognitionConfig): google.cloud.speech.v1.StreamingRecognitionConfig; + + /** + * Encodes the specified StreamingRecognitionConfig message. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognitionConfig.verify|verify} messages. + * @param message StreamingRecognitionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.IStreamingRecognitionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamingRecognitionConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognitionConfig.verify|verify} messages. + * @param message StreamingRecognitionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.IStreamingRecognitionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamingRecognitionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingRecognitionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.StreamingRecognitionConfig; + + /** + * Decodes a StreamingRecognitionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingRecognitionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.StreamingRecognitionConfig; + + /** + * Verifies a StreamingRecognitionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamingRecognitionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingRecognitionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.StreamingRecognitionConfig; + + /** + * Creates a plain object from a StreamingRecognitionConfig message. Also converts values to other types if specified. + * @param message StreamingRecognitionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.StreamingRecognitionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamingRecognitionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamingRecognitionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace StreamingRecognitionConfig { + + /** Properties of a VoiceActivityTimeout. */ + interface IVoiceActivityTimeout { + + /** VoiceActivityTimeout speechStartTimeout */ + speechStartTimeout?: (google.protobuf.IDuration|null); + + /** VoiceActivityTimeout speechEndTimeout */ + speechEndTimeout?: (google.protobuf.IDuration|null); + } + + /** Represents a VoiceActivityTimeout. */ + class VoiceActivityTimeout implements IVoiceActivityTimeout { + + /** + * Constructs a new VoiceActivityTimeout. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.StreamingRecognitionConfig.IVoiceActivityTimeout); + + /** VoiceActivityTimeout speechStartTimeout. */ + public speechStartTimeout?: (google.protobuf.IDuration|null); + + /** VoiceActivityTimeout speechEndTimeout. */ + public speechEndTimeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new VoiceActivityTimeout instance using the specified properties. + * @param [properties] Properties to set + * @returns VoiceActivityTimeout instance + */ + public static create(properties?: google.cloud.speech.v1.StreamingRecognitionConfig.IVoiceActivityTimeout): google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout; + + /** + * Encodes the specified VoiceActivityTimeout message. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout.verify|verify} messages. + * @param message VoiceActivityTimeout message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.StreamingRecognitionConfig.IVoiceActivityTimeout, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VoiceActivityTimeout message, length delimited. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout.verify|verify} messages. + * @param message VoiceActivityTimeout message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.StreamingRecognitionConfig.IVoiceActivityTimeout, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VoiceActivityTimeout message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VoiceActivityTimeout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout; + + /** + * Decodes a VoiceActivityTimeout message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VoiceActivityTimeout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout; + + /** + * Verifies a VoiceActivityTimeout message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VoiceActivityTimeout message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VoiceActivityTimeout + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout; + + /** + * Creates a plain object from a VoiceActivityTimeout message. Also converts values to other types if specified. + * @param message VoiceActivityTimeout + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VoiceActivityTimeout to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VoiceActivityTimeout + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a RecognitionConfig. */ + interface IRecognitionConfig { + + /** RecognitionConfig encoding */ + encoding?: (google.cloud.speech.v1.RecognitionConfig.AudioEncoding|keyof typeof google.cloud.speech.v1.RecognitionConfig.AudioEncoding|null); + + /** RecognitionConfig sampleRateHertz */ + sampleRateHertz?: (number|null); + + /** RecognitionConfig audioChannelCount */ + audioChannelCount?: (number|null); + + /** RecognitionConfig enableSeparateRecognitionPerChannel */ + enableSeparateRecognitionPerChannel?: (boolean|null); + + /** RecognitionConfig languageCode */ + languageCode?: (string|null); + + /** RecognitionConfig alternativeLanguageCodes */ + alternativeLanguageCodes?: (string[]|null); + + /** RecognitionConfig maxAlternatives */ + maxAlternatives?: (number|null); + + /** RecognitionConfig profanityFilter */ + profanityFilter?: (boolean|null); + + /** RecognitionConfig adaptation */ + adaptation?: (google.cloud.speech.v1.ISpeechAdaptation|null); + + /** RecognitionConfig transcriptNormalization */ + transcriptNormalization?: (google.cloud.speech.v1.ITranscriptNormalization|null); + + /** RecognitionConfig speechContexts */ + speechContexts?: (google.cloud.speech.v1.ISpeechContext[]|null); + + /** RecognitionConfig enableWordTimeOffsets */ + enableWordTimeOffsets?: (boolean|null); + + /** RecognitionConfig enableWordConfidence */ + enableWordConfidence?: (boolean|null); + + /** RecognitionConfig enableAutomaticPunctuation */ + enableAutomaticPunctuation?: (boolean|null); + + /** RecognitionConfig enableSpokenPunctuation */ + enableSpokenPunctuation?: (google.protobuf.IBoolValue|null); + + /** RecognitionConfig enableSpokenEmojis */ + enableSpokenEmojis?: (google.protobuf.IBoolValue|null); + + /** RecognitionConfig diarizationConfig */ + diarizationConfig?: (google.cloud.speech.v1.ISpeakerDiarizationConfig|null); + + /** RecognitionConfig metadata */ + metadata?: (google.cloud.speech.v1.IRecognitionMetadata|null); + + /** RecognitionConfig model */ + model?: (string|null); + + /** RecognitionConfig useEnhanced */ + useEnhanced?: (boolean|null); + } + + /** Represents a RecognitionConfig. */ + class RecognitionConfig implements IRecognitionConfig { + + /** + * Constructs a new RecognitionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.IRecognitionConfig); + + /** RecognitionConfig encoding. */ + public encoding: (google.cloud.speech.v1.RecognitionConfig.AudioEncoding|keyof typeof google.cloud.speech.v1.RecognitionConfig.AudioEncoding); + + /** RecognitionConfig sampleRateHertz. */ + public sampleRateHertz: number; + + /** RecognitionConfig audioChannelCount. */ + public audioChannelCount: number; + + /** RecognitionConfig enableSeparateRecognitionPerChannel. */ + public enableSeparateRecognitionPerChannel: boolean; + + /** RecognitionConfig languageCode. */ + public languageCode: string; + + /** RecognitionConfig alternativeLanguageCodes. */ + public alternativeLanguageCodes: string[]; + + /** RecognitionConfig maxAlternatives. */ + public maxAlternatives: number; + + /** RecognitionConfig profanityFilter. */ + public profanityFilter: boolean; + + /** RecognitionConfig adaptation. */ + public adaptation?: (google.cloud.speech.v1.ISpeechAdaptation|null); + + /** RecognitionConfig transcriptNormalization. */ + public transcriptNormalization?: (google.cloud.speech.v1.ITranscriptNormalization|null); + + /** RecognitionConfig speechContexts. */ + public speechContexts: google.cloud.speech.v1.ISpeechContext[]; + + /** RecognitionConfig enableWordTimeOffsets. */ + public enableWordTimeOffsets: boolean; + + /** RecognitionConfig enableWordConfidence. */ + public enableWordConfidence: boolean; + + /** RecognitionConfig enableAutomaticPunctuation. */ + public enableAutomaticPunctuation: boolean; + + /** RecognitionConfig enableSpokenPunctuation. */ + public enableSpokenPunctuation?: (google.protobuf.IBoolValue|null); + + /** RecognitionConfig enableSpokenEmojis. */ + public enableSpokenEmojis?: (google.protobuf.IBoolValue|null); + + /** RecognitionConfig diarizationConfig. */ + public diarizationConfig?: (google.cloud.speech.v1.ISpeakerDiarizationConfig|null); + + /** RecognitionConfig metadata. */ + public metadata?: (google.cloud.speech.v1.IRecognitionMetadata|null); + + /** RecognitionConfig model. */ + public model: string; + + /** RecognitionConfig useEnhanced. */ + public useEnhanced: boolean; + + /** + * Creates a new RecognitionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns RecognitionConfig instance + */ + public static create(properties?: google.cloud.speech.v1.IRecognitionConfig): google.cloud.speech.v1.RecognitionConfig; + + /** + * Encodes the specified RecognitionConfig message. Does not implicitly {@link google.cloud.speech.v1.RecognitionConfig.verify|verify} messages. + * @param message RecognitionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.IRecognitionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RecognitionConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v1.RecognitionConfig.verify|verify} messages. + * @param message RecognitionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.IRecognitionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RecognitionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RecognitionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.RecognitionConfig; + + /** + * Decodes a RecognitionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RecognitionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.RecognitionConfig; + + /** + * Verifies a RecognitionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RecognitionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RecognitionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.RecognitionConfig; + + /** + * Creates a plain object from a RecognitionConfig message. Also converts values to other types if specified. + * @param message RecognitionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.RecognitionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RecognitionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RecognitionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RecognitionConfig { + + /** AudioEncoding enum. */ + enum AudioEncoding { + ENCODING_UNSPECIFIED = 0, + LINEAR16 = 1, + FLAC = 2, + MULAW = 3, + AMR = 4, + AMR_WB = 5, + OGG_OPUS = 6, + SPEEX_WITH_HEADER_BYTE = 7, + MP3 = 8, + WEBM_OPUS = 9 + } + } + + /** Properties of a SpeakerDiarizationConfig. */ + interface ISpeakerDiarizationConfig { + + /** SpeakerDiarizationConfig enableSpeakerDiarization */ + enableSpeakerDiarization?: (boolean|null); + + /** SpeakerDiarizationConfig minSpeakerCount */ + minSpeakerCount?: (number|null); + + /** SpeakerDiarizationConfig maxSpeakerCount */ + maxSpeakerCount?: (number|null); + + /** SpeakerDiarizationConfig speakerTag */ + speakerTag?: (number|null); + } + + /** Represents a SpeakerDiarizationConfig. */ + class SpeakerDiarizationConfig implements ISpeakerDiarizationConfig { + + /** + * Constructs a new SpeakerDiarizationConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.ISpeakerDiarizationConfig); + + /** SpeakerDiarizationConfig enableSpeakerDiarization. */ + public enableSpeakerDiarization: boolean; + + /** SpeakerDiarizationConfig minSpeakerCount. */ + public minSpeakerCount: number; + + /** SpeakerDiarizationConfig maxSpeakerCount. */ + public maxSpeakerCount: number; + + /** SpeakerDiarizationConfig speakerTag. */ + public speakerTag: number; + + /** + * Creates a new SpeakerDiarizationConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SpeakerDiarizationConfig instance + */ + public static create(properties?: google.cloud.speech.v1.ISpeakerDiarizationConfig): google.cloud.speech.v1.SpeakerDiarizationConfig; + + /** + * Encodes the specified SpeakerDiarizationConfig message. Does not implicitly {@link google.cloud.speech.v1.SpeakerDiarizationConfig.verify|verify} messages. + * @param message SpeakerDiarizationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.ISpeakerDiarizationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpeakerDiarizationConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v1.SpeakerDiarizationConfig.verify|verify} messages. + * @param message SpeakerDiarizationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.ISpeakerDiarizationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpeakerDiarizationConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpeakerDiarizationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.SpeakerDiarizationConfig; + + /** + * Decodes a SpeakerDiarizationConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpeakerDiarizationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.SpeakerDiarizationConfig; + + /** + * Verifies a SpeakerDiarizationConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpeakerDiarizationConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpeakerDiarizationConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.SpeakerDiarizationConfig; + + /** + * Creates a plain object from a SpeakerDiarizationConfig message. Also converts values to other types if specified. + * @param message SpeakerDiarizationConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.SpeakerDiarizationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpeakerDiarizationConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpeakerDiarizationConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RecognitionMetadata. */ + interface IRecognitionMetadata { + + /** RecognitionMetadata interactionType */ + interactionType?: (google.cloud.speech.v1.RecognitionMetadata.InteractionType|keyof typeof google.cloud.speech.v1.RecognitionMetadata.InteractionType|null); + + /** RecognitionMetadata industryNaicsCodeOfAudio */ + industryNaicsCodeOfAudio?: (number|null); + + /** RecognitionMetadata microphoneDistance */ + microphoneDistance?: (google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance|keyof typeof google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance|null); + + /** RecognitionMetadata originalMediaType */ + originalMediaType?: (google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType|keyof typeof google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType|null); + + /** RecognitionMetadata recordingDeviceType */ + recordingDeviceType?: (google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType|keyof typeof google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType|null); + + /** RecognitionMetadata recordingDeviceName */ + recordingDeviceName?: (string|null); + + /** RecognitionMetadata originalMimeType */ + originalMimeType?: (string|null); + + /** RecognitionMetadata audioTopic */ + audioTopic?: (string|null); + } + + /** Represents a RecognitionMetadata. */ + class RecognitionMetadata implements IRecognitionMetadata { + + /** + * Constructs a new RecognitionMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.IRecognitionMetadata); + + /** RecognitionMetadata interactionType. */ + public interactionType: (google.cloud.speech.v1.RecognitionMetadata.InteractionType|keyof typeof google.cloud.speech.v1.RecognitionMetadata.InteractionType); + + /** RecognitionMetadata industryNaicsCodeOfAudio. */ + public industryNaicsCodeOfAudio: number; + + /** RecognitionMetadata microphoneDistance. */ + public microphoneDistance: (google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance|keyof typeof google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance); + + /** RecognitionMetadata originalMediaType. */ + public originalMediaType: (google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType|keyof typeof google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType); + + /** RecognitionMetadata recordingDeviceType. */ + public recordingDeviceType: (google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType|keyof typeof google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType); + + /** RecognitionMetadata recordingDeviceName. */ + public recordingDeviceName: string; + + /** RecognitionMetadata originalMimeType. */ + public originalMimeType: string; + + /** RecognitionMetadata audioTopic. */ + public audioTopic: string; + + /** + * Creates a new RecognitionMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns RecognitionMetadata instance + */ + public static create(properties?: google.cloud.speech.v1.IRecognitionMetadata): google.cloud.speech.v1.RecognitionMetadata; + + /** + * Encodes the specified RecognitionMetadata message. Does not implicitly {@link google.cloud.speech.v1.RecognitionMetadata.verify|verify} messages. + * @param message RecognitionMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.IRecognitionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RecognitionMetadata message, length delimited. Does not implicitly {@link google.cloud.speech.v1.RecognitionMetadata.verify|verify} messages. + * @param message RecognitionMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.IRecognitionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RecognitionMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RecognitionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.RecognitionMetadata; + + /** + * Decodes a RecognitionMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RecognitionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.RecognitionMetadata; + + /** + * Verifies a RecognitionMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RecognitionMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RecognitionMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.RecognitionMetadata; + + /** + * Creates a plain object from a RecognitionMetadata message. Also converts values to other types if specified. + * @param message RecognitionMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.RecognitionMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RecognitionMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RecognitionMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RecognitionMetadata { + + /** InteractionType enum. */ + enum InteractionType { + INTERACTION_TYPE_UNSPECIFIED = 0, + DISCUSSION = 1, + PRESENTATION = 2, + PHONE_CALL = 3, + VOICEMAIL = 4, + PROFESSIONALLY_PRODUCED = 5, + VOICE_SEARCH = 6, + VOICE_COMMAND = 7, + DICTATION = 8 + } + + /** MicrophoneDistance enum. */ + enum MicrophoneDistance { + MICROPHONE_DISTANCE_UNSPECIFIED = 0, + NEARFIELD = 1, + MIDFIELD = 2, + FARFIELD = 3 + } + + /** OriginalMediaType enum. */ + enum OriginalMediaType { + ORIGINAL_MEDIA_TYPE_UNSPECIFIED = 0, + AUDIO = 1, + VIDEO = 2 + } + + /** RecordingDeviceType enum. */ + enum RecordingDeviceType { + RECORDING_DEVICE_TYPE_UNSPECIFIED = 0, + SMARTPHONE = 1, + PC = 2, + PHONE_LINE = 3, + VEHICLE = 4, + OTHER_OUTDOOR_DEVICE = 5, + OTHER_INDOOR_DEVICE = 6 + } + } + + /** Properties of a SpeechContext. */ + interface ISpeechContext { + + /** SpeechContext phrases */ + phrases?: (string[]|null); + + /** SpeechContext boost */ + boost?: (number|null); + } + + /** Represents a SpeechContext. */ + class SpeechContext implements ISpeechContext { + + /** + * Constructs a new SpeechContext. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.ISpeechContext); + + /** SpeechContext phrases. */ + public phrases: string[]; + + /** SpeechContext boost. */ + public boost: number; + + /** + * Creates a new SpeechContext instance using the specified properties. + * @param [properties] Properties to set + * @returns SpeechContext instance + */ + public static create(properties?: google.cloud.speech.v1.ISpeechContext): google.cloud.speech.v1.SpeechContext; + + /** + * Encodes the specified SpeechContext message. Does not implicitly {@link google.cloud.speech.v1.SpeechContext.verify|verify} messages. + * @param message SpeechContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.ISpeechContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpeechContext message, length delimited. Does not implicitly {@link google.cloud.speech.v1.SpeechContext.verify|verify} messages. + * @param message SpeechContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.ISpeechContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpeechContext message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpeechContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.SpeechContext; + + /** + * Decodes a SpeechContext message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpeechContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.SpeechContext; + + /** + * Verifies a SpeechContext message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpeechContext message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpeechContext + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.SpeechContext; + + /** + * Creates a plain object from a SpeechContext message. Also converts values to other types if specified. + * @param message SpeechContext + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.SpeechContext, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpeechContext to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpeechContext + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RecognitionAudio. */ + interface IRecognitionAudio { + + /** RecognitionAudio content */ + content?: (Uint8Array|Buffer|string|null); + + /** RecognitionAudio uri */ + uri?: (string|null); + } + + /** Represents a RecognitionAudio. */ + class RecognitionAudio implements IRecognitionAudio { + + /** + * Constructs a new RecognitionAudio. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.IRecognitionAudio); + + /** RecognitionAudio content. */ + public content?: (Uint8Array|Buffer|string|null); + + /** RecognitionAudio uri. */ + public uri?: (string|null); + + /** RecognitionAudio audioSource. */ + public audioSource?: ("content"|"uri"); + + /** + * Creates a new RecognitionAudio instance using the specified properties. + * @param [properties] Properties to set + * @returns RecognitionAudio instance + */ + public static create(properties?: google.cloud.speech.v1.IRecognitionAudio): google.cloud.speech.v1.RecognitionAudio; + + /** + * Encodes the specified RecognitionAudio message. Does not implicitly {@link google.cloud.speech.v1.RecognitionAudio.verify|verify} messages. + * @param message RecognitionAudio message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.IRecognitionAudio, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RecognitionAudio message, length delimited. Does not implicitly {@link google.cloud.speech.v1.RecognitionAudio.verify|verify} messages. + * @param message RecognitionAudio message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.IRecognitionAudio, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RecognitionAudio message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RecognitionAudio + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.RecognitionAudio; + + /** + * Decodes a RecognitionAudio message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RecognitionAudio + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.RecognitionAudio; + + /** + * Verifies a RecognitionAudio message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RecognitionAudio message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RecognitionAudio + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.RecognitionAudio; + + /** + * Creates a plain object from a RecognitionAudio message. Also converts values to other types if specified. + * @param message RecognitionAudio + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.RecognitionAudio, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RecognitionAudio to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RecognitionAudio + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RecognizeResponse. */ + interface IRecognizeResponse { + + /** RecognizeResponse results */ + results?: (google.cloud.speech.v1.ISpeechRecognitionResult[]|null); + + /** RecognizeResponse totalBilledTime */ + totalBilledTime?: (google.protobuf.IDuration|null); + + /** RecognizeResponse speechAdaptationInfo */ + speechAdaptationInfo?: (google.cloud.speech.v1.ISpeechAdaptationInfo|null); + + /** RecognizeResponse requestId */ + requestId?: (number|Long|string|null); + } + + /** Represents a RecognizeResponse. */ + class RecognizeResponse implements IRecognizeResponse { + + /** + * Constructs a new RecognizeResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.IRecognizeResponse); + + /** RecognizeResponse results. */ + public results: google.cloud.speech.v1.ISpeechRecognitionResult[]; + + /** RecognizeResponse totalBilledTime. */ + public totalBilledTime?: (google.protobuf.IDuration|null); + + /** RecognizeResponse speechAdaptationInfo. */ + public speechAdaptationInfo?: (google.cloud.speech.v1.ISpeechAdaptationInfo|null); + + /** RecognizeResponse requestId. */ + public requestId: (number|Long|string); + + /** + * Creates a new RecognizeResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RecognizeResponse instance + */ + public static create(properties?: google.cloud.speech.v1.IRecognizeResponse): google.cloud.speech.v1.RecognizeResponse; + + /** + * Encodes the specified RecognizeResponse message. Does not implicitly {@link google.cloud.speech.v1.RecognizeResponse.verify|verify} messages. + * @param message RecognizeResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.IRecognizeResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RecognizeResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v1.RecognizeResponse.verify|verify} messages. + * @param message RecognizeResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.IRecognizeResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RecognizeResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RecognizeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.RecognizeResponse; + + /** + * Decodes a RecognizeResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RecognizeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.RecognizeResponse; + + /** + * Verifies a RecognizeResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RecognizeResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RecognizeResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.RecognizeResponse; + + /** + * Creates a plain object from a RecognizeResponse message. Also converts values to other types if specified. + * @param message RecognizeResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.RecognizeResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RecognizeResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RecognizeResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LongRunningRecognizeResponse. */ + interface ILongRunningRecognizeResponse { + + /** LongRunningRecognizeResponse results */ + results?: (google.cloud.speech.v1.ISpeechRecognitionResult[]|null); + + /** LongRunningRecognizeResponse totalBilledTime */ + totalBilledTime?: (google.protobuf.IDuration|null); + + /** LongRunningRecognizeResponse outputConfig */ + outputConfig?: (google.cloud.speech.v1.ITranscriptOutputConfig|null); + + /** LongRunningRecognizeResponse outputError */ + outputError?: (google.rpc.IStatus|null); + + /** LongRunningRecognizeResponse speechAdaptationInfo */ + speechAdaptationInfo?: (google.cloud.speech.v1.ISpeechAdaptationInfo|null); + + /** LongRunningRecognizeResponse requestId */ + requestId?: (number|Long|string|null); + } + + /** Represents a LongRunningRecognizeResponse. */ + class LongRunningRecognizeResponse implements ILongRunningRecognizeResponse { + + /** + * Constructs a new LongRunningRecognizeResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.ILongRunningRecognizeResponse); + + /** LongRunningRecognizeResponse results. */ + public results: google.cloud.speech.v1.ISpeechRecognitionResult[]; + + /** LongRunningRecognizeResponse totalBilledTime. */ + public totalBilledTime?: (google.protobuf.IDuration|null); + + /** LongRunningRecognizeResponse outputConfig. */ + public outputConfig?: (google.cloud.speech.v1.ITranscriptOutputConfig|null); + + /** LongRunningRecognizeResponse outputError. */ + public outputError?: (google.rpc.IStatus|null); + + /** LongRunningRecognizeResponse speechAdaptationInfo. */ + public speechAdaptationInfo?: (google.cloud.speech.v1.ISpeechAdaptationInfo|null); + + /** LongRunningRecognizeResponse requestId. */ + public requestId: (number|Long|string); + + /** + * Creates a new LongRunningRecognizeResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns LongRunningRecognizeResponse instance + */ + public static create(properties?: google.cloud.speech.v1.ILongRunningRecognizeResponse): google.cloud.speech.v1.LongRunningRecognizeResponse; + + /** + * Encodes the specified LongRunningRecognizeResponse message. Does not implicitly {@link google.cloud.speech.v1.LongRunningRecognizeResponse.verify|verify} messages. + * @param message LongRunningRecognizeResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.ILongRunningRecognizeResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LongRunningRecognizeResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v1.LongRunningRecognizeResponse.verify|verify} messages. + * @param message LongRunningRecognizeResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.ILongRunningRecognizeResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LongRunningRecognizeResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LongRunningRecognizeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.LongRunningRecognizeResponse; + + /** + * Decodes a LongRunningRecognizeResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LongRunningRecognizeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.LongRunningRecognizeResponse; + + /** + * Verifies a LongRunningRecognizeResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LongRunningRecognizeResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LongRunningRecognizeResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.LongRunningRecognizeResponse; + + /** + * Creates a plain object from a LongRunningRecognizeResponse message. Also converts values to other types if specified. + * @param message LongRunningRecognizeResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.LongRunningRecognizeResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LongRunningRecognizeResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LongRunningRecognizeResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LongRunningRecognizeMetadata. */ + interface ILongRunningRecognizeMetadata { + + /** LongRunningRecognizeMetadata progressPercent */ + progressPercent?: (number|null); + + /** LongRunningRecognizeMetadata startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** LongRunningRecognizeMetadata lastUpdateTime */ + lastUpdateTime?: (google.protobuf.ITimestamp|null); + + /** LongRunningRecognizeMetadata uri */ + uri?: (string|null); + } + + /** Represents a LongRunningRecognizeMetadata. */ + class LongRunningRecognizeMetadata implements ILongRunningRecognizeMetadata { + + /** + * Constructs a new LongRunningRecognizeMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.ILongRunningRecognizeMetadata); + + /** LongRunningRecognizeMetadata progressPercent. */ + public progressPercent: number; + + /** LongRunningRecognizeMetadata startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** LongRunningRecognizeMetadata lastUpdateTime. */ + public lastUpdateTime?: (google.protobuf.ITimestamp|null); + + /** LongRunningRecognizeMetadata uri. */ + public uri: string; + + /** + * Creates a new LongRunningRecognizeMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns LongRunningRecognizeMetadata instance + */ + public static create(properties?: google.cloud.speech.v1.ILongRunningRecognizeMetadata): google.cloud.speech.v1.LongRunningRecognizeMetadata; + + /** + * Encodes the specified LongRunningRecognizeMetadata message. Does not implicitly {@link google.cloud.speech.v1.LongRunningRecognizeMetadata.verify|verify} messages. + * @param message LongRunningRecognizeMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.ILongRunningRecognizeMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LongRunningRecognizeMetadata message, length delimited. Does not implicitly {@link google.cloud.speech.v1.LongRunningRecognizeMetadata.verify|verify} messages. + * @param message LongRunningRecognizeMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.ILongRunningRecognizeMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LongRunningRecognizeMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LongRunningRecognizeMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.LongRunningRecognizeMetadata; + + /** + * Decodes a LongRunningRecognizeMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LongRunningRecognizeMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.LongRunningRecognizeMetadata; + + /** + * Verifies a LongRunningRecognizeMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LongRunningRecognizeMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LongRunningRecognizeMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.LongRunningRecognizeMetadata; + + /** + * Creates a plain object from a LongRunningRecognizeMetadata message. Also converts values to other types if specified. + * @param message LongRunningRecognizeMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.LongRunningRecognizeMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LongRunningRecognizeMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LongRunningRecognizeMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StreamingRecognizeResponse. */ + interface IStreamingRecognizeResponse { + + /** StreamingRecognizeResponse error */ + error?: (google.rpc.IStatus|null); + + /** StreamingRecognizeResponse results */ + results?: (google.cloud.speech.v1.IStreamingRecognitionResult[]|null); + + /** StreamingRecognizeResponse speechEventType */ + speechEventType?: (google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType|keyof typeof google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType|null); + + /** StreamingRecognizeResponse speechEventTime */ + speechEventTime?: (google.protobuf.IDuration|null); + + /** StreamingRecognizeResponse totalBilledTime */ + totalBilledTime?: (google.protobuf.IDuration|null); + + /** StreamingRecognizeResponse speechAdaptationInfo */ + speechAdaptationInfo?: (google.cloud.speech.v1.ISpeechAdaptationInfo|null); + + /** StreamingRecognizeResponse requestId */ + requestId?: (number|Long|string|null); + } + + /** Represents a StreamingRecognizeResponse. */ + class StreamingRecognizeResponse implements IStreamingRecognizeResponse { + + /** + * Constructs a new StreamingRecognizeResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.IStreamingRecognizeResponse); + + /** StreamingRecognizeResponse error. */ + public error?: (google.rpc.IStatus|null); + + /** StreamingRecognizeResponse results. */ + public results: google.cloud.speech.v1.IStreamingRecognitionResult[]; + + /** StreamingRecognizeResponse speechEventType. */ + public speechEventType: (google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType|keyof typeof google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType); + + /** StreamingRecognizeResponse speechEventTime. */ + public speechEventTime?: (google.protobuf.IDuration|null); + + /** StreamingRecognizeResponse totalBilledTime. */ + public totalBilledTime?: (google.protobuf.IDuration|null); + + /** StreamingRecognizeResponse speechAdaptationInfo. */ + public speechAdaptationInfo?: (google.cloud.speech.v1.ISpeechAdaptationInfo|null); + + /** StreamingRecognizeResponse requestId. */ + public requestId: (number|Long|string); + + /** + * Creates a new StreamingRecognizeResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingRecognizeResponse instance + */ + public static create(properties?: google.cloud.speech.v1.IStreamingRecognizeResponse): google.cloud.speech.v1.StreamingRecognizeResponse; + + /** + * Encodes the specified StreamingRecognizeResponse message. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognizeResponse.verify|verify} messages. + * @param message StreamingRecognizeResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.IStreamingRecognizeResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamingRecognizeResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognizeResponse.verify|verify} messages. + * @param message StreamingRecognizeResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.IStreamingRecognizeResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamingRecognizeResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingRecognizeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.StreamingRecognizeResponse; + + /** + * Decodes a StreamingRecognizeResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingRecognizeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.StreamingRecognizeResponse; + + /** + * Verifies a StreamingRecognizeResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamingRecognizeResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingRecognizeResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.StreamingRecognizeResponse; + + /** + * Creates a plain object from a StreamingRecognizeResponse message. Also converts values to other types if specified. + * @param message StreamingRecognizeResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.StreamingRecognizeResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamingRecognizeResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamingRecognizeResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace StreamingRecognizeResponse { + + /** SpeechEventType enum. */ + enum SpeechEventType { + SPEECH_EVENT_UNSPECIFIED = 0, + END_OF_SINGLE_UTTERANCE = 1, + SPEECH_ACTIVITY_BEGIN = 2, + SPEECH_ACTIVITY_END = 3, + SPEECH_ACTIVITY_TIMEOUT = 4 + } + } + + /** Properties of a StreamingRecognitionResult. */ + interface IStreamingRecognitionResult { + + /** StreamingRecognitionResult alternatives */ + alternatives?: (google.cloud.speech.v1.ISpeechRecognitionAlternative[]|null); + + /** StreamingRecognitionResult isFinal */ + isFinal?: (boolean|null); + + /** StreamingRecognitionResult stability */ + stability?: (number|null); + + /** StreamingRecognitionResult resultEndTime */ + resultEndTime?: (google.protobuf.IDuration|null); + + /** StreamingRecognitionResult channelTag */ + channelTag?: (number|null); + + /** StreamingRecognitionResult languageCode */ + languageCode?: (string|null); + } + + /** Represents a StreamingRecognitionResult. */ + class StreamingRecognitionResult implements IStreamingRecognitionResult { + + /** + * Constructs a new StreamingRecognitionResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.IStreamingRecognitionResult); + + /** StreamingRecognitionResult alternatives. */ + public alternatives: google.cloud.speech.v1.ISpeechRecognitionAlternative[]; + + /** StreamingRecognitionResult isFinal. */ + public isFinal: boolean; + + /** StreamingRecognitionResult stability. */ + public stability: number; + + /** StreamingRecognitionResult resultEndTime. */ + public resultEndTime?: (google.protobuf.IDuration|null); + + /** StreamingRecognitionResult channelTag. */ + public channelTag: number; + + /** StreamingRecognitionResult languageCode. */ + public languageCode: string; + + /** + * Creates a new StreamingRecognitionResult instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingRecognitionResult instance + */ + public static create(properties?: google.cloud.speech.v1.IStreamingRecognitionResult): google.cloud.speech.v1.StreamingRecognitionResult; + + /** + * Encodes the specified StreamingRecognitionResult message. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognitionResult.verify|verify} messages. + * @param message StreamingRecognitionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.IStreamingRecognitionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamingRecognitionResult message, length delimited. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognitionResult.verify|verify} messages. + * @param message StreamingRecognitionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.IStreamingRecognitionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamingRecognitionResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingRecognitionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.StreamingRecognitionResult; + + /** + * Decodes a StreamingRecognitionResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingRecognitionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.StreamingRecognitionResult; + + /** + * Verifies a StreamingRecognitionResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamingRecognitionResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingRecognitionResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.StreamingRecognitionResult; + + /** + * Creates a plain object from a StreamingRecognitionResult message. Also converts values to other types if specified. + * @param message StreamingRecognitionResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.StreamingRecognitionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamingRecognitionResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamingRecognitionResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpeechRecognitionResult. */ + interface ISpeechRecognitionResult { + + /** SpeechRecognitionResult alternatives */ + alternatives?: (google.cloud.speech.v1.ISpeechRecognitionAlternative[]|null); + + /** SpeechRecognitionResult channelTag */ + channelTag?: (number|null); + + /** SpeechRecognitionResult resultEndTime */ + resultEndTime?: (google.protobuf.IDuration|null); + + /** SpeechRecognitionResult languageCode */ + languageCode?: (string|null); + } + + /** Represents a SpeechRecognitionResult. */ + class SpeechRecognitionResult implements ISpeechRecognitionResult { + + /** + * Constructs a new SpeechRecognitionResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.ISpeechRecognitionResult); + + /** SpeechRecognitionResult alternatives. */ + public alternatives: google.cloud.speech.v1.ISpeechRecognitionAlternative[]; + + /** SpeechRecognitionResult channelTag. */ + public channelTag: number; + + /** SpeechRecognitionResult resultEndTime. */ + public resultEndTime?: (google.protobuf.IDuration|null); + + /** SpeechRecognitionResult languageCode. */ + public languageCode: string; + + /** + * Creates a new SpeechRecognitionResult instance using the specified properties. + * @param [properties] Properties to set + * @returns SpeechRecognitionResult instance + */ + public static create(properties?: google.cloud.speech.v1.ISpeechRecognitionResult): google.cloud.speech.v1.SpeechRecognitionResult; + + /** + * Encodes the specified SpeechRecognitionResult message. Does not implicitly {@link google.cloud.speech.v1.SpeechRecognitionResult.verify|verify} messages. + * @param message SpeechRecognitionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.ISpeechRecognitionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpeechRecognitionResult message, length delimited. Does not implicitly {@link google.cloud.speech.v1.SpeechRecognitionResult.verify|verify} messages. + * @param message SpeechRecognitionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.ISpeechRecognitionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpeechRecognitionResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpeechRecognitionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.SpeechRecognitionResult; + + /** + * Decodes a SpeechRecognitionResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpeechRecognitionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.SpeechRecognitionResult; + + /** + * Verifies a SpeechRecognitionResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpeechRecognitionResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpeechRecognitionResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.SpeechRecognitionResult; + + /** + * Creates a plain object from a SpeechRecognitionResult message. Also converts values to other types if specified. + * @param message SpeechRecognitionResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.SpeechRecognitionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpeechRecognitionResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpeechRecognitionResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpeechRecognitionAlternative. */ + interface ISpeechRecognitionAlternative { + + /** SpeechRecognitionAlternative transcript */ + transcript?: (string|null); + + /** SpeechRecognitionAlternative confidence */ + confidence?: (number|null); + + /** SpeechRecognitionAlternative words */ + words?: (google.cloud.speech.v1.IWordInfo[]|null); + } + + /** Represents a SpeechRecognitionAlternative. */ + class SpeechRecognitionAlternative implements ISpeechRecognitionAlternative { + + /** + * Constructs a new SpeechRecognitionAlternative. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.ISpeechRecognitionAlternative); + + /** SpeechRecognitionAlternative transcript. */ + public transcript: string; + + /** SpeechRecognitionAlternative confidence. */ + public confidence: number; + + /** SpeechRecognitionAlternative words. */ + public words: google.cloud.speech.v1.IWordInfo[]; + + /** + * Creates a new SpeechRecognitionAlternative instance using the specified properties. + * @param [properties] Properties to set + * @returns SpeechRecognitionAlternative instance + */ + public static create(properties?: google.cloud.speech.v1.ISpeechRecognitionAlternative): google.cloud.speech.v1.SpeechRecognitionAlternative; + + /** + * Encodes the specified SpeechRecognitionAlternative message. Does not implicitly {@link google.cloud.speech.v1.SpeechRecognitionAlternative.verify|verify} messages. + * @param message SpeechRecognitionAlternative message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.ISpeechRecognitionAlternative, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpeechRecognitionAlternative message, length delimited. Does not implicitly {@link google.cloud.speech.v1.SpeechRecognitionAlternative.verify|verify} messages. + * @param message SpeechRecognitionAlternative message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.ISpeechRecognitionAlternative, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpeechRecognitionAlternative message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpeechRecognitionAlternative + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.SpeechRecognitionAlternative; + + /** + * Decodes a SpeechRecognitionAlternative message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpeechRecognitionAlternative + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.SpeechRecognitionAlternative; + + /** + * Verifies a SpeechRecognitionAlternative message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpeechRecognitionAlternative message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpeechRecognitionAlternative + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.SpeechRecognitionAlternative; + + /** + * Creates a plain object from a SpeechRecognitionAlternative message. Also converts values to other types if specified. + * @param message SpeechRecognitionAlternative + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.SpeechRecognitionAlternative, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpeechRecognitionAlternative to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpeechRecognitionAlternative + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WordInfo. */ + interface IWordInfo { + + /** WordInfo startTime */ + startTime?: (google.protobuf.IDuration|null); + + /** WordInfo endTime */ + endTime?: (google.protobuf.IDuration|null); + + /** WordInfo word */ + word?: (string|null); + + /** WordInfo confidence */ + confidence?: (number|null); + + /** WordInfo speakerTag */ + speakerTag?: (number|null); + + /** WordInfo speakerLabel */ + speakerLabel?: (string|null); + } + + /** Represents a WordInfo. */ + class WordInfo implements IWordInfo { + + /** + * Constructs a new WordInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.IWordInfo); + + /** WordInfo startTime. */ + public startTime?: (google.protobuf.IDuration|null); + + /** WordInfo endTime. */ + public endTime?: (google.protobuf.IDuration|null); + + /** WordInfo word. */ + public word: string; + + /** WordInfo confidence. */ + public confidence: number; + + /** WordInfo speakerTag. */ + public speakerTag: number; + + /** WordInfo speakerLabel. */ + public speakerLabel: string; + + /** + * Creates a new WordInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns WordInfo instance + */ + public static create(properties?: google.cloud.speech.v1.IWordInfo): google.cloud.speech.v1.WordInfo; + + /** + * Encodes the specified WordInfo message. Does not implicitly {@link google.cloud.speech.v1.WordInfo.verify|verify} messages. + * @param message WordInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.IWordInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WordInfo message, length delimited. Does not implicitly {@link google.cloud.speech.v1.WordInfo.verify|verify} messages. + * @param message WordInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.IWordInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WordInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WordInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.WordInfo; + + /** + * Decodes a WordInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WordInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.WordInfo; + + /** + * Verifies a WordInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WordInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WordInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.WordInfo; + + /** + * Creates a plain object from a WordInfo message. Also converts values to other types if specified. + * @param message WordInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.WordInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WordInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WordInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpeechAdaptationInfo. */ + interface ISpeechAdaptationInfo { + + /** SpeechAdaptationInfo adaptationTimeout */ + adaptationTimeout?: (boolean|null); + + /** SpeechAdaptationInfo timeoutMessage */ + timeoutMessage?: (string|null); + } + + /** Represents a SpeechAdaptationInfo. */ + class SpeechAdaptationInfo implements ISpeechAdaptationInfo { + + /** + * Constructs a new SpeechAdaptationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.ISpeechAdaptationInfo); + + /** SpeechAdaptationInfo adaptationTimeout. */ + public adaptationTimeout: boolean; + + /** SpeechAdaptationInfo timeoutMessage. */ + public timeoutMessage: string; + + /** + * Creates a new SpeechAdaptationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SpeechAdaptationInfo instance + */ + public static create(properties?: google.cloud.speech.v1.ISpeechAdaptationInfo): google.cloud.speech.v1.SpeechAdaptationInfo; + + /** + * Encodes the specified SpeechAdaptationInfo message. Does not implicitly {@link google.cloud.speech.v1.SpeechAdaptationInfo.verify|verify} messages. + * @param message SpeechAdaptationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.ISpeechAdaptationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpeechAdaptationInfo message, length delimited. Does not implicitly {@link google.cloud.speech.v1.SpeechAdaptationInfo.verify|verify} messages. + * @param message SpeechAdaptationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.ISpeechAdaptationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpeechAdaptationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpeechAdaptationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.SpeechAdaptationInfo; + + /** + * Decodes a SpeechAdaptationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpeechAdaptationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.SpeechAdaptationInfo; + + /** + * Verifies a SpeechAdaptationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpeechAdaptationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpeechAdaptationInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.SpeechAdaptationInfo; + + /** + * Creates a plain object from a SpeechAdaptationInfo message. Also converts values to other types if specified. + * @param message SpeechAdaptationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.SpeechAdaptationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpeechAdaptationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpeechAdaptationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomClass. */ + interface ICustomClass { + + /** CustomClass name */ + name?: (string|null); + + /** CustomClass customClassId */ + customClassId?: (string|null); + + /** CustomClass items */ + items?: (google.cloud.speech.v1.CustomClass.IClassItem[]|null); + } + + /** Represents a CustomClass. */ + class CustomClass implements ICustomClass { + + /** + * Constructs a new CustomClass. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.ICustomClass); + + /** CustomClass name. */ + public name: string; + + /** CustomClass customClassId. */ + public customClassId: string; + + /** CustomClass items. */ + public items: google.cloud.speech.v1.CustomClass.IClassItem[]; + + /** + * Creates a new CustomClass instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomClass instance + */ + public static create(properties?: google.cloud.speech.v1.ICustomClass): google.cloud.speech.v1.CustomClass; + + /** + * Encodes the specified CustomClass message. Does not implicitly {@link google.cloud.speech.v1.CustomClass.verify|verify} messages. + * @param message CustomClass message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.ICustomClass, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomClass message, length delimited. Does not implicitly {@link google.cloud.speech.v1.CustomClass.verify|verify} messages. + * @param message CustomClass message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.ICustomClass, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomClass message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomClass + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.CustomClass; + + /** + * Decodes a CustomClass message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomClass + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.CustomClass; + + /** + * Verifies a CustomClass message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomClass message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomClass + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.CustomClass; + + /** + * Creates a plain object from a CustomClass message. Also converts values to other types if specified. + * @param message CustomClass + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.CustomClass, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomClass to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomClass + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CustomClass { + + /** Properties of a ClassItem. */ + interface IClassItem { + + /** ClassItem value */ + value?: (string|null); + } + + /** Represents a ClassItem. */ + class ClassItem implements IClassItem { + + /** + * Constructs a new ClassItem. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.CustomClass.IClassItem); + + /** ClassItem value. */ + public value: string; + + /** + * Creates a new ClassItem instance using the specified properties. + * @param [properties] Properties to set + * @returns ClassItem instance + */ + public static create(properties?: google.cloud.speech.v1.CustomClass.IClassItem): google.cloud.speech.v1.CustomClass.ClassItem; + + /** + * Encodes the specified ClassItem message. Does not implicitly {@link google.cloud.speech.v1.CustomClass.ClassItem.verify|verify} messages. + * @param message ClassItem message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.CustomClass.IClassItem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClassItem message, length delimited. Does not implicitly {@link google.cloud.speech.v1.CustomClass.ClassItem.verify|verify} messages. + * @param message ClassItem message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.CustomClass.IClassItem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClassItem message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClassItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.CustomClass.ClassItem; + + /** + * Decodes a ClassItem message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClassItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.CustomClass.ClassItem; + + /** + * Verifies a ClassItem message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClassItem message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClassItem + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.CustomClass.ClassItem; + + /** + * Creates a plain object from a ClassItem message. Also converts values to other types if specified. + * @param message ClassItem + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.CustomClass.ClassItem, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClassItem to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClassItem + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a PhraseSet. */ + interface IPhraseSet { + + /** PhraseSet name */ + name?: (string|null); + + /** PhraseSet phrases */ + phrases?: (google.cloud.speech.v1.PhraseSet.IPhrase[]|null); + + /** PhraseSet boost */ + boost?: (number|null); + } + + /** Represents a PhraseSet. */ + class PhraseSet implements IPhraseSet { + + /** + * Constructs a new PhraseSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.IPhraseSet); + + /** PhraseSet name. */ + public name: string; + + /** PhraseSet phrases. */ + public phrases: google.cloud.speech.v1.PhraseSet.IPhrase[]; + + /** PhraseSet boost. */ + public boost: number; + + /** + * Creates a new PhraseSet instance using the specified properties. + * @param [properties] Properties to set + * @returns PhraseSet instance + */ + public static create(properties?: google.cloud.speech.v1.IPhraseSet): google.cloud.speech.v1.PhraseSet; + + /** + * Encodes the specified PhraseSet message. Does not implicitly {@link google.cloud.speech.v1.PhraseSet.verify|verify} messages. + * @param message PhraseSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.IPhraseSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PhraseSet message, length delimited. Does not implicitly {@link google.cloud.speech.v1.PhraseSet.verify|verify} messages. + * @param message PhraseSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.IPhraseSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PhraseSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PhraseSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.PhraseSet; + + /** + * Decodes a PhraseSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PhraseSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.PhraseSet; + + /** + * Verifies a PhraseSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PhraseSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PhraseSet + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.PhraseSet; + + /** + * Creates a plain object from a PhraseSet message. Also converts values to other types if specified. + * @param message PhraseSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.PhraseSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PhraseSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PhraseSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PhraseSet { + + /** Properties of a Phrase. */ + interface IPhrase { + + /** Phrase value */ + value?: (string|null); + + /** Phrase boost */ + boost?: (number|null); + } + + /** Represents a Phrase. */ + class Phrase implements IPhrase { + + /** + * Constructs a new Phrase. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.PhraseSet.IPhrase); + + /** Phrase value. */ + public value: string; + + /** Phrase boost. */ + public boost: number; + + /** + * Creates a new Phrase instance using the specified properties. + * @param [properties] Properties to set + * @returns Phrase instance + */ + public static create(properties?: google.cloud.speech.v1.PhraseSet.IPhrase): google.cloud.speech.v1.PhraseSet.Phrase; + + /** + * Encodes the specified Phrase message. Does not implicitly {@link google.cloud.speech.v1.PhraseSet.Phrase.verify|verify} messages. + * @param message Phrase message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.PhraseSet.IPhrase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Phrase message, length delimited. Does not implicitly {@link google.cloud.speech.v1.PhraseSet.Phrase.verify|verify} messages. + * @param message Phrase message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.PhraseSet.IPhrase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Phrase message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Phrase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.PhraseSet.Phrase; + + /** + * Decodes a Phrase message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Phrase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.PhraseSet.Phrase; + + /** + * Verifies a Phrase message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Phrase message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Phrase + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.PhraseSet.Phrase; + + /** + * Creates a plain object from a Phrase message. Also converts values to other types if specified. + * @param message Phrase + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.PhraseSet.Phrase, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Phrase to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Phrase + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SpeechAdaptation. */ + interface ISpeechAdaptation { + + /** SpeechAdaptation phraseSets */ + phraseSets?: (google.cloud.speech.v1.IPhraseSet[]|null); + + /** SpeechAdaptation phraseSetReferences */ + phraseSetReferences?: (string[]|null); + + /** SpeechAdaptation customClasses */ + customClasses?: (google.cloud.speech.v1.ICustomClass[]|null); + + /** SpeechAdaptation abnfGrammar */ + abnfGrammar?: (google.cloud.speech.v1.SpeechAdaptation.IABNFGrammar|null); + } + + /** Represents a SpeechAdaptation. */ + class SpeechAdaptation implements ISpeechAdaptation { + + /** + * Constructs a new SpeechAdaptation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.ISpeechAdaptation); + + /** SpeechAdaptation phraseSets. */ + public phraseSets: google.cloud.speech.v1.IPhraseSet[]; + + /** SpeechAdaptation phraseSetReferences. */ + public phraseSetReferences: string[]; + + /** SpeechAdaptation customClasses. */ + public customClasses: google.cloud.speech.v1.ICustomClass[]; + + /** SpeechAdaptation abnfGrammar. */ + public abnfGrammar?: (google.cloud.speech.v1.SpeechAdaptation.IABNFGrammar|null); + + /** + * Creates a new SpeechAdaptation instance using the specified properties. + * @param [properties] Properties to set + * @returns SpeechAdaptation instance + */ + public static create(properties?: google.cloud.speech.v1.ISpeechAdaptation): google.cloud.speech.v1.SpeechAdaptation; + + /** + * Encodes the specified SpeechAdaptation message. Does not implicitly {@link google.cloud.speech.v1.SpeechAdaptation.verify|verify} messages. + * @param message SpeechAdaptation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.ISpeechAdaptation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpeechAdaptation message, length delimited. Does not implicitly {@link google.cloud.speech.v1.SpeechAdaptation.verify|verify} messages. + * @param message SpeechAdaptation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.ISpeechAdaptation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpeechAdaptation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpeechAdaptation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.SpeechAdaptation; + + /** + * Decodes a SpeechAdaptation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpeechAdaptation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.SpeechAdaptation; + + /** + * Verifies a SpeechAdaptation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpeechAdaptation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpeechAdaptation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.SpeechAdaptation; + + /** + * Creates a plain object from a SpeechAdaptation message. Also converts values to other types if specified. + * @param message SpeechAdaptation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.SpeechAdaptation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpeechAdaptation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpeechAdaptation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SpeechAdaptation { + + /** Properties of a ABNFGrammar. */ + interface IABNFGrammar { + + /** ABNFGrammar abnfStrings */ + abnfStrings?: (string[]|null); + } + + /** Represents a ABNFGrammar. */ + class ABNFGrammar implements IABNFGrammar { + + /** + * Constructs a new ABNFGrammar. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.SpeechAdaptation.IABNFGrammar); + + /** ABNFGrammar abnfStrings. */ + public abnfStrings: string[]; + + /** + * Creates a new ABNFGrammar instance using the specified properties. + * @param [properties] Properties to set + * @returns ABNFGrammar instance + */ + public static create(properties?: google.cloud.speech.v1.SpeechAdaptation.IABNFGrammar): google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar; + + /** + * Encodes the specified ABNFGrammar message. Does not implicitly {@link google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar.verify|verify} messages. + * @param message ABNFGrammar message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.SpeechAdaptation.IABNFGrammar, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ABNFGrammar message, length delimited. Does not implicitly {@link google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar.verify|verify} messages. + * @param message ABNFGrammar message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.SpeechAdaptation.IABNFGrammar, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ABNFGrammar message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ABNFGrammar + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar; + + /** + * Decodes a ABNFGrammar message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ABNFGrammar + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar; + + /** + * Verifies a ABNFGrammar message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ABNFGrammar message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ABNFGrammar + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar; + + /** + * Creates a plain object from a ABNFGrammar message. Also converts values to other types if specified. + * @param message ABNFGrammar + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ABNFGrammar to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ABNFGrammar + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a TranscriptNormalization. */ + interface ITranscriptNormalization { + + /** TranscriptNormalization entries */ + entries?: (google.cloud.speech.v1.TranscriptNormalization.IEntry[]|null); + } + + /** Represents a TranscriptNormalization. */ + class TranscriptNormalization implements ITranscriptNormalization { + + /** + * Constructs a new TranscriptNormalization. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.ITranscriptNormalization); + + /** TranscriptNormalization entries. */ + public entries: google.cloud.speech.v1.TranscriptNormalization.IEntry[]; + + /** + * Creates a new TranscriptNormalization instance using the specified properties. + * @param [properties] Properties to set + * @returns TranscriptNormalization instance + */ + public static create(properties?: google.cloud.speech.v1.ITranscriptNormalization): google.cloud.speech.v1.TranscriptNormalization; + + /** + * Encodes the specified TranscriptNormalization message. Does not implicitly {@link google.cloud.speech.v1.TranscriptNormalization.verify|verify} messages. + * @param message TranscriptNormalization message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.ITranscriptNormalization, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TranscriptNormalization message, length delimited. Does not implicitly {@link google.cloud.speech.v1.TranscriptNormalization.verify|verify} messages. + * @param message TranscriptNormalization message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.ITranscriptNormalization, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TranscriptNormalization message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TranscriptNormalization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.TranscriptNormalization; + + /** + * Decodes a TranscriptNormalization message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TranscriptNormalization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.TranscriptNormalization; + + /** + * Verifies a TranscriptNormalization message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TranscriptNormalization message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TranscriptNormalization + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.TranscriptNormalization; + + /** + * Creates a plain object from a TranscriptNormalization message. Also converts values to other types if specified. + * @param message TranscriptNormalization + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.TranscriptNormalization, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TranscriptNormalization to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TranscriptNormalization + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TranscriptNormalization { + + /** Properties of an Entry. */ + interface IEntry { + + /** Entry search */ + search?: (string|null); + + /** Entry replace */ + replace?: (string|null); + + /** Entry caseSensitive */ + caseSensitive?: (boolean|null); + } + + /** Represents an Entry. */ + class Entry implements IEntry { + + /** + * Constructs a new Entry. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.TranscriptNormalization.IEntry); + + /** Entry search. */ + public search: string; + + /** Entry replace. */ + public replace: string; + + /** Entry caseSensitive. */ + public caseSensitive: boolean; + + /** + * Creates a new Entry instance using the specified properties. + * @param [properties] Properties to set + * @returns Entry instance + */ + public static create(properties?: google.cloud.speech.v1.TranscriptNormalization.IEntry): google.cloud.speech.v1.TranscriptNormalization.Entry; + + /** + * Encodes the specified Entry message. Does not implicitly {@link google.cloud.speech.v1.TranscriptNormalization.Entry.verify|verify} messages. + * @param message Entry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.TranscriptNormalization.IEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Entry message, length delimited. Does not implicitly {@link google.cloud.speech.v1.TranscriptNormalization.Entry.verify|verify} messages. + * @param message Entry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.TranscriptNormalization.IEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Entry message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Entry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.TranscriptNormalization.Entry; + + /** + * Decodes an Entry message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Entry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.TranscriptNormalization.Entry; + + /** + * Verifies an Entry message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Entry message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Entry + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.TranscriptNormalization.Entry; + + /** + * Creates a plain object from an Entry message. Also converts values to other types if specified. + * @param message Entry + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.TranscriptNormalization.Entry, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Entry to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Entry + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Represents an Adaptation */ + class Adaptation extends $protobuf.rpc.Service { + + /** + * Constructs a new Adaptation service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Adaptation service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Adaptation; + + /** + * Calls CreatePhraseSet. + * @param request CreatePhraseSetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PhraseSet + */ + public createPhraseSet(request: google.cloud.speech.v1.ICreatePhraseSetRequest, callback: google.cloud.speech.v1.Adaptation.CreatePhraseSetCallback): void; + + /** + * Calls CreatePhraseSet. + * @param request CreatePhraseSetRequest message or plain object + * @returns Promise + */ + public createPhraseSet(request: google.cloud.speech.v1.ICreatePhraseSetRequest): Promise; + + /** + * Calls GetPhraseSet. + * @param request GetPhraseSetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PhraseSet + */ + public getPhraseSet(request: google.cloud.speech.v1.IGetPhraseSetRequest, callback: google.cloud.speech.v1.Adaptation.GetPhraseSetCallback): void; + + /** + * Calls GetPhraseSet. + * @param request GetPhraseSetRequest message or plain object + * @returns Promise + */ + public getPhraseSet(request: google.cloud.speech.v1.IGetPhraseSetRequest): Promise; + + /** + * Calls ListPhraseSet. + * @param request ListPhraseSetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListPhraseSetResponse + */ + public listPhraseSet(request: google.cloud.speech.v1.IListPhraseSetRequest, callback: google.cloud.speech.v1.Adaptation.ListPhraseSetCallback): void; + + /** + * Calls ListPhraseSet. + * @param request ListPhraseSetRequest message or plain object + * @returns Promise + */ + public listPhraseSet(request: google.cloud.speech.v1.IListPhraseSetRequest): Promise; + + /** + * Calls UpdatePhraseSet. + * @param request UpdatePhraseSetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PhraseSet + */ + public updatePhraseSet(request: google.cloud.speech.v1.IUpdatePhraseSetRequest, callback: google.cloud.speech.v1.Adaptation.UpdatePhraseSetCallback): void; + + /** + * Calls UpdatePhraseSet. + * @param request UpdatePhraseSetRequest message or plain object + * @returns Promise + */ + public updatePhraseSet(request: google.cloud.speech.v1.IUpdatePhraseSetRequest): Promise; + + /** + * Calls DeletePhraseSet. + * @param request DeletePhraseSetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deletePhraseSet(request: google.cloud.speech.v1.IDeletePhraseSetRequest, callback: google.cloud.speech.v1.Adaptation.DeletePhraseSetCallback): void; + + /** + * Calls DeletePhraseSet. + * @param request DeletePhraseSetRequest message or plain object + * @returns Promise + */ + public deletePhraseSet(request: google.cloud.speech.v1.IDeletePhraseSetRequest): Promise; + + /** + * Calls CreateCustomClass. + * @param request CreateCustomClassRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CustomClass + */ + public createCustomClass(request: google.cloud.speech.v1.ICreateCustomClassRequest, callback: google.cloud.speech.v1.Adaptation.CreateCustomClassCallback): void; + + /** + * Calls CreateCustomClass. + * @param request CreateCustomClassRequest message or plain object + * @returns Promise + */ + public createCustomClass(request: google.cloud.speech.v1.ICreateCustomClassRequest): Promise; + + /** + * Calls GetCustomClass. + * @param request GetCustomClassRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CustomClass + */ + public getCustomClass(request: google.cloud.speech.v1.IGetCustomClassRequest, callback: google.cloud.speech.v1.Adaptation.GetCustomClassCallback): void; + + /** + * Calls GetCustomClass. + * @param request GetCustomClassRequest message or plain object + * @returns Promise + */ + public getCustomClass(request: google.cloud.speech.v1.IGetCustomClassRequest): Promise; + + /** + * Calls ListCustomClasses. + * @param request ListCustomClassesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListCustomClassesResponse + */ + public listCustomClasses(request: google.cloud.speech.v1.IListCustomClassesRequest, callback: google.cloud.speech.v1.Adaptation.ListCustomClassesCallback): void; + + /** + * Calls ListCustomClasses. + * @param request ListCustomClassesRequest message or plain object + * @returns Promise + */ + public listCustomClasses(request: google.cloud.speech.v1.IListCustomClassesRequest): Promise; + + /** + * Calls UpdateCustomClass. + * @param request UpdateCustomClassRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CustomClass + */ + public updateCustomClass(request: google.cloud.speech.v1.IUpdateCustomClassRequest, callback: google.cloud.speech.v1.Adaptation.UpdateCustomClassCallback): void; + + /** + * Calls UpdateCustomClass. + * @param request UpdateCustomClassRequest message or plain object + * @returns Promise + */ + public updateCustomClass(request: google.cloud.speech.v1.IUpdateCustomClassRequest): Promise; + + /** + * Calls DeleteCustomClass. + * @param request DeleteCustomClassRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteCustomClass(request: google.cloud.speech.v1.IDeleteCustomClassRequest, callback: google.cloud.speech.v1.Adaptation.DeleteCustomClassCallback): void; + + /** + * Calls DeleteCustomClass. + * @param request DeleteCustomClassRequest message or plain object + * @returns Promise + */ + public deleteCustomClass(request: google.cloud.speech.v1.IDeleteCustomClassRequest): Promise; + } + + namespace Adaptation { + + /** + * Callback as used by {@link google.cloud.speech.v1.Adaptation|createPhraseSet}. + * @param error Error, if any + * @param [response] PhraseSet + */ + type CreatePhraseSetCallback = (error: (Error|null), response?: google.cloud.speech.v1.PhraseSet) => void; + + /** + * Callback as used by {@link google.cloud.speech.v1.Adaptation|getPhraseSet}. + * @param error Error, if any + * @param [response] PhraseSet + */ + type GetPhraseSetCallback = (error: (Error|null), response?: google.cloud.speech.v1.PhraseSet) => void; + + /** + * Callback as used by {@link google.cloud.speech.v1.Adaptation|listPhraseSet}. + * @param error Error, if any + * @param [response] ListPhraseSetResponse + */ + type ListPhraseSetCallback = (error: (Error|null), response?: google.cloud.speech.v1.ListPhraseSetResponse) => void; + + /** + * Callback as used by {@link google.cloud.speech.v1.Adaptation|updatePhraseSet}. + * @param error Error, if any + * @param [response] PhraseSet + */ + type UpdatePhraseSetCallback = (error: (Error|null), response?: google.cloud.speech.v1.PhraseSet) => void; + + /** + * Callback as used by {@link google.cloud.speech.v1.Adaptation|deletePhraseSet}. + * @param error Error, if any + * @param [response] Empty + */ + type DeletePhraseSetCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.speech.v1.Adaptation|createCustomClass}. + * @param error Error, if any + * @param [response] CustomClass + */ + type CreateCustomClassCallback = (error: (Error|null), response?: google.cloud.speech.v1.CustomClass) => void; + + /** + * Callback as used by {@link google.cloud.speech.v1.Adaptation|getCustomClass}. + * @param error Error, if any + * @param [response] CustomClass + */ + type GetCustomClassCallback = (error: (Error|null), response?: google.cloud.speech.v1.CustomClass) => void; + + /** + * Callback as used by {@link google.cloud.speech.v1.Adaptation|listCustomClasses}. + * @param error Error, if any + * @param [response] ListCustomClassesResponse + */ + type ListCustomClassesCallback = (error: (Error|null), response?: google.cloud.speech.v1.ListCustomClassesResponse) => void; + + /** + * Callback as used by {@link google.cloud.speech.v1.Adaptation|updateCustomClass}. + * @param error Error, if any + * @param [response] CustomClass + */ + type UpdateCustomClassCallback = (error: (Error|null), response?: google.cloud.speech.v1.CustomClass) => void; + + /** + * Callback as used by {@link google.cloud.speech.v1.Adaptation|deleteCustomClass}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteCustomClassCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of a CreatePhraseSetRequest. */ + interface ICreatePhraseSetRequest { + + /** CreatePhraseSetRequest parent */ + parent?: (string|null); + + /** CreatePhraseSetRequest phraseSetId */ + phraseSetId?: (string|null); + + /** CreatePhraseSetRequest phraseSet */ + phraseSet?: (google.cloud.speech.v1.IPhraseSet|null); + } + + /** Represents a CreatePhraseSetRequest. */ + class CreatePhraseSetRequest implements ICreatePhraseSetRequest { + + /** + * Constructs a new CreatePhraseSetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.ICreatePhraseSetRequest); + + /** CreatePhraseSetRequest parent. */ + public parent: string; + + /** CreatePhraseSetRequest phraseSetId. */ + public phraseSetId: string; + + /** CreatePhraseSetRequest phraseSet. */ + public phraseSet?: (google.cloud.speech.v1.IPhraseSet|null); + + /** + * Creates a new CreatePhraseSetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreatePhraseSetRequest instance + */ + public static create(properties?: google.cloud.speech.v1.ICreatePhraseSetRequest): google.cloud.speech.v1.CreatePhraseSetRequest; + + /** + * Encodes the specified CreatePhraseSetRequest message. Does not implicitly {@link google.cloud.speech.v1.CreatePhraseSetRequest.verify|verify} messages. + * @param message CreatePhraseSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.ICreatePhraseSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreatePhraseSetRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.CreatePhraseSetRequest.verify|verify} messages. + * @param message CreatePhraseSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.ICreatePhraseSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreatePhraseSetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreatePhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.CreatePhraseSetRequest; + + /** + * Decodes a CreatePhraseSetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreatePhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.CreatePhraseSetRequest; + + /** + * Verifies a CreatePhraseSetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreatePhraseSetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreatePhraseSetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.CreatePhraseSetRequest; + + /** + * Creates a plain object from a CreatePhraseSetRequest message. Also converts values to other types if specified. + * @param message CreatePhraseSetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.CreatePhraseSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreatePhraseSetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreatePhraseSetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdatePhraseSetRequest. */ + interface IUpdatePhraseSetRequest { + + /** UpdatePhraseSetRequest phraseSet */ + phraseSet?: (google.cloud.speech.v1.IPhraseSet|null); + + /** UpdatePhraseSetRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdatePhraseSetRequest. */ + class UpdatePhraseSetRequest implements IUpdatePhraseSetRequest { + + /** + * Constructs a new UpdatePhraseSetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.IUpdatePhraseSetRequest); + + /** UpdatePhraseSetRequest phraseSet. */ + public phraseSet?: (google.cloud.speech.v1.IPhraseSet|null); + + /** UpdatePhraseSetRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdatePhraseSetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdatePhraseSetRequest instance + */ + public static create(properties?: google.cloud.speech.v1.IUpdatePhraseSetRequest): google.cloud.speech.v1.UpdatePhraseSetRequest; + + /** + * Encodes the specified UpdatePhraseSetRequest message. Does not implicitly {@link google.cloud.speech.v1.UpdatePhraseSetRequest.verify|verify} messages. + * @param message UpdatePhraseSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.IUpdatePhraseSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdatePhraseSetRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.UpdatePhraseSetRequest.verify|verify} messages. + * @param message UpdatePhraseSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.IUpdatePhraseSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdatePhraseSetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdatePhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.UpdatePhraseSetRequest; + + /** + * Decodes an UpdatePhraseSetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdatePhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.UpdatePhraseSetRequest; + + /** + * Verifies an UpdatePhraseSetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdatePhraseSetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdatePhraseSetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.UpdatePhraseSetRequest; + + /** + * Creates a plain object from an UpdatePhraseSetRequest message. Also converts values to other types if specified. + * @param message UpdatePhraseSetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.UpdatePhraseSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdatePhraseSetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdatePhraseSetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetPhraseSetRequest. */ + interface IGetPhraseSetRequest { + + /** GetPhraseSetRequest name */ + name?: (string|null); + } + + /** Represents a GetPhraseSetRequest. */ + class GetPhraseSetRequest implements IGetPhraseSetRequest { + + /** + * Constructs a new GetPhraseSetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.IGetPhraseSetRequest); + + /** GetPhraseSetRequest name. */ + public name: string; + + /** + * Creates a new GetPhraseSetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetPhraseSetRequest instance + */ + public static create(properties?: google.cloud.speech.v1.IGetPhraseSetRequest): google.cloud.speech.v1.GetPhraseSetRequest; + + /** + * Encodes the specified GetPhraseSetRequest message. Does not implicitly {@link google.cloud.speech.v1.GetPhraseSetRequest.verify|verify} messages. + * @param message GetPhraseSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.IGetPhraseSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetPhraseSetRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.GetPhraseSetRequest.verify|verify} messages. + * @param message GetPhraseSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.IGetPhraseSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetPhraseSetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetPhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.GetPhraseSetRequest; + + /** + * Decodes a GetPhraseSetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetPhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.GetPhraseSetRequest; + + /** + * Verifies a GetPhraseSetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetPhraseSetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetPhraseSetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.GetPhraseSetRequest; + + /** + * Creates a plain object from a GetPhraseSetRequest message. Also converts values to other types if specified. + * @param message GetPhraseSetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.GetPhraseSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetPhraseSetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetPhraseSetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListPhraseSetRequest. */ + interface IListPhraseSetRequest { + + /** ListPhraseSetRequest parent */ + parent?: (string|null); + + /** ListPhraseSetRequest pageSize */ + pageSize?: (number|null); + + /** ListPhraseSetRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListPhraseSetRequest. */ + class ListPhraseSetRequest implements IListPhraseSetRequest { + + /** + * Constructs a new ListPhraseSetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.IListPhraseSetRequest); + + /** ListPhraseSetRequest parent. */ + public parent: string; + + /** ListPhraseSetRequest pageSize. */ + public pageSize: number; + + /** ListPhraseSetRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListPhraseSetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPhraseSetRequest instance + */ + public static create(properties?: google.cloud.speech.v1.IListPhraseSetRequest): google.cloud.speech.v1.ListPhraseSetRequest; + + /** + * Encodes the specified ListPhraseSetRequest message. Does not implicitly {@link google.cloud.speech.v1.ListPhraseSetRequest.verify|verify} messages. + * @param message ListPhraseSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.IListPhraseSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPhraseSetRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.ListPhraseSetRequest.verify|verify} messages. + * @param message ListPhraseSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.IListPhraseSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPhraseSetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.ListPhraseSetRequest; + + /** + * Decodes a ListPhraseSetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.ListPhraseSetRequest; + + /** + * Verifies a ListPhraseSetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListPhraseSetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPhraseSetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.ListPhraseSetRequest; + + /** + * Creates a plain object from a ListPhraseSetRequest message. Also converts values to other types if specified. + * @param message ListPhraseSetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.ListPhraseSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPhraseSetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListPhraseSetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListPhraseSetResponse. */ + interface IListPhraseSetResponse { + + /** ListPhraseSetResponse phraseSets */ + phraseSets?: (google.cloud.speech.v1.IPhraseSet[]|null); + + /** ListPhraseSetResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListPhraseSetResponse. */ + class ListPhraseSetResponse implements IListPhraseSetResponse { + + /** + * Constructs a new ListPhraseSetResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.IListPhraseSetResponse); + + /** ListPhraseSetResponse phraseSets. */ + public phraseSets: google.cloud.speech.v1.IPhraseSet[]; + + /** ListPhraseSetResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListPhraseSetResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPhraseSetResponse instance + */ + public static create(properties?: google.cloud.speech.v1.IListPhraseSetResponse): google.cloud.speech.v1.ListPhraseSetResponse; + + /** + * Encodes the specified ListPhraseSetResponse message. Does not implicitly {@link google.cloud.speech.v1.ListPhraseSetResponse.verify|verify} messages. + * @param message ListPhraseSetResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.IListPhraseSetResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPhraseSetResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v1.ListPhraseSetResponse.verify|verify} messages. + * @param message ListPhraseSetResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.IListPhraseSetResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPhraseSetResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPhraseSetResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.ListPhraseSetResponse; + + /** + * Decodes a ListPhraseSetResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPhraseSetResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.ListPhraseSetResponse; + + /** + * Verifies a ListPhraseSetResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListPhraseSetResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPhraseSetResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.ListPhraseSetResponse; + + /** + * Creates a plain object from a ListPhraseSetResponse message. Also converts values to other types if specified. + * @param message ListPhraseSetResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.ListPhraseSetResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPhraseSetResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListPhraseSetResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeletePhraseSetRequest. */ + interface IDeletePhraseSetRequest { + + /** DeletePhraseSetRequest name */ + name?: (string|null); + } + + /** Represents a DeletePhraseSetRequest. */ + class DeletePhraseSetRequest implements IDeletePhraseSetRequest { + + /** + * Constructs a new DeletePhraseSetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.IDeletePhraseSetRequest); + + /** DeletePhraseSetRequest name. */ + public name: string; + + /** + * Creates a new DeletePhraseSetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeletePhraseSetRequest instance + */ + public static create(properties?: google.cloud.speech.v1.IDeletePhraseSetRequest): google.cloud.speech.v1.DeletePhraseSetRequest; + + /** + * Encodes the specified DeletePhraseSetRequest message. Does not implicitly {@link google.cloud.speech.v1.DeletePhraseSetRequest.verify|verify} messages. + * @param message DeletePhraseSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.IDeletePhraseSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeletePhraseSetRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.DeletePhraseSetRequest.verify|verify} messages. + * @param message DeletePhraseSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.IDeletePhraseSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeletePhraseSetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeletePhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.DeletePhraseSetRequest; + + /** + * Decodes a DeletePhraseSetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeletePhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.DeletePhraseSetRequest; + + /** + * Verifies a DeletePhraseSetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeletePhraseSetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeletePhraseSetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.DeletePhraseSetRequest; + + /** + * Creates a plain object from a DeletePhraseSetRequest message. Also converts values to other types if specified. + * @param message DeletePhraseSetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.DeletePhraseSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeletePhraseSetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeletePhraseSetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateCustomClassRequest. */ + interface ICreateCustomClassRequest { + + /** CreateCustomClassRequest parent */ + parent?: (string|null); + + /** CreateCustomClassRequest customClassId */ + customClassId?: (string|null); + + /** CreateCustomClassRequest customClass */ + customClass?: (google.cloud.speech.v1.ICustomClass|null); + } + + /** Represents a CreateCustomClassRequest. */ + class CreateCustomClassRequest implements ICreateCustomClassRequest { + + /** + * Constructs a new CreateCustomClassRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.ICreateCustomClassRequest); + + /** CreateCustomClassRequest parent. */ + public parent: string; + + /** CreateCustomClassRequest customClassId. */ + public customClassId: string; + + /** CreateCustomClassRequest customClass. */ + public customClass?: (google.cloud.speech.v1.ICustomClass|null); + + /** + * Creates a new CreateCustomClassRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateCustomClassRequest instance + */ + public static create(properties?: google.cloud.speech.v1.ICreateCustomClassRequest): google.cloud.speech.v1.CreateCustomClassRequest; + + /** + * Encodes the specified CreateCustomClassRequest message. Does not implicitly {@link google.cloud.speech.v1.CreateCustomClassRequest.verify|verify} messages. + * @param message CreateCustomClassRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.ICreateCustomClassRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateCustomClassRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.CreateCustomClassRequest.verify|verify} messages. + * @param message CreateCustomClassRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.ICreateCustomClassRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateCustomClassRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.CreateCustomClassRequest; + + /** + * Decodes a CreateCustomClassRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.CreateCustomClassRequest; + + /** + * Verifies a CreateCustomClassRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateCustomClassRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateCustomClassRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.CreateCustomClassRequest; + + /** + * Creates a plain object from a CreateCustomClassRequest message. Also converts values to other types if specified. + * @param message CreateCustomClassRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.CreateCustomClassRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateCustomClassRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateCustomClassRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateCustomClassRequest. */ + interface IUpdateCustomClassRequest { + + /** UpdateCustomClassRequest customClass */ + customClass?: (google.cloud.speech.v1.ICustomClass|null); + + /** UpdateCustomClassRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateCustomClassRequest. */ + class UpdateCustomClassRequest implements IUpdateCustomClassRequest { + + /** + * Constructs a new UpdateCustomClassRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.IUpdateCustomClassRequest); + + /** UpdateCustomClassRequest customClass. */ + public customClass?: (google.cloud.speech.v1.ICustomClass|null); + + /** UpdateCustomClassRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateCustomClassRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateCustomClassRequest instance + */ + public static create(properties?: google.cloud.speech.v1.IUpdateCustomClassRequest): google.cloud.speech.v1.UpdateCustomClassRequest; + + /** + * Encodes the specified UpdateCustomClassRequest message. Does not implicitly {@link google.cloud.speech.v1.UpdateCustomClassRequest.verify|verify} messages. + * @param message UpdateCustomClassRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.IUpdateCustomClassRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateCustomClassRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.UpdateCustomClassRequest.verify|verify} messages. + * @param message UpdateCustomClassRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.IUpdateCustomClassRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateCustomClassRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.UpdateCustomClassRequest; + + /** + * Decodes an UpdateCustomClassRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.UpdateCustomClassRequest; + + /** + * Verifies an UpdateCustomClassRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateCustomClassRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateCustomClassRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.UpdateCustomClassRequest; + + /** + * Creates a plain object from an UpdateCustomClassRequest message. Also converts values to other types if specified. + * @param message UpdateCustomClassRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.UpdateCustomClassRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateCustomClassRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateCustomClassRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetCustomClassRequest. */ + interface IGetCustomClassRequest { + + /** GetCustomClassRequest name */ + name?: (string|null); + } + + /** Represents a GetCustomClassRequest. */ + class GetCustomClassRequest implements IGetCustomClassRequest { + + /** + * Constructs a new GetCustomClassRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.IGetCustomClassRequest); + + /** GetCustomClassRequest name. */ + public name: string; + + /** + * Creates a new GetCustomClassRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetCustomClassRequest instance + */ + public static create(properties?: google.cloud.speech.v1.IGetCustomClassRequest): google.cloud.speech.v1.GetCustomClassRequest; + + /** + * Encodes the specified GetCustomClassRequest message. Does not implicitly {@link google.cloud.speech.v1.GetCustomClassRequest.verify|verify} messages. + * @param message GetCustomClassRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.IGetCustomClassRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetCustomClassRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.GetCustomClassRequest.verify|verify} messages. + * @param message GetCustomClassRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.IGetCustomClassRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetCustomClassRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.GetCustomClassRequest; + + /** + * Decodes a GetCustomClassRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.GetCustomClassRequest; + + /** + * Verifies a GetCustomClassRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetCustomClassRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetCustomClassRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.GetCustomClassRequest; + + /** + * Creates a plain object from a GetCustomClassRequest message. Also converts values to other types if specified. + * @param message GetCustomClassRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.GetCustomClassRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetCustomClassRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetCustomClassRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCustomClassesRequest. */ + interface IListCustomClassesRequest { + + /** ListCustomClassesRequest parent */ + parent?: (string|null); + + /** ListCustomClassesRequest pageSize */ + pageSize?: (number|null); + + /** ListCustomClassesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListCustomClassesRequest. */ + class ListCustomClassesRequest implements IListCustomClassesRequest { + + /** + * Constructs a new ListCustomClassesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.IListCustomClassesRequest); + + /** ListCustomClassesRequest parent. */ + public parent: string; + + /** ListCustomClassesRequest pageSize. */ + public pageSize: number; + + /** ListCustomClassesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListCustomClassesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCustomClassesRequest instance + */ + public static create(properties?: google.cloud.speech.v1.IListCustomClassesRequest): google.cloud.speech.v1.ListCustomClassesRequest; + + /** + * Encodes the specified ListCustomClassesRequest message. Does not implicitly {@link google.cloud.speech.v1.ListCustomClassesRequest.verify|verify} messages. + * @param message ListCustomClassesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.IListCustomClassesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCustomClassesRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.ListCustomClassesRequest.verify|verify} messages. + * @param message ListCustomClassesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.IListCustomClassesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCustomClassesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCustomClassesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.ListCustomClassesRequest; + + /** + * Decodes a ListCustomClassesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCustomClassesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.ListCustomClassesRequest; + + /** + * Verifies a ListCustomClassesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCustomClassesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCustomClassesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.ListCustomClassesRequest; + + /** + * Creates a plain object from a ListCustomClassesRequest message. Also converts values to other types if specified. + * @param message ListCustomClassesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.ListCustomClassesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCustomClassesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCustomClassesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCustomClassesResponse. */ + interface IListCustomClassesResponse { + + /** ListCustomClassesResponse customClasses */ + customClasses?: (google.cloud.speech.v1.ICustomClass[]|null); + + /** ListCustomClassesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListCustomClassesResponse. */ + class ListCustomClassesResponse implements IListCustomClassesResponse { + + /** + * Constructs a new ListCustomClassesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.IListCustomClassesResponse); + + /** ListCustomClassesResponse customClasses. */ + public customClasses: google.cloud.speech.v1.ICustomClass[]; + + /** ListCustomClassesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListCustomClassesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCustomClassesResponse instance + */ + public static create(properties?: google.cloud.speech.v1.IListCustomClassesResponse): google.cloud.speech.v1.ListCustomClassesResponse; + + /** + * Encodes the specified ListCustomClassesResponse message. Does not implicitly {@link google.cloud.speech.v1.ListCustomClassesResponse.verify|verify} messages. + * @param message ListCustomClassesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.IListCustomClassesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCustomClassesResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v1.ListCustomClassesResponse.verify|verify} messages. + * @param message ListCustomClassesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.IListCustomClassesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCustomClassesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCustomClassesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.ListCustomClassesResponse; + + /** + * Decodes a ListCustomClassesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCustomClassesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.ListCustomClassesResponse; + + /** + * Verifies a ListCustomClassesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCustomClassesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCustomClassesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.ListCustomClassesResponse; + + /** + * Creates a plain object from a ListCustomClassesResponse message. Also converts values to other types if specified. + * @param message ListCustomClassesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.ListCustomClassesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCustomClassesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCustomClassesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteCustomClassRequest. */ + interface IDeleteCustomClassRequest { + + /** DeleteCustomClassRequest name */ + name?: (string|null); + } + + /** Represents a DeleteCustomClassRequest. */ + class DeleteCustomClassRequest implements IDeleteCustomClassRequest { + + /** + * Constructs a new DeleteCustomClassRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.speech.v1.IDeleteCustomClassRequest); + + /** DeleteCustomClassRequest name. */ + public name: string; + + /** + * Creates a new DeleteCustomClassRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteCustomClassRequest instance + */ + public static create(properties?: google.cloud.speech.v1.IDeleteCustomClassRequest): google.cloud.speech.v1.DeleteCustomClassRequest; + + /** + * Encodes the specified DeleteCustomClassRequest message. Does not implicitly {@link google.cloud.speech.v1.DeleteCustomClassRequest.verify|verify} messages. + * @param message DeleteCustomClassRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.speech.v1.IDeleteCustomClassRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteCustomClassRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.DeleteCustomClassRequest.verify|verify} messages. + * @param message DeleteCustomClassRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.speech.v1.IDeleteCustomClassRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteCustomClassRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.DeleteCustomClassRequest; + + /** + * Decodes a DeleteCustomClassRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.DeleteCustomClassRequest; + + /** + * Verifies a DeleteCustomClassRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteCustomClassRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteCustomClassRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.DeleteCustomClassRequest; + + /** + * Creates a plain object from a DeleteCustomClassRequest message. Also converts values to other types if specified. + * @param message DeleteCustomClassRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.speech.v1.DeleteCustomClassRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteCustomClassRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteCustomClassRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Http message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + + /** + * Verifies a Http message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Http + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HttpRule. */ + interface IHttpRule { + + /** HttpRule selector */ + selector?: (string|null); + + /** HttpRule get */ + get?: (string|null); + + /** HttpRule put */ + put?: (string|null); + + /** HttpRule post */ + post?: (string|null); + + /** HttpRule delete */ + "delete"?: (string|null); + + /** HttpRule patch */ + patch?: (string|null); + + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body */ + body?: (string|null); + + /** HttpRule responseBody */ + responseBody?: (string|null); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } + + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { + + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); + + /** HttpRule selector. */ + public selector: string; + + /** HttpRule get. */ + public get?: (string|null); + + /** HttpRule put. */ + public put?: (string|null); + + /** HttpRule post. */ + public post?: (string|null); + + /** HttpRule delete. */ + public delete?: (string|null); + + /** HttpRule patch. */ + public patch?: (string|null); + + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body. */ + public body: string; + + /** HttpRule responseBody. */ + public responseBody: string; + + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; + + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + + /** + * Creates a new HttpRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRule instance + */ + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; + + /** + * Verifies a HttpRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRule + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @param message HttpRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { + + /** CustomHttpPattern kind */ + kind?: (string|null); + + /** CustomHttpPattern path */ + path?: (string|null); + } + + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { + + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); + + /** CustomHttpPattern kind. */ + public kind: string; + + /** CustomHttpPattern path. */ + public path: string; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHttpPattern instance + */ + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; + + /** + * Verifies a CustomHttpPattern message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomHttpPattern + */ + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @param message CustomHttpPattern + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomHttpPattern + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CommonLanguageSettings. */ + interface ICommonLanguageSettings { + + /** CommonLanguageSettings referenceDocsUri */ + referenceDocsUri?: (string|null); + + /** CommonLanguageSettings destinations */ + destinations?: (google.api.ClientLibraryDestination[]|null); + } + + /** Represents a CommonLanguageSettings. */ + class CommonLanguageSettings implements ICommonLanguageSettings { + + /** + * Constructs a new CommonLanguageSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICommonLanguageSettings); + + /** CommonLanguageSettings referenceDocsUri. */ + public referenceDocsUri: string; + + /** CommonLanguageSettings destinations. */ + public destinations: google.api.ClientLibraryDestination[]; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CommonLanguageSettings instance + */ + public static create(properties?: google.api.ICommonLanguageSettings): google.api.CommonLanguageSettings; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CommonLanguageSettings; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CommonLanguageSettings; + + /** + * Verifies a CommonLanguageSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommonLanguageSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CommonLanguageSettings; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @param message CommonLanguageSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CommonLanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CommonLanguageSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClientLibrarySettings. */ + interface IClientLibrarySettings { + + /** ClientLibrarySettings version */ + version?: (string|null); + + /** ClientLibrarySettings launchStage */ + launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); + + /** ClientLibrarySettings restNumericEnums */ + restNumericEnums?: (boolean|null); + + /** ClientLibrarySettings javaSettings */ + javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings */ + cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings */ + phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings */ + pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings */ + nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings */ + dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings */ + rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings */ + goSettings?: (google.api.IGoSettings|null); + } + + /** Represents a ClientLibrarySettings. */ + class ClientLibrarySettings implements IClientLibrarySettings { + + /** + * Constructs a new ClientLibrarySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IClientLibrarySettings); + + /** ClientLibrarySettings version. */ + public version: string; + + /** ClientLibrarySettings launchStage. */ + public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); + + /** ClientLibrarySettings restNumericEnums. */ + public restNumericEnums: boolean; + + /** ClientLibrarySettings javaSettings. */ + public javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings. */ + public cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings. */ + public phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings. */ + public pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings. */ + public nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings. */ + public dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings. */ + public rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings. */ + public goSettings?: (google.api.IGoSettings|null); + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientLibrarySettings instance + */ + public static create(properties?: google.api.IClientLibrarySettings): google.api.ClientLibrarySettings; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ClientLibrarySettings; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ClientLibrarySettings; + + /** + * Verifies a ClientLibrarySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClientLibrarySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.ClientLibrarySettings; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @param message ClientLibrarySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ClientLibrarySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClientLibrarySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Publishing. */ + interface IPublishing { + + /** Publishing methodSettings */ + methodSettings?: (google.api.IMethodSettings[]|null); + + /** Publishing newIssueUri */ + newIssueUri?: (string|null); + + /** Publishing documentationUri */ + documentationUri?: (string|null); + + /** Publishing apiShortName */ + apiShortName?: (string|null); + + /** Publishing githubLabel */ + githubLabel?: (string|null); + + /** Publishing codeownerGithubTeams */ + codeownerGithubTeams?: (string[]|null); + + /** Publishing docTagPrefix */ + docTagPrefix?: (string|null); + + /** Publishing organization */ + organization?: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization|null); + + /** Publishing librarySettings */ + librarySettings?: (google.api.IClientLibrarySettings[]|null); + + /** Publishing protoReferenceDocumentationUri */ + protoReferenceDocumentationUri?: (string|null); + + /** Publishing restReferenceDocumentationUri */ + restReferenceDocumentationUri?: (string|null); + } + + /** Represents a Publishing. */ + class Publishing implements IPublishing { + + /** + * Constructs a new Publishing. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPublishing); + + /** Publishing methodSettings. */ + public methodSettings: google.api.IMethodSettings[]; + + /** Publishing newIssueUri. */ + public newIssueUri: string; + + /** Publishing documentationUri. */ + public documentationUri: string; + + /** Publishing apiShortName. */ + public apiShortName: string; + + /** Publishing githubLabel. */ + public githubLabel: string; + + /** Publishing codeownerGithubTeams. */ + public codeownerGithubTeams: string[]; + + /** Publishing docTagPrefix. */ + public docTagPrefix: string; + + /** Publishing organization. */ + public organization: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization); + + /** Publishing librarySettings. */ + public librarySettings: google.api.IClientLibrarySettings[]; + + /** Publishing protoReferenceDocumentationUri. */ + public protoReferenceDocumentationUri: string; + + /** Publishing restReferenceDocumentationUri. */ + public restReferenceDocumentationUri: string; + + /** + * Creates a new Publishing instance using the specified properties. + * @param [properties] Properties to set + * @returns Publishing instance + */ + public static create(properties?: google.api.IPublishing): google.api.Publishing; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Publishing; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Publishing; + + /** + * Verifies a Publishing message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Publishing + */ + public static fromObject(object: { [k: string]: any }): google.api.Publishing; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @param message Publishing + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Publishing, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Publishing to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Publishing + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JavaSettings. */ + interface IJavaSettings { + + /** JavaSettings libraryPackage */ + libraryPackage?: (string|null); + + /** JavaSettings serviceClassNames */ + serviceClassNames?: ({ [k: string]: string }|null); + + /** JavaSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a JavaSettings. */ + class JavaSettings implements IJavaSettings { + + /** + * Constructs a new JavaSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IJavaSettings); + + /** JavaSettings libraryPackage. */ + public libraryPackage: string; + + /** JavaSettings serviceClassNames. */ + public serviceClassNames: { [k: string]: string }; + + /** JavaSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new JavaSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns JavaSettings instance + */ + public static create(properties?: google.api.IJavaSettings): google.api.JavaSettings; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.JavaSettings; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.JavaSettings; + + /** + * Verifies a JavaSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JavaSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.JavaSettings; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @param message JavaSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.JavaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JavaSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JavaSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CppSettings. */ + interface ICppSettings { + + /** CppSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a CppSettings. */ + class CppSettings implements ICppSettings { + + /** + * Constructs a new CppSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICppSettings); + + /** CppSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new CppSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CppSettings instance + */ + public static create(properties?: google.api.ICppSettings): google.api.CppSettings; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CppSettings; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CppSettings; + + /** + * Verifies a CppSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CppSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CppSettings; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @param message CppSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CppSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CppSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CppSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PhpSettings. */ + interface IPhpSettings { + + /** PhpSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PhpSettings. */ + class PhpSettings implements IPhpSettings { + + /** + * Constructs a new PhpSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPhpSettings); + + /** PhpSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PhpSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PhpSettings instance + */ + public static create(properties?: google.api.IPhpSettings): google.api.PhpSettings; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PhpSettings; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PhpSettings; + + /** + * Verifies a PhpSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PhpSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PhpSettings; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @param message PhpSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PhpSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PhpSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PhpSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PythonSettings. */ + interface IPythonSettings { + + /** PythonSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PythonSettings. */ + class PythonSettings implements IPythonSettings { + + /** + * Constructs a new PythonSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPythonSettings); + + /** PythonSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PythonSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PythonSettings instance + */ + public static create(properties?: google.api.IPythonSettings): google.api.PythonSettings; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings; + + /** + * Verifies a PythonSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PythonSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @param message PythonSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PythonSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PythonSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeSettings. */ + interface INodeSettings { + + /** NodeSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a NodeSettings. */ + class NodeSettings implements INodeSettings { + + /** + * Constructs a new NodeSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.INodeSettings); + + /** NodeSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new NodeSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeSettings instance + */ + public static create(properties?: google.api.INodeSettings): google.api.NodeSettings; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.NodeSettings; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.NodeSettings; + + /** + * Verifies a NodeSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.NodeSettings; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @param message NodeSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.NodeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodeSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DotnetSettings. */ + interface IDotnetSettings { + + /** DotnetSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|null); + + /** DotnetSettings renamedResources */ + renamedResources?: ({ [k: string]: string }|null); + + /** DotnetSettings ignoredResources */ + ignoredResources?: (string[]|null); + + /** DotnetSettings forcedNamespaceAliases */ + forcedNamespaceAliases?: (string[]|null); + + /** DotnetSettings handwrittenSignatures */ + handwrittenSignatures?: (string[]|null); + } + + /** Represents a DotnetSettings. */ + class DotnetSettings implements IDotnetSettings { + + /** + * Constructs a new DotnetSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IDotnetSettings); + + /** DotnetSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + + /** DotnetSettings renamedResources. */ + public renamedResources: { [k: string]: string }; + + /** DotnetSettings ignoredResources. */ + public ignoredResources: string[]; + + /** DotnetSettings forcedNamespaceAliases. */ + public forcedNamespaceAliases: string[]; + + /** DotnetSettings handwrittenSignatures. */ + public handwrittenSignatures: string[]; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns DotnetSettings instance + */ + public static create(properties?: google.api.IDotnetSettings): google.api.DotnetSettings; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.DotnetSettings; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.DotnetSettings; + + /** + * Verifies a DotnetSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DotnetSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @param message DotnetSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DotnetSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DotnetSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RubySettings. */ + interface IRubySettings { + + /** RubySettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a RubySettings. */ + class RubySettings implements IRubySettings { + + /** + * Constructs a new RubySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IRubySettings); + + /** RubySettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new RubySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns RubySettings instance + */ + public static create(properties?: google.api.IRubySettings): google.api.RubySettings; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.RubySettings; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.RubySettings; + + /** + * Verifies a RubySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RubySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.RubySettings; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @param message RubySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.RubySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RubySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RubySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GoSettings. */ + interface IGoSettings { + + /** GoSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a GoSettings. */ + class GoSettings implements IGoSettings { + + /** + * Constructs a new GoSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IGoSettings); + + /** GoSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new GoSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns GoSettings instance + */ + public static create(properties?: google.api.IGoSettings): google.api.GoSettings; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.GoSettings; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.GoSettings; + + /** + * Verifies a GoSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.GoSettings; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @param message GoSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodSettings. */ + interface IMethodSettings { + + /** MethodSettings selector */ + selector?: (string|null); + + /** MethodSettings longRunning */ + longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields */ + autoPopulatedFields?: (string[]|null); + } + + /** Represents a MethodSettings. */ + class MethodSettings implements IMethodSettings { + + /** + * Constructs a new MethodSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IMethodSettings); + + /** MethodSettings selector. */ + public selector: string; + + /** MethodSettings longRunning. */ + public longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields. */ + public autoPopulatedFields: string[]; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodSettings instance + */ + public static create(properties?: google.api.IMethodSettings): google.api.MethodSettings; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings; + + /** + * Verifies a MethodSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @param message MethodSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodSettings { + + /** Properties of a LongRunning. */ + interface ILongRunning { + + /** LongRunning initialPollDelay */ + initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier */ + pollDelayMultiplier?: (number|null); + + /** LongRunning maxPollDelay */ + maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout */ + totalPollTimeout?: (google.protobuf.IDuration|null); + } + + /** Represents a LongRunning. */ + class LongRunning implements ILongRunning { + + /** + * Constructs a new LongRunning. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.MethodSettings.ILongRunning); + + /** LongRunning initialPollDelay. */ + public initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier. */ + public pollDelayMultiplier: number; + + /** LongRunning maxPollDelay. */ + public maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout. */ + public totalPollTimeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new LongRunning instance using the specified properties. + * @param [properties] Properties to set + * @returns LongRunning instance + */ + public static create(properties?: google.api.MethodSettings.ILongRunning): google.api.MethodSettings.LongRunning; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings.LongRunning; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings.LongRunning; + + /** + * Verifies a LongRunning message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LongRunning + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings.LongRunning; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @param message LongRunning + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings.LongRunning, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LongRunning to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LongRunning + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** ClientLibraryOrganization enum. */ + enum ClientLibraryOrganization { + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, + CLOUD = 1, + ADS = 2, + PHOTOS = 3, + STREET_VIEW = 4, + SHOPPING = 5, + GEO = 6, + GENERATIVE_AI = 7 + } + + /** ClientLibraryDestination enum. */ + enum ClientLibraryDestination { + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, + GITHUB = 10, + PACKAGE_MANAGER = 20 + } + + /** LaunchStage enum. */ + enum LaunchStage { + LAUNCH_STAGE_UNSPECIFIED = 0, + UNIMPLEMENTED = 6, + PRELAUNCH = 7, + EARLY_ACCESS = 1, + ALPHA = 2, + BETA = 3, + GA = 4, + DEPRECATED = 5 + } + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7, + IDENTIFIER = 8 + } + + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { + + /** ResourceDescriptor type */ + type?: (string|null); + + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); + } + + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { + + /** + * Constructs a new ResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceDescriptor); + + /** ResourceDescriptor type. */ + public type: string; + + /** ResourceDescriptor pattern. */ + public pattern: string[]; + + /** ResourceDescriptor nameField. */ + public nameField: string; + + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceDescriptor instance + */ + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; + + /** + * Verifies a ResourceDescriptor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @param message ResourceDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } + } + + /** Properties of a ResourceReference. */ + interface IResourceReference { + + /** ResourceReference type */ + type?: (string|null); + + /** ResourceReference childType */ + childType?: (string|null); + } + + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { + + /** + * Constructs a new ResourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceReference); + + /** ResourceReference type. */ + public type: string; + + /** ResourceReference childType. */ + public childType: string; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceReference instance + */ + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; + + /** + * Verifies a ResourceReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceReference + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @param message ResourceReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { + + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } + + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { + + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); + + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorSet instance + */ + public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; + + /** + * Verifies a FileDescriptorSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @param message FileDescriptorSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Edition enum. */ + enum Edition { + EDITION_UNKNOWN = 0, + EDITION_PROTO2 = 998, + EDITION_PROTO3 = 999, + EDITION_2023 = 1000, + EDITION_2024 = 1001, + EDITION_1_TEST_ONLY = 1, + EDITION_2_TEST_ONLY = 2, + EDITION_99997_TEST_ONLY = 99997, + EDITION_99998_TEST_ONLY = 99998, + EDITION_99999_TEST_ONLY = 99999, + EDITION_MAX = 2147483647 + } + + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { + + /** FileDescriptorProto name */ + name?: (string|null); + + /** FileDescriptorProto package */ + "package"?: (string|null); + + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); + + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); + + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); + + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); + + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); + + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax */ + syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { + + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); + + /** FileDescriptorProto name. */ + public name: string; + + /** FileDescriptorProto package. */ + public package: string; + + /** FileDescriptorProto dependency. */ + public dependency: string[]; + + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; + + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; + + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; + + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; + + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax. */ + public syntax: string; + + /** FileDescriptorProto edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; + + /** + * Verifies a FileDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @param message FileDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { + + /** DescriptorProto name */ + name?: (string|null); + + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); + + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { + + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); + + /** DescriptorProto name. */ + public name: string; + + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; + + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + + /** DescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DescriptorProto instance + */ + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; + + /** + * Verifies a DescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @param message DescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DescriptorProto { + + /** Properties of an ExtensionRange. */ + interface IExtensionRange { + + /** ExtensionRange start */ + start?: (number|null); + + /** ExtensionRange end */ + end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } + + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { + + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + + /** ExtensionRange start. */ + public start: number; + + /** ExtensionRange end. */ + public end: number; + + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Verifies an ExtensionRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @param message ExtensionRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReservedRange. */ + interface IReservedRange { + + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); + } + + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { + + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + + /** ReservedRange start. */ + public start: number; + + /** ReservedRange end. */ + public end: number; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservedRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Verifies a ReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @param message ReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ExtensionRangeOptions declaration */ + declaration?: (google.protobuf.ExtensionRangeOptions.IDeclaration[]|null); + + /** ExtensionRangeOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification */ + verification?: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState|null); + } + + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { + + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); + + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** ExtensionRangeOptions declaration. */ + public declaration: google.protobuf.ExtensionRangeOptions.IDeclaration[]; + + /** ExtensionRangeOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification. */ + public verification: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState); + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRangeOptions instance + */ + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; + + /** + * Verifies an ExtensionRangeOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRangeOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @param message ExtensionRangeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExtensionRangeOptions { + + /** Properties of a Declaration. */ + interface IDeclaration { + + /** Declaration number */ + number?: (number|null); + + /** Declaration fullName */ + fullName?: (string|null); + + /** Declaration type */ + type?: (string|null); + + /** Declaration reserved */ + reserved?: (boolean|null); + + /** Declaration repeated */ + repeated?: (boolean|null); + } + + /** Represents a Declaration. */ + class Declaration implements IDeclaration { + + /** + * Constructs a new Declaration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration); + + /** Declaration number. */ + public number: number; + + /** Declaration fullName. */ + public fullName: string; + + /** Declaration type. */ + public type: string; + + /** Declaration reserved. */ + public reserved: boolean; + + /** Declaration repeated. */ + public repeated: boolean; + + /** + * Creates a new Declaration instance using the specified properties. + * @param [properties] Properties to set + * @returns Declaration instance + */ + public static create(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Verifies a Declaration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Declaration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @param message Declaration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions.Declaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Declaration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Declaration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** VerificationState enum. */ + enum VerificationState { + DECLARATION = 0, + UNVERIFIED = 1 + } + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldDescriptorProto { + + /** Type enum. */ + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } + + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REPEATED = 3, + LABEL_REQUIRED = 2 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Verifies an EnumReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; + + /** + * Verifies an EnumValueDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; + + /** + * Verifies a ServiceDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; + + /** + * Verifies a MethodDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions deprecated */ + deprecated?: (boolean|null); + + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); + + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); + + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); + + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); + + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); + + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); + + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); + + /** FileOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); + } + + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { + + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); + + /** FileOptions javaPackage. */ + public javaPackage: string; + + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; + + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; + + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions deprecated. */ + public deprecated: boolean; + + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; + + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; + + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; + + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; + + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; + + /** FileOptions phpNamespace. */ + public phpNamespace: string; + + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; + + /** FileOptions rubyPackage. */ + public rubyPackage: string; + + /** FileOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FileOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOptions instance + */ + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; + + /** + * Verifies a FileOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @param message FileOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FileOptions { + + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } + + /** Properties of a MessageOptions. */ + interface IMessageOptions { + + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); + + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); + + /** MessageOptions deprecated */ + deprecated?: (boolean|null); + + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); + + /** MessageOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** MessageOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); + } + + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { + + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); + + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** MessageOptions mapEntry. */ + public mapEntry: boolean; + + /** MessageOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** MessageOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageOptions instance + */ + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; + + /** + * Verifies a MessageOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @param message MessageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MessageOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldOptions. */ + interface IFieldOptions { + + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + + /** FieldOptions lazy */ + lazy?: (boolean|null); + + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions debugRedact */ + debugRedact?: (boolean|null); + + /** FieldOptions retention */ + retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); + + /** FieldOptions targets */ + targets?: (google.protobuf.FieldOptions.OptionTargetType[]|null); + + /** FieldOptions editionDefaults */ + editionDefaults?: (google.protobuf.FieldOptions.IEditionDefault[]|null); + + /** FieldOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions debugRedact. */ + public debugRedact: boolean; + + /** FieldOptions retention. */ + public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); + + /** FieldOptions targets. */ + public targets: google.protobuf.FieldOptions.OptionTargetType[]; + + /** FieldOptions editionDefaults. */ + public editionDefaults: google.protobuf.FieldOptions.IEditionDefault[]; + + /** FieldOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldOptions instance + */ + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; + + /** + * Verifies a FieldOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @param message FieldOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + + /** OptionRetention enum. */ + enum OptionRetention { + RETENTION_UNKNOWN = 0, + RETENTION_RUNTIME = 1, + RETENTION_SOURCE = 2 + } + + /** OptionTargetType enum. */ + enum OptionTargetType { + TARGET_TYPE_UNKNOWN = 0, + TARGET_TYPE_FILE = 1, + TARGET_TYPE_EXTENSION_RANGE = 2, + TARGET_TYPE_MESSAGE = 3, + TARGET_TYPE_FIELD = 4, + TARGET_TYPE_ONEOF = 5, + TARGET_TYPE_ENUM = 6, + TARGET_TYPE_ENUM_ENTRY = 7, + TARGET_TYPE_SERVICE = 8, + TARGET_TYPE_METHOD = 9 + } + + /** Properties of an EditionDefault. */ + interface IEditionDefault { + + /** EditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** EditionDefault value */ + value?: (string|null); + } + + /** Represents an EditionDefault. */ + class EditionDefault implements IEditionDefault { + + /** + * Constructs a new EditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IEditionDefault); + + /** EditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** EditionDefault value. */ + public value: string; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns EditionDefault instance + */ + public static create(properties?: google.protobuf.FieldOptions.IEditionDefault): google.protobuf.FieldOptions.EditionDefault; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.EditionDefault; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.EditionDefault; + + /** + * Verifies an EditionDefault message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.EditionDefault; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @param message EditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.EditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { + + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); + + /** OneofOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofOptions instance + */ + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; + + /** + * Verifies an OneofOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @param message OneofOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** EnumOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { + + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); + + /** EnumOptions allowAlias. */ + public allowAlias: boolean; + + /** EnumOptions deprecated. */ + public deprecated: boolean; + + /** EnumOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** EnumOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; + + /** + * Verifies an EnumOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact */ + debugRedact?: (boolean|null); + + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { + + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); + + /** EnumValueOptions deprecated. */ + public deprecated: boolean; + + /** EnumValueOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact. */ + public debugRedact: boolean; + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; + + /** + * Verifies an EnumValueOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + + /** ServiceOptions .google.api.apiVersion */ + ".google.api.apiVersion"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|Buffer|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|Buffer|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a FeatureSet. */ + interface IFeatureSet { + + /** FeatureSet fieldPresence */ + fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); + + /** FeatureSet enumType */ + enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); + + /** FeatureSet repeatedFieldEncoding */ + repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); + + /** FeatureSet utf8Validation */ + utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); + + /** FeatureSet messageEncoding */ + messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); + + /** FeatureSet jsonFormat */ + jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); + } + + /** Represents a FeatureSet. */ + class FeatureSet implements IFeatureSet { + + /** + * Constructs a new FeatureSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSet); + + /** FeatureSet fieldPresence. */ + public fieldPresence: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence); + + /** FeatureSet enumType. */ + public enumType: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType); + + /** FeatureSet repeatedFieldEncoding. */ + public repeatedFieldEncoding: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding); + + /** FeatureSet utf8Validation. */ + public utf8Validation: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation); + + /** FeatureSet messageEncoding. */ + public messageEncoding: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding); + + /** FeatureSet jsonFormat. */ + public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); + + /** + * Creates a new FeatureSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSet instance + */ + public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet; + + /** + * Verifies a FeatureSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @param message FeatureSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSet { + + /** FieldPresence enum. */ + enum FieldPresence { + FIELD_PRESENCE_UNKNOWN = 0, + EXPLICIT = 1, + IMPLICIT = 2, + LEGACY_REQUIRED = 3 + } + + /** EnumType enum. */ + enum EnumType { + ENUM_TYPE_UNKNOWN = 0, + OPEN = 1, + CLOSED = 2 + } + + /** RepeatedFieldEncoding enum. */ + enum RepeatedFieldEncoding { + REPEATED_FIELD_ENCODING_UNKNOWN = 0, + PACKED = 1, + EXPANDED = 2 + } + + /** Utf8Validation enum. */ + enum Utf8Validation { + UTF8_VALIDATION_UNKNOWN = 0, + VERIFY = 2, + NONE = 3 + } + + /** MessageEncoding enum. */ + enum MessageEncoding { + MESSAGE_ENCODING_UNKNOWN = 0, + LENGTH_PREFIXED = 1, + DELIMITED = 2 + } + + /** JsonFormat enum. */ + enum JsonFormat { + JSON_FORMAT_UNKNOWN = 0, + ALLOW = 1, + LEGACY_BEST_EFFORT = 2 + } + } + + /** Properties of a FeatureSetDefaults. */ + interface IFeatureSetDefaults { + + /** FeatureSetDefaults defaults */ + defaults?: (google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]|null); + + /** FeatureSetDefaults minimumEdition */ + minimumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetDefaults maximumEdition */ + maximumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSetDefaults. */ + class FeatureSetDefaults implements IFeatureSetDefaults { + + /** + * Constructs a new FeatureSetDefaults. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSetDefaults); + + /** FeatureSetDefaults defaults. */ + public defaults: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]; + + /** FeatureSetDefaults minimumEdition. */ + public minimumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetDefaults maximumEdition. */ + public maximumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetDefaults instance + */ + public static create(properties?: google.protobuf.IFeatureSetDefaults): google.protobuf.FeatureSetDefaults; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults; + + /** + * Verifies a FeatureSetDefaults message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetDefaults + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @param message FeatureSetDefaults + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetDefaults + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSetDefaults { + + /** Properties of a FeatureSetEditionDefault. */ + interface IFeatureSetEditionDefault { + + /** FeatureSetEditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetEditionDefault features */ + features?: (google.protobuf.IFeatureSet|null); + } + + /** Represents a FeatureSetEditionDefault. */ + class FeatureSetEditionDefault implements IFeatureSetEditionDefault { + + /** + * Constructs a new FeatureSetEditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault); + + /** FeatureSetEditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetEditionDefault features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetEditionDefault instance + */ + public static create(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Verifies a FeatureSetEditionDefault message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetEditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @param message FeatureSetEditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } + } + } + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long|string); + + /** Duration nanos. */ + public nanos: number; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; + + /** + * Verifies a Duration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Duration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|Buffer|string|null); + } + + /** Represents an Any. */ + class Any implements IAny { + + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); + + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: (Uint8Array|Buffer|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; + + /** + * Verifies an Any message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); + + /** + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance + */ + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; + + /** + * Verifies an Empty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Empty + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Empty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** DoubleValue value */ + value?: (number|null); + } + + /** Represents a DoubleValue. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDoubleValue); + + /** DoubleValue value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param message DoubleValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param message DoubleValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DoubleValue; + + /** + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DoubleValue; + + /** + * Verifies a DoubleValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DoubleValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DoubleValue; + + /** + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @param message DoubleValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DoubleValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DoubleValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** FloatValue value */ + value?: (number|null); + } + + /** Represents a FloatValue. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFloatValue); + + /** FloatValue value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param message FloatValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param message FloatValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FloatValue; + + /** + * Decodes a FloatValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FloatValue; + + /** + * Verifies a FloatValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FloatValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FloatValue; + + /** + * Creates a plain object from a FloatValue message. Also converts values to other types if specified. + * @param message FloatValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FloatValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FloatValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** Int64Value value */ + value?: (number|Long|string|null); + } + + /** Represents an Int64Value. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IInt64Value); + + /** Int64Value value. */ + public value: (number|Long|string); + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param message Int64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param message Int64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int64Value; + + /** + * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int64Value; + + /** + * Verifies an Int64Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Int64Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Int64Value; + + /** + * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * @param message Int64Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Int64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Int64Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** UInt64Value value */ + value?: (number|Long|string|null); + } + + /** Represents a UInt64Value. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUInt64Value); + + /** UInt64Value value. */ + public value: (number|Long|string); + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param message UInt64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param message UInt64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt64Value; + + /** + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt64Value; + + /** + * Verifies a UInt64Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UInt64Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UInt64Value; + + /** + * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. + * @param message UInt64Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UInt64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UInt64Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** Int32Value value */ + value?: (number|null); + } + + /** Represents an Int32Value. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IInt32Value); + + /** Int32Value value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param message Int32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param message Int32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int32Value; + + /** + * Decodes an Int32Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int32Value; + + /** + * Verifies an Int32Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Int32Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Int32Value; + + /** + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. + * @param message Int32Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Int32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Int32Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** UInt32Value value */ + value?: (number|null); + } + + /** Represents a UInt32Value. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUInt32Value); + + /** UInt32Value value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param message UInt32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param message UInt32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt32Value; + + /** + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt32Value; + + /** + * Verifies a UInt32Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UInt32Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UInt32Value; + + /** + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. + * @param message UInt32Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UInt32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UInt32Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** BoolValue value */ + value?: (boolean|null); + } + + /** Represents a BoolValue. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IBoolValue); + + /** BoolValue value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param message BoolValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param message BoolValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BoolValue; + + /** + * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BoolValue; + + /** + * Verifies a BoolValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoolValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.BoolValue; + + /** + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * @param message BoolValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.BoolValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoolValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** StringValue value */ + value?: (string|null); + } + + /** Represents a StringValue. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IStringValue); + + /** StringValue value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param message StringValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param message StringValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.StringValue; + + /** + * Decodes a StringValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.StringValue; + + /** + * Verifies a StringValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StringValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StringValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.StringValue; + + /** + * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * @param message StringValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.StringValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StringValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** BytesValue value */ + value?: (Uint8Array|Buffer|string|null); + } + + /** Represents a BytesValue. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IBytesValue); + + /** BytesValue value. */ + public value: (Uint8Array|Buffer|string); + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param message BytesValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param message BytesValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BytesValue; + + /** + * Decodes a BytesValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BytesValue; + + /** + * Verifies a BytesValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BytesValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.BytesValue; + + /** + * Creates a plain object from a BytesValue message. Also converts values to other types if specified. + * @param message BytesValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.BytesValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BytesValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldMask. */ + interface IFieldMask { + + /** FieldMask paths */ + paths?: (string[]|null); + } + + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { + + /** + * Constructs a new FieldMask. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldMask); + + /** FieldMask paths. */ + public paths: string[]; + + /** + * Creates a new FieldMask instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldMask instance + */ + public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; + + /** + * Verifies a FieldMask message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldMask + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @param message FieldMask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldMask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldMask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace longrunning. */ + namespace longrunning { + + /** Represents an Operations */ + class Operations extends $protobuf.rpc.Service { + + /** + * Constructs a new Operations service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Operations service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Operations; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOperationsResponse + */ + public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @returns Promise + */ + public listOperations(request: google.longrunning.IListOperationsRequest): Promise; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @returns Promise + */ + public getOperation(request: google.longrunning.IGetOperationRequest): Promise; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @returns Promise + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @returns Promise + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @returns Promise + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; + } + + namespace Operations { + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @param error Error, if any + * @param [response] ListOperationsResponse + */ + type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Operation. */ + interface IOperation { + + /** Operation name */ + name?: (string|null); + + /** Operation metadata */ + metadata?: (google.protobuf.IAny|null); + + /** Operation done */ + done?: (boolean|null); + + /** Operation error */ + error?: (google.rpc.IStatus|null); + + /** Operation response */ + response?: (google.protobuf.IAny|null); + } + + /** Represents an Operation. */ + class Operation implements IOperation { + + /** + * Constructs a new Operation. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperation); + + /** Operation name. */ + public name: string; + + /** Operation metadata. */ + public metadata?: (google.protobuf.IAny|null); + + /** Operation done. */ + public done: boolean; + + /** Operation error. */ + public error?: (google.rpc.IStatus|null); + + /** Operation response. */ + public response?: (google.protobuf.IAny|null); + + /** Operation result. */ + public result?: ("error"|"response"); + + /** + * Creates a new Operation instance using the specified properties. + * @param [properties] Properties to set + * @returns Operation instance + */ + public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.Operation; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.Operation; + + /** + * Verifies an Operation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Operation + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @param message Operation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Operation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Operation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetOperationRequest. */ + interface IGetOperationRequest { + + /** GetOperationRequest name */ + name?: (string|null); + } + + /** Represents a GetOperationRequest. */ + class GetOperationRequest implements IGetOperationRequest { + + /** + * Constructs a new GetOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IGetOperationRequest); + + /** GetOperationRequest name. */ + public name: string; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOperationRequest instance + */ + public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.GetOperationRequest; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.GetOperationRequest; + + /** + * Verifies a GetOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @param message GetOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsRequest. */ + interface IListOperationsRequest { + + /** ListOperationsRequest name */ + name?: (string|null); + + /** ListOperationsRequest filter */ + filter?: (string|null); + + /** ListOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOperationsRequest. */ + class ListOperationsRequest implements IListOperationsRequest { + + /** + * Constructs a new ListOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsRequest); + + /** ListOperationsRequest name. */ + public name: string; + + /** ListOperationsRequest filter. */ + public filter: string; + + /** ListOperationsRequest pageSize. */ + public pageSize: number; + + /** ListOperationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsRequest instance + */ + public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsRequest; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsRequest; + + /** + * Verifies a ListOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @param message ListOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsResponse. */ + interface IListOperationsResponse { + + /** ListOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOperationsResponse. */ + class ListOperationsResponse implements IListOperationsResponse { + + /** + * Constructs a new ListOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsResponse); + + /** ListOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsResponse instance + */ + public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsResponse; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsResponse; + + /** + * Verifies a ListOperationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @param message ListOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelOperationRequest. */ + interface ICancelOperationRequest { + + /** CancelOperationRequest name */ + name?: (string|null); + } + + /** Represents a CancelOperationRequest. */ + class CancelOperationRequest implements ICancelOperationRequest { + + /** + * Constructs a new CancelOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.ICancelOperationRequest); + + /** CancelOperationRequest name. */ + public name: string; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelOperationRequest instance + */ + public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.CancelOperationRequest; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.CancelOperationRequest; + + /** + * Verifies a CancelOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @param message CancelOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteOperationRequest. */ + interface IDeleteOperationRequest { + + /** DeleteOperationRequest name */ + name?: (string|null); + } + + /** Represents a DeleteOperationRequest. */ + class DeleteOperationRequest implements IDeleteOperationRequest { + + /** + * Constructs a new DeleteOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IDeleteOperationRequest); + + /** DeleteOperationRequest name. */ + public name: string; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOperationRequest instance + */ + public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.DeleteOperationRequest; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.DeleteOperationRequest; + + /** + * Verifies a DeleteOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @param message DeleteOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WaitOperationRequest. */ + interface IWaitOperationRequest { + + /** WaitOperationRequest name */ + name?: (string|null); + + /** WaitOperationRequest timeout */ + timeout?: (google.protobuf.IDuration|null); + } + + /** Represents a WaitOperationRequest. */ + class WaitOperationRequest implements IWaitOperationRequest { + + /** + * Constructs a new WaitOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IWaitOperationRequest); + + /** WaitOperationRequest name. */ + public name: string; + + /** WaitOperationRequest timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WaitOperationRequest instance + */ + public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.WaitOperationRequest; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.WaitOperationRequest; + + /** + * Verifies a WaitOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WaitOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @param message WaitOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WaitOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WaitOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationInfo. */ + interface IOperationInfo { + + /** OperationInfo responseType */ + responseType?: (string|null); + + /** OperationInfo metadataType */ + metadataType?: (string|null); + } + + /** Represents an OperationInfo. */ + class OperationInfo implements IOperationInfo { + + /** + * Constructs a new OperationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperationInfo); + + /** OperationInfo responseType. */ + public responseType: string; + + /** OperationInfo metadataType. */ + public metadataType: string; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationInfo instance + */ + public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.OperationInfo; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.OperationInfo; + + /** + * Verifies an OperationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationInfo + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @param message OperationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; + + /** + * Verifies a Status message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/protos/protos.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/protos/protos.js new file mode 100644 index 00000000000..5a027864748 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/protos/protos.js @@ -0,0 +1,35287 @@ +// 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. + +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +(function(global, factory) { /* global define, require, module */ + + /* AMD */ if (typeof define === 'function' && define.amd) + define(["protobufjs/minimal"], factory); + + /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) + module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal); + +})(this, function($protobuf) { + "use strict"; + + // Common aliases + var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + + // Exported root namespace + var $root = $protobuf.roots._google_cloud_speech_protos || ($protobuf.roots._google_cloud_speech_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.speech = (function() { + + /** + * Namespace speech. + * @memberof google.cloud + * @namespace + */ + var speech = {}; + + speech.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.speech + * @namespace + */ + var v1 = {}; + + v1.Speech = (function() { + + /** + * Constructs a new Speech service. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a Speech + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Speech(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Speech.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Speech; + + /** + * Creates new Speech service using the specified rpc implementation. + * @function create + * @memberof google.cloud.speech.v1.Speech + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Speech} RPC service. Useful where requests and/or responses are streamed. + */ + Speech.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.speech.v1.Speech|recognize}. + * @memberof google.cloud.speech.v1.Speech + * @typedef RecognizeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.speech.v1.RecognizeResponse} [response] RecognizeResponse + */ + + /** + * Calls Recognize. + * @function recognize + * @memberof google.cloud.speech.v1.Speech + * @instance + * @param {google.cloud.speech.v1.IRecognizeRequest} request RecognizeRequest message or plain object + * @param {google.cloud.speech.v1.Speech.RecognizeCallback} callback Node-style callback called with the error, if any, and RecognizeResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Speech.prototype.recognize = function recognize(request, callback) { + return this.rpcCall(recognize, $root.google.cloud.speech.v1.RecognizeRequest, $root.google.cloud.speech.v1.RecognizeResponse, request, callback); + }, "name", { value: "Recognize" }); + + /** + * Calls Recognize. + * @function recognize + * @memberof google.cloud.speech.v1.Speech + * @instance + * @param {google.cloud.speech.v1.IRecognizeRequest} request RecognizeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.speech.v1.Speech|longRunningRecognize}. + * @memberof google.cloud.speech.v1.Speech + * @typedef LongRunningRecognizeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls LongRunningRecognize. + * @function longRunningRecognize + * @memberof google.cloud.speech.v1.Speech + * @instance + * @param {google.cloud.speech.v1.ILongRunningRecognizeRequest} request LongRunningRecognizeRequest message or plain object + * @param {google.cloud.speech.v1.Speech.LongRunningRecognizeCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Speech.prototype.longRunningRecognize = function longRunningRecognize(request, callback) { + return this.rpcCall(longRunningRecognize, $root.google.cloud.speech.v1.LongRunningRecognizeRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "LongRunningRecognize" }); + + /** + * Calls LongRunningRecognize. + * @function longRunningRecognize + * @memberof google.cloud.speech.v1.Speech + * @instance + * @param {google.cloud.speech.v1.ILongRunningRecognizeRequest} request LongRunningRecognizeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.speech.v1.Speech|streamingRecognize}. + * @memberof google.cloud.speech.v1.Speech + * @typedef StreamingRecognizeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.speech.v1.StreamingRecognizeResponse} [response] StreamingRecognizeResponse + */ + + /** + * Calls StreamingRecognize. + * @function streamingRecognize + * @memberof google.cloud.speech.v1.Speech + * @instance + * @param {google.cloud.speech.v1.IStreamingRecognizeRequest} request StreamingRecognizeRequest message or plain object + * @param {google.cloud.speech.v1.Speech.StreamingRecognizeCallback} callback Node-style callback called with the error, if any, and StreamingRecognizeResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Speech.prototype.streamingRecognize = function streamingRecognize(request, callback) { + return this.rpcCall(streamingRecognize, $root.google.cloud.speech.v1.StreamingRecognizeRequest, $root.google.cloud.speech.v1.StreamingRecognizeResponse, request, callback); + }, "name", { value: "StreamingRecognize" }); + + /** + * Calls StreamingRecognize. + * @function streamingRecognize + * @memberof google.cloud.speech.v1.Speech + * @instance + * @param {google.cloud.speech.v1.IStreamingRecognizeRequest} request StreamingRecognizeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Speech; + })(); + + v1.RecognizeRequest = (function() { + + /** + * Properties of a RecognizeRequest. + * @memberof google.cloud.speech.v1 + * @interface IRecognizeRequest + * @property {google.cloud.speech.v1.IRecognitionConfig|null} [config] RecognizeRequest config + * @property {google.cloud.speech.v1.IRecognitionAudio|null} [audio] RecognizeRequest audio + */ + + /** + * Constructs a new RecognizeRequest. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a RecognizeRequest. + * @implements IRecognizeRequest + * @constructor + * @param {google.cloud.speech.v1.IRecognizeRequest=} [properties] Properties to set + */ + function RecognizeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RecognizeRequest config. + * @member {google.cloud.speech.v1.IRecognitionConfig|null|undefined} config + * @memberof google.cloud.speech.v1.RecognizeRequest + * @instance + */ + RecognizeRequest.prototype.config = null; + + /** + * RecognizeRequest audio. + * @member {google.cloud.speech.v1.IRecognitionAudio|null|undefined} audio + * @memberof google.cloud.speech.v1.RecognizeRequest + * @instance + */ + RecognizeRequest.prototype.audio = null; + + /** + * Creates a new RecognizeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.RecognizeRequest + * @static + * @param {google.cloud.speech.v1.IRecognizeRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v1.RecognizeRequest} RecognizeRequest instance + */ + RecognizeRequest.create = function create(properties) { + return new RecognizeRequest(properties); + }; + + /** + * Encodes the specified RecognizeRequest message. Does not implicitly {@link google.cloud.speech.v1.RecognizeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.RecognizeRequest + * @static + * @param {google.cloud.speech.v1.IRecognizeRequest} message RecognizeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecognizeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.cloud.speech.v1.RecognitionConfig.encode(message.config, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.audio != null && Object.hasOwnProperty.call(message, "audio")) + $root.google.cloud.speech.v1.RecognitionAudio.encode(message.audio, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RecognizeRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.RecognizeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.RecognizeRequest + * @static + * @param {google.cloud.speech.v1.IRecognizeRequest} message RecognizeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecognizeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RecognizeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.RecognizeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.RecognizeRequest} RecognizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecognizeRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.RecognizeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.config = $root.google.cloud.speech.v1.RecognitionConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.audio = $root.google.cloud.speech.v1.RecognitionAudio.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RecognizeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.RecognizeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.RecognizeRequest} RecognizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecognizeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RecognizeRequest message. + * @function verify + * @memberof google.cloud.speech.v1.RecognizeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RecognizeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.config != null && message.hasOwnProperty("config")) { + var error = $root.google.cloud.speech.v1.RecognitionConfig.verify(message.config); + if (error) + return "config." + error; + } + if (message.audio != null && message.hasOwnProperty("audio")) { + var error = $root.google.cloud.speech.v1.RecognitionAudio.verify(message.audio); + if (error) + return "audio." + error; + } + return null; + }; + + /** + * Creates a RecognizeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.RecognizeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.RecognizeRequest} RecognizeRequest + */ + RecognizeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.RecognizeRequest) + return object; + var message = new $root.google.cloud.speech.v1.RecognizeRequest(); + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.cloud.speech.v1.RecognizeRequest.config: object expected"); + message.config = $root.google.cloud.speech.v1.RecognitionConfig.fromObject(object.config); + } + if (object.audio != null) { + if (typeof object.audio !== "object") + throw TypeError(".google.cloud.speech.v1.RecognizeRequest.audio: object expected"); + message.audio = $root.google.cloud.speech.v1.RecognitionAudio.fromObject(object.audio); + } + return message; + }; + + /** + * Creates a plain object from a RecognizeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.RecognizeRequest + * @static + * @param {google.cloud.speech.v1.RecognizeRequest} message RecognizeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RecognizeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.config = null; + object.audio = null; + } + if (message.config != null && message.hasOwnProperty("config")) + object.config = $root.google.cloud.speech.v1.RecognitionConfig.toObject(message.config, options); + if (message.audio != null && message.hasOwnProperty("audio")) + object.audio = $root.google.cloud.speech.v1.RecognitionAudio.toObject(message.audio, options); + return object; + }; + + /** + * Converts this RecognizeRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.RecognizeRequest + * @instance + * @returns {Object.} JSON object + */ + RecognizeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RecognizeRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v1.RecognizeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RecognizeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.RecognizeRequest"; + }; + + return RecognizeRequest; + })(); + + v1.LongRunningRecognizeRequest = (function() { + + /** + * Properties of a LongRunningRecognizeRequest. + * @memberof google.cloud.speech.v1 + * @interface ILongRunningRecognizeRequest + * @property {google.cloud.speech.v1.IRecognitionConfig|null} [config] LongRunningRecognizeRequest config + * @property {google.cloud.speech.v1.IRecognitionAudio|null} [audio] LongRunningRecognizeRequest audio + * @property {google.cloud.speech.v1.ITranscriptOutputConfig|null} [outputConfig] LongRunningRecognizeRequest outputConfig + */ + + /** + * Constructs a new LongRunningRecognizeRequest. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a LongRunningRecognizeRequest. + * @implements ILongRunningRecognizeRequest + * @constructor + * @param {google.cloud.speech.v1.ILongRunningRecognizeRequest=} [properties] Properties to set + */ + function LongRunningRecognizeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LongRunningRecognizeRequest config. + * @member {google.cloud.speech.v1.IRecognitionConfig|null|undefined} config + * @memberof google.cloud.speech.v1.LongRunningRecognizeRequest + * @instance + */ + LongRunningRecognizeRequest.prototype.config = null; + + /** + * LongRunningRecognizeRequest audio. + * @member {google.cloud.speech.v1.IRecognitionAudio|null|undefined} audio + * @memberof google.cloud.speech.v1.LongRunningRecognizeRequest + * @instance + */ + LongRunningRecognizeRequest.prototype.audio = null; + + /** + * LongRunningRecognizeRequest outputConfig. + * @member {google.cloud.speech.v1.ITranscriptOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.speech.v1.LongRunningRecognizeRequest + * @instance + */ + LongRunningRecognizeRequest.prototype.outputConfig = null; + + /** + * Creates a new LongRunningRecognizeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.LongRunningRecognizeRequest + * @static + * @param {google.cloud.speech.v1.ILongRunningRecognizeRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v1.LongRunningRecognizeRequest} LongRunningRecognizeRequest instance + */ + LongRunningRecognizeRequest.create = function create(properties) { + return new LongRunningRecognizeRequest(properties); + }; + + /** + * Encodes the specified LongRunningRecognizeRequest message. Does not implicitly {@link google.cloud.speech.v1.LongRunningRecognizeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.LongRunningRecognizeRequest + * @static + * @param {google.cloud.speech.v1.ILongRunningRecognizeRequest} message LongRunningRecognizeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunningRecognizeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.cloud.speech.v1.RecognitionConfig.encode(message.config, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.audio != null && Object.hasOwnProperty.call(message, "audio")) + $root.google.cloud.speech.v1.RecognitionAudio.encode(message.audio, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) + $root.google.cloud.speech.v1.TranscriptOutputConfig.encode(message.outputConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LongRunningRecognizeRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.LongRunningRecognizeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.LongRunningRecognizeRequest + * @static + * @param {google.cloud.speech.v1.ILongRunningRecognizeRequest} message LongRunningRecognizeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunningRecognizeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LongRunningRecognizeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.LongRunningRecognizeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.LongRunningRecognizeRequest} LongRunningRecognizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunningRecognizeRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.LongRunningRecognizeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.config = $root.google.cloud.speech.v1.RecognitionConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.audio = $root.google.cloud.speech.v1.RecognitionAudio.decode(reader, reader.uint32()); + break; + } + case 4: { + message.outputConfig = $root.google.cloud.speech.v1.TranscriptOutputConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LongRunningRecognizeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.LongRunningRecognizeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.LongRunningRecognizeRequest} LongRunningRecognizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunningRecognizeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LongRunningRecognizeRequest message. + * @function verify + * @memberof google.cloud.speech.v1.LongRunningRecognizeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LongRunningRecognizeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.config != null && message.hasOwnProperty("config")) { + var error = $root.google.cloud.speech.v1.RecognitionConfig.verify(message.config); + if (error) + return "config." + error; + } + if (message.audio != null && message.hasOwnProperty("audio")) { + var error = $root.google.cloud.speech.v1.RecognitionAudio.verify(message.audio); + if (error) + return "audio." + error; + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.speech.v1.TranscriptOutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + return null; + }; + + /** + * Creates a LongRunningRecognizeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.LongRunningRecognizeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.LongRunningRecognizeRequest} LongRunningRecognizeRequest + */ + LongRunningRecognizeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.LongRunningRecognizeRequest) + return object; + var message = new $root.google.cloud.speech.v1.LongRunningRecognizeRequest(); + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.cloud.speech.v1.LongRunningRecognizeRequest.config: object expected"); + message.config = $root.google.cloud.speech.v1.RecognitionConfig.fromObject(object.config); + } + if (object.audio != null) { + if (typeof object.audio !== "object") + throw TypeError(".google.cloud.speech.v1.LongRunningRecognizeRequest.audio: object expected"); + message.audio = $root.google.cloud.speech.v1.RecognitionAudio.fromObject(object.audio); + } + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.speech.v1.LongRunningRecognizeRequest.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.speech.v1.TranscriptOutputConfig.fromObject(object.outputConfig); + } + return message; + }; + + /** + * Creates a plain object from a LongRunningRecognizeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.LongRunningRecognizeRequest + * @static + * @param {google.cloud.speech.v1.LongRunningRecognizeRequest} message LongRunningRecognizeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LongRunningRecognizeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.config = null; + object.audio = null; + object.outputConfig = null; + } + if (message.config != null && message.hasOwnProperty("config")) + object.config = $root.google.cloud.speech.v1.RecognitionConfig.toObject(message.config, options); + if (message.audio != null && message.hasOwnProperty("audio")) + object.audio = $root.google.cloud.speech.v1.RecognitionAudio.toObject(message.audio, options); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.speech.v1.TranscriptOutputConfig.toObject(message.outputConfig, options); + return object; + }; + + /** + * Converts this LongRunningRecognizeRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.LongRunningRecognizeRequest + * @instance + * @returns {Object.} JSON object + */ + LongRunningRecognizeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LongRunningRecognizeRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v1.LongRunningRecognizeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LongRunningRecognizeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.LongRunningRecognizeRequest"; + }; + + return LongRunningRecognizeRequest; + })(); + + v1.TranscriptOutputConfig = (function() { + + /** + * Properties of a TranscriptOutputConfig. + * @memberof google.cloud.speech.v1 + * @interface ITranscriptOutputConfig + * @property {string|null} [gcsUri] TranscriptOutputConfig gcsUri + */ + + /** + * Constructs a new TranscriptOutputConfig. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a TranscriptOutputConfig. + * @implements ITranscriptOutputConfig + * @constructor + * @param {google.cloud.speech.v1.ITranscriptOutputConfig=} [properties] Properties to set + */ + function TranscriptOutputConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TranscriptOutputConfig gcsUri. + * @member {string|null|undefined} gcsUri + * @memberof google.cloud.speech.v1.TranscriptOutputConfig + * @instance + */ + TranscriptOutputConfig.prototype.gcsUri = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TranscriptOutputConfig outputType. + * @member {"gcsUri"|undefined} outputType + * @memberof google.cloud.speech.v1.TranscriptOutputConfig + * @instance + */ + Object.defineProperty(TranscriptOutputConfig.prototype, "outputType", { + get: $util.oneOfGetter($oneOfFields = ["gcsUri"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TranscriptOutputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.TranscriptOutputConfig + * @static + * @param {google.cloud.speech.v1.ITranscriptOutputConfig=} [properties] Properties to set + * @returns {google.cloud.speech.v1.TranscriptOutputConfig} TranscriptOutputConfig instance + */ + TranscriptOutputConfig.create = function create(properties) { + return new TranscriptOutputConfig(properties); + }; + + /** + * Encodes the specified TranscriptOutputConfig message. Does not implicitly {@link google.cloud.speech.v1.TranscriptOutputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.TranscriptOutputConfig + * @static + * @param {google.cloud.speech.v1.ITranscriptOutputConfig} message TranscriptOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranscriptOutputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsUri != null && Object.hasOwnProperty.call(message, "gcsUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsUri); + return writer; + }; + + /** + * Encodes the specified TranscriptOutputConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v1.TranscriptOutputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.TranscriptOutputConfig + * @static + * @param {google.cloud.speech.v1.ITranscriptOutputConfig} message TranscriptOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranscriptOutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TranscriptOutputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.TranscriptOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.TranscriptOutputConfig} TranscriptOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranscriptOutputConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.TranscriptOutputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.gcsUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TranscriptOutputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.TranscriptOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.TranscriptOutputConfig} TranscriptOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranscriptOutputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TranscriptOutputConfig message. + * @function verify + * @memberof google.cloud.speech.v1.TranscriptOutputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TranscriptOutputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) { + properties.outputType = 1; + if (!$util.isString(message.gcsUri)) + return "gcsUri: string expected"; + } + return null; + }; + + /** + * Creates a TranscriptOutputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.TranscriptOutputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.TranscriptOutputConfig} TranscriptOutputConfig + */ + TranscriptOutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.TranscriptOutputConfig) + return object; + var message = new $root.google.cloud.speech.v1.TranscriptOutputConfig(); + if (object.gcsUri != null) + message.gcsUri = String(object.gcsUri); + return message; + }; + + /** + * Creates a plain object from a TranscriptOutputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.TranscriptOutputConfig + * @static + * @param {google.cloud.speech.v1.TranscriptOutputConfig} message TranscriptOutputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TranscriptOutputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) { + object.gcsUri = message.gcsUri; + if (options.oneofs) + object.outputType = "gcsUri"; + } + return object; + }; + + /** + * Converts this TranscriptOutputConfig to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.TranscriptOutputConfig + * @instance + * @returns {Object.} JSON object + */ + TranscriptOutputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TranscriptOutputConfig + * @function getTypeUrl + * @memberof google.cloud.speech.v1.TranscriptOutputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TranscriptOutputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.TranscriptOutputConfig"; + }; + + return TranscriptOutputConfig; + })(); + + v1.StreamingRecognizeRequest = (function() { + + /** + * Properties of a StreamingRecognizeRequest. + * @memberof google.cloud.speech.v1 + * @interface IStreamingRecognizeRequest + * @property {google.cloud.speech.v1.IStreamingRecognitionConfig|null} [streamingConfig] StreamingRecognizeRequest streamingConfig + * @property {Uint8Array|null} [audioContent] StreamingRecognizeRequest audioContent + */ + + /** + * Constructs a new StreamingRecognizeRequest. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a StreamingRecognizeRequest. + * @implements IStreamingRecognizeRequest + * @constructor + * @param {google.cloud.speech.v1.IStreamingRecognizeRequest=} [properties] Properties to set + */ + function StreamingRecognizeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamingRecognizeRequest streamingConfig. + * @member {google.cloud.speech.v1.IStreamingRecognitionConfig|null|undefined} streamingConfig + * @memberof google.cloud.speech.v1.StreamingRecognizeRequest + * @instance + */ + StreamingRecognizeRequest.prototype.streamingConfig = null; + + /** + * StreamingRecognizeRequest audioContent. + * @member {Uint8Array|null|undefined} audioContent + * @memberof google.cloud.speech.v1.StreamingRecognizeRequest + * @instance + */ + StreamingRecognizeRequest.prototype.audioContent = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * StreamingRecognizeRequest streamingRequest. + * @member {"streamingConfig"|"audioContent"|undefined} streamingRequest + * @memberof google.cloud.speech.v1.StreamingRecognizeRequest + * @instance + */ + Object.defineProperty(StreamingRecognizeRequest.prototype, "streamingRequest", { + get: $util.oneOfGetter($oneOfFields = ["streamingConfig", "audioContent"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StreamingRecognizeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.StreamingRecognizeRequest + * @static + * @param {google.cloud.speech.v1.IStreamingRecognizeRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v1.StreamingRecognizeRequest} StreamingRecognizeRequest instance + */ + StreamingRecognizeRequest.create = function create(properties) { + return new StreamingRecognizeRequest(properties); + }; + + /** + * Encodes the specified StreamingRecognizeRequest message. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognizeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.StreamingRecognizeRequest + * @static + * @param {google.cloud.speech.v1.IStreamingRecognizeRequest} message StreamingRecognizeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingRecognizeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.streamingConfig != null && Object.hasOwnProperty.call(message, "streamingConfig")) + $root.google.cloud.speech.v1.StreamingRecognitionConfig.encode(message.streamingConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.audioContent != null && Object.hasOwnProperty.call(message, "audioContent")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.audioContent); + return writer; + }; + + /** + * Encodes the specified StreamingRecognizeRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognizeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.StreamingRecognizeRequest + * @static + * @param {google.cloud.speech.v1.IStreamingRecognizeRequest} message StreamingRecognizeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingRecognizeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamingRecognizeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.StreamingRecognizeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.StreamingRecognizeRequest} StreamingRecognizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingRecognizeRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.StreamingRecognizeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.streamingConfig = $root.google.cloud.speech.v1.StreamingRecognitionConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.audioContent = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamingRecognizeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.StreamingRecognizeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.StreamingRecognizeRequest} StreamingRecognizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingRecognizeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamingRecognizeRequest message. + * @function verify + * @memberof google.cloud.speech.v1.StreamingRecognizeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingRecognizeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.streamingConfig != null && message.hasOwnProperty("streamingConfig")) { + properties.streamingRequest = 1; + { + var error = $root.google.cloud.speech.v1.StreamingRecognitionConfig.verify(message.streamingConfig); + if (error) + return "streamingConfig." + error; + } + } + if (message.audioContent != null && message.hasOwnProperty("audioContent")) { + if (properties.streamingRequest === 1) + return "streamingRequest: multiple values"; + properties.streamingRequest = 1; + if (!(message.audioContent && typeof message.audioContent.length === "number" || $util.isString(message.audioContent))) + return "audioContent: buffer expected"; + } + return null; + }; + + /** + * Creates a StreamingRecognizeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.StreamingRecognizeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.StreamingRecognizeRequest} StreamingRecognizeRequest + */ + StreamingRecognizeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.StreamingRecognizeRequest) + return object; + var message = new $root.google.cloud.speech.v1.StreamingRecognizeRequest(); + if (object.streamingConfig != null) { + if (typeof object.streamingConfig !== "object") + throw TypeError(".google.cloud.speech.v1.StreamingRecognizeRequest.streamingConfig: object expected"); + message.streamingConfig = $root.google.cloud.speech.v1.StreamingRecognitionConfig.fromObject(object.streamingConfig); + } + if (object.audioContent != null) + if (typeof object.audioContent === "string") + $util.base64.decode(object.audioContent, message.audioContent = $util.newBuffer($util.base64.length(object.audioContent)), 0); + else if (object.audioContent.length >= 0) + message.audioContent = object.audioContent; + return message; + }; + + /** + * Creates a plain object from a StreamingRecognizeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.StreamingRecognizeRequest + * @static + * @param {google.cloud.speech.v1.StreamingRecognizeRequest} message StreamingRecognizeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingRecognizeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.streamingConfig != null && message.hasOwnProperty("streamingConfig")) { + object.streamingConfig = $root.google.cloud.speech.v1.StreamingRecognitionConfig.toObject(message.streamingConfig, options); + if (options.oneofs) + object.streamingRequest = "streamingConfig"; + } + if (message.audioContent != null && message.hasOwnProperty("audioContent")) { + object.audioContent = options.bytes === String ? $util.base64.encode(message.audioContent, 0, message.audioContent.length) : options.bytes === Array ? Array.prototype.slice.call(message.audioContent) : message.audioContent; + if (options.oneofs) + object.streamingRequest = "audioContent"; + } + return object; + }; + + /** + * Converts this StreamingRecognizeRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.StreamingRecognizeRequest + * @instance + * @returns {Object.} JSON object + */ + StreamingRecognizeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamingRecognizeRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v1.StreamingRecognizeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamingRecognizeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.StreamingRecognizeRequest"; + }; + + return StreamingRecognizeRequest; + })(); + + v1.StreamingRecognitionConfig = (function() { + + /** + * Properties of a StreamingRecognitionConfig. + * @memberof google.cloud.speech.v1 + * @interface IStreamingRecognitionConfig + * @property {google.cloud.speech.v1.IRecognitionConfig|null} [config] StreamingRecognitionConfig config + * @property {boolean|null} [singleUtterance] StreamingRecognitionConfig singleUtterance + * @property {boolean|null} [interimResults] StreamingRecognitionConfig interimResults + * @property {boolean|null} [enableVoiceActivityEvents] StreamingRecognitionConfig enableVoiceActivityEvents + * @property {google.cloud.speech.v1.StreamingRecognitionConfig.IVoiceActivityTimeout|null} [voiceActivityTimeout] StreamingRecognitionConfig voiceActivityTimeout + */ + + /** + * Constructs a new StreamingRecognitionConfig. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a StreamingRecognitionConfig. + * @implements IStreamingRecognitionConfig + * @constructor + * @param {google.cloud.speech.v1.IStreamingRecognitionConfig=} [properties] Properties to set + */ + function StreamingRecognitionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamingRecognitionConfig config. + * @member {google.cloud.speech.v1.IRecognitionConfig|null|undefined} config + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig + * @instance + */ + StreamingRecognitionConfig.prototype.config = null; + + /** + * StreamingRecognitionConfig singleUtterance. + * @member {boolean} singleUtterance + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig + * @instance + */ + StreamingRecognitionConfig.prototype.singleUtterance = false; + + /** + * StreamingRecognitionConfig interimResults. + * @member {boolean} interimResults + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig + * @instance + */ + StreamingRecognitionConfig.prototype.interimResults = false; + + /** + * StreamingRecognitionConfig enableVoiceActivityEvents. + * @member {boolean} enableVoiceActivityEvents + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig + * @instance + */ + StreamingRecognitionConfig.prototype.enableVoiceActivityEvents = false; + + /** + * StreamingRecognitionConfig voiceActivityTimeout. + * @member {google.cloud.speech.v1.StreamingRecognitionConfig.IVoiceActivityTimeout|null|undefined} voiceActivityTimeout + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig + * @instance + */ + StreamingRecognitionConfig.prototype.voiceActivityTimeout = null; + + /** + * Creates a new StreamingRecognitionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig + * @static + * @param {google.cloud.speech.v1.IStreamingRecognitionConfig=} [properties] Properties to set + * @returns {google.cloud.speech.v1.StreamingRecognitionConfig} StreamingRecognitionConfig instance + */ + StreamingRecognitionConfig.create = function create(properties) { + return new StreamingRecognitionConfig(properties); + }; + + /** + * Encodes the specified StreamingRecognitionConfig message. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognitionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig + * @static + * @param {google.cloud.speech.v1.IStreamingRecognitionConfig} message StreamingRecognitionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingRecognitionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.cloud.speech.v1.RecognitionConfig.encode(message.config, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.singleUtterance != null && Object.hasOwnProperty.call(message, "singleUtterance")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.singleUtterance); + if (message.interimResults != null && Object.hasOwnProperty.call(message, "interimResults")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.interimResults); + if (message.enableVoiceActivityEvents != null && Object.hasOwnProperty.call(message, "enableVoiceActivityEvents")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.enableVoiceActivityEvents); + if (message.voiceActivityTimeout != null && Object.hasOwnProperty.call(message, "voiceActivityTimeout")) + $root.google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout.encode(message.voiceActivityTimeout, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StreamingRecognitionConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognitionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig + * @static + * @param {google.cloud.speech.v1.IStreamingRecognitionConfig} message StreamingRecognitionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingRecognitionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamingRecognitionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.StreamingRecognitionConfig} StreamingRecognitionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingRecognitionConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.StreamingRecognitionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.config = $root.google.cloud.speech.v1.RecognitionConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.singleUtterance = reader.bool(); + break; + } + case 3: { + message.interimResults = reader.bool(); + break; + } + case 5: { + message.enableVoiceActivityEvents = reader.bool(); + break; + } + case 6: { + message.voiceActivityTimeout = $root.google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamingRecognitionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.StreamingRecognitionConfig} StreamingRecognitionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingRecognitionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamingRecognitionConfig message. + * @function verify + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingRecognitionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.config != null && message.hasOwnProperty("config")) { + var error = $root.google.cloud.speech.v1.RecognitionConfig.verify(message.config); + if (error) + return "config." + error; + } + if (message.singleUtterance != null && message.hasOwnProperty("singleUtterance")) + if (typeof message.singleUtterance !== "boolean") + return "singleUtterance: boolean expected"; + if (message.interimResults != null && message.hasOwnProperty("interimResults")) + if (typeof message.interimResults !== "boolean") + return "interimResults: boolean expected"; + if (message.enableVoiceActivityEvents != null && message.hasOwnProperty("enableVoiceActivityEvents")) + if (typeof message.enableVoiceActivityEvents !== "boolean") + return "enableVoiceActivityEvents: boolean expected"; + if (message.voiceActivityTimeout != null && message.hasOwnProperty("voiceActivityTimeout")) { + var error = $root.google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout.verify(message.voiceActivityTimeout); + if (error) + return "voiceActivityTimeout." + error; + } + return null; + }; + + /** + * Creates a StreamingRecognitionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.StreamingRecognitionConfig} StreamingRecognitionConfig + */ + StreamingRecognitionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.StreamingRecognitionConfig) + return object; + var message = new $root.google.cloud.speech.v1.StreamingRecognitionConfig(); + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.cloud.speech.v1.StreamingRecognitionConfig.config: object expected"); + message.config = $root.google.cloud.speech.v1.RecognitionConfig.fromObject(object.config); + } + if (object.singleUtterance != null) + message.singleUtterance = Boolean(object.singleUtterance); + if (object.interimResults != null) + message.interimResults = Boolean(object.interimResults); + if (object.enableVoiceActivityEvents != null) + message.enableVoiceActivityEvents = Boolean(object.enableVoiceActivityEvents); + if (object.voiceActivityTimeout != null) { + if (typeof object.voiceActivityTimeout !== "object") + throw TypeError(".google.cloud.speech.v1.StreamingRecognitionConfig.voiceActivityTimeout: object expected"); + message.voiceActivityTimeout = $root.google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout.fromObject(object.voiceActivityTimeout); + } + return message; + }; + + /** + * Creates a plain object from a StreamingRecognitionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig + * @static + * @param {google.cloud.speech.v1.StreamingRecognitionConfig} message StreamingRecognitionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingRecognitionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.config = null; + object.singleUtterance = false; + object.interimResults = false; + object.enableVoiceActivityEvents = false; + object.voiceActivityTimeout = null; + } + if (message.config != null && message.hasOwnProperty("config")) + object.config = $root.google.cloud.speech.v1.RecognitionConfig.toObject(message.config, options); + if (message.singleUtterance != null && message.hasOwnProperty("singleUtterance")) + object.singleUtterance = message.singleUtterance; + if (message.interimResults != null && message.hasOwnProperty("interimResults")) + object.interimResults = message.interimResults; + if (message.enableVoiceActivityEvents != null && message.hasOwnProperty("enableVoiceActivityEvents")) + object.enableVoiceActivityEvents = message.enableVoiceActivityEvents; + if (message.voiceActivityTimeout != null && message.hasOwnProperty("voiceActivityTimeout")) + object.voiceActivityTimeout = $root.google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout.toObject(message.voiceActivityTimeout, options); + return object; + }; + + /** + * Converts this StreamingRecognitionConfig to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig + * @instance + * @returns {Object.} JSON object + */ + StreamingRecognitionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamingRecognitionConfig + * @function getTypeUrl + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamingRecognitionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.StreamingRecognitionConfig"; + }; + + StreamingRecognitionConfig.VoiceActivityTimeout = (function() { + + /** + * Properties of a VoiceActivityTimeout. + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig + * @interface IVoiceActivityTimeout + * @property {google.protobuf.IDuration|null} [speechStartTimeout] VoiceActivityTimeout speechStartTimeout + * @property {google.protobuf.IDuration|null} [speechEndTimeout] VoiceActivityTimeout speechEndTimeout + */ + + /** + * Constructs a new VoiceActivityTimeout. + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig + * @classdesc Represents a VoiceActivityTimeout. + * @implements IVoiceActivityTimeout + * @constructor + * @param {google.cloud.speech.v1.StreamingRecognitionConfig.IVoiceActivityTimeout=} [properties] Properties to set + */ + function VoiceActivityTimeout(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VoiceActivityTimeout speechStartTimeout. + * @member {google.protobuf.IDuration|null|undefined} speechStartTimeout + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout + * @instance + */ + VoiceActivityTimeout.prototype.speechStartTimeout = null; + + /** + * VoiceActivityTimeout speechEndTimeout. + * @member {google.protobuf.IDuration|null|undefined} speechEndTimeout + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout + * @instance + */ + VoiceActivityTimeout.prototype.speechEndTimeout = null; + + /** + * Creates a new VoiceActivityTimeout instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout + * @static + * @param {google.cloud.speech.v1.StreamingRecognitionConfig.IVoiceActivityTimeout=} [properties] Properties to set + * @returns {google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout} VoiceActivityTimeout instance + */ + VoiceActivityTimeout.create = function create(properties) { + return new VoiceActivityTimeout(properties); + }; + + /** + * Encodes the specified VoiceActivityTimeout message. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout + * @static + * @param {google.cloud.speech.v1.StreamingRecognitionConfig.IVoiceActivityTimeout} message VoiceActivityTimeout message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VoiceActivityTimeout.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.speechStartTimeout != null && Object.hasOwnProperty.call(message, "speechStartTimeout")) + $root.google.protobuf.Duration.encode(message.speechStartTimeout, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.speechEndTimeout != null && Object.hasOwnProperty.call(message, "speechEndTimeout")) + $root.google.protobuf.Duration.encode(message.speechEndTimeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VoiceActivityTimeout message, length delimited. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout + * @static + * @param {google.cloud.speech.v1.StreamingRecognitionConfig.IVoiceActivityTimeout} message VoiceActivityTimeout message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VoiceActivityTimeout.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VoiceActivityTimeout message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout} VoiceActivityTimeout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VoiceActivityTimeout.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.speechStartTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.speechEndTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VoiceActivityTimeout message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout} VoiceActivityTimeout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VoiceActivityTimeout.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VoiceActivityTimeout message. + * @function verify + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VoiceActivityTimeout.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.speechStartTimeout != null && message.hasOwnProperty("speechStartTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.speechStartTimeout); + if (error) + return "speechStartTimeout." + error; + } + if (message.speechEndTimeout != null && message.hasOwnProperty("speechEndTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.speechEndTimeout); + if (error) + return "speechEndTimeout." + error; + } + return null; + }; + + /** + * Creates a VoiceActivityTimeout message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout} VoiceActivityTimeout + */ + VoiceActivityTimeout.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout) + return object; + var message = new $root.google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout(); + if (object.speechStartTimeout != null) { + if (typeof object.speechStartTimeout !== "object") + throw TypeError(".google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout.speechStartTimeout: object expected"); + message.speechStartTimeout = $root.google.protobuf.Duration.fromObject(object.speechStartTimeout); + } + if (object.speechEndTimeout != null) { + if (typeof object.speechEndTimeout !== "object") + throw TypeError(".google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout.speechEndTimeout: object expected"); + message.speechEndTimeout = $root.google.protobuf.Duration.fromObject(object.speechEndTimeout); + } + return message; + }; + + /** + * Creates a plain object from a VoiceActivityTimeout message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout + * @static + * @param {google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout} message VoiceActivityTimeout + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VoiceActivityTimeout.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.speechStartTimeout = null; + object.speechEndTimeout = null; + } + if (message.speechStartTimeout != null && message.hasOwnProperty("speechStartTimeout")) + object.speechStartTimeout = $root.google.protobuf.Duration.toObject(message.speechStartTimeout, options); + if (message.speechEndTimeout != null && message.hasOwnProperty("speechEndTimeout")) + object.speechEndTimeout = $root.google.protobuf.Duration.toObject(message.speechEndTimeout, options); + return object; + }; + + /** + * Converts this VoiceActivityTimeout to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout + * @instance + * @returns {Object.} JSON object + */ + VoiceActivityTimeout.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VoiceActivityTimeout + * @function getTypeUrl + * @memberof google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VoiceActivityTimeout.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout"; + }; + + return VoiceActivityTimeout; + })(); + + return StreamingRecognitionConfig; + })(); + + v1.RecognitionConfig = (function() { + + /** + * Properties of a RecognitionConfig. + * @memberof google.cloud.speech.v1 + * @interface IRecognitionConfig + * @property {google.cloud.speech.v1.RecognitionConfig.AudioEncoding|null} [encoding] RecognitionConfig encoding + * @property {number|null} [sampleRateHertz] RecognitionConfig sampleRateHertz + * @property {number|null} [audioChannelCount] RecognitionConfig audioChannelCount + * @property {boolean|null} [enableSeparateRecognitionPerChannel] RecognitionConfig enableSeparateRecognitionPerChannel + * @property {string|null} [languageCode] RecognitionConfig languageCode + * @property {Array.|null} [alternativeLanguageCodes] RecognitionConfig alternativeLanguageCodes + * @property {number|null} [maxAlternatives] RecognitionConfig maxAlternatives + * @property {boolean|null} [profanityFilter] RecognitionConfig profanityFilter + * @property {google.cloud.speech.v1.ISpeechAdaptation|null} [adaptation] RecognitionConfig adaptation + * @property {google.cloud.speech.v1.ITranscriptNormalization|null} [transcriptNormalization] RecognitionConfig transcriptNormalization + * @property {Array.|null} [speechContexts] RecognitionConfig speechContexts + * @property {boolean|null} [enableWordTimeOffsets] RecognitionConfig enableWordTimeOffsets + * @property {boolean|null} [enableWordConfidence] RecognitionConfig enableWordConfidence + * @property {boolean|null} [enableAutomaticPunctuation] RecognitionConfig enableAutomaticPunctuation + * @property {google.protobuf.IBoolValue|null} [enableSpokenPunctuation] RecognitionConfig enableSpokenPunctuation + * @property {google.protobuf.IBoolValue|null} [enableSpokenEmojis] RecognitionConfig enableSpokenEmojis + * @property {google.cloud.speech.v1.ISpeakerDiarizationConfig|null} [diarizationConfig] RecognitionConfig diarizationConfig + * @property {google.cloud.speech.v1.IRecognitionMetadata|null} [metadata] RecognitionConfig metadata + * @property {string|null} [model] RecognitionConfig model + * @property {boolean|null} [useEnhanced] RecognitionConfig useEnhanced + */ + + /** + * Constructs a new RecognitionConfig. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a RecognitionConfig. + * @implements IRecognitionConfig + * @constructor + * @param {google.cloud.speech.v1.IRecognitionConfig=} [properties] Properties to set + */ + function RecognitionConfig(properties) { + this.alternativeLanguageCodes = []; + this.speechContexts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RecognitionConfig encoding. + * @member {google.cloud.speech.v1.RecognitionConfig.AudioEncoding} encoding + * @memberof google.cloud.speech.v1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.encoding = 0; + + /** + * RecognitionConfig sampleRateHertz. + * @member {number} sampleRateHertz + * @memberof google.cloud.speech.v1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.sampleRateHertz = 0; + + /** + * RecognitionConfig audioChannelCount. + * @member {number} audioChannelCount + * @memberof google.cloud.speech.v1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.audioChannelCount = 0; + + /** + * RecognitionConfig enableSeparateRecognitionPerChannel. + * @member {boolean} enableSeparateRecognitionPerChannel + * @memberof google.cloud.speech.v1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.enableSeparateRecognitionPerChannel = false; + + /** + * RecognitionConfig languageCode. + * @member {string} languageCode + * @memberof google.cloud.speech.v1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.languageCode = ""; + + /** + * RecognitionConfig alternativeLanguageCodes. + * @member {Array.} alternativeLanguageCodes + * @memberof google.cloud.speech.v1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.alternativeLanguageCodes = $util.emptyArray; + + /** + * RecognitionConfig maxAlternatives. + * @member {number} maxAlternatives + * @memberof google.cloud.speech.v1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.maxAlternatives = 0; + + /** + * RecognitionConfig profanityFilter. + * @member {boolean} profanityFilter + * @memberof google.cloud.speech.v1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.profanityFilter = false; + + /** + * RecognitionConfig adaptation. + * @member {google.cloud.speech.v1.ISpeechAdaptation|null|undefined} adaptation + * @memberof google.cloud.speech.v1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.adaptation = null; + + /** + * RecognitionConfig transcriptNormalization. + * @member {google.cloud.speech.v1.ITranscriptNormalization|null|undefined} transcriptNormalization + * @memberof google.cloud.speech.v1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.transcriptNormalization = null; + + /** + * RecognitionConfig speechContexts. + * @member {Array.} speechContexts + * @memberof google.cloud.speech.v1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.speechContexts = $util.emptyArray; + + /** + * RecognitionConfig enableWordTimeOffsets. + * @member {boolean} enableWordTimeOffsets + * @memberof google.cloud.speech.v1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.enableWordTimeOffsets = false; + + /** + * RecognitionConfig enableWordConfidence. + * @member {boolean} enableWordConfidence + * @memberof google.cloud.speech.v1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.enableWordConfidence = false; + + /** + * RecognitionConfig enableAutomaticPunctuation. + * @member {boolean} enableAutomaticPunctuation + * @memberof google.cloud.speech.v1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.enableAutomaticPunctuation = false; + + /** + * RecognitionConfig enableSpokenPunctuation. + * @member {google.protobuf.IBoolValue|null|undefined} enableSpokenPunctuation + * @memberof google.cloud.speech.v1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.enableSpokenPunctuation = null; + + /** + * RecognitionConfig enableSpokenEmojis. + * @member {google.protobuf.IBoolValue|null|undefined} enableSpokenEmojis + * @memberof google.cloud.speech.v1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.enableSpokenEmojis = null; + + /** + * RecognitionConfig diarizationConfig. + * @member {google.cloud.speech.v1.ISpeakerDiarizationConfig|null|undefined} diarizationConfig + * @memberof google.cloud.speech.v1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.diarizationConfig = null; + + /** + * RecognitionConfig metadata. + * @member {google.cloud.speech.v1.IRecognitionMetadata|null|undefined} metadata + * @memberof google.cloud.speech.v1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.metadata = null; + + /** + * RecognitionConfig model. + * @member {string} model + * @memberof google.cloud.speech.v1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.model = ""; + + /** + * RecognitionConfig useEnhanced. + * @member {boolean} useEnhanced + * @memberof google.cloud.speech.v1.RecognitionConfig + * @instance + */ + RecognitionConfig.prototype.useEnhanced = false; + + /** + * Creates a new RecognitionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.RecognitionConfig + * @static + * @param {google.cloud.speech.v1.IRecognitionConfig=} [properties] Properties to set + * @returns {google.cloud.speech.v1.RecognitionConfig} RecognitionConfig instance + */ + RecognitionConfig.create = function create(properties) { + return new RecognitionConfig(properties); + }; + + /** + * Encodes the specified RecognitionConfig message. Does not implicitly {@link google.cloud.speech.v1.RecognitionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.RecognitionConfig + * @static + * @param {google.cloud.speech.v1.IRecognitionConfig} message RecognitionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecognitionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.encoding); + if (message.sampleRateHertz != null && Object.hasOwnProperty.call(message, "sampleRateHertz")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.sampleRateHertz); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); + if (message.maxAlternatives != null && Object.hasOwnProperty.call(message, "maxAlternatives")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.maxAlternatives); + if (message.profanityFilter != null && Object.hasOwnProperty.call(message, "profanityFilter")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.profanityFilter); + if (message.speechContexts != null && message.speechContexts.length) + for (var i = 0; i < message.speechContexts.length; ++i) + $root.google.cloud.speech.v1.SpeechContext.encode(message.speechContexts[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.audioChannelCount != null && Object.hasOwnProperty.call(message, "audioChannelCount")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.audioChannelCount); + if (message.enableWordTimeOffsets != null && Object.hasOwnProperty.call(message, "enableWordTimeOffsets")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.enableWordTimeOffsets); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.cloud.speech.v1.RecognitionMetadata.encode(message.metadata, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.enableAutomaticPunctuation != null && Object.hasOwnProperty.call(message, "enableAutomaticPunctuation")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.enableAutomaticPunctuation); + if (message.enableSeparateRecognitionPerChannel != null && Object.hasOwnProperty.call(message, "enableSeparateRecognitionPerChannel")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.enableSeparateRecognitionPerChannel); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.model); + if (message.useEnhanced != null && Object.hasOwnProperty.call(message, "useEnhanced")) + writer.uint32(/* id 14, wireType 0 =*/112).bool(message.useEnhanced); + if (message.enableWordConfidence != null && Object.hasOwnProperty.call(message, "enableWordConfidence")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.enableWordConfidence); + if (message.alternativeLanguageCodes != null && message.alternativeLanguageCodes.length) + for (var i = 0; i < message.alternativeLanguageCodes.length; ++i) + writer.uint32(/* id 18, wireType 2 =*/146).string(message.alternativeLanguageCodes[i]); + if (message.diarizationConfig != null && Object.hasOwnProperty.call(message, "diarizationConfig")) + $root.google.cloud.speech.v1.SpeakerDiarizationConfig.encode(message.diarizationConfig, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.adaptation != null && Object.hasOwnProperty.call(message, "adaptation")) + $root.google.cloud.speech.v1.SpeechAdaptation.encode(message.adaptation, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.enableSpokenPunctuation != null && Object.hasOwnProperty.call(message, "enableSpokenPunctuation")) + $root.google.protobuf.BoolValue.encode(message.enableSpokenPunctuation, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.enableSpokenEmojis != null && Object.hasOwnProperty.call(message, "enableSpokenEmojis")) + $root.google.protobuf.BoolValue.encode(message.enableSpokenEmojis, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.transcriptNormalization != null && Object.hasOwnProperty.call(message, "transcriptNormalization")) + $root.google.cloud.speech.v1.TranscriptNormalization.encode(message.transcriptNormalization, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RecognitionConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v1.RecognitionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.RecognitionConfig + * @static + * @param {google.cloud.speech.v1.IRecognitionConfig} message RecognitionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecognitionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RecognitionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.RecognitionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.RecognitionConfig} RecognitionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecognitionConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.RecognitionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.encoding = reader.int32(); + break; + } + case 2: { + message.sampleRateHertz = reader.int32(); + break; + } + case 7: { + message.audioChannelCount = reader.int32(); + break; + } + case 12: { + message.enableSeparateRecognitionPerChannel = reader.bool(); + break; + } + case 3: { + message.languageCode = reader.string(); + break; + } + case 18: { + if (!(message.alternativeLanguageCodes && message.alternativeLanguageCodes.length)) + message.alternativeLanguageCodes = []; + message.alternativeLanguageCodes.push(reader.string()); + break; + } + case 4: { + message.maxAlternatives = reader.int32(); + break; + } + case 5: { + message.profanityFilter = reader.bool(); + break; + } + case 20: { + message.adaptation = $root.google.cloud.speech.v1.SpeechAdaptation.decode(reader, reader.uint32()); + break; + } + case 24: { + message.transcriptNormalization = $root.google.cloud.speech.v1.TranscriptNormalization.decode(reader, reader.uint32()); + break; + } + case 6: { + if (!(message.speechContexts && message.speechContexts.length)) + message.speechContexts = []; + message.speechContexts.push($root.google.cloud.speech.v1.SpeechContext.decode(reader, reader.uint32())); + break; + } + case 8: { + message.enableWordTimeOffsets = reader.bool(); + break; + } + case 15: { + message.enableWordConfidence = reader.bool(); + break; + } + case 11: { + message.enableAutomaticPunctuation = reader.bool(); + break; + } + case 22: { + message.enableSpokenPunctuation = $root.google.protobuf.BoolValue.decode(reader, reader.uint32()); + break; + } + case 23: { + message.enableSpokenEmojis = $root.google.protobuf.BoolValue.decode(reader, reader.uint32()); + break; + } + case 19: { + message.diarizationConfig = $root.google.cloud.speech.v1.SpeakerDiarizationConfig.decode(reader, reader.uint32()); + break; + } + case 9: { + message.metadata = $root.google.cloud.speech.v1.RecognitionMetadata.decode(reader, reader.uint32()); + break; + } + case 13: { + message.model = reader.string(); + break; + } + case 14: { + message.useEnhanced = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RecognitionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.RecognitionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.RecognitionConfig} RecognitionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecognitionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RecognitionConfig message. + * @function verify + * @memberof google.cloud.speech.v1.RecognitionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RecognitionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.encoding != null && message.hasOwnProperty("encoding")) + switch (message.encoding) { + default: + return "encoding: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) + if (!$util.isInteger(message.sampleRateHertz)) + return "sampleRateHertz: integer expected"; + if (message.audioChannelCount != null && message.hasOwnProperty("audioChannelCount")) + if (!$util.isInteger(message.audioChannelCount)) + return "audioChannelCount: integer expected"; + if (message.enableSeparateRecognitionPerChannel != null && message.hasOwnProperty("enableSeparateRecognitionPerChannel")) + if (typeof message.enableSeparateRecognitionPerChannel !== "boolean") + return "enableSeparateRecognitionPerChannel: boolean expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.alternativeLanguageCodes != null && message.hasOwnProperty("alternativeLanguageCodes")) { + if (!Array.isArray(message.alternativeLanguageCodes)) + return "alternativeLanguageCodes: array expected"; + for (var i = 0; i < message.alternativeLanguageCodes.length; ++i) + if (!$util.isString(message.alternativeLanguageCodes[i])) + return "alternativeLanguageCodes: string[] expected"; + } + if (message.maxAlternatives != null && message.hasOwnProperty("maxAlternatives")) + if (!$util.isInteger(message.maxAlternatives)) + return "maxAlternatives: integer expected"; + if (message.profanityFilter != null && message.hasOwnProperty("profanityFilter")) + if (typeof message.profanityFilter !== "boolean") + return "profanityFilter: boolean expected"; + if (message.adaptation != null && message.hasOwnProperty("adaptation")) { + var error = $root.google.cloud.speech.v1.SpeechAdaptation.verify(message.adaptation); + if (error) + return "adaptation." + error; + } + if (message.transcriptNormalization != null && message.hasOwnProperty("transcriptNormalization")) { + var error = $root.google.cloud.speech.v1.TranscriptNormalization.verify(message.transcriptNormalization); + if (error) + return "transcriptNormalization." + error; + } + if (message.speechContexts != null && message.hasOwnProperty("speechContexts")) { + if (!Array.isArray(message.speechContexts)) + return "speechContexts: array expected"; + for (var i = 0; i < message.speechContexts.length; ++i) { + var error = $root.google.cloud.speech.v1.SpeechContext.verify(message.speechContexts[i]); + if (error) + return "speechContexts." + error; + } + } + if (message.enableWordTimeOffsets != null && message.hasOwnProperty("enableWordTimeOffsets")) + if (typeof message.enableWordTimeOffsets !== "boolean") + return "enableWordTimeOffsets: boolean expected"; + if (message.enableWordConfidence != null && message.hasOwnProperty("enableWordConfidence")) + if (typeof message.enableWordConfidence !== "boolean") + return "enableWordConfidence: boolean expected"; + if (message.enableAutomaticPunctuation != null && message.hasOwnProperty("enableAutomaticPunctuation")) + if (typeof message.enableAutomaticPunctuation !== "boolean") + return "enableAutomaticPunctuation: boolean expected"; + if (message.enableSpokenPunctuation != null && message.hasOwnProperty("enableSpokenPunctuation")) { + var error = $root.google.protobuf.BoolValue.verify(message.enableSpokenPunctuation); + if (error) + return "enableSpokenPunctuation." + error; + } + if (message.enableSpokenEmojis != null && message.hasOwnProperty("enableSpokenEmojis")) { + var error = $root.google.protobuf.BoolValue.verify(message.enableSpokenEmojis); + if (error) + return "enableSpokenEmojis." + error; + } + if (message.diarizationConfig != null && message.hasOwnProperty("diarizationConfig")) { + var error = $root.google.cloud.speech.v1.SpeakerDiarizationConfig.verify(message.diarizationConfig); + if (error) + return "diarizationConfig." + error; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.cloud.speech.v1.RecognitionMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.useEnhanced != null && message.hasOwnProperty("useEnhanced")) + if (typeof message.useEnhanced !== "boolean") + return "useEnhanced: boolean expected"; + return null; + }; + + /** + * Creates a RecognitionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.RecognitionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.RecognitionConfig} RecognitionConfig + */ + RecognitionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.RecognitionConfig) + return object; + var message = new $root.google.cloud.speech.v1.RecognitionConfig(); + switch (object.encoding) { + default: + if (typeof object.encoding === "number") { + message.encoding = object.encoding; + break; + } + break; + case "ENCODING_UNSPECIFIED": + case 0: + message.encoding = 0; + break; + case "LINEAR16": + case 1: + message.encoding = 1; + break; + case "FLAC": + case 2: + message.encoding = 2; + break; + case "MULAW": + case 3: + message.encoding = 3; + break; + case "AMR": + case 4: + message.encoding = 4; + break; + case "AMR_WB": + case 5: + message.encoding = 5; + break; + case "OGG_OPUS": + case 6: + message.encoding = 6; + break; + case "SPEEX_WITH_HEADER_BYTE": + case 7: + message.encoding = 7; + break; + case "MP3": + case 8: + message.encoding = 8; + break; + case "WEBM_OPUS": + case 9: + message.encoding = 9; + break; + } + if (object.sampleRateHertz != null) + message.sampleRateHertz = object.sampleRateHertz | 0; + if (object.audioChannelCount != null) + message.audioChannelCount = object.audioChannelCount | 0; + if (object.enableSeparateRecognitionPerChannel != null) + message.enableSeparateRecognitionPerChannel = Boolean(object.enableSeparateRecognitionPerChannel); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.alternativeLanguageCodes) { + if (!Array.isArray(object.alternativeLanguageCodes)) + throw TypeError(".google.cloud.speech.v1.RecognitionConfig.alternativeLanguageCodes: array expected"); + message.alternativeLanguageCodes = []; + for (var i = 0; i < object.alternativeLanguageCodes.length; ++i) + message.alternativeLanguageCodes[i] = String(object.alternativeLanguageCodes[i]); + } + if (object.maxAlternatives != null) + message.maxAlternatives = object.maxAlternatives | 0; + if (object.profanityFilter != null) + message.profanityFilter = Boolean(object.profanityFilter); + if (object.adaptation != null) { + if (typeof object.adaptation !== "object") + throw TypeError(".google.cloud.speech.v1.RecognitionConfig.adaptation: object expected"); + message.adaptation = $root.google.cloud.speech.v1.SpeechAdaptation.fromObject(object.adaptation); + } + if (object.transcriptNormalization != null) { + if (typeof object.transcriptNormalization !== "object") + throw TypeError(".google.cloud.speech.v1.RecognitionConfig.transcriptNormalization: object expected"); + message.transcriptNormalization = $root.google.cloud.speech.v1.TranscriptNormalization.fromObject(object.transcriptNormalization); + } + if (object.speechContexts) { + if (!Array.isArray(object.speechContexts)) + throw TypeError(".google.cloud.speech.v1.RecognitionConfig.speechContexts: array expected"); + message.speechContexts = []; + for (var i = 0; i < object.speechContexts.length; ++i) { + if (typeof object.speechContexts[i] !== "object") + throw TypeError(".google.cloud.speech.v1.RecognitionConfig.speechContexts: object expected"); + message.speechContexts[i] = $root.google.cloud.speech.v1.SpeechContext.fromObject(object.speechContexts[i]); + } + } + if (object.enableWordTimeOffsets != null) + message.enableWordTimeOffsets = Boolean(object.enableWordTimeOffsets); + if (object.enableWordConfidence != null) + message.enableWordConfidence = Boolean(object.enableWordConfidence); + if (object.enableAutomaticPunctuation != null) + message.enableAutomaticPunctuation = Boolean(object.enableAutomaticPunctuation); + if (object.enableSpokenPunctuation != null) { + if (typeof object.enableSpokenPunctuation !== "object") + throw TypeError(".google.cloud.speech.v1.RecognitionConfig.enableSpokenPunctuation: object expected"); + message.enableSpokenPunctuation = $root.google.protobuf.BoolValue.fromObject(object.enableSpokenPunctuation); + } + if (object.enableSpokenEmojis != null) { + if (typeof object.enableSpokenEmojis !== "object") + throw TypeError(".google.cloud.speech.v1.RecognitionConfig.enableSpokenEmojis: object expected"); + message.enableSpokenEmojis = $root.google.protobuf.BoolValue.fromObject(object.enableSpokenEmojis); + } + if (object.diarizationConfig != null) { + if (typeof object.diarizationConfig !== "object") + throw TypeError(".google.cloud.speech.v1.RecognitionConfig.diarizationConfig: object expected"); + message.diarizationConfig = $root.google.cloud.speech.v1.SpeakerDiarizationConfig.fromObject(object.diarizationConfig); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.speech.v1.RecognitionConfig.metadata: object expected"); + message.metadata = $root.google.cloud.speech.v1.RecognitionMetadata.fromObject(object.metadata); + } + if (object.model != null) + message.model = String(object.model); + if (object.useEnhanced != null) + message.useEnhanced = Boolean(object.useEnhanced); + return message; + }; + + /** + * Creates a plain object from a RecognitionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.RecognitionConfig + * @static + * @param {google.cloud.speech.v1.RecognitionConfig} message RecognitionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RecognitionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.speechContexts = []; + object.alternativeLanguageCodes = []; + } + if (options.defaults) { + object.encoding = options.enums === String ? "ENCODING_UNSPECIFIED" : 0; + object.sampleRateHertz = 0; + object.languageCode = ""; + object.maxAlternatives = 0; + object.profanityFilter = false; + object.audioChannelCount = 0; + object.enableWordTimeOffsets = false; + object.metadata = null; + object.enableAutomaticPunctuation = false; + object.enableSeparateRecognitionPerChannel = false; + object.model = ""; + object.useEnhanced = false; + object.enableWordConfidence = false; + object.diarizationConfig = null; + object.adaptation = null; + object.enableSpokenPunctuation = null; + object.enableSpokenEmojis = null; + object.transcriptNormalization = null; + } + if (message.encoding != null && message.hasOwnProperty("encoding")) + object.encoding = options.enums === String ? $root.google.cloud.speech.v1.RecognitionConfig.AudioEncoding[message.encoding] === undefined ? message.encoding : $root.google.cloud.speech.v1.RecognitionConfig.AudioEncoding[message.encoding] : message.encoding; + if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) + object.sampleRateHertz = message.sampleRateHertz; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.maxAlternatives != null && message.hasOwnProperty("maxAlternatives")) + object.maxAlternatives = message.maxAlternatives; + if (message.profanityFilter != null && message.hasOwnProperty("profanityFilter")) + object.profanityFilter = message.profanityFilter; + if (message.speechContexts && message.speechContexts.length) { + object.speechContexts = []; + for (var j = 0; j < message.speechContexts.length; ++j) + object.speechContexts[j] = $root.google.cloud.speech.v1.SpeechContext.toObject(message.speechContexts[j], options); + } + if (message.audioChannelCount != null && message.hasOwnProperty("audioChannelCount")) + object.audioChannelCount = message.audioChannelCount; + if (message.enableWordTimeOffsets != null && message.hasOwnProperty("enableWordTimeOffsets")) + object.enableWordTimeOffsets = message.enableWordTimeOffsets; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.cloud.speech.v1.RecognitionMetadata.toObject(message.metadata, options); + if (message.enableAutomaticPunctuation != null && message.hasOwnProperty("enableAutomaticPunctuation")) + object.enableAutomaticPunctuation = message.enableAutomaticPunctuation; + if (message.enableSeparateRecognitionPerChannel != null && message.hasOwnProperty("enableSeparateRecognitionPerChannel")) + object.enableSeparateRecognitionPerChannel = message.enableSeparateRecognitionPerChannel; + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.useEnhanced != null && message.hasOwnProperty("useEnhanced")) + object.useEnhanced = message.useEnhanced; + if (message.enableWordConfidence != null && message.hasOwnProperty("enableWordConfidence")) + object.enableWordConfidence = message.enableWordConfidence; + if (message.alternativeLanguageCodes && message.alternativeLanguageCodes.length) { + object.alternativeLanguageCodes = []; + for (var j = 0; j < message.alternativeLanguageCodes.length; ++j) + object.alternativeLanguageCodes[j] = message.alternativeLanguageCodes[j]; + } + if (message.diarizationConfig != null && message.hasOwnProperty("diarizationConfig")) + object.diarizationConfig = $root.google.cloud.speech.v1.SpeakerDiarizationConfig.toObject(message.diarizationConfig, options); + if (message.adaptation != null && message.hasOwnProperty("adaptation")) + object.adaptation = $root.google.cloud.speech.v1.SpeechAdaptation.toObject(message.adaptation, options); + if (message.enableSpokenPunctuation != null && message.hasOwnProperty("enableSpokenPunctuation")) + object.enableSpokenPunctuation = $root.google.protobuf.BoolValue.toObject(message.enableSpokenPunctuation, options); + if (message.enableSpokenEmojis != null && message.hasOwnProperty("enableSpokenEmojis")) + object.enableSpokenEmojis = $root.google.protobuf.BoolValue.toObject(message.enableSpokenEmojis, options); + if (message.transcriptNormalization != null && message.hasOwnProperty("transcriptNormalization")) + object.transcriptNormalization = $root.google.cloud.speech.v1.TranscriptNormalization.toObject(message.transcriptNormalization, options); + return object; + }; + + /** + * Converts this RecognitionConfig to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.RecognitionConfig + * @instance + * @returns {Object.} JSON object + */ + RecognitionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RecognitionConfig + * @function getTypeUrl + * @memberof google.cloud.speech.v1.RecognitionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RecognitionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.RecognitionConfig"; + }; + + /** + * AudioEncoding enum. + * @name google.cloud.speech.v1.RecognitionConfig.AudioEncoding + * @enum {number} + * @property {number} ENCODING_UNSPECIFIED=0 ENCODING_UNSPECIFIED value + * @property {number} LINEAR16=1 LINEAR16 value + * @property {number} FLAC=2 FLAC value + * @property {number} MULAW=3 MULAW value + * @property {number} AMR=4 AMR value + * @property {number} AMR_WB=5 AMR_WB value + * @property {number} OGG_OPUS=6 OGG_OPUS value + * @property {number} SPEEX_WITH_HEADER_BYTE=7 SPEEX_WITH_HEADER_BYTE value + * @property {number} MP3=8 MP3 value + * @property {number} WEBM_OPUS=9 WEBM_OPUS value + */ + RecognitionConfig.AudioEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENCODING_UNSPECIFIED"] = 0; + values[valuesById[1] = "LINEAR16"] = 1; + values[valuesById[2] = "FLAC"] = 2; + values[valuesById[3] = "MULAW"] = 3; + values[valuesById[4] = "AMR"] = 4; + values[valuesById[5] = "AMR_WB"] = 5; + values[valuesById[6] = "OGG_OPUS"] = 6; + values[valuesById[7] = "SPEEX_WITH_HEADER_BYTE"] = 7; + values[valuesById[8] = "MP3"] = 8; + values[valuesById[9] = "WEBM_OPUS"] = 9; + return values; + })(); + + return RecognitionConfig; + })(); + + v1.SpeakerDiarizationConfig = (function() { + + /** + * Properties of a SpeakerDiarizationConfig. + * @memberof google.cloud.speech.v1 + * @interface ISpeakerDiarizationConfig + * @property {boolean|null} [enableSpeakerDiarization] SpeakerDiarizationConfig enableSpeakerDiarization + * @property {number|null} [minSpeakerCount] SpeakerDiarizationConfig minSpeakerCount + * @property {number|null} [maxSpeakerCount] SpeakerDiarizationConfig maxSpeakerCount + * @property {number|null} [speakerTag] SpeakerDiarizationConfig speakerTag + */ + + /** + * Constructs a new SpeakerDiarizationConfig. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a SpeakerDiarizationConfig. + * @implements ISpeakerDiarizationConfig + * @constructor + * @param {google.cloud.speech.v1.ISpeakerDiarizationConfig=} [properties] Properties to set + */ + function SpeakerDiarizationConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpeakerDiarizationConfig enableSpeakerDiarization. + * @member {boolean} enableSpeakerDiarization + * @memberof google.cloud.speech.v1.SpeakerDiarizationConfig + * @instance + */ + SpeakerDiarizationConfig.prototype.enableSpeakerDiarization = false; + + /** + * SpeakerDiarizationConfig minSpeakerCount. + * @member {number} minSpeakerCount + * @memberof google.cloud.speech.v1.SpeakerDiarizationConfig + * @instance + */ + SpeakerDiarizationConfig.prototype.minSpeakerCount = 0; + + /** + * SpeakerDiarizationConfig maxSpeakerCount. + * @member {number} maxSpeakerCount + * @memberof google.cloud.speech.v1.SpeakerDiarizationConfig + * @instance + */ + SpeakerDiarizationConfig.prototype.maxSpeakerCount = 0; + + /** + * SpeakerDiarizationConfig speakerTag. + * @member {number} speakerTag + * @memberof google.cloud.speech.v1.SpeakerDiarizationConfig + * @instance + */ + SpeakerDiarizationConfig.prototype.speakerTag = 0; + + /** + * Creates a new SpeakerDiarizationConfig instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.SpeakerDiarizationConfig + * @static + * @param {google.cloud.speech.v1.ISpeakerDiarizationConfig=} [properties] Properties to set + * @returns {google.cloud.speech.v1.SpeakerDiarizationConfig} SpeakerDiarizationConfig instance + */ + SpeakerDiarizationConfig.create = function create(properties) { + return new SpeakerDiarizationConfig(properties); + }; + + /** + * Encodes the specified SpeakerDiarizationConfig message. Does not implicitly {@link google.cloud.speech.v1.SpeakerDiarizationConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.SpeakerDiarizationConfig + * @static + * @param {google.cloud.speech.v1.ISpeakerDiarizationConfig} message SpeakerDiarizationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeakerDiarizationConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableSpeakerDiarization != null && Object.hasOwnProperty.call(message, "enableSpeakerDiarization")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableSpeakerDiarization); + if (message.minSpeakerCount != null && Object.hasOwnProperty.call(message, "minSpeakerCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.minSpeakerCount); + if (message.maxSpeakerCount != null && Object.hasOwnProperty.call(message, "maxSpeakerCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.maxSpeakerCount); + if (message.speakerTag != null && Object.hasOwnProperty.call(message, "speakerTag")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.speakerTag); + return writer; + }; + + /** + * Encodes the specified SpeakerDiarizationConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v1.SpeakerDiarizationConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.SpeakerDiarizationConfig + * @static + * @param {google.cloud.speech.v1.ISpeakerDiarizationConfig} message SpeakerDiarizationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeakerDiarizationConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpeakerDiarizationConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.SpeakerDiarizationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.SpeakerDiarizationConfig} SpeakerDiarizationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeakerDiarizationConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.SpeakerDiarizationConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enableSpeakerDiarization = reader.bool(); + break; + } + case 2: { + message.minSpeakerCount = reader.int32(); + break; + } + case 3: { + message.maxSpeakerCount = reader.int32(); + break; + } + case 5: { + message.speakerTag = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpeakerDiarizationConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.SpeakerDiarizationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.SpeakerDiarizationConfig} SpeakerDiarizationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeakerDiarizationConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpeakerDiarizationConfig message. + * @function verify + * @memberof google.cloud.speech.v1.SpeakerDiarizationConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpeakerDiarizationConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enableSpeakerDiarization != null && message.hasOwnProperty("enableSpeakerDiarization")) + if (typeof message.enableSpeakerDiarization !== "boolean") + return "enableSpeakerDiarization: boolean expected"; + if (message.minSpeakerCount != null && message.hasOwnProperty("minSpeakerCount")) + if (!$util.isInteger(message.minSpeakerCount)) + return "minSpeakerCount: integer expected"; + if (message.maxSpeakerCount != null && message.hasOwnProperty("maxSpeakerCount")) + if (!$util.isInteger(message.maxSpeakerCount)) + return "maxSpeakerCount: integer expected"; + if (message.speakerTag != null && message.hasOwnProperty("speakerTag")) + if (!$util.isInteger(message.speakerTag)) + return "speakerTag: integer expected"; + return null; + }; + + /** + * Creates a SpeakerDiarizationConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.SpeakerDiarizationConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.SpeakerDiarizationConfig} SpeakerDiarizationConfig + */ + SpeakerDiarizationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.SpeakerDiarizationConfig) + return object; + var message = new $root.google.cloud.speech.v1.SpeakerDiarizationConfig(); + if (object.enableSpeakerDiarization != null) + message.enableSpeakerDiarization = Boolean(object.enableSpeakerDiarization); + if (object.minSpeakerCount != null) + message.minSpeakerCount = object.minSpeakerCount | 0; + if (object.maxSpeakerCount != null) + message.maxSpeakerCount = object.maxSpeakerCount | 0; + if (object.speakerTag != null) + message.speakerTag = object.speakerTag | 0; + return message; + }; + + /** + * Creates a plain object from a SpeakerDiarizationConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.SpeakerDiarizationConfig + * @static + * @param {google.cloud.speech.v1.SpeakerDiarizationConfig} message SpeakerDiarizationConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpeakerDiarizationConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.enableSpeakerDiarization = false; + object.minSpeakerCount = 0; + object.maxSpeakerCount = 0; + object.speakerTag = 0; + } + if (message.enableSpeakerDiarization != null && message.hasOwnProperty("enableSpeakerDiarization")) + object.enableSpeakerDiarization = message.enableSpeakerDiarization; + if (message.minSpeakerCount != null && message.hasOwnProperty("minSpeakerCount")) + object.minSpeakerCount = message.minSpeakerCount; + if (message.maxSpeakerCount != null && message.hasOwnProperty("maxSpeakerCount")) + object.maxSpeakerCount = message.maxSpeakerCount; + if (message.speakerTag != null && message.hasOwnProperty("speakerTag")) + object.speakerTag = message.speakerTag; + return object; + }; + + /** + * Converts this SpeakerDiarizationConfig to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.SpeakerDiarizationConfig + * @instance + * @returns {Object.} JSON object + */ + SpeakerDiarizationConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpeakerDiarizationConfig + * @function getTypeUrl + * @memberof google.cloud.speech.v1.SpeakerDiarizationConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpeakerDiarizationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.SpeakerDiarizationConfig"; + }; + + return SpeakerDiarizationConfig; + })(); + + v1.RecognitionMetadata = (function() { + + /** + * Properties of a RecognitionMetadata. + * @memberof google.cloud.speech.v1 + * @interface IRecognitionMetadata + * @property {google.cloud.speech.v1.RecognitionMetadata.InteractionType|null} [interactionType] RecognitionMetadata interactionType + * @property {number|null} [industryNaicsCodeOfAudio] RecognitionMetadata industryNaicsCodeOfAudio + * @property {google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance|null} [microphoneDistance] RecognitionMetadata microphoneDistance + * @property {google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType|null} [originalMediaType] RecognitionMetadata originalMediaType + * @property {google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType|null} [recordingDeviceType] RecognitionMetadata recordingDeviceType + * @property {string|null} [recordingDeviceName] RecognitionMetadata recordingDeviceName + * @property {string|null} [originalMimeType] RecognitionMetadata originalMimeType + * @property {string|null} [audioTopic] RecognitionMetadata audioTopic + */ + + /** + * Constructs a new RecognitionMetadata. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a RecognitionMetadata. + * @implements IRecognitionMetadata + * @constructor + * @param {google.cloud.speech.v1.IRecognitionMetadata=} [properties] Properties to set + */ + function RecognitionMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RecognitionMetadata interactionType. + * @member {google.cloud.speech.v1.RecognitionMetadata.InteractionType} interactionType + * @memberof google.cloud.speech.v1.RecognitionMetadata + * @instance + */ + RecognitionMetadata.prototype.interactionType = 0; + + /** + * RecognitionMetadata industryNaicsCodeOfAudio. + * @member {number} industryNaicsCodeOfAudio + * @memberof google.cloud.speech.v1.RecognitionMetadata + * @instance + */ + RecognitionMetadata.prototype.industryNaicsCodeOfAudio = 0; + + /** + * RecognitionMetadata microphoneDistance. + * @member {google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance} microphoneDistance + * @memberof google.cloud.speech.v1.RecognitionMetadata + * @instance + */ + RecognitionMetadata.prototype.microphoneDistance = 0; + + /** + * RecognitionMetadata originalMediaType. + * @member {google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType} originalMediaType + * @memberof google.cloud.speech.v1.RecognitionMetadata + * @instance + */ + RecognitionMetadata.prototype.originalMediaType = 0; + + /** + * RecognitionMetadata recordingDeviceType. + * @member {google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType} recordingDeviceType + * @memberof google.cloud.speech.v1.RecognitionMetadata + * @instance + */ + RecognitionMetadata.prototype.recordingDeviceType = 0; + + /** + * RecognitionMetadata recordingDeviceName. + * @member {string} recordingDeviceName + * @memberof google.cloud.speech.v1.RecognitionMetadata + * @instance + */ + RecognitionMetadata.prototype.recordingDeviceName = ""; + + /** + * RecognitionMetadata originalMimeType. + * @member {string} originalMimeType + * @memberof google.cloud.speech.v1.RecognitionMetadata + * @instance + */ + RecognitionMetadata.prototype.originalMimeType = ""; + + /** + * RecognitionMetadata audioTopic. + * @member {string} audioTopic + * @memberof google.cloud.speech.v1.RecognitionMetadata + * @instance + */ + RecognitionMetadata.prototype.audioTopic = ""; + + /** + * Creates a new RecognitionMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.RecognitionMetadata + * @static + * @param {google.cloud.speech.v1.IRecognitionMetadata=} [properties] Properties to set + * @returns {google.cloud.speech.v1.RecognitionMetadata} RecognitionMetadata instance + */ + RecognitionMetadata.create = function create(properties) { + return new RecognitionMetadata(properties); + }; + + /** + * Encodes the specified RecognitionMetadata message. Does not implicitly {@link google.cloud.speech.v1.RecognitionMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.RecognitionMetadata + * @static + * @param {google.cloud.speech.v1.IRecognitionMetadata} message RecognitionMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecognitionMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.interactionType != null && Object.hasOwnProperty.call(message, "interactionType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.interactionType); + if (message.industryNaicsCodeOfAudio != null && Object.hasOwnProperty.call(message, "industryNaicsCodeOfAudio")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.industryNaicsCodeOfAudio); + if (message.microphoneDistance != null && Object.hasOwnProperty.call(message, "microphoneDistance")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.microphoneDistance); + if (message.originalMediaType != null && Object.hasOwnProperty.call(message, "originalMediaType")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.originalMediaType); + if (message.recordingDeviceType != null && Object.hasOwnProperty.call(message, "recordingDeviceType")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.recordingDeviceType); + if (message.recordingDeviceName != null && Object.hasOwnProperty.call(message, "recordingDeviceName")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.recordingDeviceName); + if (message.originalMimeType != null && Object.hasOwnProperty.call(message, "originalMimeType")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.originalMimeType); + if (message.audioTopic != null && Object.hasOwnProperty.call(message, "audioTopic")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.audioTopic); + return writer; + }; + + /** + * Encodes the specified RecognitionMetadata message, length delimited. Does not implicitly {@link google.cloud.speech.v1.RecognitionMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.RecognitionMetadata + * @static + * @param {google.cloud.speech.v1.IRecognitionMetadata} message RecognitionMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecognitionMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RecognitionMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.RecognitionMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.RecognitionMetadata} RecognitionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecognitionMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.RecognitionMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.interactionType = reader.int32(); + break; + } + case 3: { + message.industryNaicsCodeOfAudio = reader.uint32(); + break; + } + case 4: { + message.microphoneDistance = reader.int32(); + break; + } + case 5: { + message.originalMediaType = reader.int32(); + break; + } + case 6: { + message.recordingDeviceType = reader.int32(); + break; + } + case 7: { + message.recordingDeviceName = reader.string(); + break; + } + case 8: { + message.originalMimeType = reader.string(); + break; + } + case 10: { + message.audioTopic = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RecognitionMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.RecognitionMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.RecognitionMetadata} RecognitionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecognitionMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RecognitionMetadata message. + * @function verify + * @memberof google.cloud.speech.v1.RecognitionMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RecognitionMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.interactionType != null && message.hasOwnProperty("interactionType")) + switch (message.interactionType) { + default: + return "interactionType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + if (message.industryNaicsCodeOfAudio != null && message.hasOwnProperty("industryNaicsCodeOfAudio")) + if (!$util.isInteger(message.industryNaicsCodeOfAudio)) + return "industryNaicsCodeOfAudio: integer expected"; + if (message.microphoneDistance != null && message.hasOwnProperty("microphoneDistance")) + switch (message.microphoneDistance) { + default: + return "microphoneDistance: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.originalMediaType != null && message.hasOwnProperty("originalMediaType")) + switch (message.originalMediaType) { + default: + return "originalMediaType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.recordingDeviceType != null && message.hasOwnProperty("recordingDeviceType")) + switch (message.recordingDeviceType) { + default: + return "recordingDeviceType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.recordingDeviceName != null && message.hasOwnProperty("recordingDeviceName")) + if (!$util.isString(message.recordingDeviceName)) + return "recordingDeviceName: string expected"; + if (message.originalMimeType != null && message.hasOwnProperty("originalMimeType")) + if (!$util.isString(message.originalMimeType)) + return "originalMimeType: string expected"; + if (message.audioTopic != null && message.hasOwnProperty("audioTopic")) + if (!$util.isString(message.audioTopic)) + return "audioTopic: string expected"; + return null; + }; + + /** + * Creates a RecognitionMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.RecognitionMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.RecognitionMetadata} RecognitionMetadata + */ + RecognitionMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.RecognitionMetadata) + return object; + var message = new $root.google.cloud.speech.v1.RecognitionMetadata(); + switch (object.interactionType) { + default: + if (typeof object.interactionType === "number") { + message.interactionType = object.interactionType; + break; + } + break; + case "INTERACTION_TYPE_UNSPECIFIED": + case 0: + message.interactionType = 0; + break; + case "DISCUSSION": + case 1: + message.interactionType = 1; + break; + case "PRESENTATION": + case 2: + message.interactionType = 2; + break; + case "PHONE_CALL": + case 3: + message.interactionType = 3; + break; + case "VOICEMAIL": + case 4: + message.interactionType = 4; + break; + case "PROFESSIONALLY_PRODUCED": + case 5: + message.interactionType = 5; + break; + case "VOICE_SEARCH": + case 6: + message.interactionType = 6; + break; + case "VOICE_COMMAND": + case 7: + message.interactionType = 7; + break; + case "DICTATION": + case 8: + message.interactionType = 8; + break; + } + if (object.industryNaicsCodeOfAudio != null) + message.industryNaicsCodeOfAudio = object.industryNaicsCodeOfAudio >>> 0; + switch (object.microphoneDistance) { + default: + if (typeof object.microphoneDistance === "number") { + message.microphoneDistance = object.microphoneDistance; + break; + } + break; + case "MICROPHONE_DISTANCE_UNSPECIFIED": + case 0: + message.microphoneDistance = 0; + break; + case "NEARFIELD": + case 1: + message.microphoneDistance = 1; + break; + case "MIDFIELD": + case 2: + message.microphoneDistance = 2; + break; + case "FARFIELD": + case 3: + message.microphoneDistance = 3; + break; + } + switch (object.originalMediaType) { + default: + if (typeof object.originalMediaType === "number") { + message.originalMediaType = object.originalMediaType; + break; + } + break; + case "ORIGINAL_MEDIA_TYPE_UNSPECIFIED": + case 0: + message.originalMediaType = 0; + break; + case "AUDIO": + case 1: + message.originalMediaType = 1; + break; + case "VIDEO": + case 2: + message.originalMediaType = 2; + break; + } + switch (object.recordingDeviceType) { + default: + if (typeof object.recordingDeviceType === "number") { + message.recordingDeviceType = object.recordingDeviceType; + break; + } + break; + case "RECORDING_DEVICE_TYPE_UNSPECIFIED": + case 0: + message.recordingDeviceType = 0; + break; + case "SMARTPHONE": + case 1: + message.recordingDeviceType = 1; + break; + case "PC": + case 2: + message.recordingDeviceType = 2; + break; + case "PHONE_LINE": + case 3: + message.recordingDeviceType = 3; + break; + case "VEHICLE": + case 4: + message.recordingDeviceType = 4; + break; + case "OTHER_OUTDOOR_DEVICE": + case 5: + message.recordingDeviceType = 5; + break; + case "OTHER_INDOOR_DEVICE": + case 6: + message.recordingDeviceType = 6; + break; + } + if (object.recordingDeviceName != null) + message.recordingDeviceName = String(object.recordingDeviceName); + if (object.originalMimeType != null) + message.originalMimeType = String(object.originalMimeType); + if (object.audioTopic != null) + message.audioTopic = String(object.audioTopic); + return message; + }; + + /** + * Creates a plain object from a RecognitionMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.RecognitionMetadata + * @static + * @param {google.cloud.speech.v1.RecognitionMetadata} message RecognitionMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RecognitionMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.interactionType = options.enums === String ? "INTERACTION_TYPE_UNSPECIFIED" : 0; + object.industryNaicsCodeOfAudio = 0; + object.microphoneDistance = options.enums === String ? "MICROPHONE_DISTANCE_UNSPECIFIED" : 0; + object.originalMediaType = options.enums === String ? "ORIGINAL_MEDIA_TYPE_UNSPECIFIED" : 0; + object.recordingDeviceType = options.enums === String ? "RECORDING_DEVICE_TYPE_UNSPECIFIED" : 0; + object.recordingDeviceName = ""; + object.originalMimeType = ""; + object.audioTopic = ""; + } + if (message.interactionType != null && message.hasOwnProperty("interactionType")) + object.interactionType = options.enums === String ? $root.google.cloud.speech.v1.RecognitionMetadata.InteractionType[message.interactionType] === undefined ? message.interactionType : $root.google.cloud.speech.v1.RecognitionMetadata.InteractionType[message.interactionType] : message.interactionType; + if (message.industryNaicsCodeOfAudio != null && message.hasOwnProperty("industryNaicsCodeOfAudio")) + object.industryNaicsCodeOfAudio = message.industryNaicsCodeOfAudio; + if (message.microphoneDistance != null && message.hasOwnProperty("microphoneDistance")) + object.microphoneDistance = options.enums === String ? $root.google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance[message.microphoneDistance] === undefined ? message.microphoneDistance : $root.google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance[message.microphoneDistance] : message.microphoneDistance; + if (message.originalMediaType != null && message.hasOwnProperty("originalMediaType")) + object.originalMediaType = options.enums === String ? $root.google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType[message.originalMediaType] === undefined ? message.originalMediaType : $root.google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType[message.originalMediaType] : message.originalMediaType; + if (message.recordingDeviceType != null && message.hasOwnProperty("recordingDeviceType")) + object.recordingDeviceType = options.enums === String ? $root.google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType[message.recordingDeviceType] === undefined ? message.recordingDeviceType : $root.google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType[message.recordingDeviceType] : message.recordingDeviceType; + if (message.recordingDeviceName != null && message.hasOwnProperty("recordingDeviceName")) + object.recordingDeviceName = message.recordingDeviceName; + if (message.originalMimeType != null && message.hasOwnProperty("originalMimeType")) + object.originalMimeType = message.originalMimeType; + if (message.audioTopic != null && message.hasOwnProperty("audioTopic")) + object.audioTopic = message.audioTopic; + return object; + }; + + /** + * Converts this RecognitionMetadata to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.RecognitionMetadata + * @instance + * @returns {Object.} JSON object + */ + RecognitionMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RecognitionMetadata + * @function getTypeUrl + * @memberof google.cloud.speech.v1.RecognitionMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RecognitionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.RecognitionMetadata"; + }; + + /** + * InteractionType enum. + * @name google.cloud.speech.v1.RecognitionMetadata.InteractionType + * @enum {number} + * @property {number} INTERACTION_TYPE_UNSPECIFIED=0 INTERACTION_TYPE_UNSPECIFIED value + * @property {number} DISCUSSION=1 DISCUSSION value + * @property {number} PRESENTATION=2 PRESENTATION value + * @property {number} PHONE_CALL=3 PHONE_CALL value + * @property {number} VOICEMAIL=4 VOICEMAIL value + * @property {number} PROFESSIONALLY_PRODUCED=5 PROFESSIONALLY_PRODUCED value + * @property {number} VOICE_SEARCH=6 VOICE_SEARCH value + * @property {number} VOICE_COMMAND=7 VOICE_COMMAND value + * @property {number} DICTATION=8 DICTATION value + */ + RecognitionMetadata.InteractionType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INTERACTION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DISCUSSION"] = 1; + values[valuesById[2] = "PRESENTATION"] = 2; + values[valuesById[3] = "PHONE_CALL"] = 3; + values[valuesById[4] = "VOICEMAIL"] = 4; + values[valuesById[5] = "PROFESSIONALLY_PRODUCED"] = 5; + values[valuesById[6] = "VOICE_SEARCH"] = 6; + values[valuesById[7] = "VOICE_COMMAND"] = 7; + values[valuesById[8] = "DICTATION"] = 8; + return values; + })(); + + /** + * MicrophoneDistance enum. + * @name google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance + * @enum {number} + * @property {number} MICROPHONE_DISTANCE_UNSPECIFIED=0 MICROPHONE_DISTANCE_UNSPECIFIED value + * @property {number} NEARFIELD=1 NEARFIELD value + * @property {number} MIDFIELD=2 MIDFIELD value + * @property {number} FARFIELD=3 FARFIELD value + */ + RecognitionMetadata.MicrophoneDistance = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MICROPHONE_DISTANCE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NEARFIELD"] = 1; + values[valuesById[2] = "MIDFIELD"] = 2; + values[valuesById[3] = "FARFIELD"] = 3; + return values; + })(); + + /** + * OriginalMediaType enum. + * @name google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType + * @enum {number} + * @property {number} ORIGINAL_MEDIA_TYPE_UNSPECIFIED=0 ORIGINAL_MEDIA_TYPE_UNSPECIFIED value + * @property {number} AUDIO=1 AUDIO value + * @property {number} VIDEO=2 VIDEO value + */ + RecognitionMetadata.OriginalMediaType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ORIGINAL_MEDIA_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "AUDIO"] = 1; + values[valuesById[2] = "VIDEO"] = 2; + return values; + })(); + + /** + * RecordingDeviceType enum. + * @name google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType + * @enum {number} + * @property {number} RECORDING_DEVICE_TYPE_UNSPECIFIED=0 RECORDING_DEVICE_TYPE_UNSPECIFIED value + * @property {number} SMARTPHONE=1 SMARTPHONE value + * @property {number} PC=2 PC value + * @property {number} PHONE_LINE=3 PHONE_LINE value + * @property {number} VEHICLE=4 VEHICLE value + * @property {number} OTHER_OUTDOOR_DEVICE=5 OTHER_OUTDOOR_DEVICE value + * @property {number} OTHER_INDOOR_DEVICE=6 OTHER_INDOOR_DEVICE value + */ + RecognitionMetadata.RecordingDeviceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RECORDING_DEVICE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SMARTPHONE"] = 1; + values[valuesById[2] = "PC"] = 2; + values[valuesById[3] = "PHONE_LINE"] = 3; + values[valuesById[4] = "VEHICLE"] = 4; + values[valuesById[5] = "OTHER_OUTDOOR_DEVICE"] = 5; + values[valuesById[6] = "OTHER_INDOOR_DEVICE"] = 6; + return values; + })(); + + return RecognitionMetadata; + })(); + + v1.SpeechContext = (function() { + + /** + * Properties of a SpeechContext. + * @memberof google.cloud.speech.v1 + * @interface ISpeechContext + * @property {Array.|null} [phrases] SpeechContext phrases + * @property {number|null} [boost] SpeechContext boost + */ + + /** + * Constructs a new SpeechContext. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a SpeechContext. + * @implements ISpeechContext + * @constructor + * @param {google.cloud.speech.v1.ISpeechContext=} [properties] Properties to set + */ + function SpeechContext(properties) { + this.phrases = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpeechContext phrases. + * @member {Array.} phrases + * @memberof google.cloud.speech.v1.SpeechContext + * @instance + */ + SpeechContext.prototype.phrases = $util.emptyArray; + + /** + * SpeechContext boost. + * @member {number} boost + * @memberof google.cloud.speech.v1.SpeechContext + * @instance + */ + SpeechContext.prototype.boost = 0; + + /** + * Creates a new SpeechContext instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.SpeechContext + * @static + * @param {google.cloud.speech.v1.ISpeechContext=} [properties] Properties to set + * @returns {google.cloud.speech.v1.SpeechContext} SpeechContext instance + */ + SpeechContext.create = function create(properties) { + return new SpeechContext(properties); + }; + + /** + * Encodes the specified SpeechContext message. Does not implicitly {@link google.cloud.speech.v1.SpeechContext.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.SpeechContext + * @static + * @param {google.cloud.speech.v1.ISpeechContext} message SpeechContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechContext.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.phrases != null && message.phrases.length) + for (var i = 0; i < message.phrases.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.phrases[i]); + if (message.boost != null && Object.hasOwnProperty.call(message, "boost")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.boost); + return writer; + }; + + /** + * Encodes the specified SpeechContext message, length delimited. Does not implicitly {@link google.cloud.speech.v1.SpeechContext.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.SpeechContext + * @static + * @param {google.cloud.speech.v1.ISpeechContext} message SpeechContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechContext.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpeechContext message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.SpeechContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.SpeechContext} SpeechContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechContext.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.SpeechContext(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.phrases && message.phrases.length)) + message.phrases = []; + message.phrases.push(reader.string()); + break; + } + case 4: { + message.boost = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpeechContext message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.SpeechContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.SpeechContext} SpeechContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechContext.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpeechContext message. + * @function verify + * @memberof google.cloud.speech.v1.SpeechContext + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpeechContext.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.phrases != null && message.hasOwnProperty("phrases")) { + if (!Array.isArray(message.phrases)) + return "phrases: array expected"; + for (var i = 0; i < message.phrases.length; ++i) + if (!$util.isString(message.phrases[i])) + return "phrases: string[] expected"; + } + if (message.boost != null && message.hasOwnProperty("boost")) + if (typeof message.boost !== "number") + return "boost: number expected"; + return null; + }; + + /** + * Creates a SpeechContext message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.SpeechContext + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.SpeechContext} SpeechContext + */ + SpeechContext.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.SpeechContext) + return object; + var message = new $root.google.cloud.speech.v1.SpeechContext(); + if (object.phrases) { + if (!Array.isArray(object.phrases)) + throw TypeError(".google.cloud.speech.v1.SpeechContext.phrases: array expected"); + message.phrases = []; + for (var i = 0; i < object.phrases.length; ++i) + message.phrases[i] = String(object.phrases[i]); + } + if (object.boost != null) + message.boost = Number(object.boost); + return message; + }; + + /** + * Creates a plain object from a SpeechContext message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.SpeechContext + * @static + * @param {google.cloud.speech.v1.SpeechContext} message SpeechContext + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpeechContext.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.phrases = []; + if (options.defaults) + object.boost = 0; + if (message.phrases && message.phrases.length) { + object.phrases = []; + for (var j = 0; j < message.phrases.length; ++j) + object.phrases[j] = message.phrases[j]; + } + if (message.boost != null && message.hasOwnProperty("boost")) + object.boost = options.json && !isFinite(message.boost) ? String(message.boost) : message.boost; + return object; + }; + + /** + * Converts this SpeechContext to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.SpeechContext + * @instance + * @returns {Object.} JSON object + */ + SpeechContext.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpeechContext + * @function getTypeUrl + * @memberof google.cloud.speech.v1.SpeechContext + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpeechContext.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.SpeechContext"; + }; + + return SpeechContext; + })(); + + v1.RecognitionAudio = (function() { + + /** + * Properties of a RecognitionAudio. + * @memberof google.cloud.speech.v1 + * @interface IRecognitionAudio + * @property {Uint8Array|null} [content] RecognitionAudio content + * @property {string|null} [uri] RecognitionAudio uri + */ + + /** + * Constructs a new RecognitionAudio. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a RecognitionAudio. + * @implements IRecognitionAudio + * @constructor + * @param {google.cloud.speech.v1.IRecognitionAudio=} [properties] Properties to set + */ + function RecognitionAudio(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RecognitionAudio content. + * @member {Uint8Array|null|undefined} content + * @memberof google.cloud.speech.v1.RecognitionAudio + * @instance + */ + RecognitionAudio.prototype.content = null; + + /** + * RecognitionAudio uri. + * @member {string|null|undefined} uri + * @memberof google.cloud.speech.v1.RecognitionAudio + * @instance + */ + RecognitionAudio.prototype.uri = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RecognitionAudio audioSource. + * @member {"content"|"uri"|undefined} audioSource + * @memberof google.cloud.speech.v1.RecognitionAudio + * @instance + */ + Object.defineProperty(RecognitionAudio.prototype, "audioSource", { + get: $util.oneOfGetter($oneOfFields = ["content", "uri"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RecognitionAudio instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.RecognitionAudio + * @static + * @param {google.cloud.speech.v1.IRecognitionAudio=} [properties] Properties to set + * @returns {google.cloud.speech.v1.RecognitionAudio} RecognitionAudio instance + */ + RecognitionAudio.create = function create(properties) { + return new RecognitionAudio(properties); + }; + + /** + * Encodes the specified RecognitionAudio message. Does not implicitly {@link google.cloud.speech.v1.RecognitionAudio.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.RecognitionAudio + * @static + * @param {google.cloud.speech.v1.IRecognitionAudio} message RecognitionAudio message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecognitionAudio.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.content); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uri); + return writer; + }; + + /** + * Encodes the specified RecognitionAudio message, length delimited. Does not implicitly {@link google.cloud.speech.v1.RecognitionAudio.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.RecognitionAudio + * @static + * @param {google.cloud.speech.v1.IRecognitionAudio} message RecognitionAudio message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecognitionAudio.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RecognitionAudio message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.RecognitionAudio + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.RecognitionAudio} RecognitionAudio + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecognitionAudio.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.RecognitionAudio(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.content = reader.bytes(); + break; + } + case 2: { + message.uri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RecognitionAudio message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.RecognitionAudio + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.RecognitionAudio} RecognitionAudio + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecognitionAudio.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RecognitionAudio message. + * @function verify + * @memberof google.cloud.speech.v1.RecognitionAudio + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RecognitionAudio.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.content != null && message.hasOwnProperty("content")) { + properties.audioSource = 1; + if (!(message.content && typeof message.content.length === "number" || $util.isString(message.content))) + return "content: buffer expected"; + } + if (message.uri != null && message.hasOwnProperty("uri")) { + if (properties.audioSource === 1) + return "audioSource: multiple values"; + properties.audioSource = 1; + if (!$util.isString(message.uri)) + return "uri: string expected"; + } + return null; + }; + + /** + * Creates a RecognitionAudio message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.RecognitionAudio + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.RecognitionAudio} RecognitionAudio + */ + RecognitionAudio.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.RecognitionAudio) + return object; + var message = new $root.google.cloud.speech.v1.RecognitionAudio(); + if (object.content != null) + if (typeof object.content === "string") + $util.base64.decode(object.content, message.content = $util.newBuffer($util.base64.length(object.content)), 0); + else if (object.content.length >= 0) + message.content = object.content; + if (object.uri != null) + message.uri = String(object.uri); + return message; + }; + + /** + * Creates a plain object from a RecognitionAudio message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.RecognitionAudio + * @static + * @param {google.cloud.speech.v1.RecognitionAudio} message RecognitionAudio + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RecognitionAudio.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.content != null && message.hasOwnProperty("content")) { + object.content = options.bytes === String ? $util.base64.encode(message.content, 0, message.content.length) : options.bytes === Array ? Array.prototype.slice.call(message.content) : message.content; + if (options.oneofs) + object.audioSource = "content"; + } + if (message.uri != null && message.hasOwnProperty("uri")) { + object.uri = message.uri; + if (options.oneofs) + object.audioSource = "uri"; + } + return object; + }; + + /** + * Converts this RecognitionAudio to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.RecognitionAudio + * @instance + * @returns {Object.} JSON object + */ + RecognitionAudio.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RecognitionAudio + * @function getTypeUrl + * @memberof google.cloud.speech.v1.RecognitionAudio + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RecognitionAudio.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.RecognitionAudio"; + }; + + return RecognitionAudio; + })(); + + v1.RecognizeResponse = (function() { + + /** + * Properties of a RecognizeResponse. + * @memberof google.cloud.speech.v1 + * @interface IRecognizeResponse + * @property {Array.|null} [results] RecognizeResponse results + * @property {google.protobuf.IDuration|null} [totalBilledTime] RecognizeResponse totalBilledTime + * @property {google.cloud.speech.v1.ISpeechAdaptationInfo|null} [speechAdaptationInfo] RecognizeResponse speechAdaptationInfo + * @property {number|Long|null} [requestId] RecognizeResponse requestId + */ + + /** + * Constructs a new RecognizeResponse. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a RecognizeResponse. + * @implements IRecognizeResponse + * @constructor + * @param {google.cloud.speech.v1.IRecognizeResponse=} [properties] Properties to set + */ + function RecognizeResponse(properties) { + this.results = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RecognizeResponse results. + * @member {Array.} results + * @memberof google.cloud.speech.v1.RecognizeResponse + * @instance + */ + RecognizeResponse.prototype.results = $util.emptyArray; + + /** + * RecognizeResponse totalBilledTime. + * @member {google.protobuf.IDuration|null|undefined} totalBilledTime + * @memberof google.cloud.speech.v1.RecognizeResponse + * @instance + */ + RecognizeResponse.prototype.totalBilledTime = null; + + /** + * RecognizeResponse speechAdaptationInfo. + * @member {google.cloud.speech.v1.ISpeechAdaptationInfo|null|undefined} speechAdaptationInfo + * @memberof google.cloud.speech.v1.RecognizeResponse + * @instance + */ + RecognizeResponse.prototype.speechAdaptationInfo = null; + + /** + * RecognizeResponse requestId. + * @member {number|Long} requestId + * @memberof google.cloud.speech.v1.RecognizeResponse + * @instance + */ + RecognizeResponse.prototype.requestId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RecognizeResponse instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.RecognizeResponse + * @static + * @param {google.cloud.speech.v1.IRecognizeResponse=} [properties] Properties to set + * @returns {google.cloud.speech.v1.RecognizeResponse} RecognizeResponse instance + */ + RecognizeResponse.create = function create(properties) { + return new RecognizeResponse(properties); + }; + + /** + * Encodes the specified RecognizeResponse message. Does not implicitly {@link google.cloud.speech.v1.RecognizeResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.RecognizeResponse + * @static + * @param {google.cloud.speech.v1.IRecognizeResponse} message RecognizeResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecognizeResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.results != null && message.results.length) + for (var i = 0; i < message.results.length; ++i) + $root.google.cloud.speech.v1.SpeechRecognitionResult.encode(message.results[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.totalBilledTime != null && Object.hasOwnProperty.call(message, "totalBilledTime")) + $root.google.protobuf.Duration.encode(message.totalBilledTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.speechAdaptationInfo != null && Object.hasOwnProperty.call(message, "speechAdaptationInfo")) + $root.google.cloud.speech.v1.SpeechAdaptationInfo.encode(message.speechAdaptationInfo, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 8, wireType 0 =*/64).int64(message.requestId); + return writer; + }; + + /** + * Encodes the specified RecognizeResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v1.RecognizeResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.RecognizeResponse + * @static + * @param {google.cloud.speech.v1.IRecognizeResponse} message RecognizeResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecognizeResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RecognizeResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.RecognizeResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.RecognizeResponse} RecognizeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecognizeResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.RecognizeResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.results && message.results.length)) + message.results = []; + message.results.push($root.google.cloud.speech.v1.SpeechRecognitionResult.decode(reader, reader.uint32())); + break; + } + case 3: { + message.totalBilledTime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 7: { + message.speechAdaptationInfo = $root.google.cloud.speech.v1.SpeechAdaptationInfo.decode(reader, reader.uint32()); + break; + } + case 8: { + message.requestId = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RecognizeResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.RecognizeResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.RecognizeResponse} RecognizeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecognizeResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RecognizeResponse message. + * @function verify + * @memberof google.cloud.speech.v1.RecognizeResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RecognizeResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.results != null && message.hasOwnProperty("results")) { + if (!Array.isArray(message.results)) + return "results: array expected"; + for (var i = 0; i < message.results.length; ++i) { + var error = $root.google.cloud.speech.v1.SpeechRecognitionResult.verify(message.results[i]); + if (error) + return "results." + error; + } + } + if (message.totalBilledTime != null && message.hasOwnProperty("totalBilledTime")) { + var error = $root.google.protobuf.Duration.verify(message.totalBilledTime); + if (error) + return "totalBilledTime." + error; + } + if (message.speechAdaptationInfo != null && message.hasOwnProperty("speechAdaptationInfo")) { + var error = $root.google.cloud.speech.v1.SpeechAdaptationInfo.verify(message.speechAdaptationInfo); + if (error) + return "speechAdaptationInfo." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isInteger(message.requestId) && !(message.requestId && $util.isInteger(message.requestId.low) && $util.isInteger(message.requestId.high))) + return "requestId: integer|Long expected"; + return null; + }; + + /** + * Creates a RecognizeResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.RecognizeResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.RecognizeResponse} RecognizeResponse + */ + RecognizeResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.RecognizeResponse) + return object; + var message = new $root.google.cloud.speech.v1.RecognizeResponse(); + if (object.results) { + if (!Array.isArray(object.results)) + throw TypeError(".google.cloud.speech.v1.RecognizeResponse.results: array expected"); + message.results = []; + for (var i = 0; i < object.results.length; ++i) { + if (typeof object.results[i] !== "object") + throw TypeError(".google.cloud.speech.v1.RecognizeResponse.results: object expected"); + message.results[i] = $root.google.cloud.speech.v1.SpeechRecognitionResult.fromObject(object.results[i]); + } + } + if (object.totalBilledTime != null) { + if (typeof object.totalBilledTime !== "object") + throw TypeError(".google.cloud.speech.v1.RecognizeResponse.totalBilledTime: object expected"); + message.totalBilledTime = $root.google.protobuf.Duration.fromObject(object.totalBilledTime); + } + if (object.speechAdaptationInfo != null) { + if (typeof object.speechAdaptationInfo !== "object") + throw TypeError(".google.cloud.speech.v1.RecognizeResponse.speechAdaptationInfo: object expected"); + message.speechAdaptationInfo = $root.google.cloud.speech.v1.SpeechAdaptationInfo.fromObject(object.speechAdaptationInfo); + } + if (object.requestId != null) + if ($util.Long) + (message.requestId = $util.Long.fromValue(object.requestId)).unsigned = false; + else if (typeof object.requestId === "string") + message.requestId = parseInt(object.requestId, 10); + else if (typeof object.requestId === "number") + message.requestId = object.requestId; + else if (typeof object.requestId === "object") + message.requestId = new $util.LongBits(object.requestId.low >>> 0, object.requestId.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a RecognizeResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.RecognizeResponse + * @static + * @param {google.cloud.speech.v1.RecognizeResponse} message RecognizeResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RecognizeResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.results = []; + if (options.defaults) { + object.totalBilledTime = null; + object.speechAdaptationInfo = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.requestId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.requestId = options.longs === String ? "0" : 0; + } + if (message.results && message.results.length) { + object.results = []; + for (var j = 0; j < message.results.length; ++j) + object.results[j] = $root.google.cloud.speech.v1.SpeechRecognitionResult.toObject(message.results[j], options); + } + if (message.totalBilledTime != null && message.hasOwnProperty("totalBilledTime")) + object.totalBilledTime = $root.google.protobuf.Duration.toObject(message.totalBilledTime, options); + if (message.speechAdaptationInfo != null && message.hasOwnProperty("speechAdaptationInfo")) + object.speechAdaptationInfo = $root.google.cloud.speech.v1.SpeechAdaptationInfo.toObject(message.speechAdaptationInfo, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (typeof message.requestId === "number") + object.requestId = options.longs === String ? String(message.requestId) : message.requestId; + else + object.requestId = options.longs === String ? $util.Long.prototype.toString.call(message.requestId) : options.longs === Number ? new $util.LongBits(message.requestId.low >>> 0, message.requestId.high >>> 0).toNumber() : message.requestId; + return object; + }; + + /** + * Converts this RecognizeResponse to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.RecognizeResponse + * @instance + * @returns {Object.} JSON object + */ + RecognizeResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RecognizeResponse + * @function getTypeUrl + * @memberof google.cloud.speech.v1.RecognizeResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RecognizeResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.RecognizeResponse"; + }; + + return RecognizeResponse; + })(); + + v1.LongRunningRecognizeResponse = (function() { + + /** + * Properties of a LongRunningRecognizeResponse. + * @memberof google.cloud.speech.v1 + * @interface ILongRunningRecognizeResponse + * @property {Array.|null} [results] LongRunningRecognizeResponse results + * @property {google.protobuf.IDuration|null} [totalBilledTime] LongRunningRecognizeResponse totalBilledTime + * @property {google.cloud.speech.v1.ITranscriptOutputConfig|null} [outputConfig] LongRunningRecognizeResponse outputConfig + * @property {google.rpc.IStatus|null} [outputError] LongRunningRecognizeResponse outputError + * @property {google.cloud.speech.v1.ISpeechAdaptationInfo|null} [speechAdaptationInfo] LongRunningRecognizeResponse speechAdaptationInfo + * @property {number|Long|null} [requestId] LongRunningRecognizeResponse requestId + */ + + /** + * Constructs a new LongRunningRecognizeResponse. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a LongRunningRecognizeResponse. + * @implements ILongRunningRecognizeResponse + * @constructor + * @param {google.cloud.speech.v1.ILongRunningRecognizeResponse=} [properties] Properties to set + */ + function LongRunningRecognizeResponse(properties) { + this.results = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LongRunningRecognizeResponse results. + * @member {Array.} results + * @memberof google.cloud.speech.v1.LongRunningRecognizeResponse + * @instance + */ + LongRunningRecognizeResponse.prototype.results = $util.emptyArray; + + /** + * LongRunningRecognizeResponse totalBilledTime. + * @member {google.protobuf.IDuration|null|undefined} totalBilledTime + * @memberof google.cloud.speech.v1.LongRunningRecognizeResponse + * @instance + */ + LongRunningRecognizeResponse.prototype.totalBilledTime = null; + + /** + * LongRunningRecognizeResponse outputConfig. + * @member {google.cloud.speech.v1.ITranscriptOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.speech.v1.LongRunningRecognizeResponse + * @instance + */ + LongRunningRecognizeResponse.prototype.outputConfig = null; + + /** + * LongRunningRecognizeResponse outputError. + * @member {google.rpc.IStatus|null|undefined} outputError + * @memberof google.cloud.speech.v1.LongRunningRecognizeResponse + * @instance + */ + LongRunningRecognizeResponse.prototype.outputError = null; + + /** + * LongRunningRecognizeResponse speechAdaptationInfo. + * @member {google.cloud.speech.v1.ISpeechAdaptationInfo|null|undefined} speechAdaptationInfo + * @memberof google.cloud.speech.v1.LongRunningRecognizeResponse + * @instance + */ + LongRunningRecognizeResponse.prototype.speechAdaptationInfo = null; + + /** + * LongRunningRecognizeResponse requestId. + * @member {number|Long} requestId + * @memberof google.cloud.speech.v1.LongRunningRecognizeResponse + * @instance + */ + LongRunningRecognizeResponse.prototype.requestId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new LongRunningRecognizeResponse instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.LongRunningRecognizeResponse + * @static + * @param {google.cloud.speech.v1.ILongRunningRecognizeResponse=} [properties] Properties to set + * @returns {google.cloud.speech.v1.LongRunningRecognizeResponse} LongRunningRecognizeResponse instance + */ + LongRunningRecognizeResponse.create = function create(properties) { + return new LongRunningRecognizeResponse(properties); + }; + + /** + * Encodes the specified LongRunningRecognizeResponse message. Does not implicitly {@link google.cloud.speech.v1.LongRunningRecognizeResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.LongRunningRecognizeResponse + * @static + * @param {google.cloud.speech.v1.ILongRunningRecognizeResponse} message LongRunningRecognizeResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunningRecognizeResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.results != null && message.results.length) + for (var i = 0; i < message.results.length; ++i) + $root.google.cloud.speech.v1.SpeechRecognitionResult.encode(message.results[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.totalBilledTime != null && Object.hasOwnProperty.call(message, "totalBilledTime")) + $root.google.protobuf.Duration.encode(message.totalBilledTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) + $root.google.cloud.speech.v1.TranscriptOutputConfig.encode(message.outputConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.outputError != null && Object.hasOwnProperty.call(message, "outputError")) + $root.google.rpc.Status.encode(message.outputError, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.speechAdaptationInfo != null && Object.hasOwnProperty.call(message, "speechAdaptationInfo")) + $root.google.cloud.speech.v1.SpeechAdaptationInfo.encode(message.speechAdaptationInfo, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 9, wireType 0 =*/72).int64(message.requestId); + return writer; + }; + + /** + * Encodes the specified LongRunningRecognizeResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v1.LongRunningRecognizeResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.LongRunningRecognizeResponse + * @static + * @param {google.cloud.speech.v1.ILongRunningRecognizeResponse} message LongRunningRecognizeResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunningRecognizeResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LongRunningRecognizeResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.LongRunningRecognizeResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.LongRunningRecognizeResponse} LongRunningRecognizeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunningRecognizeResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.LongRunningRecognizeResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.results && message.results.length)) + message.results = []; + message.results.push($root.google.cloud.speech.v1.SpeechRecognitionResult.decode(reader, reader.uint32())); + break; + } + case 3: { + message.totalBilledTime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 6: { + message.outputConfig = $root.google.cloud.speech.v1.TranscriptOutputConfig.decode(reader, reader.uint32()); + break; + } + case 7: { + message.outputError = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 8: { + message.speechAdaptationInfo = $root.google.cloud.speech.v1.SpeechAdaptationInfo.decode(reader, reader.uint32()); + break; + } + case 9: { + message.requestId = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LongRunningRecognizeResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.LongRunningRecognizeResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.LongRunningRecognizeResponse} LongRunningRecognizeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunningRecognizeResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LongRunningRecognizeResponse message. + * @function verify + * @memberof google.cloud.speech.v1.LongRunningRecognizeResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LongRunningRecognizeResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.results != null && message.hasOwnProperty("results")) { + if (!Array.isArray(message.results)) + return "results: array expected"; + for (var i = 0; i < message.results.length; ++i) { + var error = $root.google.cloud.speech.v1.SpeechRecognitionResult.verify(message.results[i]); + if (error) + return "results." + error; + } + } + if (message.totalBilledTime != null && message.hasOwnProperty("totalBilledTime")) { + var error = $root.google.protobuf.Duration.verify(message.totalBilledTime); + if (error) + return "totalBilledTime." + error; + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.speech.v1.TranscriptOutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + if (message.outputError != null && message.hasOwnProperty("outputError")) { + var error = $root.google.rpc.Status.verify(message.outputError); + if (error) + return "outputError." + error; + } + if (message.speechAdaptationInfo != null && message.hasOwnProperty("speechAdaptationInfo")) { + var error = $root.google.cloud.speech.v1.SpeechAdaptationInfo.verify(message.speechAdaptationInfo); + if (error) + return "speechAdaptationInfo." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isInteger(message.requestId) && !(message.requestId && $util.isInteger(message.requestId.low) && $util.isInteger(message.requestId.high))) + return "requestId: integer|Long expected"; + return null; + }; + + /** + * Creates a LongRunningRecognizeResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.LongRunningRecognizeResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.LongRunningRecognizeResponse} LongRunningRecognizeResponse + */ + LongRunningRecognizeResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.LongRunningRecognizeResponse) + return object; + var message = new $root.google.cloud.speech.v1.LongRunningRecognizeResponse(); + if (object.results) { + if (!Array.isArray(object.results)) + throw TypeError(".google.cloud.speech.v1.LongRunningRecognizeResponse.results: array expected"); + message.results = []; + for (var i = 0; i < object.results.length; ++i) { + if (typeof object.results[i] !== "object") + throw TypeError(".google.cloud.speech.v1.LongRunningRecognizeResponse.results: object expected"); + message.results[i] = $root.google.cloud.speech.v1.SpeechRecognitionResult.fromObject(object.results[i]); + } + } + if (object.totalBilledTime != null) { + if (typeof object.totalBilledTime !== "object") + throw TypeError(".google.cloud.speech.v1.LongRunningRecognizeResponse.totalBilledTime: object expected"); + message.totalBilledTime = $root.google.protobuf.Duration.fromObject(object.totalBilledTime); + } + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.speech.v1.LongRunningRecognizeResponse.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.speech.v1.TranscriptOutputConfig.fromObject(object.outputConfig); + } + if (object.outputError != null) { + if (typeof object.outputError !== "object") + throw TypeError(".google.cloud.speech.v1.LongRunningRecognizeResponse.outputError: object expected"); + message.outputError = $root.google.rpc.Status.fromObject(object.outputError); + } + if (object.speechAdaptationInfo != null) { + if (typeof object.speechAdaptationInfo !== "object") + throw TypeError(".google.cloud.speech.v1.LongRunningRecognizeResponse.speechAdaptationInfo: object expected"); + message.speechAdaptationInfo = $root.google.cloud.speech.v1.SpeechAdaptationInfo.fromObject(object.speechAdaptationInfo); + } + if (object.requestId != null) + if ($util.Long) + (message.requestId = $util.Long.fromValue(object.requestId)).unsigned = false; + else if (typeof object.requestId === "string") + message.requestId = parseInt(object.requestId, 10); + else if (typeof object.requestId === "number") + message.requestId = object.requestId; + else if (typeof object.requestId === "object") + message.requestId = new $util.LongBits(object.requestId.low >>> 0, object.requestId.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a LongRunningRecognizeResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.LongRunningRecognizeResponse + * @static + * @param {google.cloud.speech.v1.LongRunningRecognizeResponse} message LongRunningRecognizeResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LongRunningRecognizeResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.results = []; + if (options.defaults) { + object.totalBilledTime = null; + object.outputConfig = null; + object.outputError = null; + object.speechAdaptationInfo = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.requestId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.requestId = options.longs === String ? "0" : 0; + } + if (message.results && message.results.length) { + object.results = []; + for (var j = 0; j < message.results.length; ++j) + object.results[j] = $root.google.cloud.speech.v1.SpeechRecognitionResult.toObject(message.results[j], options); + } + if (message.totalBilledTime != null && message.hasOwnProperty("totalBilledTime")) + object.totalBilledTime = $root.google.protobuf.Duration.toObject(message.totalBilledTime, options); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.speech.v1.TranscriptOutputConfig.toObject(message.outputConfig, options); + if (message.outputError != null && message.hasOwnProperty("outputError")) + object.outputError = $root.google.rpc.Status.toObject(message.outputError, options); + if (message.speechAdaptationInfo != null && message.hasOwnProperty("speechAdaptationInfo")) + object.speechAdaptationInfo = $root.google.cloud.speech.v1.SpeechAdaptationInfo.toObject(message.speechAdaptationInfo, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (typeof message.requestId === "number") + object.requestId = options.longs === String ? String(message.requestId) : message.requestId; + else + object.requestId = options.longs === String ? $util.Long.prototype.toString.call(message.requestId) : options.longs === Number ? new $util.LongBits(message.requestId.low >>> 0, message.requestId.high >>> 0).toNumber() : message.requestId; + return object; + }; + + /** + * Converts this LongRunningRecognizeResponse to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.LongRunningRecognizeResponse + * @instance + * @returns {Object.} JSON object + */ + LongRunningRecognizeResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LongRunningRecognizeResponse + * @function getTypeUrl + * @memberof google.cloud.speech.v1.LongRunningRecognizeResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LongRunningRecognizeResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.LongRunningRecognizeResponse"; + }; + + return LongRunningRecognizeResponse; + })(); + + v1.LongRunningRecognizeMetadata = (function() { + + /** + * Properties of a LongRunningRecognizeMetadata. + * @memberof google.cloud.speech.v1 + * @interface ILongRunningRecognizeMetadata + * @property {number|null} [progressPercent] LongRunningRecognizeMetadata progressPercent + * @property {google.protobuf.ITimestamp|null} [startTime] LongRunningRecognizeMetadata startTime + * @property {google.protobuf.ITimestamp|null} [lastUpdateTime] LongRunningRecognizeMetadata lastUpdateTime + * @property {string|null} [uri] LongRunningRecognizeMetadata uri + */ + + /** + * Constructs a new LongRunningRecognizeMetadata. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a LongRunningRecognizeMetadata. + * @implements ILongRunningRecognizeMetadata + * @constructor + * @param {google.cloud.speech.v1.ILongRunningRecognizeMetadata=} [properties] Properties to set + */ + function LongRunningRecognizeMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LongRunningRecognizeMetadata progressPercent. + * @member {number} progressPercent + * @memberof google.cloud.speech.v1.LongRunningRecognizeMetadata + * @instance + */ + LongRunningRecognizeMetadata.prototype.progressPercent = 0; + + /** + * LongRunningRecognizeMetadata startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.speech.v1.LongRunningRecognizeMetadata + * @instance + */ + LongRunningRecognizeMetadata.prototype.startTime = null; + + /** + * LongRunningRecognizeMetadata lastUpdateTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastUpdateTime + * @memberof google.cloud.speech.v1.LongRunningRecognizeMetadata + * @instance + */ + LongRunningRecognizeMetadata.prototype.lastUpdateTime = null; + + /** + * LongRunningRecognizeMetadata uri. + * @member {string} uri + * @memberof google.cloud.speech.v1.LongRunningRecognizeMetadata + * @instance + */ + LongRunningRecognizeMetadata.prototype.uri = ""; + + /** + * Creates a new LongRunningRecognizeMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.LongRunningRecognizeMetadata + * @static + * @param {google.cloud.speech.v1.ILongRunningRecognizeMetadata=} [properties] Properties to set + * @returns {google.cloud.speech.v1.LongRunningRecognizeMetadata} LongRunningRecognizeMetadata instance + */ + LongRunningRecognizeMetadata.create = function create(properties) { + return new LongRunningRecognizeMetadata(properties); + }; + + /** + * Encodes the specified LongRunningRecognizeMetadata message. Does not implicitly {@link google.cloud.speech.v1.LongRunningRecognizeMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.LongRunningRecognizeMetadata + * @static + * @param {google.cloud.speech.v1.ILongRunningRecognizeMetadata} message LongRunningRecognizeMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunningRecognizeMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.progressPercent != null && Object.hasOwnProperty.call(message, "progressPercent")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.progressPercent); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.lastUpdateTime != null && Object.hasOwnProperty.call(message, "lastUpdateTime")) + $root.google.protobuf.Timestamp.encode(message.lastUpdateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.uri); + return writer; + }; + + /** + * Encodes the specified LongRunningRecognizeMetadata message, length delimited. Does not implicitly {@link google.cloud.speech.v1.LongRunningRecognizeMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.LongRunningRecognizeMetadata + * @static + * @param {google.cloud.speech.v1.ILongRunningRecognizeMetadata} message LongRunningRecognizeMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunningRecognizeMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LongRunningRecognizeMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.LongRunningRecognizeMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.LongRunningRecognizeMetadata} LongRunningRecognizeMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunningRecognizeMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.LongRunningRecognizeMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.progressPercent = reader.int32(); + break; + } + case 2: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.lastUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.uri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LongRunningRecognizeMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.LongRunningRecognizeMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.LongRunningRecognizeMetadata} LongRunningRecognizeMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunningRecognizeMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LongRunningRecognizeMetadata message. + * @function verify + * @memberof google.cloud.speech.v1.LongRunningRecognizeMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LongRunningRecognizeMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + if (!$util.isInteger(message.progressPercent)) + return "progressPercent: integer expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.lastUpdateTime != null && message.hasOwnProperty("lastUpdateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastUpdateTime); + if (error) + return "lastUpdateTime." + error; + } + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + return null; + }; + + /** + * Creates a LongRunningRecognizeMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.LongRunningRecognizeMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.LongRunningRecognizeMetadata} LongRunningRecognizeMetadata + */ + LongRunningRecognizeMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.LongRunningRecognizeMetadata) + return object; + var message = new $root.google.cloud.speech.v1.LongRunningRecognizeMetadata(); + if (object.progressPercent != null) + message.progressPercent = object.progressPercent | 0; + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.speech.v1.LongRunningRecognizeMetadata.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.lastUpdateTime != null) { + if (typeof object.lastUpdateTime !== "object") + throw TypeError(".google.cloud.speech.v1.LongRunningRecognizeMetadata.lastUpdateTime: object expected"); + message.lastUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.lastUpdateTime); + } + if (object.uri != null) + message.uri = String(object.uri); + return message; + }; + + /** + * Creates a plain object from a LongRunningRecognizeMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.LongRunningRecognizeMetadata + * @static + * @param {google.cloud.speech.v1.LongRunningRecognizeMetadata} message LongRunningRecognizeMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LongRunningRecognizeMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.progressPercent = 0; + object.startTime = null; + object.lastUpdateTime = null; + object.uri = ""; + } + if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + object.progressPercent = message.progressPercent; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.lastUpdateTime != null && message.hasOwnProperty("lastUpdateTime")) + object.lastUpdateTime = $root.google.protobuf.Timestamp.toObject(message.lastUpdateTime, options); + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + return object; + }; + + /** + * Converts this LongRunningRecognizeMetadata to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.LongRunningRecognizeMetadata + * @instance + * @returns {Object.} JSON object + */ + LongRunningRecognizeMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LongRunningRecognizeMetadata + * @function getTypeUrl + * @memberof google.cloud.speech.v1.LongRunningRecognizeMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LongRunningRecognizeMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.LongRunningRecognizeMetadata"; + }; + + return LongRunningRecognizeMetadata; + })(); + + v1.StreamingRecognizeResponse = (function() { + + /** + * Properties of a StreamingRecognizeResponse. + * @memberof google.cloud.speech.v1 + * @interface IStreamingRecognizeResponse + * @property {google.rpc.IStatus|null} [error] StreamingRecognizeResponse error + * @property {Array.|null} [results] StreamingRecognizeResponse results + * @property {google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType|null} [speechEventType] StreamingRecognizeResponse speechEventType + * @property {google.protobuf.IDuration|null} [speechEventTime] StreamingRecognizeResponse speechEventTime + * @property {google.protobuf.IDuration|null} [totalBilledTime] StreamingRecognizeResponse totalBilledTime + * @property {google.cloud.speech.v1.ISpeechAdaptationInfo|null} [speechAdaptationInfo] StreamingRecognizeResponse speechAdaptationInfo + * @property {number|Long|null} [requestId] StreamingRecognizeResponse requestId + */ + + /** + * Constructs a new StreamingRecognizeResponse. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a StreamingRecognizeResponse. + * @implements IStreamingRecognizeResponse + * @constructor + * @param {google.cloud.speech.v1.IStreamingRecognizeResponse=} [properties] Properties to set + */ + function StreamingRecognizeResponse(properties) { + this.results = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamingRecognizeResponse error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.speech.v1.StreamingRecognizeResponse + * @instance + */ + StreamingRecognizeResponse.prototype.error = null; + + /** + * StreamingRecognizeResponse results. + * @member {Array.} results + * @memberof google.cloud.speech.v1.StreamingRecognizeResponse + * @instance + */ + StreamingRecognizeResponse.prototype.results = $util.emptyArray; + + /** + * StreamingRecognizeResponse speechEventType. + * @member {google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType} speechEventType + * @memberof google.cloud.speech.v1.StreamingRecognizeResponse + * @instance + */ + StreamingRecognizeResponse.prototype.speechEventType = 0; + + /** + * StreamingRecognizeResponse speechEventTime. + * @member {google.protobuf.IDuration|null|undefined} speechEventTime + * @memberof google.cloud.speech.v1.StreamingRecognizeResponse + * @instance + */ + StreamingRecognizeResponse.prototype.speechEventTime = null; + + /** + * StreamingRecognizeResponse totalBilledTime. + * @member {google.protobuf.IDuration|null|undefined} totalBilledTime + * @memberof google.cloud.speech.v1.StreamingRecognizeResponse + * @instance + */ + StreamingRecognizeResponse.prototype.totalBilledTime = null; + + /** + * StreamingRecognizeResponse speechAdaptationInfo. + * @member {google.cloud.speech.v1.ISpeechAdaptationInfo|null|undefined} speechAdaptationInfo + * @memberof google.cloud.speech.v1.StreamingRecognizeResponse + * @instance + */ + StreamingRecognizeResponse.prototype.speechAdaptationInfo = null; + + /** + * StreamingRecognizeResponse requestId. + * @member {number|Long} requestId + * @memberof google.cloud.speech.v1.StreamingRecognizeResponse + * @instance + */ + StreamingRecognizeResponse.prototype.requestId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new StreamingRecognizeResponse instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.StreamingRecognizeResponse + * @static + * @param {google.cloud.speech.v1.IStreamingRecognizeResponse=} [properties] Properties to set + * @returns {google.cloud.speech.v1.StreamingRecognizeResponse} StreamingRecognizeResponse instance + */ + StreamingRecognizeResponse.create = function create(properties) { + return new StreamingRecognizeResponse(properties); + }; + + /** + * Encodes the specified StreamingRecognizeResponse message. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognizeResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.StreamingRecognizeResponse + * @static + * @param {google.cloud.speech.v1.IStreamingRecognizeResponse} message StreamingRecognizeResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingRecognizeResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.results != null && message.results.length) + for (var i = 0; i < message.results.length; ++i) + $root.google.cloud.speech.v1.StreamingRecognitionResult.encode(message.results[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.speechEventType != null && Object.hasOwnProperty.call(message, "speechEventType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.speechEventType); + if (message.totalBilledTime != null && Object.hasOwnProperty.call(message, "totalBilledTime")) + $root.google.protobuf.Duration.encode(message.totalBilledTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.speechEventTime != null && Object.hasOwnProperty.call(message, "speechEventTime")) + $root.google.protobuf.Duration.encode(message.speechEventTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.speechAdaptationInfo != null && Object.hasOwnProperty.call(message, "speechAdaptationInfo")) + $root.google.cloud.speech.v1.SpeechAdaptationInfo.encode(message.speechAdaptationInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 10, wireType 0 =*/80).int64(message.requestId); + return writer; + }; + + /** + * Encodes the specified StreamingRecognizeResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognizeResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.StreamingRecognizeResponse + * @static + * @param {google.cloud.speech.v1.IStreamingRecognizeResponse} message StreamingRecognizeResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingRecognizeResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamingRecognizeResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.StreamingRecognizeResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.StreamingRecognizeResponse} StreamingRecognizeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingRecognizeResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.StreamingRecognizeResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.results && message.results.length)) + message.results = []; + message.results.push($root.google.cloud.speech.v1.StreamingRecognitionResult.decode(reader, reader.uint32())); + break; + } + case 4: { + message.speechEventType = reader.int32(); + break; + } + case 8: { + message.speechEventTime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 5: { + message.totalBilledTime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 9: { + message.speechAdaptationInfo = $root.google.cloud.speech.v1.SpeechAdaptationInfo.decode(reader, reader.uint32()); + break; + } + case 10: { + message.requestId = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamingRecognizeResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.StreamingRecognizeResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.StreamingRecognizeResponse} StreamingRecognizeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingRecognizeResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamingRecognizeResponse message. + * @function verify + * @memberof google.cloud.speech.v1.StreamingRecognizeResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingRecognizeResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.error != null && message.hasOwnProperty("error")) { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + if (message.results != null && message.hasOwnProperty("results")) { + if (!Array.isArray(message.results)) + return "results: array expected"; + for (var i = 0; i < message.results.length; ++i) { + var error = $root.google.cloud.speech.v1.StreamingRecognitionResult.verify(message.results[i]); + if (error) + return "results." + error; + } + } + if (message.speechEventType != null && message.hasOwnProperty("speechEventType")) + switch (message.speechEventType) { + default: + return "speechEventType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.speechEventTime != null && message.hasOwnProperty("speechEventTime")) { + var error = $root.google.protobuf.Duration.verify(message.speechEventTime); + if (error) + return "speechEventTime." + error; + } + if (message.totalBilledTime != null && message.hasOwnProperty("totalBilledTime")) { + var error = $root.google.protobuf.Duration.verify(message.totalBilledTime); + if (error) + return "totalBilledTime." + error; + } + if (message.speechAdaptationInfo != null && message.hasOwnProperty("speechAdaptationInfo")) { + var error = $root.google.cloud.speech.v1.SpeechAdaptationInfo.verify(message.speechAdaptationInfo); + if (error) + return "speechAdaptationInfo." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isInteger(message.requestId) && !(message.requestId && $util.isInteger(message.requestId.low) && $util.isInteger(message.requestId.high))) + return "requestId: integer|Long expected"; + return null; + }; + + /** + * Creates a StreamingRecognizeResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.StreamingRecognizeResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.StreamingRecognizeResponse} StreamingRecognizeResponse + */ + StreamingRecognizeResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.StreamingRecognizeResponse) + return object; + var message = new $root.google.cloud.speech.v1.StreamingRecognizeResponse(); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.speech.v1.StreamingRecognizeResponse.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.results) { + if (!Array.isArray(object.results)) + throw TypeError(".google.cloud.speech.v1.StreamingRecognizeResponse.results: array expected"); + message.results = []; + for (var i = 0; i < object.results.length; ++i) { + if (typeof object.results[i] !== "object") + throw TypeError(".google.cloud.speech.v1.StreamingRecognizeResponse.results: object expected"); + message.results[i] = $root.google.cloud.speech.v1.StreamingRecognitionResult.fromObject(object.results[i]); + } + } + switch (object.speechEventType) { + default: + if (typeof object.speechEventType === "number") { + message.speechEventType = object.speechEventType; + break; + } + break; + case "SPEECH_EVENT_UNSPECIFIED": + case 0: + message.speechEventType = 0; + break; + case "END_OF_SINGLE_UTTERANCE": + case 1: + message.speechEventType = 1; + break; + case "SPEECH_ACTIVITY_BEGIN": + case 2: + message.speechEventType = 2; + break; + case "SPEECH_ACTIVITY_END": + case 3: + message.speechEventType = 3; + break; + case "SPEECH_ACTIVITY_TIMEOUT": + case 4: + message.speechEventType = 4; + break; + } + if (object.speechEventTime != null) { + if (typeof object.speechEventTime !== "object") + throw TypeError(".google.cloud.speech.v1.StreamingRecognizeResponse.speechEventTime: object expected"); + message.speechEventTime = $root.google.protobuf.Duration.fromObject(object.speechEventTime); + } + if (object.totalBilledTime != null) { + if (typeof object.totalBilledTime !== "object") + throw TypeError(".google.cloud.speech.v1.StreamingRecognizeResponse.totalBilledTime: object expected"); + message.totalBilledTime = $root.google.protobuf.Duration.fromObject(object.totalBilledTime); + } + if (object.speechAdaptationInfo != null) { + if (typeof object.speechAdaptationInfo !== "object") + throw TypeError(".google.cloud.speech.v1.StreamingRecognizeResponse.speechAdaptationInfo: object expected"); + message.speechAdaptationInfo = $root.google.cloud.speech.v1.SpeechAdaptationInfo.fromObject(object.speechAdaptationInfo); + } + if (object.requestId != null) + if ($util.Long) + (message.requestId = $util.Long.fromValue(object.requestId)).unsigned = false; + else if (typeof object.requestId === "string") + message.requestId = parseInt(object.requestId, 10); + else if (typeof object.requestId === "number") + message.requestId = object.requestId; + else if (typeof object.requestId === "object") + message.requestId = new $util.LongBits(object.requestId.low >>> 0, object.requestId.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a StreamingRecognizeResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.StreamingRecognizeResponse + * @static + * @param {google.cloud.speech.v1.StreamingRecognizeResponse} message StreamingRecognizeResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingRecognizeResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.results = []; + if (options.defaults) { + object.error = null; + object.speechEventType = options.enums === String ? "SPEECH_EVENT_UNSPECIFIED" : 0; + object.totalBilledTime = null; + object.speechEventTime = null; + object.speechAdaptationInfo = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.requestId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.requestId = options.longs === String ? "0" : 0; + } + if (message.error != null && message.hasOwnProperty("error")) + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (message.results && message.results.length) { + object.results = []; + for (var j = 0; j < message.results.length; ++j) + object.results[j] = $root.google.cloud.speech.v1.StreamingRecognitionResult.toObject(message.results[j], options); + } + if (message.speechEventType != null && message.hasOwnProperty("speechEventType")) + object.speechEventType = options.enums === String ? $root.google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType[message.speechEventType] === undefined ? message.speechEventType : $root.google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType[message.speechEventType] : message.speechEventType; + if (message.totalBilledTime != null && message.hasOwnProperty("totalBilledTime")) + object.totalBilledTime = $root.google.protobuf.Duration.toObject(message.totalBilledTime, options); + if (message.speechEventTime != null && message.hasOwnProperty("speechEventTime")) + object.speechEventTime = $root.google.protobuf.Duration.toObject(message.speechEventTime, options); + if (message.speechAdaptationInfo != null && message.hasOwnProperty("speechAdaptationInfo")) + object.speechAdaptationInfo = $root.google.cloud.speech.v1.SpeechAdaptationInfo.toObject(message.speechAdaptationInfo, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (typeof message.requestId === "number") + object.requestId = options.longs === String ? String(message.requestId) : message.requestId; + else + object.requestId = options.longs === String ? $util.Long.prototype.toString.call(message.requestId) : options.longs === Number ? new $util.LongBits(message.requestId.low >>> 0, message.requestId.high >>> 0).toNumber() : message.requestId; + return object; + }; + + /** + * Converts this StreamingRecognizeResponse to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.StreamingRecognizeResponse + * @instance + * @returns {Object.} JSON object + */ + StreamingRecognizeResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamingRecognizeResponse + * @function getTypeUrl + * @memberof google.cloud.speech.v1.StreamingRecognizeResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamingRecognizeResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.StreamingRecognizeResponse"; + }; + + /** + * SpeechEventType enum. + * @name google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType + * @enum {number} + * @property {number} SPEECH_EVENT_UNSPECIFIED=0 SPEECH_EVENT_UNSPECIFIED value + * @property {number} END_OF_SINGLE_UTTERANCE=1 END_OF_SINGLE_UTTERANCE value + * @property {number} SPEECH_ACTIVITY_BEGIN=2 SPEECH_ACTIVITY_BEGIN value + * @property {number} SPEECH_ACTIVITY_END=3 SPEECH_ACTIVITY_END value + * @property {number} SPEECH_ACTIVITY_TIMEOUT=4 SPEECH_ACTIVITY_TIMEOUT value + */ + StreamingRecognizeResponse.SpeechEventType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SPEECH_EVENT_UNSPECIFIED"] = 0; + values[valuesById[1] = "END_OF_SINGLE_UTTERANCE"] = 1; + values[valuesById[2] = "SPEECH_ACTIVITY_BEGIN"] = 2; + values[valuesById[3] = "SPEECH_ACTIVITY_END"] = 3; + values[valuesById[4] = "SPEECH_ACTIVITY_TIMEOUT"] = 4; + return values; + })(); + + return StreamingRecognizeResponse; + })(); + + v1.StreamingRecognitionResult = (function() { + + /** + * Properties of a StreamingRecognitionResult. + * @memberof google.cloud.speech.v1 + * @interface IStreamingRecognitionResult + * @property {Array.|null} [alternatives] StreamingRecognitionResult alternatives + * @property {boolean|null} [isFinal] StreamingRecognitionResult isFinal + * @property {number|null} [stability] StreamingRecognitionResult stability + * @property {google.protobuf.IDuration|null} [resultEndTime] StreamingRecognitionResult resultEndTime + * @property {number|null} [channelTag] StreamingRecognitionResult channelTag + * @property {string|null} [languageCode] StreamingRecognitionResult languageCode + */ + + /** + * Constructs a new StreamingRecognitionResult. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a StreamingRecognitionResult. + * @implements IStreamingRecognitionResult + * @constructor + * @param {google.cloud.speech.v1.IStreamingRecognitionResult=} [properties] Properties to set + */ + function StreamingRecognitionResult(properties) { + this.alternatives = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamingRecognitionResult alternatives. + * @member {Array.} alternatives + * @memberof google.cloud.speech.v1.StreamingRecognitionResult + * @instance + */ + StreamingRecognitionResult.prototype.alternatives = $util.emptyArray; + + /** + * StreamingRecognitionResult isFinal. + * @member {boolean} isFinal + * @memberof google.cloud.speech.v1.StreamingRecognitionResult + * @instance + */ + StreamingRecognitionResult.prototype.isFinal = false; + + /** + * StreamingRecognitionResult stability. + * @member {number} stability + * @memberof google.cloud.speech.v1.StreamingRecognitionResult + * @instance + */ + StreamingRecognitionResult.prototype.stability = 0; + + /** + * StreamingRecognitionResult resultEndTime. + * @member {google.protobuf.IDuration|null|undefined} resultEndTime + * @memberof google.cloud.speech.v1.StreamingRecognitionResult + * @instance + */ + StreamingRecognitionResult.prototype.resultEndTime = null; + + /** + * StreamingRecognitionResult channelTag. + * @member {number} channelTag + * @memberof google.cloud.speech.v1.StreamingRecognitionResult + * @instance + */ + StreamingRecognitionResult.prototype.channelTag = 0; + + /** + * StreamingRecognitionResult languageCode. + * @member {string} languageCode + * @memberof google.cloud.speech.v1.StreamingRecognitionResult + * @instance + */ + StreamingRecognitionResult.prototype.languageCode = ""; + + /** + * Creates a new StreamingRecognitionResult instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.StreamingRecognitionResult + * @static + * @param {google.cloud.speech.v1.IStreamingRecognitionResult=} [properties] Properties to set + * @returns {google.cloud.speech.v1.StreamingRecognitionResult} StreamingRecognitionResult instance + */ + StreamingRecognitionResult.create = function create(properties) { + return new StreamingRecognitionResult(properties); + }; + + /** + * Encodes the specified StreamingRecognitionResult message. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognitionResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.StreamingRecognitionResult + * @static + * @param {google.cloud.speech.v1.IStreamingRecognitionResult} message StreamingRecognitionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingRecognitionResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.alternatives != null && message.alternatives.length) + for (var i = 0; i < message.alternatives.length; ++i) + $root.google.cloud.speech.v1.SpeechRecognitionAlternative.encode(message.alternatives[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.isFinal != null && Object.hasOwnProperty.call(message, "isFinal")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isFinal); + if (message.stability != null && Object.hasOwnProperty.call(message, "stability")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.stability); + if (message.resultEndTime != null && Object.hasOwnProperty.call(message, "resultEndTime")) + $root.google.protobuf.Duration.encode(message.resultEndTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.channelTag != null && Object.hasOwnProperty.call(message, "channelTag")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.channelTag); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified StreamingRecognitionResult message, length delimited. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognitionResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.StreamingRecognitionResult + * @static + * @param {google.cloud.speech.v1.IStreamingRecognitionResult} message StreamingRecognitionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingRecognitionResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamingRecognitionResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.StreamingRecognitionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.StreamingRecognitionResult} StreamingRecognitionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingRecognitionResult.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.StreamingRecognitionResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.alternatives && message.alternatives.length)) + message.alternatives = []; + message.alternatives.push($root.google.cloud.speech.v1.SpeechRecognitionAlternative.decode(reader, reader.uint32())); + break; + } + case 2: { + message.isFinal = reader.bool(); + break; + } + case 3: { + message.stability = reader.float(); + break; + } + case 4: { + message.resultEndTime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 5: { + message.channelTag = reader.int32(); + break; + } + case 6: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamingRecognitionResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.StreamingRecognitionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.StreamingRecognitionResult} StreamingRecognitionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingRecognitionResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamingRecognitionResult message. + * @function verify + * @memberof google.cloud.speech.v1.StreamingRecognitionResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingRecognitionResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.alternatives != null && message.hasOwnProperty("alternatives")) { + if (!Array.isArray(message.alternatives)) + return "alternatives: array expected"; + for (var i = 0; i < message.alternatives.length; ++i) { + var error = $root.google.cloud.speech.v1.SpeechRecognitionAlternative.verify(message.alternatives[i]); + if (error) + return "alternatives." + error; + } + } + if (message.isFinal != null && message.hasOwnProperty("isFinal")) + if (typeof message.isFinal !== "boolean") + return "isFinal: boolean expected"; + if (message.stability != null && message.hasOwnProperty("stability")) + if (typeof message.stability !== "number") + return "stability: number expected"; + if (message.resultEndTime != null && message.hasOwnProperty("resultEndTime")) { + var error = $root.google.protobuf.Duration.verify(message.resultEndTime); + if (error) + return "resultEndTime." + error; + } + if (message.channelTag != null && message.hasOwnProperty("channelTag")) + if (!$util.isInteger(message.channelTag)) + return "channelTag: integer expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a StreamingRecognitionResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.StreamingRecognitionResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.StreamingRecognitionResult} StreamingRecognitionResult + */ + StreamingRecognitionResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.StreamingRecognitionResult) + return object; + var message = new $root.google.cloud.speech.v1.StreamingRecognitionResult(); + if (object.alternatives) { + if (!Array.isArray(object.alternatives)) + throw TypeError(".google.cloud.speech.v1.StreamingRecognitionResult.alternatives: array expected"); + message.alternatives = []; + for (var i = 0; i < object.alternatives.length; ++i) { + if (typeof object.alternatives[i] !== "object") + throw TypeError(".google.cloud.speech.v1.StreamingRecognitionResult.alternatives: object expected"); + message.alternatives[i] = $root.google.cloud.speech.v1.SpeechRecognitionAlternative.fromObject(object.alternatives[i]); + } + } + if (object.isFinal != null) + message.isFinal = Boolean(object.isFinal); + if (object.stability != null) + message.stability = Number(object.stability); + if (object.resultEndTime != null) { + if (typeof object.resultEndTime !== "object") + throw TypeError(".google.cloud.speech.v1.StreamingRecognitionResult.resultEndTime: object expected"); + message.resultEndTime = $root.google.protobuf.Duration.fromObject(object.resultEndTime); + } + if (object.channelTag != null) + message.channelTag = object.channelTag | 0; + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a StreamingRecognitionResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.StreamingRecognitionResult + * @static + * @param {google.cloud.speech.v1.StreamingRecognitionResult} message StreamingRecognitionResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingRecognitionResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.alternatives = []; + if (options.defaults) { + object.isFinal = false; + object.stability = 0; + object.resultEndTime = null; + object.channelTag = 0; + object.languageCode = ""; + } + if (message.alternatives && message.alternatives.length) { + object.alternatives = []; + for (var j = 0; j < message.alternatives.length; ++j) + object.alternatives[j] = $root.google.cloud.speech.v1.SpeechRecognitionAlternative.toObject(message.alternatives[j], options); + } + if (message.isFinal != null && message.hasOwnProperty("isFinal")) + object.isFinal = message.isFinal; + if (message.stability != null && message.hasOwnProperty("stability")) + object.stability = options.json && !isFinite(message.stability) ? String(message.stability) : message.stability; + if (message.resultEndTime != null && message.hasOwnProperty("resultEndTime")) + object.resultEndTime = $root.google.protobuf.Duration.toObject(message.resultEndTime, options); + if (message.channelTag != null && message.hasOwnProperty("channelTag")) + object.channelTag = message.channelTag; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this StreamingRecognitionResult to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.StreamingRecognitionResult + * @instance + * @returns {Object.} JSON object + */ + StreamingRecognitionResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamingRecognitionResult + * @function getTypeUrl + * @memberof google.cloud.speech.v1.StreamingRecognitionResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamingRecognitionResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.StreamingRecognitionResult"; + }; + + return StreamingRecognitionResult; + })(); + + v1.SpeechRecognitionResult = (function() { + + /** + * Properties of a SpeechRecognitionResult. + * @memberof google.cloud.speech.v1 + * @interface ISpeechRecognitionResult + * @property {Array.|null} [alternatives] SpeechRecognitionResult alternatives + * @property {number|null} [channelTag] SpeechRecognitionResult channelTag + * @property {google.protobuf.IDuration|null} [resultEndTime] SpeechRecognitionResult resultEndTime + * @property {string|null} [languageCode] SpeechRecognitionResult languageCode + */ + + /** + * Constructs a new SpeechRecognitionResult. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a SpeechRecognitionResult. + * @implements ISpeechRecognitionResult + * @constructor + * @param {google.cloud.speech.v1.ISpeechRecognitionResult=} [properties] Properties to set + */ + function SpeechRecognitionResult(properties) { + this.alternatives = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpeechRecognitionResult alternatives. + * @member {Array.} alternatives + * @memberof google.cloud.speech.v1.SpeechRecognitionResult + * @instance + */ + SpeechRecognitionResult.prototype.alternatives = $util.emptyArray; + + /** + * SpeechRecognitionResult channelTag. + * @member {number} channelTag + * @memberof google.cloud.speech.v1.SpeechRecognitionResult + * @instance + */ + SpeechRecognitionResult.prototype.channelTag = 0; + + /** + * SpeechRecognitionResult resultEndTime. + * @member {google.protobuf.IDuration|null|undefined} resultEndTime + * @memberof google.cloud.speech.v1.SpeechRecognitionResult + * @instance + */ + SpeechRecognitionResult.prototype.resultEndTime = null; + + /** + * SpeechRecognitionResult languageCode. + * @member {string} languageCode + * @memberof google.cloud.speech.v1.SpeechRecognitionResult + * @instance + */ + SpeechRecognitionResult.prototype.languageCode = ""; + + /** + * Creates a new SpeechRecognitionResult instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.SpeechRecognitionResult + * @static + * @param {google.cloud.speech.v1.ISpeechRecognitionResult=} [properties] Properties to set + * @returns {google.cloud.speech.v1.SpeechRecognitionResult} SpeechRecognitionResult instance + */ + SpeechRecognitionResult.create = function create(properties) { + return new SpeechRecognitionResult(properties); + }; + + /** + * Encodes the specified SpeechRecognitionResult message. Does not implicitly {@link google.cloud.speech.v1.SpeechRecognitionResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.SpeechRecognitionResult + * @static + * @param {google.cloud.speech.v1.ISpeechRecognitionResult} message SpeechRecognitionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechRecognitionResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.alternatives != null && message.alternatives.length) + for (var i = 0; i < message.alternatives.length; ++i) + $root.google.cloud.speech.v1.SpeechRecognitionAlternative.encode(message.alternatives[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.channelTag != null && Object.hasOwnProperty.call(message, "channelTag")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.channelTag); + if (message.resultEndTime != null && Object.hasOwnProperty.call(message, "resultEndTime")) + $root.google.protobuf.Duration.encode(message.resultEndTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified SpeechRecognitionResult message, length delimited. Does not implicitly {@link google.cloud.speech.v1.SpeechRecognitionResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.SpeechRecognitionResult + * @static + * @param {google.cloud.speech.v1.ISpeechRecognitionResult} message SpeechRecognitionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechRecognitionResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpeechRecognitionResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.SpeechRecognitionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.SpeechRecognitionResult} SpeechRecognitionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechRecognitionResult.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.SpeechRecognitionResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.alternatives && message.alternatives.length)) + message.alternatives = []; + message.alternatives.push($root.google.cloud.speech.v1.SpeechRecognitionAlternative.decode(reader, reader.uint32())); + break; + } + case 2: { + message.channelTag = reader.int32(); + break; + } + case 4: { + message.resultEndTime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 5: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpeechRecognitionResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.SpeechRecognitionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.SpeechRecognitionResult} SpeechRecognitionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechRecognitionResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpeechRecognitionResult message. + * @function verify + * @memberof google.cloud.speech.v1.SpeechRecognitionResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpeechRecognitionResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.alternatives != null && message.hasOwnProperty("alternatives")) { + if (!Array.isArray(message.alternatives)) + return "alternatives: array expected"; + for (var i = 0; i < message.alternatives.length; ++i) { + var error = $root.google.cloud.speech.v1.SpeechRecognitionAlternative.verify(message.alternatives[i]); + if (error) + return "alternatives." + error; + } + } + if (message.channelTag != null && message.hasOwnProperty("channelTag")) + if (!$util.isInteger(message.channelTag)) + return "channelTag: integer expected"; + if (message.resultEndTime != null && message.hasOwnProperty("resultEndTime")) { + var error = $root.google.protobuf.Duration.verify(message.resultEndTime); + if (error) + return "resultEndTime." + error; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a SpeechRecognitionResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.SpeechRecognitionResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.SpeechRecognitionResult} SpeechRecognitionResult + */ + SpeechRecognitionResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.SpeechRecognitionResult) + return object; + var message = new $root.google.cloud.speech.v1.SpeechRecognitionResult(); + if (object.alternatives) { + if (!Array.isArray(object.alternatives)) + throw TypeError(".google.cloud.speech.v1.SpeechRecognitionResult.alternatives: array expected"); + message.alternatives = []; + for (var i = 0; i < object.alternatives.length; ++i) { + if (typeof object.alternatives[i] !== "object") + throw TypeError(".google.cloud.speech.v1.SpeechRecognitionResult.alternatives: object expected"); + message.alternatives[i] = $root.google.cloud.speech.v1.SpeechRecognitionAlternative.fromObject(object.alternatives[i]); + } + } + if (object.channelTag != null) + message.channelTag = object.channelTag | 0; + if (object.resultEndTime != null) { + if (typeof object.resultEndTime !== "object") + throw TypeError(".google.cloud.speech.v1.SpeechRecognitionResult.resultEndTime: object expected"); + message.resultEndTime = $root.google.protobuf.Duration.fromObject(object.resultEndTime); + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a SpeechRecognitionResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.SpeechRecognitionResult + * @static + * @param {google.cloud.speech.v1.SpeechRecognitionResult} message SpeechRecognitionResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpeechRecognitionResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.alternatives = []; + if (options.defaults) { + object.channelTag = 0; + object.resultEndTime = null; + object.languageCode = ""; + } + if (message.alternatives && message.alternatives.length) { + object.alternatives = []; + for (var j = 0; j < message.alternatives.length; ++j) + object.alternatives[j] = $root.google.cloud.speech.v1.SpeechRecognitionAlternative.toObject(message.alternatives[j], options); + } + if (message.channelTag != null && message.hasOwnProperty("channelTag")) + object.channelTag = message.channelTag; + if (message.resultEndTime != null && message.hasOwnProperty("resultEndTime")) + object.resultEndTime = $root.google.protobuf.Duration.toObject(message.resultEndTime, options); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this SpeechRecognitionResult to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.SpeechRecognitionResult + * @instance + * @returns {Object.} JSON object + */ + SpeechRecognitionResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpeechRecognitionResult + * @function getTypeUrl + * @memberof google.cloud.speech.v1.SpeechRecognitionResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpeechRecognitionResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.SpeechRecognitionResult"; + }; + + return SpeechRecognitionResult; + })(); + + v1.SpeechRecognitionAlternative = (function() { + + /** + * Properties of a SpeechRecognitionAlternative. + * @memberof google.cloud.speech.v1 + * @interface ISpeechRecognitionAlternative + * @property {string|null} [transcript] SpeechRecognitionAlternative transcript + * @property {number|null} [confidence] SpeechRecognitionAlternative confidence + * @property {Array.|null} [words] SpeechRecognitionAlternative words + */ + + /** + * Constructs a new SpeechRecognitionAlternative. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a SpeechRecognitionAlternative. + * @implements ISpeechRecognitionAlternative + * @constructor + * @param {google.cloud.speech.v1.ISpeechRecognitionAlternative=} [properties] Properties to set + */ + function SpeechRecognitionAlternative(properties) { + this.words = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpeechRecognitionAlternative transcript. + * @member {string} transcript + * @memberof google.cloud.speech.v1.SpeechRecognitionAlternative + * @instance + */ + SpeechRecognitionAlternative.prototype.transcript = ""; + + /** + * SpeechRecognitionAlternative confidence. + * @member {number} confidence + * @memberof google.cloud.speech.v1.SpeechRecognitionAlternative + * @instance + */ + SpeechRecognitionAlternative.prototype.confidence = 0; + + /** + * SpeechRecognitionAlternative words. + * @member {Array.} words + * @memberof google.cloud.speech.v1.SpeechRecognitionAlternative + * @instance + */ + SpeechRecognitionAlternative.prototype.words = $util.emptyArray; + + /** + * Creates a new SpeechRecognitionAlternative instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.SpeechRecognitionAlternative + * @static + * @param {google.cloud.speech.v1.ISpeechRecognitionAlternative=} [properties] Properties to set + * @returns {google.cloud.speech.v1.SpeechRecognitionAlternative} SpeechRecognitionAlternative instance + */ + SpeechRecognitionAlternative.create = function create(properties) { + return new SpeechRecognitionAlternative(properties); + }; + + /** + * Encodes the specified SpeechRecognitionAlternative message. Does not implicitly {@link google.cloud.speech.v1.SpeechRecognitionAlternative.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.SpeechRecognitionAlternative + * @static + * @param {google.cloud.speech.v1.ISpeechRecognitionAlternative} message SpeechRecognitionAlternative message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechRecognitionAlternative.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.transcript != null && Object.hasOwnProperty.call(message, "transcript")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.transcript); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence); + if (message.words != null && message.words.length) + for (var i = 0; i < message.words.length; ++i) + $root.google.cloud.speech.v1.WordInfo.encode(message.words[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SpeechRecognitionAlternative message, length delimited. Does not implicitly {@link google.cloud.speech.v1.SpeechRecognitionAlternative.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.SpeechRecognitionAlternative + * @static + * @param {google.cloud.speech.v1.ISpeechRecognitionAlternative} message SpeechRecognitionAlternative message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechRecognitionAlternative.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpeechRecognitionAlternative message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.SpeechRecognitionAlternative + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.SpeechRecognitionAlternative} SpeechRecognitionAlternative + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechRecognitionAlternative.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.SpeechRecognitionAlternative(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.transcript = reader.string(); + break; + } + case 2: { + message.confidence = reader.float(); + break; + } + case 3: { + if (!(message.words && message.words.length)) + message.words = []; + message.words.push($root.google.cloud.speech.v1.WordInfo.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpeechRecognitionAlternative message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.SpeechRecognitionAlternative + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.SpeechRecognitionAlternative} SpeechRecognitionAlternative + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechRecognitionAlternative.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpeechRecognitionAlternative message. + * @function verify + * @memberof google.cloud.speech.v1.SpeechRecognitionAlternative + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpeechRecognitionAlternative.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.transcript != null && message.hasOwnProperty("transcript")) + if (!$util.isString(message.transcript)) + return "transcript: string expected"; + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + if (message.words != null && message.hasOwnProperty("words")) { + if (!Array.isArray(message.words)) + return "words: array expected"; + for (var i = 0; i < message.words.length; ++i) { + var error = $root.google.cloud.speech.v1.WordInfo.verify(message.words[i]); + if (error) + return "words." + error; + } + } + return null; + }; + + /** + * Creates a SpeechRecognitionAlternative message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.SpeechRecognitionAlternative + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.SpeechRecognitionAlternative} SpeechRecognitionAlternative + */ + SpeechRecognitionAlternative.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.SpeechRecognitionAlternative) + return object; + var message = new $root.google.cloud.speech.v1.SpeechRecognitionAlternative(); + if (object.transcript != null) + message.transcript = String(object.transcript); + if (object.confidence != null) + message.confidence = Number(object.confidence); + if (object.words) { + if (!Array.isArray(object.words)) + throw TypeError(".google.cloud.speech.v1.SpeechRecognitionAlternative.words: array expected"); + message.words = []; + for (var i = 0; i < object.words.length; ++i) { + if (typeof object.words[i] !== "object") + throw TypeError(".google.cloud.speech.v1.SpeechRecognitionAlternative.words: object expected"); + message.words[i] = $root.google.cloud.speech.v1.WordInfo.fromObject(object.words[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SpeechRecognitionAlternative message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.SpeechRecognitionAlternative + * @static + * @param {google.cloud.speech.v1.SpeechRecognitionAlternative} message SpeechRecognitionAlternative + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpeechRecognitionAlternative.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.words = []; + if (options.defaults) { + object.transcript = ""; + object.confidence = 0; + } + if (message.transcript != null && message.hasOwnProperty("transcript")) + object.transcript = message.transcript; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + if (message.words && message.words.length) { + object.words = []; + for (var j = 0; j < message.words.length; ++j) + object.words[j] = $root.google.cloud.speech.v1.WordInfo.toObject(message.words[j], options); + } + return object; + }; + + /** + * Converts this SpeechRecognitionAlternative to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.SpeechRecognitionAlternative + * @instance + * @returns {Object.} JSON object + */ + SpeechRecognitionAlternative.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpeechRecognitionAlternative + * @function getTypeUrl + * @memberof google.cloud.speech.v1.SpeechRecognitionAlternative + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpeechRecognitionAlternative.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.SpeechRecognitionAlternative"; + }; + + return SpeechRecognitionAlternative; + })(); + + v1.WordInfo = (function() { + + /** + * Properties of a WordInfo. + * @memberof google.cloud.speech.v1 + * @interface IWordInfo + * @property {google.protobuf.IDuration|null} [startTime] WordInfo startTime + * @property {google.protobuf.IDuration|null} [endTime] WordInfo endTime + * @property {string|null} [word] WordInfo word + * @property {number|null} [confidence] WordInfo confidence + * @property {number|null} [speakerTag] WordInfo speakerTag + * @property {string|null} [speakerLabel] WordInfo speakerLabel + */ + + /** + * Constructs a new WordInfo. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a WordInfo. + * @implements IWordInfo + * @constructor + * @param {google.cloud.speech.v1.IWordInfo=} [properties] Properties to set + */ + function WordInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WordInfo startTime. + * @member {google.protobuf.IDuration|null|undefined} startTime + * @memberof google.cloud.speech.v1.WordInfo + * @instance + */ + WordInfo.prototype.startTime = null; + + /** + * WordInfo endTime. + * @member {google.protobuf.IDuration|null|undefined} endTime + * @memberof google.cloud.speech.v1.WordInfo + * @instance + */ + WordInfo.prototype.endTime = null; + + /** + * WordInfo word. + * @member {string} word + * @memberof google.cloud.speech.v1.WordInfo + * @instance + */ + WordInfo.prototype.word = ""; + + /** + * WordInfo confidence. + * @member {number} confidence + * @memberof google.cloud.speech.v1.WordInfo + * @instance + */ + WordInfo.prototype.confidence = 0; + + /** + * WordInfo speakerTag. + * @member {number} speakerTag + * @memberof google.cloud.speech.v1.WordInfo + * @instance + */ + WordInfo.prototype.speakerTag = 0; + + /** + * WordInfo speakerLabel. + * @member {string} speakerLabel + * @memberof google.cloud.speech.v1.WordInfo + * @instance + */ + WordInfo.prototype.speakerLabel = ""; + + /** + * Creates a new WordInfo instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.WordInfo + * @static + * @param {google.cloud.speech.v1.IWordInfo=} [properties] Properties to set + * @returns {google.cloud.speech.v1.WordInfo} WordInfo instance + */ + WordInfo.create = function create(properties) { + return new WordInfo(properties); + }; + + /** + * Encodes the specified WordInfo message. Does not implicitly {@link google.cloud.speech.v1.WordInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.WordInfo + * @static + * @param {google.cloud.speech.v1.IWordInfo} message WordInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WordInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Duration.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Duration.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.word != null && Object.hasOwnProperty.call(message, "word")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.word); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.confidence); + if (message.speakerTag != null && Object.hasOwnProperty.call(message, "speakerTag")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.speakerTag); + if (message.speakerLabel != null && Object.hasOwnProperty.call(message, "speakerLabel")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.speakerLabel); + return writer; + }; + + /** + * Encodes the specified WordInfo message, length delimited. Does not implicitly {@link google.cloud.speech.v1.WordInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.WordInfo + * @static + * @param {google.cloud.speech.v1.IWordInfo} message WordInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WordInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WordInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.WordInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.WordInfo} WordInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WordInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.WordInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.startTime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 3: { + message.word = reader.string(); + break; + } + case 4: { + message.confidence = reader.float(); + break; + } + case 5: { + message.speakerTag = reader.int32(); + break; + } + case 6: { + message.speakerLabel = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WordInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.WordInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.WordInfo} WordInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WordInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WordInfo message. + * @function verify + * @memberof google.cloud.speech.v1.WordInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WordInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Duration.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Duration.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.word != null && message.hasOwnProperty("word")) + if (!$util.isString(message.word)) + return "word: string expected"; + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + if (message.speakerTag != null && message.hasOwnProperty("speakerTag")) + if (!$util.isInteger(message.speakerTag)) + return "speakerTag: integer expected"; + if (message.speakerLabel != null && message.hasOwnProperty("speakerLabel")) + if (!$util.isString(message.speakerLabel)) + return "speakerLabel: string expected"; + return null; + }; + + /** + * Creates a WordInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.WordInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.WordInfo} WordInfo + */ + WordInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.WordInfo) + return object; + var message = new $root.google.cloud.speech.v1.WordInfo(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.speech.v1.WordInfo.startTime: object expected"); + message.startTime = $root.google.protobuf.Duration.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.speech.v1.WordInfo.endTime: object expected"); + message.endTime = $root.google.protobuf.Duration.fromObject(object.endTime); + } + if (object.word != null) + message.word = String(object.word); + if (object.confidence != null) + message.confidence = Number(object.confidence); + if (object.speakerTag != null) + message.speakerTag = object.speakerTag | 0; + if (object.speakerLabel != null) + message.speakerLabel = String(object.speakerLabel); + return message; + }; + + /** + * Creates a plain object from a WordInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.WordInfo + * @static + * @param {google.cloud.speech.v1.WordInfo} message WordInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WordInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startTime = null; + object.endTime = null; + object.word = ""; + object.confidence = 0; + object.speakerTag = 0; + object.speakerLabel = ""; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Duration.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Duration.toObject(message.endTime, options); + if (message.word != null && message.hasOwnProperty("word")) + object.word = message.word; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + if (message.speakerTag != null && message.hasOwnProperty("speakerTag")) + object.speakerTag = message.speakerTag; + if (message.speakerLabel != null && message.hasOwnProperty("speakerLabel")) + object.speakerLabel = message.speakerLabel; + return object; + }; + + /** + * Converts this WordInfo to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.WordInfo + * @instance + * @returns {Object.} JSON object + */ + WordInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WordInfo + * @function getTypeUrl + * @memberof google.cloud.speech.v1.WordInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WordInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.WordInfo"; + }; + + return WordInfo; + })(); + + v1.SpeechAdaptationInfo = (function() { + + /** + * Properties of a SpeechAdaptationInfo. + * @memberof google.cloud.speech.v1 + * @interface ISpeechAdaptationInfo + * @property {boolean|null} [adaptationTimeout] SpeechAdaptationInfo adaptationTimeout + * @property {string|null} [timeoutMessage] SpeechAdaptationInfo timeoutMessage + */ + + /** + * Constructs a new SpeechAdaptationInfo. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a SpeechAdaptationInfo. + * @implements ISpeechAdaptationInfo + * @constructor + * @param {google.cloud.speech.v1.ISpeechAdaptationInfo=} [properties] Properties to set + */ + function SpeechAdaptationInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpeechAdaptationInfo adaptationTimeout. + * @member {boolean} adaptationTimeout + * @memberof google.cloud.speech.v1.SpeechAdaptationInfo + * @instance + */ + SpeechAdaptationInfo.prototype.adaptationTimeout = false; + + /** + * SpeechAdaptationInfo timeoutMessage. + * @member {string} timeoutMessage + * @memberof google.cloud.speech.v1.SpeechAdaptationInfo + * @instance + */ + SpeechAdaptationInfo.prototype.timeoutMessage = ""; + + /** + * Creates a new SpeechAdaptationInfo instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.SpeechAdaptationInfo + * @static + * @param {google.cloud.speech.v1.ISpeechAdaptationInfo=} [properties] Properties to set + * @returns {google.cloud.speech.v1.SpeechAdaptationInfo} SpeechAdaptationInfo instance + */ + SpeechAdaptationInfo.create = function create(properties) { + return new SpeechAdaptationInfo(properties); + }; + + /** + * Encodes the specified SpeechAdaptationInfo message. Does not implicitly {@link google.cloud.speech.v1.SpeechAdaptationInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.SpeechAdaptationInfo + * @static + * @param {google.cloud.speech.v1.ISpeechAdaptationInfo} message SpeechAdaptationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechAdaptationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.adaptationTimeout != null && Object.hasOwnProperty.call(message, "adaptationTimeout")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.adaptationTimeout); + if (message.timeoutMessage != null && Object.hasOwnProperty.call(message, "timeoutMessage")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.timeoutMessage); + return writer; + }; + + /** + * Encodes the specified SpeechAdaptationInfo message, length delimited. Does not implicitly {@link google.cloud.speech.v1.SpeechAdaptationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.SpeechAdaptationInfo + * @static + * @param {google.cloud.speech.v1.ISpeechAdaptationInfo} message SpeechAdaptationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechAdaptationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpeechAdaptationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.SpeechAdaptationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.SpeechAdaptationInfo} SpeechAdaptationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechAdaptationInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.SpeechAdaptationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.adaptationTimeout = reader.bool(); + break; + } + case 4: { + message.timeoutMessage = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpeechAdaptationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.SpeechAdaptationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.SpeechAdaptationInfo} SpeechAdaptationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechAdaptationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpeechAdaptationInfo message. + * @function verify + * @memberof google.cloud.speech.v1.SpeechAdaptationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpeechAdaptationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.adaptationTimeout != null && message.hasOwnProperty("adaptationTimeout")) + if (typeof message.adaptationTimeout !== "boolean") + return "adaptationTimeout: boolean expected"; + if (message.timeoutMessage != null && message.hasOwnProperty("timeoutMessage")) + if (!$util.isString(message.timeoutMessage)) + return "timeoutMessage: string expected"; + return null; + }; + + /** + * Creates a SpeechAdaptationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.SpeechAdaptationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.SpeechAdaptationInfo} SpeechAdaptationInfo + */ + SpeechAdaptationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.SpeechAdaptationInfo) + return object; + var message = new $root.google.cloud.speech.v1.SpeechAdaptationInfo(); + if (object.adaptationTimeout != null) + message.adaptationTimeout = Boolean(object.adaptationTimeout); + if (object.timeoutMessage != null) + message.timeoutMessage = String(object.timeoutMessage); + return message; + }; + + /** + * Creates a plain object from a SpeechAdaptationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.SpeechAdaptationInfo + * @static + * @param {google.cloud.speech.v1.SpeechAdaptationInfo} message SpeechAdaptationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpeechAdaptationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.adaptationTimeout = false; + object.timeoutMessage = ""; + } + if (message.adaptationTimeout != null && message.hasOwnProperty("adaptationTimeout")) + object.adaptationTimeout = message.adaptationTimeout; + if (message.timeoutMessage != null && message.hasOwnProperty("timeoutMessage")) + object.timeoutMessage = message.timeoutMessage; + return object; + }; + + /** + * Converts this SpeechAdaptationInfo to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.SpeechAdaptationInfo + * @instance + * @returns {Object.} JSON object + */ + SpeechAdaptationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpeechAdaptationInfo + * @function getTypeUrl + * @memberof google.cloud.speech.v1.SpeechAdaptationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpeechAdaptationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.SpeechAdaptationInfo"; + }; + + return SpeechAdaptationInfo; + })(); + + v1.CustomClass = (function() { + + /** + * Properties of a CustomClass. + * @memberof google.cloud.speech.v1 + * @interface ICustomClass + * @property {string|null} [name] CustomClass name + * @property {string|null} [customClassId] CustomClass customClassId + * @property {Array.|null} [items] CustomClass items + */ + + /** + * Constructs a new CustomClass. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a CustomClass. + * @implements ICustomClass + * @constructor + * @param {google.cloud.speech.v1.ICustomClass=} [properties] Properties to set + */ + function CustomClass(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomClass name. + * @member {string} name + * @memberof google.cloud.speech.v1.CustomClass + * @instance + */ + CustomClass.prototype.name = ""; + + /** + * CustomClass customClassId. + * @member {string} customClassId + * @memberof google.cloud.speech.v1.CustomClass + * @instance + */ + CustomClass.prototype.customClassId = ""; + + /** + * CustomClass items. + * @member {Array.} items + * @memberof google.cloud.speech.v1.CustomClass + * @instance + */ + CustomClass.prototype.items = $util.emptyArray; + + /** + * Creates a new CustomClass instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.CustomClass + * @static + * @param {google.cloud.speech.v1.ICustomClass=} [properties] Properties to set + * @returns {google.cloud.speech.v1.CustomClass} CustomClass instance + */ + CustomClass.create = function create(properties) { + return new CustomClass(properties); + }; + + /** + * Encodes the specified CustomClass message. Does not implicitly {@link google.cloud.speech.v1.CustomClass.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.CustomClass + * @static + * @param {google.cloud.speech.v1.ICustomClass} message CustomClass message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomClass.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.customClassId != null && Object.hasOwnProperty.call(message, "customClassId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.customClassId); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.speech.v1.CustomClass.ClassItem.encode(message.items[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CustomClass message, length delimited. Does not implicitly {@link google.cloud.speech.v1.CustomClass.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.CustomClass + * @static + * @param {google.cloud.speech.v1.ICustomClass} message CustomClass message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomClass.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomClass message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.CustomClass + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.CustomClass} CustomClass + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomClass.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.CustomClass(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.customClassId = reader.string(); + break; + } + case 3: { + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.speech.v1.CustomClass.ClassItem.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomClass message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.CustomClass + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.CustomClass} CustomClass + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomClass.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomClass message. + * @function verify + * @memberof google.cloud.speech.v1.CustomClass + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomClass.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.customClassId != null && message.hasOwnProperty("customClassId")) + if (!$util.isString(message.customClassId)) + return "customClassId: string expected"; + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.speech.v1.CustomClass.ClassItem.verify(message.items[i]); + if (error) + return "items." + error; + } + } + return null; + }; + + /** + * Creates a CustomClass message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.CustomClass + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.CustomClass} CustomClass + */ + CustomClass.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.CustomClass) + return object; + var message = new $root.google.cloud.speech.v1.CustomClass(); + if (object.name != null) + message.name = String(object.name); + if (object.customClassId != null) + message.customClassId = String(object.customClassId); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.speech.v1.CustomClass.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.speech.v1.CustomClass.items: object expected"); + message.items[i] = $root.google.cloud.speech.v1.CustomClass.ClassItem.fromObject(object.items[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CustomClass message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.CustomClass + * @static + * @param {google.cloud.speech.v1.CustomClass} message CustomClass + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomClass.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (options.defaults) { + object.name = ""; + object.customClassId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.customClassId != null && message.hasOwnProperty("customClassId")) + object.customClassId = message.customClassId; + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.speech.v1.CustomClass.ClassItem.toObject(message.items[j], options); + } + return object; + }; + + /** + * Converts this CustomClass to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.CustomClass + * @instance + * @returns {Object.} JSON object + */ + CustomClass.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomClass + * @function getTypeUrl + * @memberof google.cloud.speech.v1.CustomClass + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomClass.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.CustomClass"; + }; + + CustomClass.ClassItem = (function() { + + /** + * Properties of a ClassItem. + * @memberof google.cloud.speech.v1.CustomClass + * @interface IClassItem + * @property {string|null} [value] ClassItem value + */ + + /** + * Constructs a new ClassItem. + * @memberof google.cloud.speech.v1.CustomClass + * @classdesc Represents a ClassItem. + * @implements IClassItem + * @constructor + * @param {google.cloud.speech.v1.CustomClass.IClassItem=} [properties] Properties to set + */ + function ClassItem(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClassItem value. + * @member {string} value + * @memberof google.cloud.speech.v1.CustomClass.ClassItem + * @instance + */ + ClassItem.prototype.value = ""; + + /** + * Creates a new ClassItem instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.CustomClass.ClassItem + * @static + * @param {google.cloud.speech.v1.CustomClass.IClassItem=} [properties] Properties to set + * @returns {google.cloud.speech.v1.CustomClass.ClassItem} ClassItem instance + */ + ClassItem.create = function create(properties) { + return new ClassItem(properties); + }; + + /** + * Encodes the specified ClassItem message. Does not implicitly {@link google.cloud.speech.v1.CustomClass.ClassItem.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.CustomClass.ClassItem + * @static + * @param {google.cloud.speech.v1.CustomClass.IClassItem} message ClassItem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClassItem.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + return writer; + }; + + /** + * Encodes the specified ClassItem message, length delimited. Does not implicitly {@link google.cloud.speech.v1.CustomClass.ClassItem.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.CustomClass.ClassItem + * @static + * @param {google.cloud.speech.v1.CustomClass.IClassItem} message ClassItem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClassItem.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClassItem message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.CustomClass.ClassItem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.CustomClass.ClassItem} ClassItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClassItem.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.CustomClass.ClassItem(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClassItem message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.CustomClass.ClassItem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.CustomClass.ClassItem} ClassItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClassItem.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClassItem message. + * @function verify + * @memberof google.cloud.speech.v1.CustomClass.ClassItem + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClassItem.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates a ClassItem message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.CustomClass.ClassItem + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.CustomClass.ClassItem} ClassItem + */ + ClassItem.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.CustomClass.ClassItem) + return object; + var message = new $root.google.cloud.speech.v1.CustomClass.ClassItem(); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a ClassItem message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.CustomClass.ClassItem + * @static + * @param {google.cloud.speech.v1.CustomClass.ClassItem} message ClassItem + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClassItem.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = ""; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this ClassItem to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.CustomClass.ClassItem + * @instance + * @returns {Object.} JSON object + */ + ClassItem.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClassItem + * @function getTypeUrl + * @memberof google.cloud.speech.v1.CustomClass.ClassItem + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClassItem.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.CustomClass.ClassItem"; + }; + + return ClassItem; + })(); + + return CustomClass; + })(); + + v1.PhraseSet = (function() { + + /** + * Properties of a PhraseSet. + * @memberof google.cloud.speech.v1 + * @interface IPhraseSet + * @property {string|null} [name] PhraseSet name + * @property {Array.|null} [phrases] PhraseSet phrases + * @property {number|null} [boost] PhraseSet boost + */ + + /** + * Constructs a new PhraseSet. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a PhraseSet. + * @implements IPhraseSet + * @constructor + * @param {google.cloud.speech.v1.IPhraseSet=} [properties] Properties to set + */ + function PhraseSet(properties) { + this.phrases = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PhraseSet name. + * @member {string} name + * @memberof google.cloud.speech.v1.PhraseSet + * @instance + */ + PhraseSet.prototype.name = ""; + + /** + * PhraseSet phrases. + * @member {Array.} phrases + * @memberof google.cloud.speech.v1.PhraseSet + * @instance + */ + PhraseSet.prototype.phrases = $util.emptyArray; + + /** + * PhraseSet boost. + * @member {number} boost + * @memberof google.cloud.speech.v1.PhraseSet + * @instance + */ + PhraseSet.prototype.boost = 0; + + /** + * Creates a new PhraseSet instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.PhraseSet + * @static + * @param {google.cloud.speech.v1.IPhraseSet=} [properties] Properties to set + * @returns {google.cloud.speech.v1.PhraseSet} PhraseSet instance + */ + PhraseSet.create = function create(properties) { + return new PhraseSet(properties); + }; + + /** + * Encodes the specified PhraseSet message. Does not implicitly {@link google.cloud.speech.v1.PhraseSet.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.PhraseSet + * @static + * @param {google.cloud.speech.v1.IPhraseSet} message PhraseSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhraseSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.phrases != null && message.phrases.length) + for (var i = 0; i < message.phrases.length; ++i) + $root.google.cloud.speech.v1.PhraseSet.Phrase.encode(message.phrases[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.boost != null && Object.hasOwnProperty.call(message, "boost")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.boost); + return writer; + }; + + /** + * Encodes the specified PhraseSet message, length delimited. Does not implicitly {@link google.cloud.speech.v1.PhraseSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.PhraseSet + * @static + * @param {google.cloud.speech.v1.IPhraseSet} message PhraseSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhraseSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PhraseSet message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.PhraseSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.PhraseSet} PhraseSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhraseSet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.PhraseSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.phrases && message.phrases.length)) + message.phrases = []; + message.phrases.push($root.google.cloud.speech.v1.PhraseSet.Phrase.decode(reader, reader.uint32())); + break; + } + case 4: { + message.boost = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PhraseSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.PhraseSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.PhraseSet} PhraseSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhraseSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PhraseSet message. + * @function verify + * @memberof google.cloud.speech.v1.PhraseSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PhraseSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.phrases != null && message.hasOwnProperty("phrases")) { + if (!Array.isArray(message.phrases)) + return "phrases: array expected"; + for (var i = 0; i < message.phrases.length; ++i) { + var error = $root.google.cloud.speech.v1.PhraseSet.Phrase.verify(message.phrases[i]); + if (error) + return "phrases." + error; + } + } + if (message.boost != null && message.hasOwnProperty("boost")) + if (typeof message.boost !== "number") + return "boost: number expected"; + return null; + }; + + /** + * Creates a PhraseSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.PhraseSet + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.PhraseSet} PhraseSet + */ + PhraseSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.PhraseSet) + return object; + var message = new $root.google.cloud.speech.v1.PhraseSet(); + if (object.name != null) + message.name = String(object.name); + if (object.phrases) { + if (!Array.isArray(object.phrases)) + throw TypeError(".google.cloud.speech.v1.PhraseSet.phrases: array expected"); + message.phrases = []; + for (var i = 0; i < object.phrases.length; ++i) { + if (typeof object.phrases[i] !== "object") + throw TypeError(".google.cloud.speech.v1.PhraseSet.phrases: object expected"); + message.phrases[i] = $root.google.cloud.speech.v1.PhraseSet.Phrase.fromObject(object.phrases[i]); + } + } + if (object.boost != null) + message.boost = Number(object.boost); + return message; + }; + + /** + * Creates a plain object from a PhraseSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.PhraseSet + * @static + * @param {google.cloud.speech.v1.PhraseSet} message PhraseSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PhraseSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.phrases = []; + if (options.defaults) { + object.name = ""; + object.boost = 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.phrases && message.phrases.length) { + object.phrases = []; + for (var j = 0; j < message.phrases.length; ++j) + object.phrases[j] = $root.google.cloud.speech.v1.PhraseSet.Phrase.toObject(message.phrases[j], options); + } + if (message.boost != null && message.hasOwnProperty("boost")) + object.boost = options.json && !isFinite(message.boost) ? String(message.boost) : message.boost; + return object; + }; + + /** + * Converts this PhraseSet to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.PhraseSet + * @instance + * @returns {Object.} JSON object + */ + PhraseSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PhraseSet + * @function getTypeUrl + * @memberof google.cloud.speech.v1.PhraseSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PhraseSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.PhraseSet"; + }; + + PhraseSet.Phrase = (function() { + + /** + * Properties of a Phrase. + * @memberof google.cloud.speech.v1.PhraseSet + * @interface IPhrase + * @property {string|null} [value] Phrase value + * @property {number|null} [boost] Phrase boost + */ + + /** + * Constructs a new Phrase. + * @memberof google.cloud.speech.v1.PhraseSet + * @classdesc Represents a Phrase. + * @implements IPhrase + * @constructor + * @param {google.cloud.speech.v1.PhraseSet.IPhrase=} [properties] Properties to set + */ + function Phrase(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Phrase value. + * @member {string} value + * @memberof google.cloud.speech.v1.PhraseSet.Phrase + * @instance + */ + Phrase.prototype.value = ""; + + /** + * Phrase boost. + * @member {number} boost + * @memberof google.cloud.speech.v1.PhraseSet.Phrase + * @instance + */ + Phrase.prototype.boost = 0; + + /** + * Creates a new Phrase instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.PhraseSet.Phrase + * @static + * @param {google.cloud.speech.v1.PhraseSet.IPhrase=} [properties] Properties to set + * @returns {google.cloud.speech.v1.PhraseSet.Phrase} Phrase instance + */ + Phrase.create = function create(properties) { + return new Phrase(properties); + }; + + /** + * Encodes the specified Phrase message. Does not implicitly {@link google.cloud.speech.v1.PhraseSet.Phrase.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.PhraseSet.Phrase + * @static + * @param {google.cloud.speech.v1.PhraseSet.IPhrase} message Phrase message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Phrase.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + if (message.boost != null && Object.hasOwnProperty.call(message, "boost")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.boost); + return writer; + }; + + /** + * Encodes the specified Phrase message, length delimited. Does not implicitly {@link google.cloud.speech.v1.PhraseSet.Phrase.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.PhraseSet.Phrase + * @static + * @param {google.cloud.speech.v1.PhraseSet.IPhrase} message Phrase message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Phrase.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Phrase message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.PhraseSet.Phrase + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.PhraseSet.Phrase} Phrase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Phrase.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.PhraseSet.Phrase(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.string(); + break; + } + case 2: { + message.boost = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Phrase message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.PhraseSet.Phrase + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.PhraseSet.Phrase} Phrase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Phrase.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Phrase message. + * @function verify + * @memberof google.cloud.speech.v1.PhraseSet.Phrase + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Phrase.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + if (message.boost != null && message.hasOwnProperty("boost")) + if (typeof message.boost !== "number") + return "boost: number expected"; + return null; + }; + + /** + * Creates a Phrase message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.PhraseSet.Phrase + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.PhraseSet.Phrase} Phrase + */ + Phrase.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.PhraseSet.Phrase) + return object; + var message = new $root.google.cloud.speech.v1.PhraseSet.Phrase(); + if (object.value != null) + message.value = String(object.value); + if (object.boost != null) + message.boost = Number(object.boost); + return message; + }; + + /** + * Creates a plain object from a Phrase message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.PhraseSet.Phrase + * @static + * @param {google.cloud.speech.v1.PhraseSet.Phrase} message Phrase + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Phrase.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + object.boost = 0; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.boost != null && message.hasOwnProperty("boost")) + object.boost = options.json && !isFinite(message.boost) ? String(message.boost) : message.boost; + return object; + }; + + /** + * Converts this Phrase to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.PhraseSet.Phrase + * @instance + * @returns {Object.} JSON object + */ + Phrase.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Phrase + * @function getTypeUrl + * @memberof google.cloud.speech.v1.PhraseSet.Phrase + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Phrase.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.PhraseSet.Phrase"; + }; + + return Phrase; + })(); + + return PhraseSet; + })(); + + v1.SpeechAdaptation = (function() { + + /** + * Properties of a SpeechAdaptation. + * @memberof google.cloud.speech.v1 + * @interface ISpeechAdaptation + * @property {Array.|null} [phraseSets] SpeechAdaptation phraseSets + * @property {Array.|null} [phraseSetReferences] SpeechAdaptation phraseSetReferences + * @property {Array.|null} [customClasses] SpeechAdaptation customClasses + * @property {google.cloud.speech.v1.SpeechAdaptation.IABNFGrammar|null} [abnfGrammar] SpeechAdaptation abnfGrammar + */ + + /** + * Constructs a new SpeechAdaptation. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a SpeechAdaptation. + * @implements ISpeechAdaptation + * @constructor + * @param {google.cloud.speech.v1.ISpeechAdaptation=} [properties] Properties to set + */ + function SpeechAdaptation(properties) { + this.phraseSets = []; + this.phraseSetReferences = []; + this.customClasses = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpeechAdaptation phraseSets. + * @member {Array.} phraseSets + * @memberof google.cloud.speech.v1.SpeechAdaptation + * @instance + */ + SpeechAdaptation.prototype.phraseSets = $util.emptyArray; + + /** + * SpeechAdaptation phraseSetReferences. + * @member {Array.} phraseSetReferences + * @memberof google.cloud.speech.v1.SpeechAdaptation + * @instance + */ + SpeechAdaptation.prototype.phraseSetReferences = $util.emptyArray; + + /** + * SpeechAdaptation customClasses. + * @member {Array.} customClasses + * @memberof google.cloud.speech.v1.SpeechAdaptation + * @instance + */ + SpeechAdaptation.prototype.customClasses = $util.emptyArray; + + /** + * SpeechAdaptation abnfGrammar. + * @member {google.cloud.speech.v1.SpeechAdaptation.IABNFGrammar|null|undefined} abnfGrammar + * @memberof google.cloud.speech.v1.SpeechAdaptation + * @instance + */ + SpeechAdaptation.prototype.abnfGrammar = null; + + /** + * Creates a new SpeechAdaptation instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.SpeechAdaptation + * @static + * @param {google.cloud.speech.v1.ISpeechAdaptation=} [properties] Properties to set + * @returns {google.cloud.speech.v1.SpeechAdaptation} SpeechAdaptation instance + */ + SpeechAdaptation.create = function create(properties) { + return new SpeechAdaptation(properties); + }; + + /** + * Encodes the specified SpeechAdaptation message. Does not implicitly {@link google.cloud.speech.v1.SpeechAdaptation.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.SpeechAdaptation + * @static + * @param {google.cloud.speech.v1.ISpeechAdaptation} message SpeechAdaptation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechAdaptation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.phraseSets != null && message.phraseSets.length) + for (var i = 0; i < message.phraseSets.length; ++i) + $root.google.cloud.speech.v1.PhraseSet.encode(message.phraseSets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.phraseSetReferences != null && message.phraseSetReferences.length) + for (var i = 0; i < message.phraseSetReferences.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.phraseSetReferences[i]); + if (message.customClasses != null && message.customClasses.length) + for (var i = 0; i < message.customClasses.length; ++i) + $root.google.cloud.speech.v1.CustomClass.encode(message.customClasses[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.abnfGrammar != null && Object.hasOwnProperty.call(message, "abnfGrammar")) + $root.google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar.encode(message.abnfGrammar, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SpeechAdaptation message, length delimited. Does not implicitly {@link google.cloud.speech.v1.SpeechAdaptation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.SpeechAdaptation + * @static + * @param {google.cloud.speech.v1.ISpeechAdaptation} message SpeechAdaptation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechAdaptation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpeechAdaptation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.SpeechAdaptation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.SpeechAdaptation} SpeechAdaptation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechAdaptation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.SpeechAdaptation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.phraseSets && message.phraseSets.length)) + message.phraseSets = []; + message.phraseSets.push($root.google.cloud.speech.v1.PhraseSet.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.phraseSetReferences && message.phraseSetReferences.length)) + message.phraseSetReferences = []; + message.phraseSetReferences.push(reader.string()); + break; + } + case 3: { + if (!(message.customClasses && message.customClasses.length)) + message.customClasses = []; + message.customClasses.push($root.google.cloud.speech.v1.CustomClass.decode(reader, reader.uint32())); + break; + } + case 4: { + message.abnfGrammar = $root.google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpeechAdaptation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.SpeechAdaptation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.SpeechAdaptation} SpeechAdaptation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechAdaptation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpeechAdaptation message. + * @function verify + * @memberof google.cloud.speech.v1.SpeechAdaptation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpeechAdaptation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.phraseSets != null && message.hasOwnProperty("phraseSets")) { + if (!Array.isArray(message.phraseSets)) + return "phraseSets: array expected"; + for (var i = 0; i < message.phraseSets.length; ++i) { + var error = $root.google.cloud.speech.v1.PhraseSet.verify(message.phraseSets[i]); + if (error) + return "phraseSets." + error; + } + } + if (message.phraseSetReferences != null && message.hasOwnProperty("phraseSetReferences")) { + if (!Array.isArray(message.phraseSetReferences)) + return "phraseSetReferences: array expected"; + for (var i = 0; i < message.phraseSetReferences.length; ++i) + if (!$util.isString(message.phraseSetReferences[i])) + return "phraseSetReferences: string[] expected"; + } + if (message.customClasses != null && message.hasOwnProperty("customClasses")) { + if (!Array.isArray(message.customClasses)) + return "customClasses: array expected"; + for (var i = 0; i < message.customClasses.length; ++i) { + var error = $root.google.cloud.speech.v1.CustomClass.verify(message.customClasses[i]); + if (error) + return "customClasses." + error; + } + } + if (message.abnfGrammar != null && message.hasOwnProperty("abnfGrammar")) { + var error = $root.google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar.verify(message.abnfGrammar); + if (error) + return "abnfGrammar." + error; + } + return null; + }; + + /** + * Creates a SpeechAdaptation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.SpeechAdaptation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.SpeechAdaptation} SpeechAdaptation + */ + SpeechAdaptation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.SpeechAdaptation) + return object; + var message = new $root.google.cloud.speech.v1.SpeechAdaptation(); + if (object.phraseSets) { + if (!Array.isArray(object.phraseSets)) + throw TypeError(".google.cloud.speech.v1.SpeechAdaptation.phraseSets: array expected"); + message.phraseSets = []; + for (var i = 0; i < object.phraseSets.length; ++i) { + if (typeof object.phraseSets[i] !== "object") + throw TypeError(".google.cloud.speech.v1.SpeechAdaptation.phraseSets: object expected"); + message.phraseSets[i] = $root.google.cloud.speech.v1.PhraseSet.fromObject(object.phraseSets[i]); + } + } + if (object.phraseSetReferences) { + if (!Array.isArray(object.phraseSetReferences)) + throw TypeError(".google.cloud.speech.v1.SpeechAdaptation.phraseSetReferences: array expected"); + message.phraseSetReferences = []; + for (var i = 0; i < object.phraseSetReferences.length; ++i) + message.phraseSetReferences[i] = String(object.phraseSetReferences[i]); + } + if (object.customClasses) { + if (!Array.isArray(object.customClasses)) + throw TypeError(".google.cloud.speech.v1.SpeechAdaptation.customClasses: array expected"); + message.customClasses = []; + for (var i = 0; i < object.customClasses.length; ++i) { + if (typeof object.customClasses[i] !== "object") + throw TypeError(".google.cloud.speech.v1.SpeechAdaptation.customClasses: object expected"); + message.customClasses[i] = $root.google.cloud.speech.v1.CustomClass.fromObject(object.customClasses[i]); + } + } + if (object.abnfGrammar != null) { + if (typeof object.abnfGrammar !== "object") + throw TypeError(".google.cloud.speech.v1.SpeechAdaptation.abnfGrammar: object expected"); + message.abnfGrammar = $root.google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar.fromObject(object.abnfGrammar); + } + return message; + }; + + /** + * Creates a plain object from a SpeechAdaptation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.SpeechAdaptation + * @static + * @param {google.cloud.speech.v1.SpeechAdaptation} message SpeechAdaptation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpeechAdaptation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.phraseSets = []; + object.phraseSetReferences = []; + object.customClasses = []; + } + if (options.defaults) + object.abnfGrammar = null; + if (message.phraseSets && message.phraseSets.length) { + object.phraseSets = []; + for (var j = 0; j < message.phraseSets.length; ++j) + object.phraseSets[j] = $root.google.cloud.speech.v1.PhraseSet.toObject(message.phraseSets[j], options); + } + if (message.phraseSetReferences && message.phraseSetReferences.length) { + object.phraseSetReferences = []; + for (var j = 0; j < message.phraseSetReferences.length; ++j) + object.phraseSetReferences[j] = message.phraseSetReferences[j]; + } + if (message.customClasses && message.customClasses.length) { + object.customClasses = []; + for (var j = 0; j < message.customClasses.length; ++j) + object.customClasses[j] = $root.google.cloud.speech.v1.CustomClass.toObject(message.customClasses[j], options); + } + if (message.abnfGrammar != null && message.hasOwnProperty("abnfGrammar")) + object.abnfGrammar = $root.google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar.toObject(message.abnfGrammar, options); + return object; + }; + + /** + * Converts this SpeechAdaptation to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.SpeechAdaptation + * @instance + * @returns {Object.} JSON object + */ + SpeechAdaptation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpeechAdaptation + * @function getTypeUrl + * @memberof google.cloud.speech.v1.SpeechAdaptation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpeechAdaptation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.SpeechAdaptation"; + }; + + SpeechAdaptation.ABNFGrammar = (function() { + + /** + * Properties of a ABNFGrammar. + * @memberof google.cloud.speech.v1.SpeechAdaptation + * @interface IABNFGrammar + * @property {Array.|null} [abnfStrings] ABNFGrammar abnfStrings + */ + + /** + * Constructs a new ABNFGrammar. + * @memberof google.cloud.speech.v1.SpeechAdaptation + * @classdesc Represents a ABNFGrammar. + * @implements IABNFGrammar + * @constructor + * @param {google.cloud.speech.v1.SpeechAdaptation.IABNFGrammar=} [properties] Properties to set + */ + function ABNFGrammar(properties) { + this.abnfStrings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ABNFGrammar abnfStrings. + * @member {Array.} abnfStrings + * @memberof google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar + * @instance + */ + ABNFGrammar.prototype.abnfStrings = $util.emptyArray; + + /** + * Creates a new ABNFGrammar instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar + * @static + * @param {google.cloud.speech.v1.SpeechAdaptation.IABNFGrammar=} [properties] Properties to set + * @returns {google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar} ABNFGrammar instance + */ + ABNFGrammar.create = function create(properties) { + return new ABNFGrammar(properties); + }; + + /** + * Encodes the specified ABNFGrammar message. Does not implicitly {@link google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar + * @static + * @param {google.cloud.speech.v1.SpeechAdaptation.IABNFGrammar} message ABNFGrammar message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ABNFGrammar.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.abnfStrings != null && message.abnfStrings.length) + for (var i = 0; i < message.abnfStrings.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.abnfStrings[i]); + return writer; + }; + + /** + * Encodes the specified ABNFGrammar message, length delimited. Does not implicitly {@link google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar + * @static + * @param {google.cloud.speech.v1.SpeechAdaptation.IABNFGrammar} message ABNFGrammar message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ABNFGrammar.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ABNFGrammar message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar} ABNFGrammar + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ABNFGrammar.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.abnfStrings && message.abnfStrings.length)) + message.abnfStrings = []; + message.abnfStrings.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ABNFGrammar message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar} ABNFGrammar + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ABNFGrammar.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ABNFGrammar message. + * @function verify + * @memberof google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ABNFGrammar.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.abnfStrings != null && message.hasOwnProperty("abnfStrings")) { + if (!Array.isArray(message.abnfStrings)) + return "abnfStrings: array expected"; + for (var i = 0; i < message.abnfStrings.length; ++i) + if (!$util.isString(message.abnfStrings[i])) + return "abnfStrings: string[] expected"; + } + return null; + }; + + /** + * Creates a ABNFGrammar message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar} ABNFGrammar + */ + ABNFGrammar.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar) + return object; + var message = new $root.google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar(); + if (object.abnfStrings) { + if (!Array.isArray(object.abnfStrings)) + throw TypeError(".google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar.abnfStrings: array expected"); + message.abnfStrings = []; + for (var i = 0; i < object.abnfStrings.length; ++i) + message.abnfStrings[i] = String(object.abnfStrings[i]); + } + return message; + }; + + /** + * Creates a plain object from a ABNFGrammar message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar + * @static + * @param {google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar} message ABNFGrammar + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ABNFGrammar.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.abnfStrings = []; + if (message.abnfStrings && message.abnfStrings.length) { + object.abnfStrings = []; + for (var j = 0; j < message.abnfStrings.length; ++j) + object.abnfStrings[j] = message.abnfStrings[j]; + } + return object; + }; + + /** + * Converts this ABNFGrammar to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar + * @instance + * @returns {Object.} JSON object + */ + ABNFGrammar.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ABNFGrammar + * @function getTypeUrl + * @memberof google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ABNFGrammar.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar"; + }; + + return ABNFGrammar; + })(); + + return SpeechAdaptation; + })(); + + v1.TranscriptNormalization = (function() { + + /** + * Properties of a TranscriptNormalization. + * @memberof google.cloud.speech.v1 + * @interface ITranscriptNormalization + * @property {Array.|null} [entries] TranscriptNormalization entries + */ + + /** + * Constructs a new TranscriptNormalization. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a TranscriptNormalization. + * @implements ITranscriptNormalization + * @constructor + * @param {google.cloud.speech.v1.ITranscriptNormalization=} [properties] Properties to set + */ + function TranscriptNormalization(properties) { + this.entries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TranscriptNormalization entries. + * @member {Array.} entries + * @memberof google.cloud.speech.v1.TranscriptNormalization + * @instance + */ + TranscriptNormalization.prototype.entries = $util.emptyArray; + + /** + * Creates a new TranscriptNormalization instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.TranscriptNormalization + * @static + * @param {google.cloud.speech.v1.ITranscriptNormalization=} [properties] Properties to set + * @returns {google.cloud.speech.v1.TranscriptNormalization} TranscriptNormalization instance + */ + TranscriptNormalization.create = function create(properties) { + return new TranscriptNormalization(properties); + }; + + /** + * Encodes the specified TranscriptNormalization message. Does not implicitly {@link google.cloud.speech.v1.TranscriptNormalization.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.TranscriptNormalization + * @static + * @param {google.cloud.speech.v1.ITranscriptNormalization} message TranscriptNormalization message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranscriptNormalization.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entries != null && message.entries.length) + for (var i = 0; i < message.entries.length; ++i) + $root.google.cloud.speech.v1.TranscriptNormalization.Entry.encode(message.entries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TranscriptNormalization message, length delimited. Does not implicitly {@link google.cloud.speech.v1.TranscriptNormalization.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.TranscriptNormalization + * @static + * @param {google.cloud.speech.v1.ITranscriptNormalization} message TranscriptNormalization message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranscriptNormalization.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TranscriptNormalization message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.TranscriptNormalization + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.TranscriptNormalization} TranscriptNormalization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranscriptNormalization.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.TranscriptNormalization(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.entries && message.entries.length)) + message.entries = []; + message.entries.push($root.google.cloud.speech.v1.TranscriptNormalization.Entry.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TranscriptNormalization message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.TranscriptNormalization + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.TranscriptNormalization} TranscriptNormalization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranscriptNormalization.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TranscriptNormalization message. + * @function verify + * @memberof google.cloud.speech.v1.TranscriptNormalization + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TranscriptNormalization.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entries != null && message.hasOwnProperty("entries")) { + if (!Array.isArray(message.entries)) + return "entries: array expected"; + for (var i = 0; i < message.entries.length; ++i) { + var error = $root.google.cloud.speech.v1.TranscriptNormalization.Entry.verify(message.entries[i]); + if (error) + return "entries." + error; + } + } + return null; + }; + + /** + * Creates a TranscriptNormalization message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.TranscriptNormalization + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.TranscriptNormalization} TranscriptNormalization + */ + TranscriptNormalization.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.TranscriptNormalization) + return object; + var message = new $root.google.cloud.speech.v1.TranscriptNormalization(); + if (object.entries) { + if (!Array.isArray(object.entries)) + throw TypeError(".google.cloud.speech.v1.TranscriptNormalization.entries: array expected"); + message.entries = []; + for (var i = 0; i < object.entries.length; ++i) { + if (typeof object.entries[i] !== "object") + throw TypeError(".google.cloud.speech.v1.TranscriptNormalization.entries: object expected"); + message.entries[i] = $root.google.cloud.speech.v1.TranscriptNormalization.Entry.fromObject(object.entries[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TranscriptNormalization message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.TranscriptNormalization + * @static + * @param {google.cloud.speech.v1.TranscriptNormalization} message TranscriptNormalization + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TranscriptNormalization.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.entries = []; + if (message.entries && message.entries.length) { + object.entries = []; + for (var j = 0; j < message.entries.length; ++j) + object.entries[j] = $root.google.cloud.speech.v1.TranscriptNormalization.Entry.toObject(message.entries[j], options); + } + return object; + }; + + /** + * Converts this TranscriptNormalization to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.TranscriptNormalization + * @instance + * @returns {Object.} JSON object + */ + TranscriptNormalization.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TranscriptNormalization + * @function getTypeUrl + * @memberof google.cloud.speech.v1.TranscriptNormalization + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TranscriptNormalization.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.TranscriptNormalization"; + }; + + TranscriptNormalization.Entry = (function() { + + /** + * Properties of an Entry. + * @memberof google.cloud.speech.v1.TranscriptNormalization + * @interface IEntry + * @property {string|null} [search] Entry search + * @property {string|null} [replace] Entry replace + * @property {boolean|null} [caseSensitive] Entry caseSensitive + */ + + /** + * Constructs a new Entry. + * @memberof google.cloud.speech.v1.TranscriptNormalization + * @classdesc Represents an Entry. + * @implements IEntry + * @constructor + * @param {google.cloud.speech.v1.TranscriptNormalization.IEntry=} [properties] Properties to set + */ + function Entry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Entry search. + * @member {string} search + * @memberof google.cloud.speech.v1.TranscriptNormalization.Entry + * @instance + */ + Entry.prototype.search = ""; + + /** + * Entry replace. + * @member {string} replace + * @memberof google.cloud.speech.v1.TranscriptNormalization.Entry + * @instance + */ + Entry.prototype.replace = ""; + + /** + * Entry caseSensitive. + * @member {boolean} caseSensitive + * @memberof google.cloud.speech.v1.TranscriptNormalization.Entry + * @instance + */ + Entry.prototype.caseSensitive = false; + + /** + * Creates a new Entry instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.TranscriptNormalization.Entry + * @static + * @param {google.cloud.speech.v1.TranscriptNormalization.IEntry=} [properties] Properties to set + * @returns {google.cloud.speech.v1.TranscriptNormalization.Entry} Entry instance + */ + Entry.create = function create(properties) { + return new Entry(properties); + }; + + /** + * Encodes the specified Entry message. Does not implicitly {@link google.cloud.speech.v1.TranscriptNormalization.Entry.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.TranscriptNormalization.Entry + * @static + * @param {google.cloud.speech.v1.TranscriptNormalization.IEntry} message Entry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.search != null && Object.hasOwnProperty.call(message, "search")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.search); + if (message.replace != null && Object.hasOwnProperty.call(message, "replace")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.replace); + if (message.caseSensitive != null && Object.hasOwnProperty.call(message, "caseSensitive")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.caseSensitive); + return writer; + }; + + /** + * Encodes the specified Entry message, length delimited. Does not implicitly {@link google.cloud.speech.v1.TranscriptNormalization.Entry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.TranscriptNormalization.Entry + * @static + * @param {google.cloud.speech.v1.TranscriptNormalization.IEntry} message Entry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Entry message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.TranscriptNormalization.Entry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.TranscriptNormalization.Entry} Entry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entry.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.TranscriptNormalization.Entry(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.search = reader.string(); + break; + } + case 2: { + message.replace = reader.string(); + break; + } + case 3: { + message.caseSensitive = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Entry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.TranscriptNormalization.Entry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.TranscriptNormalization.Entry} Entry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Entry message. + * @function verify + * @memberof google.cloud.speech.v1.TranscriptNormalization.Entry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Entry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.search != null && message.hasOwnProperty("search")) + if (!$util.isString(message.search)) + return "search: string expected"; + if (message.replace != null && message.hasOwnProperty("replace")) + if (!$util.isString(message.replace)) + return "replace: string expected"; + if (message.caseSensitive != null && message.hasOwnProperty("caseSensitive")) + if (typeof message.caseSensitive !== "boolean") + return "caseSensitive: boolean expected"; + return null; + }; + + /** + * Creates an Entry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.TranscriptNormalization.Entry + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.TranscriptNormalization.Entry} Entry + */ + Entry.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.TranscriptNormalization.Entry) + return object; + var message = new $root.google.cloud.speech.v1.TranscriptNormalization.Entry(); + if (object.search != null) + message.search = String(object.search); + if (object.replace != null) + message.replace = String(object.replace); + if (object.caseSensitive != null) + message.caseSensitive = Boolean(object.caseSensitive); + return message; + }; + + /** + * Creates a plain object from an Entry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.TranscriptNormalization.Entry + * @static + * @param {google.cloud.speech.v1.TranscriptNormalization.Entry} message Entry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Entry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.search = ""; + object.replace = ""; + object.caseSensitive = false; + } + if (message.search != null && message.hasOwnProperty("search")) + object.search = message.search; + if (message.replace != null && message.hasOwnProperty("replace")) + object.replace = message.replace; + if (message.caseSensitive != null && message.hasOwnProperty("caseSensitive")) + object.caseSensitive = message.caseSensitive; + return object; + }; + + /** + * Converts this Entry to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.TranscriptNormalization.Entry + * @instance + * @returns {Object.} JSON object + */ + Entry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Entry + * @function getTypeUrl + * @memberof google.cloud.speech.v1.TranscriptNormalization.Entry + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Entry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.TranscriptNormalization.Entry"; + }; + + return Entry; + })(); + + return TranscriptNormalization; + })(); + + v1.Adaptation = (function() { + + /** + * Constructs a new Adaptation service. + * @memberof google.cloud.speech.v1 + * @classdesc Represents an Adaptation + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Adaptation(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Adaptation.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Adaptation; + + /** + * Creates new Adaptation service using the specified rpc implementation. + * @function create + * @memberof google.cloud.speech.v1.Adaptation + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Adaptation} RPC service. Useful where requests and/or responses are streamed. + */ + Adaptation.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.speech.v1.Adaptation|createPhraseSet}. + * @memberof google.cloud.speech.v1.Adaptation + * @typedef CreatePhraseSetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.speech.v1.PhraseSet} [response] PhraseSet + */ + + /** + * Calls CreatePhraseSet. + * @function createPhraseSet + * @memberof google.cloud.speech.v1.Adaptation + * @instance + * @param {google.cloud.speech.v1.ICreatePhraseSetRequest} request CreatePhraseSetRequest message or plain object + * @param {google.cloud.speech.v1.Adaptation.CreatePhraseSetCallback} callback Node-style callback called with the error, if any, and PhraseSet + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Adaptation.prototype.createPhraseSet = function createPhraseSet(request, callback) { + return this.rpcCall(createPhraseSet, $root.google.cloud.speech.v1.CreatePhraseSetRequest, $root.google.cloud.speech.v1.PhraseSet, request, callback); + }, "name", { value: "CreatePhraseSet" }); + + /** + * Calls CreatePhraseSet. + * @function createPhraseSet + * @memberof google.cloud.speech.v1.Adaptation + * @instance + * @param {google.cloud.speech.v1.ICreatePhraseSetRequest} request CreatePhraseSetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.speech.v1.Adaptation|getPhraseSet}. + * @memberof google.cloud.speech.v1.Adaptation + * @typedef GetPhraseSetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.speech.v1.PhraseSet} [response] PhraseSet + */ + + /** + * Calls GetPhraseSet. + * @function getPhraseSet + * @memberof google.cloud.speech.v1.Adaptation + * @instance + * @param {google.cloud.speech.v1.IGetPhraseSetRequest} request GetPhraseSetRequest message or plain object + * @param {google.cloud.speech.v1.Adaptation.GetPhraseSetCallback} callback Node-style callback called with the error, if any, and PhraseSet + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Adaptation.prototype.getPhraseSet = function getPhraseSet(request, callback) { + return this.rpcCall(getPhraseSet, $root.google.cloud.speech.v1.GetPhraseSetRequest, $root.google.cloud.speech.v1.PhraseSet, request, callback); + }, "name", { value: "GetPhraseSet" }); + + /** + * Calls GetPhraseSet. + * @function getPhraseSet + * @memberof google.cloud.speech.v1.Adaptation + * @instance + * @param {google.cloud.speech.v1.IGetPhraseSetRequest} request GetPhraseSetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.speech.v1.Adaptation|listPhraseSet}. + * @memberof google.cloud.speech.v1.Adaptation + * @typedef ListPhraseSetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.speech.v1.ListPhraseSetResponse} [response] ListPhraseSetResponse + */ + + /** + * Calls ListPhraseSet. + * @function listPhraseSet + * @memberof google.cloud.speech.v1.Adaptation + * @instance + * @param {google.cloud.speech.v1.IListPhraseSetRequest} request ListPhraseSetRequest message or plain object + * @param {google.cloud.speech.v1.Adaptation.ListPhraseSetCallback} callback Node-style callback called with the error, if any, and ListPhraseSetResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Adaptation.prototype.listPhraseSet = function listPhraseSet(request, callback) { + return this.rpcCall(listPhraseSet, $root.google.cloud.speech.v1.ListPhraseSetRequest, $root.google.cloud.speech.v1.ListPhraseSetResponse, request, callback); + }, "name", { value: "ListPhraseSet" }); + + /** + * Calls ListPhraseSet. + * @function listPhraseSet + * @memberof google.cloud.speech.v1.Adaptation + * @instance + * @param {google.cloud.speech.v1.IListPhraseSetRequest} request ListPhraseSetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.speech.v1.Adaptation|updatePhraseSet}. + * @memberof google.cloud.speech.v1.Adaptation + * @typedef UpdatePhraseSetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.speech.v1.PhraseSet} [response] PhraseSet + */ + + /** + * Calls UpdatePhraseSet. + * @function updatePhraseSet + * @memberof google.cloud.speech.v1.Adaptation + * @instance + * @param {google.cloud.speech.v1.IUpdatePhraseSetRequest} request UpdatePhraseSetRequest message or plain object + * @param {google.cloud.speech.v1.Adaptation.UpdatePhraseSetCallback} callback Node-style callback called with the error, if any, and PhraseSet + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Adaptation.prototype.updatePhraseSet = function updatePhraseSet(request, callback) { + return this.rpcCall(updatePhraseSet, $root.google.cloud.speech.v1.UpdatePhraseSetRequest, $root.google.cloud.speech.v1.PhraseSet, request, callback); + }, "name", { value: "UpdatePhraseSet" }); + + /** + * Calls UpdatePhraseSet. + * @function updatePhraseSet + * @memberof google.cloud.speech.v1.Adaptation + * @instance + * @param {google.cloud.speech.v1.IUpdatePhraseSetRequest} request UpdatePhraseSetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.speech.v1.Adaptation|deletePhraseSet}. + * @memberof google.cloud.speech.v1.Adaptation + * @typedef DeletePhraseSetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeletePhraseSet. + * @function deletePhraseSet + * @memberof google.cloud.speech.v1.Adaptation + * @instance + * @param {google.cloud.speech.v1.IDeletePhraseSetRequest} request DeletePhraseSetRequest message or plain object + * @param {google.cloud.speech.v1.Adaptation.DeletePhraseSetCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Adaptation.prototype.deletePhraseSet = function deletePhraseSet(request, callback) { + return this.rpcCall(deletePhraseSet, $root.google.cloud.speech.v1.DeletePhraseSetRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeletePhraseSet" }); + + /** + * Calls DeletePhraseSet. + * @function deletePhraseSet + * @memberof google.cloud.speech.v1.Adaptation + * @instance + * @param {google.cloud.speech.v1.IDeletePhraseSetRequest} request DeletePhraseSetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.speech.v1.Adaptation|createCustomClass}. + * @memberof google.cloud.speech.v1.Adaptation + * @typedef CreateCustomClassCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.speech.v1.CustomClass} [response] CustomClass + */ + + /** + * Calls CreateCustomClass. + * @function createCustomClass + * @memberof google.cloud.speech.v1.Adaptation + * @instance + * @param {google.cloud.speech.v1.ICreateCustomClassRequest} request CreateCustomClassRequest message or plain object + * @param {google.cloud.speech.v1.Adaptation.CreateCustomClassCallback} callback Node-style callback called with the error, if any, and CustomClass + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Adaptation.prototype.createCustomClass = function createCustomClass(request, callback) { + return this.rpcCall(createCustomClass, $root.google.cloud.speech.v1.CreateCustomClassRequest, $root.google.cloud.speech.v1.CustomClass, request, callback); + }, "name", { value: "CreateCustomClass" }); + + /** + * Calls CreateCustomClass. + * @function createCustomClass + * @memberof google.cloud.speech.v1.Adaptation + * @instance + * @param {google.cloud.speech.v1.ICreateCustomClassRequest} request CreateCustomClassRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.speech.v1.Adaptation|getCustomClass}. + * @memberof google.cloud.speech.v1.Adaptation + * @typedef GetCustomClassCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.speech.v1.CustomClass} [response] CustomClass + */ + + /** + * Calls GetCustomClass. + * @function getCustomClass + * @memberof google.cloud.speech.v1.Adaptation + * @instance + * @param {google.cloud.speech.v1.IGetCustomClassRequest} request GetCustomClassRequest message or plain object + * @param {google.cloud.speech.v1.Adaptation.GetCustomClassCallback} callback Node-style callback called with the error, if any, and CustomClass + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Adaptation.prototype.getCustomClass = function getCustomClass(request, callback) { + return this.rpcCall(getCustomClass, $root.google.cloud.speech.v1.GetCustomClassRequest, $root.google.cloud.speech.v1.CustomClass, request, callback); + }, "name", { value: "GetCustomClass" }); + + /** + * Calls GetCustomClass. + * @function getCustomClass + * @memberof google.cloud.speech.v1.Adaptation + * @instance + * @param {google.cloud.speech.v1.IGetCustomClassRequest} request GetCustomClassRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.speech.v1.Adaptation|listCustomClasses}. + * @memberof google.cloud.speech.v1.Adaptation + * @typedef ListCustomClassesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.speech.v1.ListCustomClassesResponse} [response] ListCustomClassesResponse + */ + + /** + * Calls ListCustomClasses. + * @function listCustomClasses + * @memberof google.cloud.speech.v1.Adaptation + * @instance + * @param {google.cloud.speech.v1.IListCustomClassesRequest} request ListCustomClassesRequest message or plain object + * @param {google.cloud.speech.v1.Adaptation.ListCustomClassesCallback} callback Node-style callback called with the error, if any, and ListCustomClassesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Adaptation.prototype.listCustomClasses = function listCustomClasses(request, callback) { + return this.rpcCall(listCustomClasses, $root.google.cloud.speech.v1.ListCustomClassesRequest, $root.google.cloud.speech.v1.ListCustomClassesResponse, request, callback); + }, "name", { value: "ListCustomClasses" }); + + /** + * Calls ListCustomClasses. + * @function listCustomClasses + * @memberof google.cloud.speech.v1.Adaptation + * @instance + * @param {google.cloud.speech.v1.IListCustomClassesRequest} request ListCustomClassesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.speech.v1.Adaptation|updateCustomClass}. + * @memberof google.cloud.speech.v1.Adaptation + * @typedef UpdateCustomClassCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.speech.v1.CustomClass} [response] CustomClass + */ + + /** + * Calls UpdateCustomClass. + * @function updateCustomClass + * @memberof google.cloud.speech.v1.Adaptation + * @instance + * @param {google.cloud.speech.v1.IUpdateCustomClassRequest} request UpdateCustomClassRequest message or plain object + * @param {google.cloud.speech.v1.Adaptation.UpdateCustomClassCallback} callback Node-style callback called with the error, if any, and CustomClass + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Adaptation.prototype.updateCustomClass = function updateCustomClass(request, callback) { + return this.rpcCall(updateCustomClass, $root.google.cloud.speech.v1.UpdateCustomClassRequest, $root.google.cloud.speech.v1.CustomClass, request, callback); + }, "name", { value: "UpdateCustomClass" }); + + /** + * Calls UpdateCustomClass. + * @function updateCustomClass + * @memberof google.cloud.speech.v1.Adaptation + * @instance + * @param {google.cloud.speech.v1.IUpdateCustomClassRequest} request UpdateCustomClassRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.speech.v1.Adaptation|deleteCustomClass}. + * @memberof google.cloud.speech.v1.Adaptation + * @typedef DeleteCustomClassCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteCustomClass. + * @function deleteCustomClass + * @memberof google.cloud.speech.v1.Adaptation + * @instance + * @param {google.cloud.speech.v1.IDeleteCustomClassRequest} request DeleteCustomClassRequest message or plain object + * @param {google.cloud.speech.v1.Adaptation.DeleteCustomClassCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Adaptation.prototype.deleteCustomClass = function deleteCustomClass(request, callback) { + return this.rpcCall(deleteCustomClass, $root.google.cloud.speech.v1.DeleteCustomClassRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteCustomClass" }); + + /** + * Calls DeleteCustomClass. + * @function deleteCustomClass + * @memberof google.cloud.speech.v1.Adaptation + * @instance + * @param {google.cloud.speech.v1.IDeleteCustomClassRequest} request DeleteCustomClassRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Adaptation; + })(); + + v1.CreatePhraseSetRequest = (function() { + + /** + * Properties of a CreatePhraseSetRequest. + * @memberof google.cloud.speech.v1 + * @interface ICreatePhraseSetRequest + * @property {string|null} [parent] CreatePhraseSetRequest parent + * @property {string|null} [phraseSetId] CreatePhraseSetRequest phraseSetId + * @property {google.cloud.speech.v1.IPhraseSet|null} [phraseSet] CreatePhraseSetRequest phraseSet + */ + + /** + * Constructs a new CreatePhraseSetRequest. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a CreatePhraseSetRequest. + * @implements ICreatePhraseSetRequest + * @constructor + * @param {google.cloud.speech.v1.ICreatePhraseSetRequest=} [properties] Properties to set + */ + function CreatePhraseSetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreatePhraseSetRequest parent. + * @member {string} parent + * @memberof google.cloud.speech.v1.CreatePhraseSetRequest + * @instance + */ + CreatePhraseSetRequest.prototype.parent = ""; + + /** + * CreatePhraseSetRequest phraseSetId. + * @member {string} phraseSetId + * @memberof google.cloud.speech.v1.CreatePhraseSetRequest + * @instance + */ + CreatePhraseSetRequest.prototype.phraseSetId = ""; + + /** + * CreatePhraseSetRequest phraseSet. + * @member {google.cloud.speech.v1.IPhraseSet|null|undefined} phraseSet + * @memberof google.cloud.speech.v1.CreatePhraseSetRequest + * @instance + */ + CreatePhraseSetRequest.prototype.phraseSet = null; + + /** + * Creates a new CreatePhraseSetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.CreatePhraseSetRequest + * @static + * @param {google.cloud.speech.v1.ICreatePhraseSetRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v1.CreatePhraseSetRequest} CreatePhraseSetRequest instance + */ + CreatePhraseSetRequest.create = function create(properties) { + return new CreatePhraseSetRequest(properties); + }; + + /** + * Encodes the specified CreatePhraseSetRequest message. Does not implicitly {@link google.cloud.speech.v1.CreatePhraseSetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.CreatePhraseSetRequest + * @static + * @param {google.cloud.speech.v1.ICreatePhraseSetRequest} message CreatePhraseSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreatePhraseSetRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.phraseSetId != null && Object.hasOwnProperty.call(message, "phraseSetId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.phraseSetId); + if (message.phraseSet != null && Object.hasOwnProperty.call(message, "phraseSet")) + $root.google.cloud.speech.v1.PhraseSet.encode(message.phraseSet, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreatePhraseSetRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.CreatePhraseSetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.CreatePhraseSetRequest + * @static + * @param {google.cloud.speech.v1.ICreatePhraseSetRequest} message CreatePhraseSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreatePhraseSetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreatePhraseSetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.CreatePhraseSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.CreatePhraseSetRequest} CreatePhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreatePhraseSetRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.CreatePhraseSetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.phraseSetId = reader.string(); + break; + } + case 3: { + message.phraseSet = $root.google.cloud.speech.v1.PhraseSet.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreatePhraseSetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.CreatePhraseSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.CreatePhraseSetRequest} CreatePhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreatePhraseSetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreatePhraseSetRequest message. + * @function verify + * @memberof google.cloud.speech.v1.CreatePhraseSetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreatePhraseSetRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.phraseSetId != null && message.hasOwnProperty("phraseSetId")) + if (!$util.isString(message.phraseSetId)) + return "phraseSetId: string expected"; + if (message.phraseSet != null && message.hasOwnProperty("phraseSet")) { + var error = $root.google.cloud.speech.v1.PhraseSet.verify(message.phraseSet); + if (error) + return "phraseSet." + error; + } + return null; + }; + + /** + * Creates a CreatePhraseSetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.CreatePhraseSetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.CreatePhraseSetRequest} CreatePhraseSetRequest + */ + CreatePhraseSetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.CreatePhraseSetRequest) + return object; + var message = new $root.google.cloud.speech.v1.CreatePhraseSetRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.phraseSetId != null) + message.phraseSetId = String(object.phraseSetId); + if (object.phraseSet != null) { + if (typeof object.phraseSet !== "object") + throw TypeError(".google.cloud.speech.v1.CreatePhraseSetRequest.phraseSet: object expected"); + message.phraseSet = $root.google.cloud.speech.v1.PhraseSet.fromObject(object.phraseSet); + } + return message; + }; + + /** + * Creates a plain object from a CreatePhraseSetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.CreatePhraseSetRequest + * @static + * @param {google.cloud.speech.v1.CreatePhraseSetRequest} message CreatePhraseSetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreatePhraseSetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.phraseSetId = ""; + object.phraseSet = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.phraseSetId != null && message.hasOwnProperty("phraseSetId")) + object.phraseSetId = message.phraseSetId; + if (message.phraseSet != null && message.hasOwnProperty("phraseSet")) + object.phraseSet = $root.google.cloud.speech.v1.PhraseSet.toObject(message.phraseSet, options); + return object; + }; + + /** + * Converts this CreatePhraseSetRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.CreatePhraseSetRequest + * @instance + * @returns {Object.} JSON object + */ + CreatePhraseSetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreatePhraseSetRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v1.CreatePhraseSetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreatePhraseSetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.CreatePhraseSetRequest"; + }; + + return CreatePhraseSetRequest; + })(); + + v1.UpdatePhraseSetRequest = (function() { + + /** + * Properties of an UpdatePhraseSetRequest. + * @memberof google.cloud.speech.v1 + * @interface IUpdatePhraseSetRequest + * @property {google.cloud.speech.v1.IPhraseSet|null} [phraseSet] UpdatePhraseSetRequest phraseSet + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdatePhraseSetRequest updateMask + */ + + /** + * Constructs a new UpdatePhraseSetRequest. + * @memberof google.cloud.speech.v1 + * @classdesc Represents an UpdatePhraseSetRequest. + * @implements IUpdatePhraseSetRequest + * @constructor + * @param {google.cloud.speech.v1.IUpdatePhraseSetRequest=} [properties] Properties to set + */ + function UpdatePhraseSetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdatePhraseSetRequest phraseSet. + * @member {google.cloud.speech.v1.IPhraseSet|null|undefined} phraseSet + * @memberof google.cloud.speech.v1.UpdatePhraseSetRequest + * @instance + */ + UpdatePhraseSetRequest.prototype.phraseSet = null; + + /** + * UpdatePhraseSetRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.speech.v1.UpdatePhraseSetRequest + * @instance + */ + UpdatePhraseSetRequest.prototype.updateMask = null; + + /** + * Creates a new UpdatePhraseSetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.UpdatePhraseSetRequest + * @static + * @param {google.cloud.speech.v1.IUpdatePhraseSetRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v1.UpdatePhraseSetRequest} UpdatePhraseSetRequest instance + */ + UpdatePhraseSetRequest.create = function create(properties) { + return new UpdatePhraseSetRequest(properties); + }; + + /** + * Encodes the specified UpdatePhraseSetRequest message. Does not implicitly {@link google.cloud.speech.v1.UpdatePhraseSetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.UpdatePhraseSetRequest + * @static + * @param {google.cloud.speech.v1.IUpdatePhraseSetRequest} message UpdatePhraseSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdatePhraseSetRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.phraseSet != null && Object.hasOwnProperty.call(message, "phraseSet")) + $root.google.cloud.speech.v1.PhraseSet.encode(message.phraseSet, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdatePhraseSetRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.UpdatePhraseSetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.UpdatePhraseSetRequest + * @static + * @param {google.cloud.speech.v1.IUpdatePhraseSetRequest} message UpdatePhraseSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdatePhraseSetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdatePhraseSetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.UpdatePhraseSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.UpdatePhraseSetRequest} UpdatePhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdatePhraseSetRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.UpdatePhraseSetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.phraseSet = $root.google.cloud.speech.v1.PhraseSet.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdatePhraseSetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.UpdatePhraseSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.UpdatePhraseSetRequest} UpdatePhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdatePhraseSetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdatePhraseSetRequest message. + * @function verify + * @memberof google.cloud.speech.v1.UpdatePhraseSetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdatePhraseSetRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.phraseSet != null && message.hasOwnProperty("phraseSet")) { + var error = $root.google.cloud.speech.v1.PhraseSet.verify(message.phraseSet); + if (error) + return "phraseSet." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdatePhraseSetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.UpdatePhraseSetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.UpdatePhraseSetRequest} UpdatePhraseSetRequest + */ + UpdatePhraseSetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.UpdatePhraseSetRequest) + return object; + var message = new $root.google.cloud.speech.v1.UpdatePhraseSetRequest(); + if (object.phraseSet != null) { + if (typeof object.phraseSet !== "object") + throw TypeError(".google.cloud.speech.v1.UpdatePhraseSetRequest.phraseSet: object expected"); + message.phraseSet = $root.google.cloud.speech.v1.PhraseSet.fromObject(object.phraseSet); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.speech.v1.UpdatePhraseSetRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdatePhraseSetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.UpdatePhraseSetRequest + * @static + * @param {google.cloud.speech.v1.UpdatePhraseSetRequest} message UpdatePhraseSetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdatePhraseSetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.phraseSet = null; + object.updateMask = null; + } + if (message.phraseSet != null && message.hasOwnProperty("phraseSet")) + object.phraseSet = $root.google.cloud.speech.v1.PhraseSet.toObject(message.phraseSet, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdatePhraseSetRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.UpdatePhraseSetRequest + * @instance + * @returns {Object.} JSON object + */ + UpdatePhraseSetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdatePhraseSetRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v1.UpdatePhraseSetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdatePhraseSetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.UpdatePhraseSetRequest"; + }; + + return UpdatePhraseSetRequest; + })(); + + v1.GetPhraseSetRequest = (function() { + + /** + * Properties of a GetPhraseSetRequest. + * @memberof google.cloud.speech.v1 + * @interface IGetPhraseSetRequest + * @property {string|null} [name] GetPhraseSetRequest name + */ + + /** + * Constructs a new GetPhraseSetRequest. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a GetPhraseSetRequest. + * @implements IGetPhraseSetRequest + * @constructor + * @param {google.cloud.speech.v1.IGetPhraseSetRequest=} [properties] Properties to set + */ + function GetPhraseSetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetPhraseSetRequest name. + * @member {string} name + * @memberof google.cloud.speech.v1.GetPhraseSetRequest + * @instance + */ + GetPhraseSetRequest.prototype.name = ""; + + /** + * Creates a new GetPhraseSetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.GetPhraseSetRequest + * @static + * @param {google.cloud.speech.v1.IGetPhraseSetRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v1.GetPhraseSetRequest} GetPhraseSetRequest instance + */ + GetPhraseSetRequest.create = function create(properties) { + return new GetPhraseSetRequest(properties); + }; + + /** + * Encodes the specified GetPhraseSetRequest message. Does not implicitly {@link google.cloud.speech.v1.GetPhraseSetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.GetPhraseSetRequest + * @static + * @param {google.cloud.speech.v1.IGetPhraseSetRequest} message GetPhraseSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPhraseSetRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetPhraseSetRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.GetPhraseSetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.GetPhraseSetRequest + * @static + * @param {google.cloud.speech.v1.IGetPhraseSetRequest} message GetPhraseSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPhraseSetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPhraseSetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.GetPhraseSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.GetPhraseSetRequest} GetPhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPhraseSetRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.GetPhraseSetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetPhraseSetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.GetPhraseSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.GetPhraseSetRequest} GetPhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPhraseSetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPhraseSetRequest message. + * @function verify + * @memberof google.cloud.speech.v1.GetPhraseSetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPhraseSetRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetPhraseSetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.GetPhraseSetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.GetPhraseSetRequest} GetPhraseSetRequest + */ + GetPhraseSetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.GetPhraseSetRequest) + return object; + var message = new $root.google.cloud.speech.v1.GetPhraseSetRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetPhraseSetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.GetPhraseSetRequest + * @static + * @param {google.cloud.speech.v1.GetPhraseSetRequest} message GetPhraseSetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPhraseSetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetPhraseSetRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.GetPhraseSetRequest + * @instance + * @returns {Object.} JSON object + */ + GetPhraseSetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetPhraseSetRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v1.GetPhraseSetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetPhraseSetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.GetPhraseSetRequest"; + }; + + return GetPhraseSetRequest; + })(); + + v1.ListPhraseSetRequest = (function() { + + /** + * Properties of a ListPhraseSetRequest. + * @memberof google.cloud.speech.v1 + * @interface IListPhraseSetRequest + * @property {string|null} [parent] ListPhraseSetRequest parent + * @property {number|null} [pageSize] ListPhraseSetRequest pageSize + * @property {string|null} [pageToken] ListPhraseSetRequest pageToken + */ + + /** + * Constructs a new ListPhraseSetRequest. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a ListPhraseSetRequest. + * @implements IListPhraseSetRequest + * @constructor + * @param {google.cloud.speech.v1.IListPhraseSetRequest=} [properties] Properties to set + */ + function ListPhraseSetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListPhraseSetRequest parent. + * @member {string} parent + * @memberof google.cloud.speech.v1.ListPhraseSetRequest + * @instance + */ + ListPhraseSetRequest.prototype.parent = ""; + + /** + * ListPhraseSetRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.speech.v1.ListPhraseSetRequest + * @instance + */ + ListPhraseSetRequest.prototype.pageSize = 0; + + /** + * ListPhraseSetRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.speech.v1.ListPhraseSetRequest + * @instance + */ + ListPhraseSetRequest.prototype.pageToken = ""; + + /** + * Creates a new ListPhraseSetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.ListPhraseSetRequest + * @static + * @param {google.cloud.speech.v1.IListPhraseSetRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v1.ListPhraseSetRequest} ListPhraseSetRequest instance + */ + ListPhraseSetRequest.create = function create(properties) { + return new ListPhraseSetRequest(properties); + }; + + /** + * Encodes the specified ListPhraseSetRequest message. Does not implicitly {@link google.cloud.speech.v1.ListPhraseSetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.ListPhraseSetRequest + * @static + * @param {google.cloud.speech.v1.IListPhraseSetRequest} message ListPhraseSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPhraseSetRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListPhraseSetRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.ListPhraseSetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.ListPhraseSetRequest + * @static + * @param {google.cloud.speech.v1.IListPhraseSetRequest} message ListPhraseSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPhraseSetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPhraseSetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.ListPhraseSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.ListPhraseSetRequest} ListPhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPhraseSetRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.ListPhraseSetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListPhraseSetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.ListPhraseSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.ListPhraseSetRequest} ListPhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPhraseSetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPhraseSetRequest message. + * @function verify + * @memberof google.cloud.speech.v1.ListPhraseSetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPhraseSetRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListPhraseSetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.ListPhraseSetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.ListPhraseSetRequest} ListPhraseSetRequest + */ + ListPhraseSetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.ListPhraseSetRequest) + return object; + var message = new $root.google.cloud.speech.v1.ListPhraseSetRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListPhraseSetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.ListPhraseSetRequest + * @static + * @param {google.cloud.speech.v1.ListPhraseSetRequest} message ListPhraseSetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPhraseSetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListPhraseSetRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.ListPhraseSetRequest + * @instance + * @returns {Object.} JSON object + */ + ListPhraseSetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListPhraseSetRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v1.ListPhraseSetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPhraseSetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.ListPhraseSetRequest"; + }; + + return ListPhraseSetRequest; + })(); + + v1.ListPhraseSetResponse = (function() { + + /** + * Properties of a ListPhraseSetResponse. + * @memberof google.cloud.speech.v1 + * @interface IListPhraseSetResponse + * @property {Array.|null} [phraseSets] ListPhraseSetResponse phraseSets + * @property {string|null} [nextPageToken] ListPhraseSetResponse nextPageToken + */ + + /** + * Constructs a new ListPhraseSetResponse. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a ListPhraseSetResponse. + * @implements IListPhraseSetResponse + * @constructor + * @param {google.cloud.speech.v1.IListPhraseSetResponse=} [properties] Properties to set + */ + function ListPhraseSetResponse(properties) { + this.phraseSets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListPhraseSetResponse phraseSets. + * @member {Array.} phraseSets + * @memberof google.cloud.speech.v1.ListPhraseSetResponse + * @instance + */ + ListPhraseSetResponse.prototype.phraseSets = $util.emptyArray; + + /** + * ListPhraseSetResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.speech.v1.ListPhraseSetResponse + * @instance + */ + ListPhraseSetResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListPhraseSetResponse instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.ListPhraseSetResponse + * @static + * @param {google.cloud.speech.v1.IListPhraseSetResponse=} [properties] Properties to set + * @returns {google.cloud.speech.v1.ListPhraseSetResponse} ListPhraseSetResponse instance + */ + ListPhraseSetResponse.create = function create(properties) { + return new ListPhraseSetResponse(properties); + }; + + /** + * Encodes the specified ListPhraseSetResponse message. Does not implicitly {@link google.cloud.speech.v1.ListPhraseSetResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.ListPhraseSetResponse + * @static + * @param {google.cloud.speech.v1.IListPhraseSetResponse} message ListPhraseSetResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPhraseSetResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.phraseSets != null && message.phraseSets.length) + for (var i = 0; i < message.phraseSets.length; ++i) + $root.google.cloud.speech.v1.PhraseSet.encode(message.phraseSets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListPhraseSetResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v1.ListPhraseSetResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.ListPhraseSetResponse + * @static + * @param {google.cloud.speech.v1.IListPhraseSetResponse} message ListPhraseSetResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPhraseSetResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPhraseSetResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.ListPhraseSetResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.ListPhraseSetResponse} ListPhraseSetResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPhraseSetResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.ListPhraseSetResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.phraseSets && message.phraseSets.length)) + message.phraseSets = []; + message.phraseSets.push($root.google.cloud.speech.v1.PhraseSet.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListPhraseSetResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.ListPhraseSetResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.ListPhraseSetResponse} ListPhraseSetResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPhraseSetResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPhraseSetResponse message. + * @function verify + * @memberof google.cloud.speech.v1.ListPhraseSetResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPhraseSetResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.phraseSets != null && message.hasOwnProperty("phraseSets")) { + if (!Array.isArray(message.phraseSets)) + return "phraseSets: array expected"; + for (var i = 0; i < message.phraseSets.length; ++i) { + var error = $root.google.cloud.speech.v1.PhraseSet.verify(message.phraseSets[i]); + if (error) + return "phraseSets." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListPhraseSetResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.ListPhraseSetResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.ListPhraseSetResponse} ListPhraseSetResponse + */ + ListPhraseSetResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.ListPhraseSetResponse) + return object; + var message = new $root.google.cloud.speech.v1.ListPhraseSetResponse(); + if (object.phraseSets) { + if (!Array.isArray(object.phraseSets)) + throw TypeError(".google.cloud.speech.v1.ListPhraseSetResponse.phraseSets: array expected"); + message.phraseSets = []; + for (var i = 0; i < object.phraseSets.length; ++i) { + if (typeof object.phraseSets[i] !== "object") + throw TypeError(".google.cloud.speech.v1.ListPhraseSetResponse.phraseSets: object expected"); + message.phraseSets[i] = $root.google.cloud.speech.v1.PhraseSet.fromObject(object.phraseSets[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListPhraseSetResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.ListPhraseSetResponse + * @static + * @param {google.cloud.speech.v1.ListPhraseSetResponse} message ListPhraseSetResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPhraseSetResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.phraseSets = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.phraseSets && message.phraseSets.length) { + object.phraseSets = []; + for (var j = 0; j < message.phraseSets.length; ++j) + object.phraseSets[j] = $root.google.cloud.speech.v1.PhraseSet.toObject(message.phraseSets[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListPhraseSetResponse to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.ListPhraseSetResponse + * @instance + * @returns {Object.} JSON object + */ + ListPhraseSetResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListPhraseSetResponse + * @function getTypeUrl + * @memberof google.cloud.speech.v1.ListPhraseSetResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPhraseSetResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.ListPhraseSetResponse"; + }; + + return ListPhraseSetResponse; + })(); + + v1.DeletePhraseSetRequest = (function() { + + /** + * Properties of a DeletePhraseSetRequest. + * @memberof google.cloud.speech.v1 + * @interface IDeletePhraseSetRequest + * @property {string|null} [name] DeletePhraseSetRequest name + */ + + /** + * Constructs a new DeletePhraseSetRequest. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a DeletePhraseSetRequest. + * @implements IDeletePhraseSetRequest + * @constructor + * @param {google.cloud.speech.v1.IDeletePhraseSetRequest=} [properties] Properties to set + */ + function DeletePhraseSetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeletePhraseSetRequest name. + * @member {string} name + * @memberof google.cloud.speech.v1.DeletePhraseSetRequest + * @instance + */ + DeletePhraseSetRequest.prototype.name = ""; + + /** + * Creates a new DeletePhraseSetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.DeletePhraseSetRequest + * @static + * @param {google.cloud.speech.v1.IDeletePhraseSetRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v1.DeletePhraseSetRequest} DeletePhraseSetRequest instance + */ + DeletePhraseSetRequest.create = function create(properties) { + return new DeletePhraseSetRequest(properties); + }; + + /** + * Encodes the specified DeletePhraseSetRequest message. Does not implicitly {@link google.cloud.speech.v1.DeletePhraseSetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.DeletePhraseSetRequest + * @static + * @param {google.cloud.speech.v1.IDeletePhraseSetRequest} message DeletePhraseSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeletePhraseSetRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeletePhraseSetRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.DeletePhraseSetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.DeletePhraseSetRequest + * @static + * @param {google.cloud.speech.v1.IDeletePhraseSetRequest} message DeletePhraseSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeletePhraseSetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeletePhraseSetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.DeletePhraseSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.DeletePhraseSetRequest} DeletePhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeletePhraseSetRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.DeletePhraseSetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeletePhraseSetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.DeletePhraseSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.DeletePhraseSetRequest} DeletePhraseSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeletePhraseSetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeletePhraseSetRequest message. + * @function verify + * @memberof google.cloud.speech.v1.DeletePhraseSetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeletePhraseSetRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeletePhraseSetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.DeletePhraseSetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.DeletePhraseSetRequest} DeletePhraseSetRequest + */ + DeletePhraseSetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.DeletePhraseSetRequest) + return object; + var message = new $root.google.cloud.speech.v1.DeletePhraseSetRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeletePhraseSetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.DeletePhraseSetRequest + * @static + * @param {google.cloud.speech.v1.DeletePhraseSetRequest} message DeletePhraseSetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeletePhraseSetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeletePhraseSetRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.DeletePhraseSetRequest + * @instance + * @returns {Object.} JSON object + */ + DeletePhraseSetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeletePhraseSetRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v1.DeletePhraseSetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeletePhraseSetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.DeletePhraseSetRequest"; + }; + + return DeletePhraseSetRequest; + })(); + + v1.CreateCustomClassRequest = (function() { + + /** + * Properties of a CreateCustomClassRequest. + * @memberof google.cloud.speech.v1 + * @interface ICreateCustomClassRequest + * @property {string|null} [parent] CreateCustomClassRequest parent + * @property {string|null} [customClassId] CreateCustomClassRequest customClassId + * @property {google.cloud.speech.v1.ICustomClass|null} [customClass] CreateCustomClassRequest customClass + */ + + /** + * Constructs a new CreateCustomClassRequest. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a CreateCustomClassRequest. + * @implements ICreateCustomClassRequest + * @constructor + * @param {google.cloud.speech.v1.ICreateCustomClassRequest=} [properties] Properties to set + */ + function CreateCustomClassRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateCustomClassRequest parent. + * @member {string} parent + * @memberof google.cloud.speech.v1.CreateCustomClassRequest + * @instance + */ + CreateCustomClassRequest.prototype.parent = ""; + + /** + * CreateCustomClassRequest customClassId. + * @member {string} customClassId + * @memberof google.cloud.speech.v1.CreateCustomClassRequest + * @instance + */ + CreateCustomClassRequest.prototype.customClassId = ""; + + /** + * CreateCustomClassRequest customClass. + * @member {google.cloud.speech.v1.ICustomClass|null|undefined} customClass + * @memberof google.cloud.speech.v1.CreateCustomClassRequest + * @instance + */ + CreateCustomClassRequest.prototype.customClass = null; + + /** + * Creates a new CreateCustomClassRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.CreateCustomClassRequest + * @static + * @param {google.cloud.speech.v1.ICreateCustomClassRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v1.CreateCustomClassRequest} CreateCustomClassRequest instance + */ + CreateCustomClassRequest.create = function create(properties) { + return new CreateCustomClassRequest(properties); + }; + + /** + * Encodes the specified CreateCustomClassRequest message. Does not implicitly {@link google.cloud.speech.v1.CreateCustomClassRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.CreateCustomClassRequest + * @static + * @param {google.cloud.speech.v1.ICreateCustomClassRequest} message CreateCustomClassRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCustomClassRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.customClassId != null && Object.hasOwnProperty.call(message, "customClassId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.customClassId); + if (message.customClass != null && Object.hasOwnProperty.call(message, "customClass")) + $root.google.cloud.speech.v1.CustomClass.encode(message.customClass, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateCustomClassRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.CreateCustomClassRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.CreateCustomClassRequest + * @static + * @param {google.cloud.speech.v1.ICreateCustomClassRequest} message CreateCustomClassRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCustomClassRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateCustomClassRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.CreateCustomClassRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.CreateCustomClassRequest} CreateCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCustomClassRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.CreateCustomClassRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.customClassId = reader.string(); + break; + } + case 3: { + message.customClass = $root.google.cloud.speech.v1.CustomClass.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateCustomClassRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.CreateCustomClassRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.CreateCustomClassRequest} CreateCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCustomClassRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateCustomClassRequest message. + * @function verify + * @memberof google.cloud.speech.v1.CreateCustomClassRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateCustomClassRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.customClassId != null && message.hasOwnProperty("customClassId")) + if (!$util.isString(message.customClassId)) + return "customClassId: string expected"; + if (message.customClass != null && message.hasOwnProperty("customClass")) { + var error = $root.google.cloud.speech.v1.CustomClass.verify(message.customClass); + if (error) + return "customClass." + error; + } + return null; + }; + + /** + * Creates a CreateCustomClassRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.CreateCustomClassRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.CreateCustomClassRequest} CreateCustomClassRequest + */ + CreateCustomClassRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.CreateCustomClassRequest) + return object; + var message = new $root.google.cloud.speech.v1.CreateCustomClassRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.customClassId != null) + message.customClassId = String(object.customClassId); + if (object.customClass != null) { + if (typeof object.customClass !== "object") + throw TypeError(".google.cloud.speech.v1.CreateCustomClassRequest.customClass: object expected"); + message.customClass = $root.google.cloud.speech.v1.CustomClass.fromObject(object.customClass); + } + return message; + }; + + /** + * Creates a plain object from a CreateCustomClassRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.CreateCustomClassRequest + * @static + * @param {google.cloud.speech.v1.CreateCustomClassRequest} message CreateCustomClassRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateCustomClassRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.customClassId = ""; + object.customClass = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.customClassId != null && message.hasOwnProperty("customClassId")) + object.customClassId = message.customClassId; + if (message.customClass != null && message.hasOwnProperty("customClass")) + object.customClass = $root.google.cloud.speech.v1.CustomClass.toObject(message.customClass, options); + return object; + }; + + /** + * Converts this CreateCustomClassRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.CreateCustomClassRequest + * @instance + * @returns {Object.} JSON object + */ + CreateCustomClassRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateCustomClassRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v1.CreateCustomClassRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateCustomClassRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.CreateCustomClassRequest"; + }; + + return CreateCustomClassRequest; + })(); + + v1.UpdateCustomClassRequest = (function() { + + /** + * Properties of an UpdateCustomClassRequest. + * @memberof google.cloud.speech.v1 + * @interface IUpdateCustomClassRequest + * @property {google.cloud.speech.v1.ICustomClass|null} [customClass] UpdateCustomClassRequest customClass + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCustomClassRequest updateMask + */ + + /** + * Constructs a new UpdateCustomClassRequest. + * @memberof google.cloud.speech.v1 + * @classdesc Represents an UpdateCustomClassRequest. + * @implements IUpdateCustomClassRequest + * @constructor + * @param {google.cloud.speech.v1.IUpdateCustomClassRequest=} [properties] Properties to set + */ + function UpdateCustomClassRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateCustomClassRequest customClass. + * @member {google.cloud.speech.v1.ICustomClass|null|undefined} customClass + * @memberof google.cloud.speech.v1.UpdateCustomClassRequest + * @instance + */ + UpdateCustomClassRequest.prototype.customClass = null; + + /** + * UpdateCustomClassRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.speech.v1.UpdateCustomClassRequest + * @instance + */ + UpdateCustomClassRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateCustomClassRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.UpdateCustomClassRequest + * @static + * @param {google.cloud.speech.v1.IUpdateCustomClassRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v1.UpdateCustomClassRequest} UpdateCustomClassRequest instance + */ + UpdateCustomClassRequest.create = function create(properties) { + return new UpdateCustomClassRequest(properties); + }; + + /** + * Encodes the specified UpdateCustomClassRequest message. Does not implicitly {@link google.cloud.speech.v1.UpdateCustomClassRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.UpdateCustomClassRequest + * @static + * @param {google.cloud.speech.v1.IUpdateCustomClassRequest} message UpdateCustomClassRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCustomClassRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.customClass != null && Object.hasOwnProperty.call(message, "customClass")) + $root.google.cloud.speech.v1.CustomClass.encode(message.customClass, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateCustomClassRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.UpdateCustomClassRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.UpdateCustomClassRequest + * @static + * @param {google.cloud.speech.v1.IUpdateCustomClassRequest} message UpdateCustomClassRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCustomClassRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateCustomClassRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.UpdateCustomClassRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.UpdateCustomClassRequest} UpdateCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCustomClassRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.UpdateCustomClassRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.customClass = $root.google.cloud.speech.v1.CustomClass.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateCustomClassRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.UpdateCustomClassRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.UpdateCustomClassRequest} UpdateCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCustomClassRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateCustomClassRequest message. + * @function verify + * @memberof google.cloud.speech.v1.UpdateCustomClassRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateCustomClassRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.customClass != null && message.hasOwnProperty("customClass")) { + var error = $root.google.cloud.speech.v1.CustomClass.verify(message.customClass); + if (error) + return "customClass." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateCustomClassRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.UpdateCustomClassRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.UpdateCustomClassRequest} UpdateCustomClassRequest + */ + UpdateCustomClassRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.UpdateCustomClassRequest) + return object; + var message = new $root.google.cloud.speech.v1.UpdateCustomClassRequest(); + if (object.customClass != null) { + if (typeof object.customClass !== "object") + throw TypeError(".google.cloud.speech.v1.UpdateCustomClassRequest.customClass: object expected"); + message.customClass = $root.google.cloud.speech.v1.CustomClass.fromObject(object.customClass); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.speech.v1.UpdateCustomClassRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateCustomClassRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.UpdateCustomClassRequest + * @static + * @param {google.cloud.speech.v1.UpdateCustomClassRequest} message UpdateCustomClassRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateCustomClassRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.customClass = null; + object.updateMask = null; + } + if (message.customClass != null && message.hasOwnProperty("customClass")) + object.customClass = $root.google.cloud.speech.v1.CustomClass.toObject(message.customClass, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateCustomClassRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.UpdateCustomClassRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateCustomClassRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateCustomClassRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v1.UpdateCustomClassRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateCustomClassRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.UpdateCustomClassRequest"; + }; + + return UpdateCustomClassRequest; + })(); + + v1.GetCustomClassRequest = (function() { + + /** + * Properties of a GetCustomClassRequest. + * @memberof google.cloud.speech.v1 + * @interface IGetCustomClassRequest + * @property {string|null} [name] GetCustomClassRequest name + */ + + /** + * Constructs a new GetCustomClassRequest. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a GetCustomClassRequest. + * @implements IGetCustomClassRequest + * @constructor + * @param {google.cloud.speech.v1.IGetCustomClassRequest=} [properties] Properties to set + */ + function GetCustomClassRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetCustomClassRequest name. + * @member {string} name + * @memberof google.cloud.speech.v1.GetCustomClassRequest + * @instance + */ + GetCustomClassRequest.prototype.name = ""; + + /** + * Creates a new GetCustomClassRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.GetCustomClassRequest + * @static + * @param {google.cloud.speech.v1.IGetCustomClassRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v1.GetCustomClassRequest} GetCustomClassRequest instance + */ + GetCustomClassRequest.create = function create(properties) { + return new GetCustomClassRequest(properties); + }; + + /** + * Encodes the specified GetCustomClassRequest message. Does not implicitly {@link google.cloud.speech.v1.GetCustomClassRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.GetCustomClassRequest + * @static + * @param {google.cloud.speech.v1.IGetCustomClassRequest} message GetCustomClassRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCustomClassRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetCustomClassRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.GetCustomClassRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.GetCustomClassRequest + * @static + * @param {google.cloud.speech.v1.IGetCustomClassRequest} message GetCustomClassRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCustomClassRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetCustomClassRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.GetCustomClassRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.GetCustomClassRequest} GetCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCustomClassRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.GetCustomClassRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetCustomClassRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.GetCustomClassRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.GetCustomClassRequest} GetCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCustomClassRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetCustomClassRequest message. + * @function verify + * @memberof google.cloud.speech.v1.GetCustomClassRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetCustomClassRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetCustomClassRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.GetCustomClassRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.GetCustomClassRequest} GetCustomClassRequest + */ + GetCustomClassRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.GetCustomClassRequest) + return object; + var message = new $root.google.cloud.speech.v1.GetCustomClassRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetCustomClassRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.GetCustomClassRequest + * @static + * @param {google.cloud.speech.v1.GetCustomClassRequest} message GetCustomClassRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetCustomClassRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetCustomClassRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.GetCustomClassRequest + * @instance + * @returns {Object.} JSON object + */ + GetCustomClassRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetCustomClassRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v1.GetCustomClassRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetCustomClassRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.GetCustomClassRequest"; + }; + + return GetCustomClassRequest; + })(); + + v1.ListCustomClassesRequest = (function() { + + /** + * Properties of a ListCustomClassesRequest. + * @memberof google.cloud.speech.v1 + * @interface IListCustomClassesRequest + * @property {string|null} [parent] ListCustomClassesRequest parent + * @property {number|null} [pageSize] ListCustomClassesRequest pageSize + * @property {string|null} [pageToken] ListCustomClassesRequest pageToken + */ + + /** + * Constructs a new ListCustomClassesRequest. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a ListCustomClassesRequest. + * @implements IListCustomClassesRequest + * @constructor + * @param {google.cloud.speech.v1.IListCustomClassesRequest=} [properties] Properties to set + */ + function ListCustomClassesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCustomClassesRequest parent. + * @member {string} parent + * @memberof google.cloud.speech.v1.ListCustomClassesRequest + * @instance + */ + ListCustomClassesRequest.prototype.parent = ""; + + /** + * ListCustomClassesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.speech.v1.ListCustomClassesRequest + * @instance + */ + ListCustomClassesRequest.prototype.pageSize = 0; + + /** + * ListCustomClassesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.speech.v1.ListCustomClassesRequest + * @instance + */ + ListCustomClassesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListCustomClassesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.ListCustomClassesRequest + * @static + * @param {google.cloud.speech.v1.IListCustomClassesRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v1.ListCustomClassesRequest} ListCustomClassesRequest instance + */ + ListCustomClassesRequest.create = function create(properties) { + return new ListCustomClassesRequest(properties); + }; + + /** + * Encodes the specified ListCustomClassesRequest message. Does not implicitly {@link google.cloud.speech.v1.ListCustomClassesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.ListCustomClassesRequest + * @static + * @param {google.cloud.speech.v1.IListCustomClassesRequest} message ListCustomClassesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCustomClassesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListCustomClassesRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.ListCustomClassesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.ListCustomClassesRequest + * @static + * @param {google.cloud.speech.v1.IListCustomClassesRequest} message ListCustomClassesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCustomClassesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCustomClassesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.ListCustomClassesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.ListCustomClassesRequest} ListCustomClassesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCustomClassesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.ListCustomClassesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCustomClassesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.ListCustomClassesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.ListCustomClassesRequest} ListCustomClassesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCustomClassesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCustomClassesRequest message. + * @function verify + * @memberof google.cloud.speech.v1.ListCustomClassesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCustomClassesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListCustomClassesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.ListCustomClassesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.ListCustomClassesRequest} ListCustomClassesRequest + */ + ListCustomClassesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.ListCustomClassesRequest) + return object; + var message = new $root.google.cloud.speech.v1.ListCustomClassesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListCustomClassesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.ListCustomClassesRequest + * @static + * @param {google.cloud.speech.v1.ListCustomClassesRequest} message ListCustomClassesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCustomClassesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListCustomClassesRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.ListCustomClassesRequest + * @instance + * @returns {Object.} JSON object + */ + ListCustomClassesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCustomClassesRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v1.ListCustomClassesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCustomClassesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.ListCustomClassesRequest"; + }; + + return ListCustomClassesRequest; + })(); + + v1.ListCustomClassesResponse = (function() { + + /** + * Properties of a ListCustomClassesResponse. + * @memberof google.cloud.speech.v1 + * @interface IListCustomClassesResponse + * @property {Array.|null} [customClasses] ListCustomClassesResponse customClasses + * @property {string|null} [nextPageToken] ListCustomClassesResponse nextPageToken + */ + + /** + * Constructs a new ListCustomClassesResponse. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a ListCustomClassesResponse. + * @implements IListCustomClassesResponse + * @constructor + * @param {google.cloud.speech.v1.IListCustomClassesResponse=} [properties] Properties to set + */ + function ListCustomClassesResponse(properties) { + this.customClasses = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCustomClassesResponse customClasses. + * @member {Array.} customClasses + * @memberof google.cloud.speech.v1.ListCustomClassesResponse + * @instance + */ + ListCustomClassesResponse.prototype.customClasses = $util.emptyArray; + + /** + * ListCustomClassesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.speech.v1.ListCustomClassesResponse + * @instance + */ + ListCustomClassesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListCustomClassesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.ListCustomClassesResponse + * @static + * @param {google.cloud.speech.v1.IListCustomClassesResponse=} [properties] Properties to set + * @returns {google.cloud.speech.v1.ListCustomClassesResponse} ListCustomClassesResponse instance + */ + ListCustomClassesResponse.create = function create(properties) { + return new ListCustomClassesResponse(properties); + }; + + /** + * Encodes the specified ListCustomClassesResponse message. Does not implicitly {@link google.cloud.speech.v1.ListCustomClassesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.ListCustomClassesResponse + * @static + * @param {google.cloud.speech.v1.IListCustomClassesResponse} message ListCustomClassesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCustomClassesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.customClasses != null && message.customClasses.length) + for (var i = 0; i < message.customClasses.length; ++i) + $root.google.cloud.speech.v1.CustomClass.encode(message.customClasses[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListCustomClassesResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v1.ListCustomClassesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.ListCustomClassesResponse + * @static + * @param {google.cloud.speech.v1.IListCustomClassesResponse} message ListCustomClassesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCustomClassesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCustomClassesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.ListCustomClassesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.ListCustomClassesResponse} ListCustomClassesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCustomClassesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.ListCustomClassesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.customClasses && message.customClasses.length)) + message.customClasses = []; + message.customClasses.push($root.google.cloud.speech.v1.CustomClass.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCustomClassesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.ListCustomClassesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.ListCustomClassesResponse} ListCustomClassesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCustomClassesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCustomClassesResponse message. + * @function verify + * @memberof google.cloud.speech.v1.ListCustomClassesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCustomClassesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.customClasses != null && message.hasOwnProperty("customClasses")) { + if (!Array.isArray(message.customClasses)) + return "customClasses: array expected"; + for (var i = 0; i < message.customClasses.length; ++i) { + var error = $root.google.cloud.speech.v1.CustomClass.verify(message.customClasses[i]); + if (error) + return "customClasses." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListCustomClassesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.ListCustomClassesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.ListCustomClassesResponse} ListCustomClassesResponse + */ + ListCustomClassesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.ListCustomClassesResponse) + return object; + var message = new $root.google.cloud.speech.v1.ListCustomClassesResponse(); + if (object.customClasses) { + if (!Array.isArray(object.customClasses)) + throw TypeError(".google.cloud.speech.v1.ListCustomClassesResponse.customClasses: array expected"); + message.customClasses = []; + for (var i = 0; i < object.customClasses.length; ++i) { + if (typeof object.customClasses[i] !== "object") + throw TypeError(".google.cloud.speech.v1.ListCustomClassesResponse.customClasses: object expected"); + message.customClasses[i] = $root.google.cloud.speech.v1.CustomClass.fromObject(object.customClasses[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListCustomClassesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.ListCustomClassesResponse + * @static + * @param {google.cloud.speech.v1.ListCustomClassesResponse} message ListCustomClassesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCustomClassesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.customClasses = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.customClasses && message.customClasses.length) { + object.customClasses = []; + for (var j = 0; j < message.customClasses.length; ++j) + object.customClasses[j] = $root.google.cloud.speech.v1.CustomClass.toObject(message.customClasses[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListCustomClassesResponse to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.ListCustomClassesResponse + * @instance + * @returns {Object.} JSON object + */ + ListCustomClassesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCustomClassesResponse + * @function getTypeUrl + * @memberof google.cloud.speech.v1.ListCustomClassesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCustomClassesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.ListCustomClassesResponse"; + }; + + return ListCustomClassesResponse; + })(); + + v1.DeleteCustomClassRequest = (function() { + + /** + * Properties of a DeleteCustomClassRequest. + * @memberof google.cloud.speech.v1 + * @interface IDeleteCustomClassRequest + * @property {string|null} [name] DeleteCustomClassRequest name + */ + + /** + * Constructs a new DeleteCustomClassRequest. + * @memberof google.cloud.speech.v1 + * @classdesc Represents a DeleteCustomClassRequest. + * @implements IDeleteCustomClassRequest + * @constructor + * @param {google.cloud.speech.v1.IDeleteCustomClassRequest=} [properties] Properties to set + */ + function DeleteCustomClassRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteCustomClassRequest name. + * @member {string} name + * @memberof google.cloud.speech.v1.DeleteCustomClassRequest + * @instance + */ + DeleteCustomClassRequest.prototype.name = ""; + + /** + * Creates a new DeleteCustomClassRequest instance using the specified properties. + * @function create + * @memberof google.cloud.speech.v1.DeleteCustomClassRequest + * @static + * @param {google.cloud.speech.v1.IDeleteCustomClassRequest=} [properties] Properties to set + * @returns {google.cloud.speech.v1.DeleteCustomClassRequest} DeleteCustomClassRequest instance + */ + DeleteCustomClassRequest.create = function create(properties) { + return new DeleteCustomClassRequest(properties); + }; + + /** + * Encodes the specified DeleteCustomClassRequest message. Does not implicitly {@link google.cloud.speech.v1.DeleteCustomClassRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.speech.v1.DeleteCustomClassRequest + * @static + * @param {google.cloud.speech.v1.IDeleteCustomClassRequest} message DeleteCustomClassRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteCustomClassRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteCustomClassRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.DeleteCustomClassRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.speech.v1.DeleteCustomClassRequest + * @static + * @param {google.cloud.speech.v1.IDeleteCustomClassRequest} message DeleteCustomClassRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteCustomClassRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteCustomClassRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.speech.v1.DeleteCustomClassRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.speech.v1.DeleteCustomClassRequest} DeleteCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteCustomClassRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.DeleteCustomClassRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteCustomClassRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.speech.v1.DeleteCustomClassRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.speech.v1.DeleteCustomClassRequest} DeleteCustomClassRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteCustomClassRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteCustomClassRequest message. + * @function verify + * @memberof google.cloud.speech.v1.DeleteCustomClassRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteCustomClassRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteCustomClassRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.speech.v1.DeleteCustomClassRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.speech.v1.DeleteCustomClassRequest} DeleteCustomClassRequest + */ + DeleteCustomClassRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.speech.v1.DeleteCustomClassRequest) + return object; + var message = new $root.google.cloud.speech.v1.DeleteCustomClassRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteCustomClassRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.speech.v1.DeleteCustomClassRequest + * @static + * @param {google.cloud.speech.v1.DeleteCustomClassRequest} message DeleteCustomClassRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteCustomClassRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteCustomClassRequest to JSON. + * @function toJSON + * @memberof google.cloud.speech.v1.DeleteCustomClassRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteCustomClassRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteCustomClassRequest + * @function getTypeUrl + * @memberof google.cloud.speech.v1.DeleteCustomClassRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteCustomClassRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.speech.v1.DeleteCustomClassRequest"; + }; + + return DeleteCustomClassRequest; + })(); + + return v1; + })(); + + return speech; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.fullyDecodeReservedExpansion = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Http + * @function getTypeUrl + * @memberof google.api.Http + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Http"; + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; + + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.get = reader.string(); + break; + } + case 3: { + message.put = reader.string(); + break; + } + case 4: { + message.post = reader.string(); + break; + } + case 5: { + message["delete"] = reader.string(); + break; + } + case 6: { + message.patch = reader.string(); + break; + } + case 8: { + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + } + case 7: { + message.body = reader.string(); + break; + } + case 12: { + message.responseBody = reader.string(); + break; + } + case 11: { + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) + return object; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + return object; + }; + + /** + * Converts this HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpRule + * @function getTypeUrl + * @memberof google.api.HttpRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpRule"; + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomHttpPattern + * @function getTypeUrl + * @memberof google.api.CustomHttpPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CustomHttpPattern"; + }; + + return CustomHttpPattern; + })(); + + api.CommonLanguageSettings = (function() { + + /** + * Properties of a CommonLanguageSettings. + * @memberof google.api + * @interface ICommonLanguageSettings + * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri + * @property {Array.|null} [destinations] CommonLanguageSettings destinations + */ + + /** + * Constructs a new CommonLanguageSettings. + * @memberof google.api + * @classdesc Represents a CommonLanguageSettings. + * @implements ICommonLanguageSettings + * @constructor + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + */ + function CommonLanguageSettings(properties) { + this.destinations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommonLanguageSettings referenceDocsUri. + * @member {string} referenceDocsUri + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.referenceDocsUri = ""; + + /** + * CommonLanguageSettings destinations. + * @member {Array.} destinations + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.destinations = $util.emptyArray; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @function create + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings instance + */ + CommonLanguageSettings.create = function create(properties) { + return new CommonLanguageSettings(properties); + }; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.referenceDocsUri); + if (message.destinations != null && message.destinations.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.destinations.length; ++i) + writer.int32(message.destinations[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CommonLanguageSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.referenceDocsUri = reader.string(); + break; + } + case 2: { + if (!(message.destinations && message.destinations.length)) + message.destinations = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.destinations.push(reader.int32()); + } else + message.destinations.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommonLanguageSettings message. + * @function verify + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommonLanguageSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + if (!$util.isString(message.referenceDocsUri)) + return "referenceDocsUri: string expected"; + if (message.destinations != null && message.hasOwnProperty("destinations")) { + if (!Array.isArray(message.destinations)) + return "destinations: array expected"; + for (var i = 0; i < message.destinations.length; ++i) + switch (message.destinations[i]) { + default: + return "destinations: enum value[] expected"; + case 0: + case 10: + case 20: + break; + } + } + return null; + }; + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + */ + CommonLanguageSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CommonLanguageSettings) + return object; + var message = new $root.google.api.CommonLanguageSettings(); + if (object.referenceDocsUri != null) + message.referenceDocsUri = String(object.referenceDocsUri); + if (object.destinations) { + if (!Array.isArray(object.destinations)) + throw TypeError(".google.api.CommonLanguageSettings.destinations: array expected"); + message.destinations = []; + for (var i = 0; i < object.destinations.length; ++i) + switch (object.destinations[i]) { + default: + if (typeof object.destinations[i] === "number") { + message.destinations[i] = object.destinations[i]; + break; + } + case "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": + case 0: + message.destinations[i] = 0; + break; + case "GITHUB": + case 10: + message.destinations[i] = 10; + break; + case "PACKAGE_MANAGER": + case 20: + message.destinations[i] = 20; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommonLanguageSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.destinations = []; + if (options.defaults) + object.referenceDocsUri = ""; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + object.referenceDocsUri = message.referenceDocsUri; + if (message.destinations && message.destinations.length) { + object.destinations = []; + for (var j = 0; j < message.destinations.length; ++j) + object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; + } + return object; + }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @function toJSON + * @memberof google.api.CommonLanguageSettings + * @instance + * @returns {Object.} JSON object + */ + CommonLanguageSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommonLanguageSettings + * @function getTypeUrl + * @memberof google.api.CommonLanguageSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CommonLanguageSettings"; + }; + + return CommonLanguageSettings; + })(); + + api.ClientLibrarySettings = (function() { + + /** + * Properties of a ClientLibrarySettings. + * @memberof google.api + * @interface IClientLibrarySettings + * @property {string|null} [version] ClientLibrarySettings version + * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage + * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums + * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings + * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings + * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings + * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings + * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings + * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings + * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings + * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings + */ + + /** + * Constructs a new ClientLibrarySettings. + * @memberof google.api + * @classdesc Represents a ClientLibrarySettings. + * @implements IClientLibrarySettings + * @constructor + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + */ + function ClientLibrarySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClientLibrarySettings version. + * @member {string} version + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.version = ""; + + /** + * ClientLibrarySettings launchStage. + * @member {google.api.LaunchStage} launchStage + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.launchStage = 0; + + /** + * ClientLibrarySettings restNumericEnums. + * @member {boolean} restNumericEnums + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.restNumericEnums = false; + + /** + * ClientLibrarySettings javaSettings. + * @member {google.api.IJavaSettings|null|undefined} javaSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.javaSettings = null; + + /** + * ClientLibrarySettings cppSettings. + * @member {google.api.ICppSettings|null|undefined} cppSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.cppSettings = null; + + /** + * ClientLibrarySettings phpSettings. + * @member {google.api.IPhpSettings|null|undefined} phpSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.phpSettings = null; + + /** + * ClientLibrarySettings pythonSettings. + * @member {google.api.IPythonSettings|null|undefined} pythonSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.pythonSettings = null; + + /** + * ClientLibrarySettings nodeSettings. + * @member {google.api.INodeSettings|null|undefined} nodeSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.nodeSettings = null; + + /** + * ClientLibrarySettings dotnetSettings. + * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.dotnetSettings = null; + + /** + * ClientLibrarySettings rubySettings. + * @member {google.api.IRubySettings|null|undefined} rubySettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.rubySettings = null; + + /** + * ClientLibrarySettings goSettings. + * @member {google.api.IGoSettings|null|undefined} goSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.goSettings = null; + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @function create + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance + */ + ClientLibrarySettings.create = function create(properties) { + return new ClientLibrarySettings(properties); + }; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage); + if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums); + if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) + $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) + $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) + $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) + $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) + $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) + $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) + $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) + $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ClientLibrarySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.version = reader.string(); + break; + } + case 2: { + message.launchStage = reader.int32(); + break; + } + case 3: { + message.restNumericEnums = reader.bool(); + break; + } + case 21: { + message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32()); + break; + } + case 22: { + message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32()); + break; + } + case 23: { + message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32()); + break; + } + case 24: { + message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32()); + break; + } + case 25: { + message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32()); + break; + } + case 26: { + message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32()); + break; + } + case 27: { + message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32()); + break; + } + case 28: { + message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientLibrarySettings message. + * @function verify + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientLibrarySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + switch (message.launchStage) { + default: + return "launchStage: enum value expected"; + case 0: + case 6: + case 7: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + if (typeof message.restNumericEnums !== "boolean") + return "restNumericEnums: boolean expected"; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) { + var error = $root.google.api.JavaSettings.verify(message.javaSettings); + if (error) + return "javaSettings." + error; + } + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) { + var error = $root.google.api.CppSettings.verify(message.cppSettings); + if (error) + return "cppSettings." + error; + } + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) { + var error = $root.google.api.PhpSettings.verify(message.phpSettings); + if (error) + return "phpSettings." + error; + } + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) { + var error = $root.google.api.PythonSettings.verify(message.pythonSettings); + if (error) + return "pythonSettings." + error; + } + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) { + var error = $root.google.api.NodeSettings.verify(message.nodeSettings); + if (error) + return "nodeSettings." + error; + } + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) { + var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings); + if (error) + return "dotnetSettings." + error; + } + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) { + var error = $root.google.api.RubySettings.verify(message.rubySettings); + if (error) + return "rubySettings." + error; + } + if (message.goSettings != null && message.hasOwnProperty("goSettings")) { + var error = $root.google.api.GoSettings.verify(message.goSettings); + if (error) + return "goSettings." + error; + } + return null; + }; + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + */ + ClientLibrarySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ClientLibrarySettings) + return object; + var message = new $root.google.api.ClientLibrarySettings(); + if (object.version != null) + message.version = String(object.version); + switch (object.launchStage) { + default: + if (typeof object.launchStage === "number") { + message.launchStage = object.launchStage; + break; + } + break; + case "LAUNCH_STAGE_UNSPECIFIED": + case 0: + message.launchStage = 0; + break; + case "UNIMPLEMENTED": + case 6: + message.launchStage = 6; + break; + case "PRELAUNCH": + case 7: + message.launchStage = 7; + break; + case "EARLY_ACCESS": + case 1: + message.launchStage = 1; + break; + case "ALPHA": + case 2: + message.launchStage = 2; + break; + case "BETA": + case 3: + message.launchStage = 3; + break; + case "GA": + case 4: + message.launchStage = 4; + break; + case "DEPRECATED": + case 5: + message.launchStage = 5; + break; + } + if (object.restNumericEnums != null) + message.restNumericEnums = Boolean(object.restNumericEnums); + if (object.javaSettings != null) { + if (typeof object.javaSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); + message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings); + } + if (object.cppSettings != null) { + if (typeof object.cppSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); + message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings); + } + if (object.phpSettings != null) { + if (typeof object.phpSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); + message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings); + } + if (object.pythonSettings != null) { + if (typeof object.pythonSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); + message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings); + } + if (object.nodeSettings != null) { + if (typeof object.nodeSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); + message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings); + } + if (object.dotnetSettings != null) { + if (typeof object.dotnetSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); + message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings); + } + if (object.rubySettings != null) { + if (typeof object.rubySettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); + message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings); + } + if (object.goSettings != null) { + if (typeof object.goSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); + message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings); + } + return message; + }; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientLibrarySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + object.restNumericEnums = false; + object.javaSettings = null; + object.cppSettings = null; + object.phpSettings = null; + object.pythonSettings = null; + object.nodeSettings = null; + object.dotnetSettings = null; + object.rubySettings = null; + object.goSettings = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + object.restNumericEnums = message.restNumericEnums; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) + object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options); + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) + object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options); + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) + object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options); + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) + object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options); + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) + object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options); + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) + object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options); + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) + object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options); + if (message.goSettings != null && message.hasOwnProperty("goSettings")) + object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options); + return object; + }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @function toJSON + * @memberof google.api.ClientLibrarySettings + * @instance + * @returns {Object.} JSON object + */ + ClientLibrarySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientLibrarySettings + * @function getTypeUrl + * @memberof google.api.ClientLibrarySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ClientLibrarySettings"; + }; + + return ClientLibrarySettings; + })(); + + api.Publishing = (function() { + + /** + * Properties of a Publishing. + * @memberof google.api + * @interface IPublishing + * @property {Array.|null} [methodSettings] Publishing methodSettings + * @property {string|null} [newIssueUri] Publishing newIssueUri + * @property {string|null} [documentationUri] Publishing documentationUri + * @property {string|null} [apiShortName] Publishing apiShortName + * @property {string|null} [githubLabel] Publishing githubLabel + * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams + * @property {string|null} [docTagPrefix] Publishing docTagPrefix + * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization + * @property {Array.|null} [librarySettings] Publishing librarySettings + * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri + * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri + */ + + /** + * Constructs a new Publishing. + * @memberof google.api + * @classdesc Represents a Publishing. + * @implements IPublishing + * @constructor + * @param {google.api.IPublishing=} [properties] Properties to set + */ + function Publishing(properties) { + this.methodSettings = []; + this.codeownerGithubTeams = []; + this.librarySettings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Publishing methodSettings. + * @member {Array.} methodSettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.methodSettings = $util.emptyArray; + + /** + * Publishing newIssueUri. + * @member {string} newIssueUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.newIssueUri = ""; + + /** + * Publishing documentationUri. + * @member {string} documentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.documentationUri = ""; + + /** + * Publishing apiShortName. + * @member {string} apiShortName + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.apiShortName = ""; + + /** + * Publishing githubLabel. + * @member {string} githubLabel + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.githubLabel = ""; + + /** + * Publishing codeownerGithubTeams. + * @member {Array.} codeownerGithubTeams + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.codeownerGithubTeams = $util.emptyArray; + + /** + * Publishing docTagPrefix. + * @member {string} docTagPrefix + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.docTagPrefix = ""; + + /** + * Publishing organization. + * @member {google.api.ClientLibraryOrganization} organization + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.organization = 0; + + /** + * Publishing librarySettings. + * @member {Array.} librarySettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.librarySettings = $util.emptyArray; + + /** + * Publishing protoReferenceDocumentationUri. + * @member {string} protoReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.protoReferenceDocumentationUri = ""; + + /** + * Publishing restReferenceDocumentationUri. + * @member {string} restReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.restReferenceDocumentationUri = ""; + + /** + * Creates a new Publishing instance using the specified properties. + * @function create + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing=} [properties] Properties to set + * @returns {google.api.Publishing} Publishing instance + */ + Publishing.create = function create(properties) { + return new Publishing(properties); + }; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encode + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.methodSettings != null && message.methodSettings.length) + for (var i = 0; i < message.methodSettings.length; ++i) + $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) + writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri); + if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) + writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri); + if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) + writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName); + if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) + writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel); + if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length) + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]); + if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) + writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization); + if (message.librarySettings != null && message.librarySettings.length) + for (var i = 0; i < message.librarySettings.length; ++i) + $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); + if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) + writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); + if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) + writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); + return writer; + }; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @function decode + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Publishing(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.methodSettings && message.methodSettings.length)) + message.methodSettings = []; + message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32())); + break; + } + case 101: { + message.newIssueUri = reader.string(); + break; + } + case 102: { + message.documentationUri = reader.string(); + break; + } + case 103: { + message.apiShortName = reader.string(); + break; + } + case 104: { + message.githubLabel = reader.string(); + break; + } + case 105: { + if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) + message.codeownerGithubTeams = []; + message.codeownerGithubTeams.push(reader.string()); + break; + } + case 106: { + message.docTagPrefix = reader.string(); + break; + } + case 107: { + message.organization = reader.int32(); + break; + } + case 109: { + if (!(message.librarySettings && message.librarySettings.length)) + message.librarySettings = []; + message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32())); + break; + } + case 110: { + message.protoReferenceDocumentationUri = reader.string(); + break; + } + case 111: { + message.restReferenceDocumentationUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Publishing message. + * @function verify + * @memberof google.api.Publishing + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Publishing.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.methodSettings != null && message.hasOwnProperty("methodSettings")) { + if (!Array.isArray(message.methodSettings)) + return "methodSettings: array expected"; + for (var i = 0; i < message.methodSettings.length; ++i) { + var error = $root.google.api.MethodSettings.verify(message.methodSettings[i]); + if (error) + return "methodSettings." + error; + } + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + if (!$util.isString(message.newIssueUri)) + return "newIssueUri: string expected"; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + if (!$util.isString(message.documentationUri)) + return "documentationUri: string expected"; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + if (!$util.isString(message.apiShortName)) + return "apiShortName: string expected"; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + if (!$util.isString(message.githubLabel)) + return "githubLabel: string expected"; + if (message.codeownerGithubTeams != null && message.hasOwnProperty("codeownerGithubTeams")) { + if (!Array.isArray(message.codeownerGithubTeams)) + return "codeownerGithubTeams: array expected"; + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + if (!$util.isString(message.codeownerGithubTeams[i])) + return "codeownerGithubTeams: string[] expected"; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + if (!$util.isString(message.docTagPrefix)) + return "docTagPrefix: string expected"; + if (message.organization != null && message.hasOwnProperty("organization")) + switch (message.organization) { + default: + return "organization: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { + if (!Array.isArray(message.librarySettings)) + return "librarySettings: array expected"; + for (var i = 0; i < message.librarySettings.length; ++i) { + var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i]); + if (error) + return "librarySettings." + error; + } + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + if (!$util.isString(message.protoReferenceDocumentationUri)) + return "protoReferenceDocumentationUri: string expected"; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + if (!$util.isString(message.restReferenceDocumentationUri)) + return "restReferenceDocumentationUri: string expected"; + return null; + }; + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Publishing + * @static + * @param {Object.} object Plain object + * @returns {google.api.Publishing} Publishing + */ + Publishing.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Publishing) + return object; + var message = new $root.google.api.Publishing(); + if (object.methodSettings) { + if (!Array.isArray(object.methodSettings)) + throw TypeError(".google.api.Publishing.methodSettings: array expected"); + message.methodSettings = []; + for (var i = 0; i < object.methodSettings.length; ++i) { + if (typeof object.methodSettings[i] !== "object") + throw TypeError(".google.api.Publishing.methodSettings: object expected"); + message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i]); + } + } + if (object.newIssueUri != null) + message.newIssueUri = String(object.newIssueUri); + if (object.documentationUri != null) + message.documentationUri = String(object.documentationUri); + if (object.apiShortName != null) + message.apiShortName = String(object.apiShortName); + if (object.githubLabel != null) + message.githubLabel = String(object.githubLabel); + if (object.codeownerGithubTeams) { + if (!Array.isArray(object.codeownerGithubTeams)) + throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); + message.codeownerGithubTeams = []; + for (var i = 0; i < object.codeownerGithubTeams.length; ++i) + message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); + } + if (object.docTagPrefix != null) + message.docTagPrefix = String(object.docTagPrefix); + switch (object.organization) { + default: + if (typeof object.organization === "number") { + message.organization = object.organization; + break; + } + break; + case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": + case 0: + message.organization = 0; + break; + case "CLOUD": + case 1: + message.organization = 1; + break; + case "ADS": + case 2: + message.organization = 2; + break; + case "PHOTOS": + case 3: + message.organization = 3; + break; + case "STREET_VIEW": + case 4: + message.organization = 4; + break; + case "SHOPPING": + case 5: + message.organization = 5; + break; + case "GEO": + case 6: + message.organization = 6; + break; + case "GENERATIVE_AI": + case 7: + message.organization = 7; + break; + } + if (object.librarySettings) { + if (!Array.isArray(object.librarySettings)) + throw TypeError(".google.api.Publishing.librarySettings: array expected"); + message.librarySettings = []; + for (var i = 0; i < object.librarySettings.length; ++i) { + if (typeof object.librarySettings[i] !== "object") + throw TypeError(".google.api.Publishing.librarySettings: object expected"); + message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]); + } + } + if (object.protoReferenceDocumentationUri != null) + message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); + if (object.restReferenceDocumentationUri != null) + message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); + return message; + }; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Publishing + * @static + * @param {google.api.Publishing} message Publishing + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Publishing.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.methodSettings = []; + object.codeownerGithubTeams = []; + object.librarySettings = []; + } + if (options.defaults) { + object.newIssueUri = ""; + object.documentationUri = ""; + object.apiShortName = ""; + object.githubLabel = ""; + object.docTagPrefix = ""; + object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; + object.protoReferenceDocumentationUri = ""; + object.restReferenceDocumentationUri = ""; + } + if (message.methodSettings && message.methodSettings.length) { + object.methodSettings = []; + for (var j = 0; j < message.methodSettings.length; ++j) + object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options); + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + object.newIssueUri = message.newIssueUri; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + object.documentationUri = message.documentationUri; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + object.apiShortName = message.apiShortName; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + object.githubLabel = message.githubLabel; + if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { + object.codeownerGithubTeams = []; + for (var j = 0; j < message.codeownerGithubTeams.length; ++j) + object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + object.docTagPrefix = message.docTagPrefix; + if (message.organization != null && message.hasOwnProperty("organization")) + object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; + if (message.librarySettings && message.librarySettings.length) { + object.librarySettings = []; + for (var j = 0; j < message.librarySettings.length; ++j) + object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; + return object; + }; + + /** + * Converts this Publishing to JSON. + * @function toJSON + * @memberof google.api.Publishing + * @instance + * @returns {Object.} JSON object + */ + Publishing.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Publishing + * @function getTypeUrl + * @memberof google.api.Publishing + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Publishing"; + }; + + return Publishing; + })(); + + api.JavaSettings = (function() { + + /** + * Properties of a JavaSettings. + * @memberof google.api + * @interface IJavaSettings + * @property {string|null} [libraryPackage] JavaSettings libraryPackage + * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames + * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common + */ + + /** + * Constructs a new JavaSettings. + * @memberof google.api + * @classdesc Represents a JavaSettings. + * @implements IJavaSettings + * @constructor + * @param {google.api.IJavaSettings=} [properties] Properties to set + */ + function JavaSettings(properties) { + this.serviceClassNames = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JavaSettings libraryPackage. + * @member {string} libraryPackage + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.libraryPackage = ""; + + /** + * JavaSettings serviceClassNames. + * @member {Object.} serviceClassNames + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.serviceClassNames = $util.emptyObject; + + /** + * JavaSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.common = null; + + /** + * Creates a new JavaSettings instance using the specified properties. + * @function create + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings=} [properties] Properties to set + * @returns {google.api.JavaSettings} JavaSettings instance + */ + JavaSettings.create = function create(properties) { + return new JavaSettings(properties); + }; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encode + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage); + if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) + for (var keys = Object.keys(message.serviceClassNames), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.serviceClassNames[keys[i]]).ldelim(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.JavaSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.libraryPackage = reader.string(); + break; + } + case 2: { + if (message.serviceClassNames === $util.emptyObject) + message.serviceClassNames = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.serviceClassNames[key] = value; + break; + } + case 3: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JavaSettings message. + * @function verify + * @memberof google.api.JavaSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JavaSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + if (!$util.isString(message.libraryPackage)) + return "libraryPackage: string expected"; + if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) { + if (!$util.isObject(message.serviceClassNames)) + return "serviceClassNames: object expected"; + var key = Object.keys(message.serviceClassNames); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.serviceClassNames[key[i]])) + return "serviceClassNames: string{k:string} expected"; + } + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.JavaSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.JavaSettings} JavaSettings + */ + JavaSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.JavaSettings) + return object; + var message = new $root.google.api.JavaSettings(); + if (object.libraryPackage != null) + message.libraryPackage = String(object.libraryPackage); + if (object.serviceClassNames) { + if (typeof object.serviceClassNames !== "object") + throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); + message.serviceClassNames = {}; + for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) + message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); + } + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.JavaSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.JavaSettings + * @static + * @param {google.api.JavaSettings} message JavaSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JavaSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.serviceClassNames = {}; + if (options.defaults) { + object.libraryPackage = ""; + object.common = null; + } + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + object.libraryPackage = message.libraryPackage; + var keys2; + if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { + object.serviceClassNames = {}; + for (var j = 0; j < keys2.length; ++j) + object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; + } + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this JavaSettings to JSON. + * @function toJSON + * @memberof google.api.JavaSettings + * @instance + * @returns {Object.} JSON object + */ + JavaSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JavaSettings + * @function getTypeUrl + * @memberof google.api.JavaSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.JavaSettings"; + }; + + return JavaSettings; + })(); + + api.CppSettings = (function() { + + /** + * Properties of a CppSettings. + * @memberof google.api + * @interface ICppSettings + * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common + */ + + /** + * Constructs a new CppSettings. + * @memberof google.api + * @classdesc Represents a CppSettings. + * @implements ICppSettings + * @constructor + * @param {google.api.ICppSettings=} [properties] Properties to set + */ + function CppSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CppSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.CppSettings + * @instance + */ + CppSettings.prototype.common = null; + + /** + * Creates a new CppSettings instance using the specified properties. + * @function create + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings=} [properties] Properties to set + * @returns {google.api.CppSettings} CppSettings instance + */ + CppSettings.create = function create(properties) { + return new CppSettings(properties); + }; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CppSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CppSettings message. + * @function verify + * @memberof google.api.CppSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CppSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CppSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CppSettings} CppSettings + */ + CppSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CppSettings) + return object; + var message = new $root.google.api.CppSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.CppSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CppSettings + * @static + * @param {google.api.CppSettings} message CppSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CppSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this CppSettings to JSON. + * @function toJSON + * @memberof google.api.CppSettings + * @instance + * @returns {Object.} JSON object + */ + CppSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CppSettings + * @function getTypeUrl + * @memberof google.api.CppSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CppSettings"; + }; + + return CppSettings; + })(); + + api.PhpSettings = (function() { + + /** + * Properties of a PhpSettings. + * @memberof google.api + * @interface IPhpSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common + */ + + /** + * Constructs a new PhpSettings. + * @memberof google.api + * @classdesc Represents a PhpSettings. + * @implements IPhpSettings + * @constructor + * @param {google.api.IPhpSettings=} [properties] Properties to set + */ + function PhpSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PhpSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PhpSettings + * @instance + */ + PhpSettings.prototype.common = null; + + /** + * Creates a new PhpSettings instance using the specified properties. + * @function create + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings=} [properties] Properties to set + * @returns {google.api.PhpSettings} PhpSettings instance + */ + PhpSettings.create = function create(properties) { + return new PhpSettings(properties); + }; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PhpSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PhpSettings message. + * @function verify + * @memberof google.api.PhpSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PhpSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PhpSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PhpSettings} PhpSettings + */ + PhpSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PhpSettings) + return object; + var message = new $root.google.api.PhpSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PhpSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PhpSettings + * @static + * @param {google.api.PhpSettings} message PhpSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PhpSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PhpSettings to JSON. + * @function toJSON + * @memberof google.api.PhpSettings + * @instance + * @returns {Object.} JSON object + */ + PhpSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PhpSettings + * @function getTypeUrl + * @memberof google.api.PhpSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PhpSettings"; + }; + + return PhpSettings; + })(); + + api.PythonSettings = (function() { + + /** + * Properties of a PythonSettings. + * @memberof google.api + * @interface IPythonSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common + */ + + /** + * Constructs a new PythonSettings. + * @memberof google.api + * @classdesc Represents a PythonSettings. + * @implements IPythonSettings + * @constructor + * @param {google.api.IPythonSettings=} [properties] Properties to set + */ + function PythonSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PythonSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.common = null; + + /** + * Creates a new PythonSettings instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings=} [properties] Properties to set + * @returns {google.api.PythonSettings} PythonSettings instance + */ + PythonSettings.create = function create(properties) { + return new PythonSettings(properties); + }; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PythonSettings message. + * @function verify + * @memberof google.api.PythonSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PythonSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings} PythonSettings + */ + PythonSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PythonSettings) + return object; + var message = new $root.google.api.PythonSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PythonSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings + * @static + * @param {google.api.PythonSettings} message PythonSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PythonSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PythonSettings to JSON. + * @function toJSON + * @memberof google.api.PythonSettings + * @instance + * @returns {Object.} JSON object + */ + PythonSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PythonSettings + * @function getTypeUrl + * @memberof google.api.PythonSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings"; + }; + + return PythonSettings; + })(); + + api.NodeSettings = (function() { + + /** + * Properties of a NodeSettings. + * @memberof google.api + * @interface INodeSettings + * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common + */ + + /** + * Constructs a new NodeSettings. + * @memberof google.api + * @classdesc Represents a NodeSettings. + * @implements INodeSettings + * @constructor + * @param {google.api.INodeSettings=} [properties] Properties to set + */ + function NodeSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.NodeSettings + * @instance + */ + NodeSettings.prototype.common = null; + + /** + * Creates a new NodeSettings instance using the specified properties. + * @function create + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings=} [properties] Properties to set + * @returns {google.api.NodeSettings} NodeSettings instance + */ + NodeSettings.create = function create(properties) { + return new NodeSettings(properties); + }; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encode + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.NodeSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeSettings message. + * @function verify + * @memberof google.api.NodeSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.NodeSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.NodeSettings} NodeSettings + */ + NodeSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.NodeSettings) + return object; + var message = new $root.google.api.NodeSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.NodeSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.NodeSettings + * @static + * @param {google.api.NodeSettings} message NodeSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this NodeSettings to JSON. + * @function toJSON + * @memberof google.api.NodeSettings + * @instance + * @returns {Object.} JSON object + */ + NodeSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeSettings + * @function getTypeUrl + * @memberof google.api.NodeSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.NodeSettings"; + }; + + return NodeSettings; + })(); + + api.DotnetSettings = (function() { + + /** + * Properties of a DotnetSettings. + * @memberof google.api + * @interface IDotnetSettings + * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common + * @property {Object.|null} [renamedServices] DotnetSettings renamedServices + * @property {Object.|null} [renamedResources] DotnetSettings renamedResources + * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources + * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases + * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures + */ + + /** + * Constructs a new DotnetSettings. + * @memberof google.api + * @classdesc Represents a DotnetSettings. + * @implements IDotnetSettings + * @constructor + * @param {google.api.IDotnetSettings=} [properties] Properties to set + */ + function DotnetSettings(properties) { + this.renamedServices = {}; + this.renamedResources = {}; + this.ignoredResources = []; + this.forcedNamespaceAliases = []; + this.handwrittenSignatures = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DotnetSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.common = null; + + /** + * DotnetSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedServices = $util.emptyObject; + + /** + * DotnetSettings renamedResources. + * @member {Object.} renamedResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedResources = $util.emptyObject; + + /** + * DotnetSettings ignoredResources. + * @member {Array.} ignoredResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.ignoredResources = $util.emptyArray; + + /** + * DotnetSettings forcedNamespaceAliases. + * @member {Array.} forcedNamespaceAliases + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; + + /** + * DotnetSettings handwrittenSignatures. + * @member {Array.} handwrittenSignatures + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @function create + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings=} [properties] Properties to set + * @returns {google.api.DotnetSettings} DotnetSettings instance + */ + DotnetSettings.create = function create(properties) { + return new DotnetSettings(properties); + }; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encode + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); + if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) + for (var keys = Object.keys(message.renamedResources), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedResources[keys[i]]).ldelim(); + if (message.ignoredResources != null && message.ignoredResources.length) + for (var i = 0; i < message.ignoredResources.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]); + if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length) + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]); + if (message.handwrittenSignatures != null && message.handwrittenSignatures.length) + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]); + return writer; + }; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedServices[key] = value; + break; + } + case 3: { + if (message.renamedResources === $util.emptyObject) + message.renamedResources = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedResources[key] = value; + break; + } + case 4: { + if (!(message.ignoredResources && message.ignoredResources.length)) + message.ignoredResources = []; + message.ignoredResources.push(reader.string()); + break; + } + case 5: { + if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length)) + message.forcedNamespaceAliases = []; + message.forcedNamespaceAliases.push(reader.string()); + break; + } + case 6: { + if (!(message.handwrittenSignatures && message.handwrittenSignatures.length)) + message.handwrittenSignatures = []; + message.handwrittenSignatures.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DotnetSettings message. + * @function verify + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DotnetSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } + if (message.renamedResources != null && message.hasOwnProperty("renamedResources")) { + if (!$util.isObject(message.renamedResources)) + return "renamedResources: object expected"; + var key = Object.keys(message.renamedResources); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedResources[key[i]])) + return "renamedResources: string{k:string} expected"; + } + if (message.ignoredResources != null && message.hasOwnProperty("ignoredResources")) { + if (!Array.isArray(message.ignoredResources)) + return "ignoredResources: array expected"; + for (var i = 0; i < message.ignoredResources.length; ++i) + if (!$util.isString(message.ignoredResources[i])) + return "ignoredResources: string[] expected"; + } + if (message.forcedNamespaceAliases != null && message.hasOwnProperty("forcedNamespaceAliases")) { + if (!Array.isArray(message.forcedNamespaceAliases)) + return "forcedNamespaceAliases: array expected"; + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + if (!$util.isString(message.forcedNamespaceAliases[i])) + return "forcedNamespaceAliases: string[] expected"; + } + if (message.handwrittenSignatures != null && message.hasOwnProperty("handwrittenSignatures")) { + if (!Array.isArray(message.handwrittenSignatures)) + return "handwrittenSignatures: array expected"; + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + if (!$util.isString(message.handwrittenSignatures[i])) + return "handwrittenSignatures: string[] expected"; + } + return null; + }; + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.DotnetSettings} DotnetSettings + */ + DotnetSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.DotnetSettings) + return object; + var message = new $root.google.api.DotnetSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.DotnetSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + if (object.renamedServices) { + if (typeof object.renamedServices !== "object") + throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } + if (object.renamedResources) { + if (typeof object.renamedResources !== "object") + throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); + message.renamedResources = {}; + for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) + message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]); + } + if (object.ignoredResources) { + if (!Array.isArray(object.ignoredResources)) + throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected"); + message.ignoredResources = []; + for (var i = 0; i < object.ignoredResources.length; ++i) + message.ignoredResources[i] = String(object.ignoredResources[i]); + } + if (object.forcedNamespaceAliases) { + if (!Array.isArray(object.forcedNamespaceAliases)) + throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected"); + message.forcedNamespaceAliases = []; + for (var i = 0; i < object.forcedNamespaceAliases.length; ++i) + message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]); + } + if (object.handwrittenSignatures) { + if (!Array.isArray(object.handwrittenSignatures)) + throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected"); + message.handwrittenSignatures = []; + for (var i = 0; i < object.handwrittenSignatures.length; ++i) + message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]); + } + return message; + }; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.DotnetSettings} message DotnetSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DotnetSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ignoredResources = []; + object.forcedNamespaceAliases = []; + object.handwrittenSignatures = []; + } + if (options.objects || options.defaults) { + object.renamedServices = {}; + object.renamedResources = {}; + } + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } + if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) { + object.renamedResources = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]]; + } + if (message.ignoredResources && message.ignoredResources.length) { + object.ignoredResources = []; + for (var j = 0; j < message.ignoredResources.length; ++j) + object.ignoredResources[j] = message.ignoredResources[j]; + } + if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) { + object.forcedNamespaceAliases = []; + for (var j = 0; j < message.forcedNamespaceAliases.length; ++j) + object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j]; + } + if (message.handwrittenSignatures && message.handwrittenSignatures.length) { + object.handwrittenSignatures = []; + for (var j = 0; j < message.handwrittenSignatures.length; ++j) + object.handwrittenSignatures[j] = message.handwrittenSignatures[j]; + } + return object; + }; + + /** + * Converts this DotnetSettings to JSON. + * @function toJSON + * @memberof google.api.DotnetSettings + * @instance + * @returns {Object.} JSON object + */ + DotnetSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DotnetSettings + * @function getTypeUrl + * @memberof google.api.DotnetSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.DotnetSettings"; + }; + + return DotnetSettings; + })(); + + api.RubySettings = (function() { + + /** + * Properties of a RubySettings. + * @memberof google.api + * @interface IRubySettings + * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common + */ + + /** + * Constructs a new RubySettings. + * @memberof google.api + * @classdesc Represents a RubySettings. + * @implements IRubySettings + * @constructor + * @param {google.api.IRubySettings=} [properties] Properties to set + */ + function RubySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RubySettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.RubySettings + * @instance + */ + RubySettings.prototype.common = null; + + /** + * Creates a new RubySettings instance using the specified properties. + * @function create + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings=} [properties] Properties to set + * @returns {google.api.RubySettings} RubySettings instance + */ + RubySettings.create = function create(properties) { + return new RubySettings(properties); + }; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encode + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RubySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RubySettings message. + * @function verify + * @memberof google.api.RubySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RubySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.RubySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.RubySettings} RubySettings + */ + RubySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.RubySettings) + return object; + var message = new $root.google.api.RubySettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.RubySettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.RubySettings + * @static + * @param {google.api.RubySettings} message RubySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RubySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this RubySettings to JSON. + * @function toJSON + * @memberof google.api.RubySettings + * @instance + * @returns {Object.} JSON object + */ + RubySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RubySettings + * @function getTypeUrl + * @memberof google.api.RubySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.RubySettings"; + }; + + return RubySettings; + })(); + + api.GoSettings = (function() { + + /** + * Properties of a GoSettings. + * @memberof google.api + * @interface IGoSettings + * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common + */ + + /** + * Constructs a new GoSettings. + * @memberof google.api + * @classdesc Represents a GoSettings. + * @implements IGoSettings + * @constructor + * @param {google.api.IGoSettings=} [properties] Properties to set + */ + function GoSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GoSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.common = null; + + /** + * Creates a new GoSettings instance using the specified properties. + * @function create + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings=} [properties] Properties to set + * @returns {google.api.GoSettings} GoSettings instance + */ + GoSettings.create = function create(properties) { + return new GoSettings(properties); + }; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encode + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoSettings message. + * @function verify + * @memberof google.api.GoSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.GoSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.GoSettings} GoSettings + */ + GoSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.GoSettings) + return object; + var message = new $root.google.api.GoSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.GoSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.GoSettings + * @static + * @param {google.api.GoSettings} message GoSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this GoSettings to JSON. + * @function toJSON + * @memberof google.api.GoSettings + * @instance + * @returns {Object.} JSON object + */ + GoSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoSettings + * @function getTypeUrl + * @memberof google.api.GoSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.GoSettings"; + }; + + return GoSettings; + })(); + + api.MethodSettings = (function() { + + /** + * Properties of a MethodSettings. + * @memberof google.api + * @interface IMethodSettings + * @property {string|null} [selector] MethodSettings selector + * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning + * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields + */ + + /** + * Constructs a new MethodSettings. + * @memberof google.api + * @classdesc Represents a MethodSettings. + * @implements IMethodSettings + * @constructor + * @param {google.api.IMethodSettings=} [properties] Properties to set + */ + function MethodSettings(properties) { + this.autoPopulatedFields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodSettings selector. + * @member {string} selector + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.selector = ""; + + /** + * MethodSettings longRunning. + * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.longRunning = null; + + /** + * MethodSettings autoPopulatedFields. + * @member {Array.} autoPopulatedFields + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.autoPopulatedFields = $util.emptyArray; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings=} [properties] Properties to set + * @returns {google.api.MethodSettings} MethodSettings instance + */ + MethodSettings.create = function create(properties) { + return new MethodSettings(properties); + }; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) + $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.autoPopulatedFields != null && message.autoPopulatedFields.length) + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]); + return writer; + }; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.autoPopulatedFields && message.autoPopulatedFields.length)) + message.autoPopulatedFields = []; + message.autoPopulatedFields.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodSettings message. + * @function verify + * @memberof google.api.MethodSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) { + var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning); + if (error) + return "longRunning." + error; + } + if (message.autoPopulatedFields != null && message.hasOwnProperty("autoPopulatedFields")) { + if (!Array.isArray(message.autoPopulatedFields)) + return "autoPopulatedFields: array expected"; + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + if (!$util.isString(message.autoPopulatedFields[i])) + return "autoPopulatedFields: string[] expected"; + } + return null; + }; + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings} MethodSettings + */ + MethodSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings) + return object; + var message = new $root.google.api.MethodSettings(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.longRunning != null) { + if (typeof object.longRunning !== "object") + throw TypeError(".google.api.MethodSettings.longRunning: object expected"); + message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning); + } + if (object.autoPopulatedFields) { + if (!Array.isArray(object.autoPopulatedFields)) + throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected"); + message.autoPopulatedFields = []; + for (var i = 0; i < object.autoPopulatedFields.length; ++i) + message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]); + } + return message; + }; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings + * @static + * @param {google.api.MethodSettings} message MethodSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.autoPopulatedFields = []; + if (options.defaults) { + object.selector = ""; + object.longRunning = null; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) + object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options); + if (message.autoPopulatedFields && message.autoPopulatedFields.length) { + object.autoPopulatedFields = []; + for (var j = 0; j < message.autoPopulatedFields.length; ++j) + object.autoPopulatedFields[j] = message.autoPopulatedFields[j]; + } + return object; + }; + + /** + * Converts this MethodSettings to JSON. + * @function toJSON + * @memberof google.api.MethodSettings + * @instance + * @returns {Object.} JSON object + */ + MethodSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodSettings + * @function getTypeUrl + * @memberof google.api.MethodSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings"; + }; + + MethodSettings.LongRunning = (function() { + + /** + * Properties of a LongRunning. + * @memberof google.api.MethodSettings + * @interface ILongRunning + * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay + * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier + * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay + * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout + */ + + /** + * Constructs a new LongRunning. + * @memberof google.api.MethodSettings + * @classdesc Represents a LongRunning. + * @implements ILongRunning + * @constructor + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + */ + function LongRunning(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LongRunning initialPollDelay. + * @member {google.protobuf.IDuration|null|undefined} initialPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.initialPollDelay = null; + + /** + * LongRunning pollDelayMultiplier. + * @member {number} pollDelayMultiplier + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.pollDelayMultiplier = 0; + + /** + * LongRunning maxPollDelay. + * @member {google.protobuf.IDuration|null|undefined} maxPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.maxPollDelay = null; + + /** + * LongRunning totalPollTimeout. + * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.totalPollTimeout = null; + + /** + * Creates a new LongRunning instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + * @returns {google.api.MethodSettings.LongRunning} LongRunning instance + */ + LongRunning.create = function create(properties) { + return new LongRunning(properties); + }; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) + $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier); + if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) + $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) + $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings.LongRunning(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.pollDelayMultiplier = reader.float(); + break; + } + case 3: { + message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LongRunning message. + * @function verify + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LongRunning.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.initialPollDelay); + if (error) + return "initialPollDelay." + error; + } + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + if (typeof message.pollDelayMultiplier !== "number") + return "pollDelayMultiplier: number expected"; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.maxPollDelay); + if (error) + return "maxPollDelay." + error; + } + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout); + if (error) + return "totalPollTimeout." + error; + } + return null; + }; + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings.LongRunning} LongRunning + */ + LongRunning.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings.LongRunning) + return object; + var message = new $root.google.api.MethodSettings.LongRunning(); + if (object.initialPollDelay != null) { + if (typeof object.initialPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); + message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay); + } + if (object.pollDelayMultiplier != null) + message.pollDelayMultiplier = Number(object.pollDelayMultiplier); + if (object.maxPollDelay != null) { + if (typeof object.maxPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); + message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay); + } + if (object.totalPollTimeout != null) { + if (typeof object.totalPollTimeout !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); + message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout); + } + return message; + }; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.LongRunning} message LongRunning + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LongRunning.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.initialPollDelay = null; + object.pollDelayMultiplier = 0; + object.maxPollDelay = null; + object.totalPollTimeout = null; + } + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) + object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options); + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) + object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options); + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) + object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options); + return object; + }; + + /** + * Converts this LongRunning to JSON. + * @function toJSON + * @memberof google.api.MethodSettings.LongRunning + * @instance + * @returns {Object.} JSON object + */ + LongRunning.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LongRunning + * @function getTypeUrl + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; + }; + + return LongRunning; + })(); + + return MethodSettings; + })(); + + /** + * ClientLibraryOrganization enum. + * @name google.api.ClientLibraryOrganization + * @enum {number} + * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value + * @property {number} CLOUD=1 CLOUD value + * @property {number} ADS=2 ADS value + * @property {number} PHOTOS=3 PHOTOS value + * @property {number} STREET_VIEW=4 STREET_VIEW value + * @property {number} SHOPPING=5 SHOPPING value + * @property {number} GEO=6 GEO value + * @property {number} GENERATIVE_AI=7 GENERATIVE_AI value + */ + api.ClientLibraryOrganization = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD"] = 1; + values[valuesById[2] = "ADS"] = 2; + values[valuesById[3] = "PHOTOS"] = 3; + values[valuesById[4] = "STREET_VIEW"] = 4; + values[valuesById[5] = "SHOPPING"] = 5; + values[valuesById[6] = "GEO"] = 6; + values[valuesById[7] = "GENERATIVE_AI"] = 7; + return values; + })(); + + /** + * ClientLibraryDestination enum. + * @name google.api.ClientLibraryDestination + * @enum {number} + * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value + * @property {number} GITHUB=10 GITHUB value + * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value + */ + api.ClientLibraryDestination = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0; + values[valuesById[10] = "GITHUB"] = 10; + values[valuesById[20] = "PACKAGE_MANAGER"] = 20; + return values; + })(); + + /** + * LaunchStage enum. + * @name google.api.LaunchStage + * @enum {number} + * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value + * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value + * @property {number} PRELAUNCH=7 PRELAUNCH value + * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value + * @property {number} ALPHA=2 ALPHA value + * @property {number} BETA=3 BETA value + * @property {number} GA=4 GA value + * @property {number} DEPRECATED=5 DEPRECATED value + */ + api.LaunchStage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; + values[valuesById[6] = "UNIMPLEMENTED"] = 6; + values[valuesById[7] = "PRELAUNCH"] = 7; + values[valuesById[1] = "EARLY_ACCESS"] = 1; + values[valuesById[2] = "ALPHA"] = 2; + values[valuesById[3] = "BETA"] = 3; + values[valuesById[4] = "GA"] = 4; + values[valuesById[5] = "DEPRECATED"] = 5; + return values; + })(); + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {number} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value + * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value + * @property {number} IDENTIFIER=8 IDENTIFIER value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + values[valuesById[6] = "UNORDERED_LIST"] = 6; + values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; + values[valuesById[8] = "IDENTIFIER"] = 8; + return values; + })(); + + api.ResourceDescriptor = (function() { + + /** + * Properties of a ResourceDescriptor. + * @memberof google.api + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular + * @property {Array.|null} [style] ResourceDescriptor style + */ + + /** + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor + * @constructor + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + */ + function ResourceDescriptor(properties) { + this.pattern = []; + this.style = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.type = ""; + + /** + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; + + /** + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; + + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; + + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; + + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; + + /** + * ResourceDescriptor style. + * @member {Array.} style + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.style = $util.emptyArray; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @function create + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + */ + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); + }; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.style != null && message.style.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.style.length; ++i) + writer.int32(message.style[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + } + case 3: { + message.nameField = reader.string(); + break; + } + case 4: { + message.history = reader.int32(); + break; + } + case 5: { + message.plural = reader.string(); + break; + } + case 6: { + message.singular = reader.string(); + break; + } + case 10: { + if (!(message.style && message.style.length)) + message.style = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.style.push(reader.int32()); + } else + message.style.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + if (message.style != null && message.hasOwnProperty("style")) { + if (!Array.isArray(message.style)) + return "style: array expected"; + for (var i = 0; i < message.style.length; ++i) + switch (message.style[i]) { + default: + return "style: enum value[] expected"; + case 0: + case 1: + break; + } + } + return null; + }; + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) + return object; + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + default: + if (typeof object.history === "number") { + message.history = object.history; + break; + } + break; + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + if (object.style) { + if (!Array.isArray(object.style)) + throw TypeError(".google.api.ResourceDescriptor.style: array expected"); + message.style = []; + for (var i = 0; i < object.style.length; ++i) + switch (object.style[i]) { + default: + if (typeof object.style[i] === "number") { + message.style[i] = object.style[i]; + break; + } + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pattern = []; + object.style = []; + } + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + if (message.style && message.style.length) { + object.style = []; + for (var j = 0; j < message.style.length; ++j) + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + } + return object; + }; + + /** + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + ResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceDescriptor + * @function getTypeUrl + * @memberof google.api.ResourceDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceDescriptor"; + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {number} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); + + /** + * Style enum. + * @name google.api.ResourceDescriptor.Style + * @enum {number} + * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value + * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value + */ + ResourceDescriptor.Style = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; + return values; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.childType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceReference message. + * @function verify + * @memberof google.api.ResourceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; + return null; + }; + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceReference} ResourceReference + */ + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) + return object; + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); + return message; + }; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceReference + * @static + * @param {google.api.ResourceReference} message ResourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.childType = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; + return object; + }; + + /** + * Converts this ResourceReference to JSON. + * @function toJSON + * @memberof google.api.ResourceReference + * @instance + * @returns {Object.} JSON object + */ + ResourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceReference + * @function getTypeUrl + * @memberof google.api.ResourceReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceReference"; + }; + + return ResourceReference; + })(); + + return api; + })(); + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorSet + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; + }; + + return FileDescriptorSet; + })(); + + /** + * Edition enum. + * @name google.protobuf.Edition + * @enum {number} + * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value + * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value + * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value + * @property {number} EDITION_2023=1000 EDITION_2023 value + * @property {number} EDITION_2024=1001 EDITION_2024 value + * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value + * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value + * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value + * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value + * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value + * @property {number} EDITION_MAX=2147483647 EDITION_MAX value + */ + protobuf.Edition = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EDITION_UNKNOWN"] = 0; + values[valuesById[998] = "EDITION_PROTO2"] = 998; + values[valuesById[999] = "EDITION_PROTO3"] = 999; + values[valuesById[1000] = "EDITION_2023"] = 1000; + values[valuesById[1001] = "EDITION_2024"] = 1001; + values[valuesById[1] = "EDITION_1_TEST_ONLY"] = 1; + values[valuesById[2] = "EDITION_2_TEST_ONLY"] = 2; + values[valuesById[99997] = "EDITION_99997_TEST_ONLY"] = 99997; + values[valuesById[99998] = "EDITION_99998_TEST_ONLY"] = 99998; + values[valuesById[99999] = "EDITION_99999_TEST_ONLY"] = 99999; + values[valuesById[2147483647] = "EDITION_MAX"] = 2147483647; + return values; + })(); + + protobuf.FileDescriptorProto = (function() { + + /** + * Properties of a FileDescriptorProto. + * @memberof google.protobuf + * @interface IFileDescriptorProto + * @property {string|null} [name] FileDescriptorProto name + * @property {string|null} ["package"] FileDescriptorProto package + * @property {Array.|null} [dependency] FileDescriptorProto dependency + * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency + * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [messageType] FileDescriptorProto messageType + * @property {Array.|null} [enumType] FileDescriptorProto enumType + * @property {Array.|null} [service] FileDescriptorProto service + * @property {Array.|null} [extension] FileDescriptorProto extension + * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options + * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo + * @property {string|null} [syntax] FileDescriptorProto syntax + * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition + */ + + /** + * Constructs a new FileDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto + * @constructor + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + */ + function FileDescriptorProto(properties) { + this.dependency = []; + this.publicDependency = []; + this.weakDependency = []; + this.messageType = []; + this.enumType = []; + this.service = []; + this.extension = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; + + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; + + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; + + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; + + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; + + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; + + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; + + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; + + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; + + /** + * FileDescriptorProto edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = 0; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message["package"] = reader.string(); + break; + } + case 3: { + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + } + case 10: { + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + } + case 11: { + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + } + case 4: { + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 8: { + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + } + case 12: { + message.syntax = reader.string(); + break; + } + case 14: { + message.edition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorProto message. + * @function verify + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message["package"] != null && message.hasOwnProperty("package")) + if (!$util.isString(message["package"])) + return "package: string expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + if (!Array.isArray(message.dependency)) + return "dependency: array expected"; + for (var i = 0; i < message.dependency.length; ++i) + if (!$util.isString(message.dependency[i])) + return "dependency: string[] expected"; + } + if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { + if (!Array.isArray(message.publicDependency)) + return "publicDependency: array expected"; + for (var i = 0; i < message.publicDependency.length; ++i) + if (!$util.isInteger(message.publicDependency[i])) + return "publicDependency: integer[] expected"; + } + if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { + if (!Array.isArray(message.weakDependency)) + return "weakDependency: array expected"; + for (var i = 0; i < message.weakDependency.length; ++i) + if (!$util.isInteger(message.weakDependency[i])) + return "weakDependency: integer[] expected"; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (!Array.isArray(message.messageType)) + return "messageType: array expected"; + for (var i = 0; i < message.messageType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); + if (error) + return "messageType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.service != null && message.hasOwnProperty("service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); + if (error) + return "service." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + */ + FileDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) + return object; + var message = new $root.google.protobuf.FileDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object["package"] != null) + message["package"] = String(object["package"]); + if (object.dependency) { + if (!Array.isArray(object.dependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); + message.dependency = []; + for (var i = 0; i < object.dependency.length; ++i) + message.dependency[i] = String(object.dependency[i]); + } + if (object.publicDependency) { + if (!Array.isArray(object.publicDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); + message.publicDependency = []; + for (var i = 0; i < object.publicDependency.length; ++i) + message.publicDependency[i] = object.publicDependency[i] | 0; + } + if (object.weakDependency) { + if (!Array.isArray(object.weakDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); + message.weakDependency = []; + for (var i = 0; i < object.weakDependency.length; ++i) + message.weakDependency[i] = object.weakDependency[i] | 0; + } + if (object.messageType) { + if (!Array.isArray(object.messageType)) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); + message.messageType = []; + for (var i = 0; i < object.messageType.length; ++i) { + if (typeof object.messageType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); + message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (typeof object.service[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); + message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options); + } + if (object.sourceCodeInfo != null) { + if (typeof object.sourceCodeInfo !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message["package"] != null && message.hasOwnProperty("package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = message.syntax; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + */ + + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; + + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; + + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; + + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; + + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; + + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; + + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; + + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescriptorProto message. + * @function verify + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.field != null && message.hasOwnProperty("field")) { + if (!Array.isArray(message.field)) + return "field: array expected"; + for (var i = 0; i < message.field.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); + if (error) + return "field." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.nestedType != null && message.hasOwnProperty("nestedType")) { + if (!Array.isArray(message.nestedType)) + return "nestedType: array expected"; + for (var i = 0; i < message.nestedType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); + if (error) + return "nestedType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { + if (!Array.isArray(message.extensionRange)) + return "extensionRange: array expected"; + for (var i = 0; i < message.extensionRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); + if (error) + return "extensionRange." + error; + } + } + if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { + if (!Array.isArray(message.oneofDecl)) + return "oneofDecl: array expected"; + for (var i = 0; i < message.oneofDecl.length; ++i) { + var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); + if (error) + return "oneofDecl." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MessageOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto} DescriptorProto + */ + DescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto) + return object; + var message = new $root.google.protobuf.DescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.field) { + if (!Array.isArray(object.field)) + throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); + message.field = []; + for (var i = 0; i < object.field.length; ++i) { + if (typeof object.field[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); + message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.nestedType) { + if (!Array.isArray(object.nestedType)) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); + message.nestedType = []; + for (var i = 0; i < object.nestedType.length; ++i) { + if (typeof object.nestedType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); + message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (typeof object.extensionRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (typeof object.oneofDecl[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto"; + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReservedRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + * @property {Array.|null} [declaration] ExtensionRangeOptions declaration + * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features + * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification + */ + + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + this.declaration = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ExtensionRangeOptions declaration. + * @member {Array.} declaration + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.declaration = $util.emptyArray; + + /** + * ExtensionRangeOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.features = null; + + /** + * ExtensionRangeOptions verification. + * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.verification = 1; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + */ + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.declaration != null && message.declaration.length) + for (var i = 0; i < message.declaration.length; ++i) + $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.declaration && message.declaration.length)) + message.declaration = []; + message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32())); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.verification = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message.declaration != null && message.hasOwnProperty("declaration")) { + if (!Array.isArray(message.declaration)) + return "declaration: array expected"; + for (var i = 0; i < message.declaration.length; ++i) { + var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i]); + if (error) + return "declaration." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.verification != null && message.hasOwnProperty("verification")) + switch (message.verification) { + default: + return "verification: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object.declaration) { + if (!Array.isArray(object.declaration)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); + message.declaration = []; + for (var i = 0; i < object.declaration.length; ++i) { + if (typeof object.declaration[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); + message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + switch (object.verification) { + case "DECLARATION": + case 0: + message.verification = 0; + break; + default: + if (typeof object.verification === "number") { + message.verification = object.verification; + break; + } + break; + case "UNVERIFIED": + case 1: + message.verification = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.declaration = []; + object.uninterpretedOption = []; + } + if (options.defaults) { + object.verification = options.enums === String ? "UNVERIFIED" : 1; + object.features = null; + } + if (message.declaration && message.declaration.length) { + object.declaration = []; + for (var j = 0; j < message.declaration.length; ++j) + object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); + } + if (message.verification != null && message.hasOwnProperty("verification")) + object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + * @returns {Object.} JSON object + */ + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; + }; + + ExtensionRangeOptions.Declaration = (function() { + + /** + * Properties of a Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @interface IDeclaration + * @property {number|null} [number] Declaration number + * @property {string|null} [fullName] Declaration fullName + * @property {string|null} [type] Declaration type + * @property {boolean|null} [reserved] Declaration reserved + * @property {boolean|null} [repeated] Declaration repeated + */ + + /** + * Constructs a new Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @classdesc Represents a Declaration. + * @implements IDeclaration + * @constructor + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + */ + function Declaration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Declaration number. + * @member {number} number + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.number = 0; + + /** + * Declaration fullName. + * @member {string} fullName + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.fullName = ""; + + /** + * Declaration type. + * @member {string} type + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.type = ""; + + /** + * Declaration reserved. + * @member {boolean} reserved + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.reserved = false; + + /** + * Declaration repeated. + * @member {boolean} repeated + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.repeated = false; + + /** + * Creates a new Declaration instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance + */ + Declaration.create = function create(properties) { + return new Declaration(properties); + }; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); + if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); + if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); + return writer; + }; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.number = reader.int32(); + break; + } + case 2: { + message.fullName = reader.string(); + break; + } + case 3: { + message.type = reader.string(); + break; + } + case 5: { + message.reserved = reader.bool(); + break; + } + case 6: { + message.repeated = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Declaration message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Declaration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.fullName != null && message.hasOwnProperty("fullName")) + if (!$util.isString(message.fullName)) + return "fullName: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.reserved != null && message.hasOwnProperty("reserved")) + if (typeof message.reserved !== "boolean") + return "reserved: boolean expected"; + if (message.repeated != null && message.hasOwnProperty("repeated")) + if (typeof message.repeated !== "boolean") + return "repeated: boolean expected"; + return null; + }; + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + */ + Declaration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + if (object.number != null) + message.number = object.number | 0; + if (object.fullName != null) + message.fullName = String(object.fullName); + if (object.type != null) + message.type = String(object.type); + if (object.reserved != null) + message.reserved = Boolean(object.reserved); + if (object.repeated != null) + message.repeated = Boolean(object.repeated); + return message; + }; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Declaration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.number = 0; + object.fullName = ""; + object.type = ""; + object.reserved = false; + object.repeated = false; + } + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.fullName != null && message.hasOwnProperty("fullName")) + object.fullName = message.fullName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.reserved != null && message.hasOwnProperty("reserved")) + object.reserved = message.reserved; + if (message.repeated != null && message.hasOwnProperty("repeated")) + object.repeated = message.repeated; + return object; + }; + + /** + * Converts this Declaration to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + * @returns {Object.} JSON object + */ + Declaration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Declaration + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"; + }; + + return Declaration; + })(); + + /** + * VerificationState enum. + * @name google.protobuf.ExtensionRangeOptions.VerificationState + * @enum {number} + * @property {number} DECLARATION=0 DECLARATION value + * @property {number} UNVERIFIED=1 UNVERIFIED value + */ + ExtensionRangeOptions.VerificationState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DECLARATION"] = 0; + values[valuesById[1] = "UNVERIFIED"] = 1; + return values; + })(); + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.number = reader.int32(); + break; + } + case 4: { + message.label = reader.int32(); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.typeName = reader.string(); + break; + } + case 2: { + message.extendee = reader.string(); + break; + } + case 7: { + message.defaultValue = reader.string(); + break; + } + case 9: { + message.oneofIndex = reader.int32(); + break; + } + case 10: { + message.jsonName = reader.string(); + break; + } + case 8: { + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + } + case 17: { + message.proto3Optional = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 3: + case 2: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + object.proto3Optional = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {number} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; + }; + + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + */ + + /** + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + */ + function EnumDescriptorProto(properties) { + this.value = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; + + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; + + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) { + var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); + if (error) + return "value." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + */ + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (typeof object.value[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); + message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumReservedRange message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumReservedRange + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.number = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); + if (error) + return "method." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (typeof object.method[i] !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.inputType = reader.string(); + break; + } + case 3: { + message.outputType = reader.string(); + break; + } + case 4: { + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.clientStreaming = reader.bool(); + break; + } + case 6: { + message.serverStreaming = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = message.inputType; + if (message.outputType != null && message.hasOwnProperty("outputType")) + object.outputType = message.outputType; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {google.protobuf.IFeatureSet|null} [features] FileOptions features + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.resourceDefinition"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = true; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.features = null; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.javaPackage = reader.string(); + break; + } + case 8: { + message.javaOuterClassname = reader.string(); + break; + } + case 10: { + message.javaMultipleFiles = reader.bool(); + break; + } + case 20: { + message.javaGenerateEqualsAndHash = reader.bool(); + break; + } + case 27: { + message.javaStringCheckUtf8 = reader.bool(); + break; + } + case 9: { + message.optimizeFor = reader.int32(); + break; + } + case 11: { + message.goPackage = reader.string(); + break; + } + case 16: { + message.ccGenericServices = reader.bool(); + break; + } + case 17: { + message.javaGenericServices = reader.bool(); + break; + } + case 18: { + message.pyGenericServices = reader.bool(); + break; + } + case 23: { + message.deprecated = reader.bool(); + break; + } + case 31: { + message.ccEnableArenas = reader.bool(); + break; + } + case 36: { + message.objcClassPrefix = reader.string(); + break; + } + case 37: { + message.csharpNamespace = reader.string(); + break; + } + case 39: { + message.swiftPrefix = reader.string(); + break; + } + case 40: { + message.phpClassPrefix = reader.string(); + break; + } + case 41: { + message.phpNamespace = reader.string(); + break; + } + case 44: { + message.phpMetadataNamespace = reader.string(); + break; + } + case 45: { + message.rubyPackage = reader.string(); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) + message[".google.api.resourceDefinition"] = []; + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { + if (!Array.isArray(message[".google.api.resourceDefinition"])) + return ".google.api.resourceDefinition: array expected"; + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); + if (error) + return ".google.api.resourceDefinition." + error; + } + } + return null; + }; + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + default: + if (typeof object.optimizeFor === "number") { + message.optimizeFor = object.optimizeFor; + break; + } + break; + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.ccEnableArenas != null) + message.ccEnableArenas = Boolean(object.ccEnableArenas); + if (object.objcClassPrefix != null) + message.objcClassPrefix = String(object.objcClassPrefix); + if (object.csharpNamespace != null) + message.csharpNamespace = String(object.csharpNamespace); + if (object.swiftPrefix != null) + message.swiftPrefix = String(object.swiftPrefix); + if (object.phpClassPrefix != null) + message.phpClassPrefix = String(object.phpClassPrefix); + if (object.phpNamespace != null) + message.phpNamespace = String(object.phpNamespace); + if (object.phpMetadataNamespace != null) + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + if (object.rubyPackage != null) + message.rubyPackage = String(object.rubyPackage); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FileOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resourceDefinition"]) { + if (!Array.isArray(object[".google.api.resourceDefinition"])) + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); + message[".google.api.resourceDefinition"] = []; + for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { + if (typeof object[".google.api.resourceDefinition"][i] !== "object") + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); + message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + object.features = null; + } + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { + object[".google.api.resourceDefinition"] = []; + for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} JSON object + */ + FileOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileOptions + * @function getTypeUrl + * @memberof google.protobuf.FileOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileOptions"; + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {number} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { + + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * MessageOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.features = null; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.messageSetWireFormat = reader.bool(); + break; + } + case 2: { + message.noStandardDescriptorAccessor = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 7: { + message.mapEntry = reader.bool(); + break; + } + case 11: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 12: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); + if (error) + return ".google.api.resource." + error; + } + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MessageOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resource"] != null) { + if (typeof object[".google.api.resource"] !== "object") + throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); + } + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + object[".google.api.resource"] = null; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); + return object; + }; + + /** + * Converts this MessageOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MessageOptions + * @instance + * @returns {Object.} JSON object + */ + MessageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessageOptions + * @function getTypeUrl + * @memberof google.protobuf.MessageOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MessageOptions"; + }; + + return MessageOptions; + })(); + + protobuf.FieldOptions = (function() { + + /** + * Properties of a FieldOptions. + * @memberof google.protobuf + * @interface IFieldOptions + * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype + * @property {boolean|null} [packed] FieldOptions packed + * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype + * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {boolean|null} [debugRedact] FieldOptions debugRedact + * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention + * @property {Array.|null} [targets] FieldOptions targets + * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults + * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + */ + + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.targets = []; + this.editionDefaults = []; + this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; + + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; + + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; + + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; + + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; + + /** + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; + + /** + * FieldOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.debugRedact = false; + + /** + * FieldOptions retention. + * @member {google.protobuf.FieldOptions.OptionRetention} retention + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.retention = 0; + + /** + * FieldOptions targets. + * @member {Array.} targets + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.targets = $util.emptyArray; + + /** + * FieldOptions editionDefaults. + * @member {Array.} editionDefaults + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.editionDefaults = $util.emptyArray; + + /** + * FieldOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.features = null; + + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact); + if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention); + if (message.targets != null && message.targets.length) + for (var i = 0; i < message.targets.length; ++i) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]); + if (message.editionDefaults != null && message.editionDefaults.length) + for (var i = 0; i < message.editionDefaults.length; ++i) + $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.ctype = reader.int32(); + break; + } + case 2: { + message.packed = reader.bool(); + break; + } + case 6: { + message.jstype = reader.int32(); + break; + } + case 5: { + message.lazy = reader.bool(); + break; + } + case 15: { + message.unverifiedLazy = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 10: { + message.weak = reader.bool(); + break; + } + case 16: { + message.debugRedact = reader.bool(); + break; + } + case 17: { + message.retention = reader.int32(); + break; + } + case 19: { + if (!(message.targets && message.targets.length)) + message.targets = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.targets.push(reader.int32()); + } else + message.targets.push(reader.int32()); + break; + } + case 20: { + if (!(message.editionDefaults && message.editionDefaults.length)) + message.editionDefaults = []; + message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32())); + break; + } + case 21: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + if (typeof message.unverifiedLazy !== "boolean") + return "unverifiedLazy: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.retention != null && message.hasOwnProperty("retention")) + switch (message.retention) { + default: + return "retention: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.targets != null && message.hasOwnProperty("targets")) { + if (!Array.isArray(message.targets)) + return "targets: array expected"; + for (var i = 0; i < message.targets.length; ++i) + switch (message.targets[i]) { + default: + return "targets: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + } + if (message.editionDefaults != null && message.hasOwnProperty("editionDefaults")) { + if (!Array.isArray(message.editionDefaults)) + return "editionDefaults: array expected"; + for (var i = 0; i < message.editionDefaults.length; ++i) { + var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i]); + if (error) + return "editionDefaults." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + default: + if (typeof object.ctype === "number") { + message.ctype = object.ctype; + break; + } + break; + case "STRING": + case 0: + message.ctype = 0; + break; + case "CORD": + case 1: + message.ctype = 1; + break; + case "STRING_PIECE": + case 2: + message.ctype = 2; + break; + } + if (object.packed != null) + message.packed = Boolean(object.packed); + switch (object.jstype) { + default: + if (typeof object.jstype === "number") { + message.jstype = object.jstype; + break; + } + break; + case "JS_NORMAL": + case 0: + message.jstype = 0; + break; + case "JS_STRING": + case 1: + message.jstype = 1; + break; + case "JS_NUMBER": + case 2: + message.jstype = 2; + break; + } + if (object.lazy != null) + message.lazy = Boolean(object.lazy); + if (object.unverifiedLazy != null) + message.unverifiedLazy = Boolean(object.unverifiedLazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + switch (object.retention) { + default: + if (typeof object.retention === "number") { + message.retention = object.retention; + break; + } + break; + case "RETENTION_UNKNOWN": + case 0: + message.retention = 0; + break; + case "RETENTION_RUNTIME": + case 1: + message.retention = 1; + break; + case "RETENTION_SOURCE": + case 2: + message.retention = 2; + break; + } + if (object.targets) { + if (!Array.isArray(object.targets)) + throw TypeError(".google.protobuf.FieldOptions.targets: array expected"); + message.targets = []; + for (var i = 0; i < object.targets.length; ++i) + switch (object.targets[i]) { + default: + if (typeof object.targets[i] === "number") { + message.targets[i] = object.targets[i]; + break; + } + case "TARGET_TYPE_UNKNOWN": + case 0: + message.targets[i] = 0; + break; + case "TARGET_TYPE_FILE": + case 1: + message.targets[i] = 1; + break; + case "TARGET_TYPE_EXTENSION_RANGE": + case 2: + message.targets[i] = 2; + break; + case "TARGET_TYPE_MESSAGE": + case 3: + message.targets[i] = 3; + break; + case "TARGET_TYPE_FIELD": + case 4: + message.targets[i] = 4; + break; + case "TARGET_TYPE_ONEOF": + case 5: + message.targets[i] = 5; + break; + case "TARGET_TYPE_ENUM": + case 6: + message.targets[i] = 6; + break; + case "TARGET_TYPE_ENUM_ENTRY": + case 7: + message.targets[i] = 7; + break; + case "TARGET_TYPE_SERVICE": + case 8: + message.targets[i] = 8; + break; + case "TARGET_TYPE_METHOD": + case 9: + message.targets[i] = 9; + break; + } + } + if (object.editionDefaults) { + if (!Array.isArray(object.editionDefaults)) + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected"); + message.editionDefaults = []; + for (var i = 0; i < object.editionDefaults.length; ++i) { + if (typeof object.editionDefaults[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); + message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FieldOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; + case "IDENTIFIER": + case 8: + message[".google.api.fieldBehavior"][i] = 8; + break; + } + } + if (object[".google.api.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + } + return message; + }; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.targets = []; + object.editionDefaults = []; + object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } + if (options.defaults) { + object.ctype = options.enums === String ? "STRING" : 0; + object.packed = false; + object.deprecated = false; + object.lazy = false; + object.jstype = options.enums === String ? "JS_NORMAL" : 0; + object.weak = false; + object.unverifiedLazy = false; + object.debugRedact = false; + object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; + object.features = null; + object[".google.api.resourceReference"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + if (message.packed != null && message.hasOwnProperty("packed")) + object.packed = message.packed; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.lazy != null && message.hasOwnProperty("lazy")) + object.lazy = message.lazy; + if (message.jstype != null && message.hasOwnProperty("jstype")) + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + object.unverifiedLazy = message.unverifiedLazy; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.retention != null && message.hasOwnProperty("retention")) + object.retention = options.enums === String ? $root.google.protobuf.FieldOptions.OptionRetention[message.retention] === undefined ? message.retention : $root.google.protobuf.FieldOptions.OptionRetention[message.retention] : message.retention; + if (message.targets && message.targets.length) { + object.targets = []; + for (var j = 0; j < message.targets.length; ++j) + object.targets[j] = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] === undefined ? message.targets[j] : $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] : message.targets[j]; + } + if (message.editionDefaults && message.editionDefaults.length) { + object.editionDefaults = []; + for (var j = 0; j < message.editionDefaults.length; ++j) + object.editionDefaults[j] = $root.google.protobuf.FieldOptions.EditionDefault.toObject(message.editionDefaults[j], options); + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { + object[".google.api.fieldBehavior"] = []; + for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldOptions + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions"; + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + /** + * OptionRetention enum. + * @name google.protobuf.FieldOptions.OptionRetention + * @enum {number} + * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value + * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value + * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value + */ + FieldOptions.OptionRetention = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; + values[valuesById[1] = "RETENTION_RUNTIME"] = 1; + values[valuesById[2] = "RETENTION_SOURCE"] = 2; + return values; + })(); + + /** + * OptionTargetType enum. + * @name google.protobuf.FieldOptions.OptionTargetType + * @enum {number} + * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value + * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value + * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value + * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value + * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value + * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value + * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value + * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value + * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value + * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value + */ + FieldOptions.OptionTargetType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; + values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; + values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; + values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; + values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; + values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; + values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; + values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; + values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; + return values; + })(); + + FieldOptions.EditionDefault = (function() { + + /** + * Properties of an EditionDefault. + * @memberof google.protobuf.FieldOptions + * @interface IEditionDefault + * @property {google.protobuf.Edition|null} [edition] EditionDefault edition + * @property {string|null} [value] EditionDefault value + */ + + /** + * Constructs a new EditionDefault. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents an EditionDefault. + * @implements IEditionDefault + * @constructor + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + */ + function EditionDefault(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.edition = 0; + + /** + * EditionDefault value. + * @member {string} value + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.value = ""; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance + */ + EditionDefault.create = function create(properties) { + return new EditionDefault(properties); + }; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EditionDefault message. + * @function verify + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + */ + EditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) + return object; + var message = new $root.google.protobuf.FieldOptions.EditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this EditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + * @returns {Object.} JSON object + */ + EditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; + }; + + return EditionDefault; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.features = null; + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + var message = new $root.google.protobuf.OneofOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.OneofOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.features = null; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofOptions + * @function getTypeUrl + * @memberof google.protobuf.OneofOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofOptions"; + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * EnumOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.features = null; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.allowAlias = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 6: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 7: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumOptions"; + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features + * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.features = null; + + /** + * EnumValueOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.debugRedact = false; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.deprecated = reader.bool(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.debugRedact = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object.debugRedact = false; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.features = null; + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * ServiceOptions .google.api.apiVersion. + * @member {string} .google.api.apiVersion + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.apiVersion"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) + writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 34: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + case 525000001: { + message[".google.api.apiVersion"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + if (!$util.isString(message[".google.api.apiVersion"])) + return ".google.api.apiVersion: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + if (object[".google.api.apiVersion"] != null) + message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + object[".google.api.apiVersion"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {google.protobuf.IFeatureSet|null} [features] MethodOptions features + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo + */ + + /** + * Constructs a new MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions + * @constructor + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + */ + function MethodOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.features = null; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + + /** + * MethodOptions .google.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.longrunning.operationInfo"] = null; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance + */ + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) + $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 35: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + } + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } + case 1049: { + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { + var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); + if (error) + return ".google.longrunning.operationInfo." + error; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodOptions} MethodOptions + */ + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) + return object; + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MethodOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } + if (object[".google.longrunning.operationInfo"] != null) { + if (typeof object[".google.longrunning.operationInfo"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object.features = null; + object[".google.longrunning.operationInfo"] = null; + object[".google.api.http"] = null; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodOptions + * @function getTypeUrl + * @memberof google.protobuf.MethodOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + } + case 3: { + message.identifierValue = reader.string(); + break; + } + case 4: { + message.positiveIntValue = reader.uint64(); + break; + } + case 5: { + message.negativeIntValue = reader.int64(); + break; + } + case 6: { + message.doubleValue = reader.double(); + break; + } + case 7: { + message.stringValue = reader.bytes(); + break; + } + case 8: { + message.aggregateValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length >= 0) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.FeatureSet = (function() { + + /** + * Properties of a FeatureSet. + * @memberof google.protobuf + * @interface IFeatureSet + * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence + * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType + * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding + * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation + * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding + * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat + */ + + /** + * Constructs a new FeatureSet. + * @memberof google.protobuf + * @classdesc Represents a FeatureSet. + * @implements IFeatureSet + * @constructor + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + */ + function FeatureSet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSet fieldPresence. + * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.fieldPresence = 0; + + /** + * FeatureSet enumType. + * @member {google.protobuf.FeatureSet.EnumType} enumType + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enumType = 0; + + /** + * FeatureSet repeatedFieldEncoding. + * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.repeatedFieldEncoding = 0; + + /** + * FeatureSet utf8Validation. + * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.utf8Validation = 0; + + /** + * FeatureSet messageEncoding. + * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.messageEncoding = 0; + + /** + * FeatureSet jsonFormat. + * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.jsonFormat = 0; + + /** + * Creates a new FeatureSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet} FeatureSet instance + */ + FeatureSet.create = function create(properties) { + return new FeatureSet(properties); + }; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); + if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); + if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); + if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); + if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); + if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); + return writer; + }; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.fieldPresence = reader.int32(); + break; + } + case 2: { + message.enumType = reader.int32(); + break; + } + case 3: { + message.repeatedFieldEncoding = reader.int32(); + break; + } + case 4: { + message.utf8Validation = reader.int32(); + break; + } + case 5: { + message.messageEncoding = reader.int32(); + break; + } + case 6: { + message.jsonFormat = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSet message. + * @function verify + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + switch (message.fieldPresence) { + default: + return "fieldPresence: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.enumType != null && message.hasOwnProperty("enumType")) + switch (message.enumType) { + default: + return "enumType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + switch (message.repeatedFieldEncoding) { + default: + return "repeatedFieldEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + switch (message.utf8Validation) { + default: + return "utf8Validation: enum value expected"; + case 0: + case 2: + case 3: + break; + } + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + switch (message.messageEncoding) { + default: + return "messageEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + switch (message.jsonFormat) { + default: + return "jsonFormat: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet} FeatureSet + */ + FeatureSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSet) + return object; + var message = new $root.google.protobuf.FeatureSet(); + switch (object.fieldPresence) { + default: + if (typeof object.fieldPresence === "number") { + message.fieldPresence = object.fieldPresence; + break; + } + break; + case "FIELD_PRESENCE_UNKNOWN": + case 0: + message.fieldPresence = 0; + break; + case "EXPLICIT": + case 1: + message.fieldPresence = 1; + break; + case "IMPLICIT": + case 2: + message.fieldPresence = 2; + break; + case "LEGACY_REQUIRED": + case 3: + message.fieldPresence = 3; + break; + } + switch (object.enumType) { + default: + if (typeof object.enumType === "number") { + message.enumType = object.enumType; + break; + } + break; + case "ENUM_TYPE_UNKNOWN": + case 0: + message.enumType = 0; + break; + case "OPEN": + case 1: + message.enumType = 1; + break; + case "CLOSED": + case 2: + message.enumType = 2; + break; + } + switch (object.repeatedFieldEncoding) { + default: + if (typeof object.repeatedFieldEncoding === "number") { + message.repeatedFieldEncoding = object.repeatedFieldEncoding; + break; + } + break; + case "REPEATED_FIELD_ENCODING_UNKNOWN": + case 0: + message.repeatedFieldEncoding = 0; + break; + case "PACKED": + case 1: + message.repeatedFieldEncoding = 1; + break; + case "EXPANDED": + case 2: + message.repeatedFieldEncoding = 2; + break; + } + switch (object.utf8Validation) { + default: + if (typeof object.utf8Validation === "number") { + message.utf8Validation = object.utf8Validation; + break; + } + break; + case "UTF8_VALIDATION_UNKNOWN": + case 0: + message.utf8Validation = 0; + break; + case "VERIFY": + case 2: + message.utf8Validation = 2; + break; + case "NONE": + case 3: + message.utf8Validation = 3; + break; + } + switch (object.messageEncoding) { + default: + if (typeof object.messageEncoding === "number") { + message.messageEncoding = object.messageEncoding; + break; + } + break; + case "MESSAGE_ENCODING_UNKNOWN": + case 0: + message.messageEncoding = 0; + break; + case "LENGTH_PREFIXED": + case 1: + message.messageEncoding = 1; + break; + case "DELIMITED": + case 2: + message.messageEncoding = 2; + break; + } + switch (object.jsonFormat) { + default: + if (typeof object.jsonFormat === "number") { + message.jsonFormat = object.jsonFormat; + break; + } + break; + case "JSON_FORMAT_UNKNOWN": + case 0: + message.jsonFormat = 0; + break; + case "ALLOW": + case 1: + message.jsonFormat = 1; + break; + case "LEGACY_BEST_EFFORT": + case 2: + message.jsonFormat = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.FeatureSet} message FeatureSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; + object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; + object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; + object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; + object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; + object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; + } + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; + if (message.enumType != null && message.hasOwnProperty("enumType")) + object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType; + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding; + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation; + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; + return object; + }; + + /** + * Converts this FeatureSet to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet + * @instance + * @returns {Object.} JSON object + */ + FeatureSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSet + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet"; + }; + + /** + * FieldPresence enum. + * @name google.protobuf.FeatureSet.FieldPresence + * @enum {number} + * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value + * @property {number} EXPLICIT=1 EXPLICIT value + * @property {number} IMPLICIT=2 IMPLICIT value + * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value + */ + FeatureSet.FieldPresence = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; + values[valuesById[1] = "EXPLICIT"] = 1; + values[valuesById[2] = "IMPLICIT"] = 2; + values[valuesById[3] = "LEGACY_REQUIRED"] = 3; + return values; + })(); + + /** + * EnumType enum. + * @name google.protobuf.FeatureSet.EnumType + * @enum {number} + * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value + * @property {number} OPEN=1 OPEN value + * @property {number} CLOSED=2 CLOSED value + */ + FeatureSet.EnumType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "OPEN"] = 1; + values[valuesById[2] = "CLOSED"] = 2; + return values; + })(); + + /** + * RepeatedFieldEncoding enum. + * @name google.protobuf.FeatureSet.RepeatedFieldEncoding + * @enum {number} + * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value + * @property {number} PACKED=1 PACKED value + * @property {number} EXPANDED=2 EXPANDED value + */ + FeatureSet.RepeatedFieldEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "PACKED"] = 1; + values[valuesById[2] = "EXPANDED"] = 2; + return values; + })(); + + /** + * Utf8Validation enum. + * @name google.protobuf.FeatureSet.Utf8Validation + * @enum {number} + * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value + * @property {number} VERIFY=2 VERIFY value + * @property {number} NONE=3 NONE value + */ + FeatureSet.Utf8Validation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; + values[valuesById[2] = "VERIFY"] = 2; + values[valuesById[3] = "NONE"] = 3; + return values; + })(); + + /** + * MessageEncoding enum. + * @name google.protobuf.FeatureSet.MessageEncoding + * @enum {number} + * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value + * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value + * @property {number} DELIMITED=2 DELIMITED value + */ + FeatureSet.MessageEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "LENGTH_PREFIXED"] = 1; + values[valuesById[2] = "DELIMITED"] = 2; + return values; + })(); + + /** + * JsonFormat enum. + * @name google.protobuf.FeatureSet.JsonFormat + * @enum {number} + * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value + * @property {number} ALLOW=1 ALLOW value + * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value + */ + FeatureSet.JsonFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; + values[valuesById[1] = "ALLOW"] = 1; + values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; + return values; + })(); + + return FeatureSet; + })(); + + protobuf.FeatureSetDefaults = (function() { + + /** + * Properties of a FeatureSetDefaults. + * @memberof google.protobuf + * @interface IFeatureSetDefaults + * @property {Array.|null} [defaults] FeatureSetDefaults defaults + * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition + * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition + */ + + /** + * Constructs a new FeatureSetDefaults. + * @memberof google.protobuf + * @classdesc Represents a FeatureSetDefaults. + * @implements IFeatureSetDefaults + * @constructor + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + */ + function FeatureSetDefaults(properties) { + this.defaults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSetDefaults defaults. + * @member {Array.} defaults + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.defaults = $util.emptyArray; + + /** + * FeatureSetDefaults minimumEdition. + * @member {google.protobuf.Edition} minimumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.minimumEdition = 0; + + /** + * FeatureSetDefaults maximumEdition. + * @member {google.protobuf.Edition} maximumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.maximumEdition = 0; + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance + */ + FeatureSetDefaults.create = function create(properties) { + return new FeatureSetDefaults(properties); + }; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.defaults != null && message.defaults.length) + for (var i = 0; i < message.defaults.length; ++i) + $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); + if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); + return writer; + }; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.defaults && message.defaults.length)) + message.defaults = []; + message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32())); + break; + } + case 4: { + message.minimumEdition = reader.int32(); + break; + } + case 5: { + message.maximumEdition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetDefaults message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetDefaults.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.defaults != null && message.hasOwnProperty("defaults")) { + if (!Array.isArray(message.defaults)) + return "defaults: array expected"; + for (var i = 0; i < message.defaults.length; ++i) { + var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i]); + if (error) + return "defaults." + error; + } + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + switch (message.minimumEdition) { + default: + return "minimumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + switch (message.maximumEdition) { + default: + return "maximumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + */ + FeatureSetDefaults.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults(); + if (object.defaults) { + if (!Array.isArray(object.defaults)) + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected"); + message.defaults = []; + for (var i = 0; i < object.defaults.length; ++i) { + if (typeof object.defaults[i] !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected"); + message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i]); + } + } + switch (object.minimumEdition) { + default: + if (typeof object.minimumEdition === "number") { + message.minimumEdition = object.minimumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.minimumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.minimumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.minimumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.minimumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.minimumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.minimumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.minimumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.minimumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.minimumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.minimumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.minimumEdition = 2147483647; + break; + } + switch (object.maximumEdition) { + default: + if (typeof object.maximumEdition === "number") { + message.maximumEdition = object.maximumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.maximumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.maximumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.maximumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.maximumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.maximumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.maximumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.maximumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.maximumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.maximumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.maximumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.maximumEdition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetDefaults.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.defaults = []; + if (options.defaults) { + object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.defaults && message.defaults.length) { + object.defaults = []; + for (var j = 0; j < message.defaults.length; ++j) + object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options); + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; + return object; + }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults + * @instance + * @returns {Object.} JSON object + */ + FeatureSetDefaults.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetDefaults + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; + }; + + FeatureSetDefaults.FeatureSetEditionDefault = (function() { + + /** + * Properties of a FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @interface IFeatureSetEditionDefault + * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition + * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features + */ + + /** + * Constructs a new FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @classdesc Represents a FeatureSetEditionDefault. + * @implements IFeatureSetEditionDefault + * @constructor + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + */ + function FeatureSetEditionDefault(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSetEditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.edition = 0; + + /** + * FeatureSetEditionDefault features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.features = null; + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance + */ + FeatureSetEditionDefault.create = function create(properties) { + return new FeatureSetEditionDefault(properties); + }; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetEditionDefault message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetEditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + return null; + }; + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + */ + FeatureSetEditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetEditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.features = null; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + * @returns {Object.} JSON object + */ + FeatureSetEditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; + }; + + return FeatureSetEditionDefault; + })(); + + return FeatureSetDefaults; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + } + case 3: { + message.leadingComments = reader.string(); + break; + } + case 4: { + message.trailingComments = reader.string(); + break; + } + case 6: { + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + message.sourceFile = reader.string(); + break; + } + case 3: { + message.begin = reader.int32(); + break; + } + case 4: { + message.end = reader.int32(); + break; + } + case 5: { + message.semantic = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.semantic != null && message.hasOwnProperty("semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) + return object; + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof google.protobuf.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Duration"; + }; + + return Duration; + })(); + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + + return Any; + })(); + + protobuf.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + + return Empty; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.protobuf.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Timestamp"; + }; + + return Timestamp; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] DoubleValue value + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Represents a DoubleValue. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + */ + function DoubleValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DoubleValue value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.value); + return writer; + }; + + /** + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DoubleValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DoubleValue message. + * @function verify + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DoubleValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DoubleValue} DoubleValue + */ + DoubleValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DoubleValue) + return object; + var message = new $root.google.protobuf.DoubleValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.DoubleValue} message DoubleValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DoubleValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this DoubleValue to JSON. + * @function toJSON + * @memberof google.protobuf.DoubleValue + * @instance + * @returns {Object.} JSON object + */ + DoubleValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] FloatValue value + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Represents a FloatValue. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + */ + function FloatValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FloatValue value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.value); + return writer; + }; + + /** + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FloatValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FloatValue message. + * @function verify + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FloatValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FloatValue} FloatValue + */ + FloatValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FloatValue) + return object; + var message = new $root.google.protobuf.FloatValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a FloatValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.FloatValue} message FloatValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FloatValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this FloatValue to JSON. + * @function toJSON + * @memberof google.protobuf.FloatValue + * @instance + * @returns {Object.} JSON object + */ + FloatValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {number|Long|null} [value] Int64Value value + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Represents an Int64Value. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + */ + function Int64Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Int64Value value. + * @member {number|Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.value); + return writer; + }; + + /** + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int64Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int64Value message. + * @function verify + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int64Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + return null; + }; + + /** + * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int64Value} Int64Value + */ + Int64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int64Value) + return object; + var message = new $root.google.protobuf.Int64Value(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = false; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.Int64Value} message Int64Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int64Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value; + return object; + }; + + /** + * Converts this Int64Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int64Value + * @instance + * @returns {Object.} JSON object + */ + Int64Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {number|Long|null} [value] UInt64Value value + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Represents a UInt64Value. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + */ + function UInt64Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UInt64Value value. + * @member {number|Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.value); + return writer; + }; + + /** + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt64Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.uint64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UInt64Value message. + * @function verify + * @memberof google.protobuf.UInt64Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UInt64Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + return null; + }; + + /** + * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UInt64Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UInt64Value} UInt64Value + */ + UInt64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt64Value) + return object; + var message = new $root.google.protobuf.UInt64Value(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = true; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.UInt64Value} message UInt64Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UInt64Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber(true) : message.value; + return object; + }; + + /** + * Converts this UInt64Value to JSON. + * @function toJSON + * @memberof google.protobuf.UInt64Value + * @instance + * @returns {Object.} JSON object + */ + UInt64Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] Int32Value value + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Represents an Int32Value. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + */ + function Int32Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Int32Value value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.value); + return writer; + }; + + /** + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int32Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int32Value message. + * @function verify + * @memberof google.protobuf.Int32Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int32Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; + return null; + }; + + /** + * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int32Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int32Value} Int32Value + */ + Int32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int32Value) + return object; + var message = new $root.google.protobuf.Int32Value(); + if (object.value != null) + message.value = object.value | 0; + return message; + }; + + /** + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.Int32Value} message Int32Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int32Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this Int32Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int32Value + * @instance + * @returns {Object.} JSON object + */ + Int32Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] UInt32Value value + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Represents a UInt32Value. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + */ + function UInt32Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UInt32Value value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.value); + return writer; + }; + + /** + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt32Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.uint32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UInt32Value message. + * @function verify + * @memberof google.protobuf.UInt32Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UInt32Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; + return null; + }; + + /** + * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UInt32Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UInt32Value} UInt32Value + */ + UInt32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt32Value) + return object; + var message = new $root.google.protobuf.UInt32Value(); + if (object.value != null) + message.value = object.value >>> 0; + return message; + }; + + /** + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.UInt32Value} message UInt32Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UInt32Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this UInt32Value to JSON. + * @function toJSON + * @memberof google.protobuf.UInt32Value + * @instance + * @returns {Object.} JSON object + */ + UInt32Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] BoolValue value + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Represents a BoolValue. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + */ + function BoolValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BoolValue value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.value); + return writer; + }; + + /** + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BoolValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoolValue message. + * @function verify + * @memberof google.protobuf.BoolValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoolValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "boolean") + return "value: boolean expected"; + return null; + }; + + /** + * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.BoolValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.BoolValue} BoolValue + */ + BoolValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BoolValue) + return object; + var message = new $root.google.protobuf.BoolValue(); + if (object.value != null) + message.value = Boolean(object.value); + return message; + }; + + /** + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.BoolValue} message BoolValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoolValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = false; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this BoolValue to JSON. + * @function toJSON + * @memberof google.protobuf.BoolValue + * @instance + * @returns {Object.} JSON object + */ + BoolValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] StringValue value + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Represents a StringValue. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [properties] Properties to set + */ + function StringValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StringValue value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + return writer; + }; + + /** + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.StringValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StringValue message. + * @function verify + * @memberof google.protobuf.StringValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StringValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates a StringValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.StringValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.StringValue} StringValue + */ + StringValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.StringValue) + return object; + var message = new $root.google.protobuf.StringValue(); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.StringValue} message StringValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StringValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = ""; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this StringValue to JSON. + * @function toJSON + * @memberof google.protobuf.StringValue + * @instance + * @returns {Object.} JSON object + */ + StringValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] BytesValue value + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Represents a BytesValue. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + */ + function BytesValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BytesValue value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BytesValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BytesValue message. + * @function verify + * @memberof google.protobuf.BytesValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BytesValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.BytesValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.BytesValue} BytesValue + */ + BytesValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BytesValue) + return object; + var message = new $root.google.protobuf.BytesValue(); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from a BytesValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.BytesValue} message BytesValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BytesValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this BytesValue to JSON. + * @function toJSON + * @memberof google.protobuf.BytesValue + * @instance + * @returns {Object.} JSON object + */ + BytesValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.FieldMask = (function() { + + /** + * Properties of a FieldMask. + * @memberof google.protobuf + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths + */ + + /** + * Constructs a new FieldMask. + * @memberof google.protobuf + * @classdesc Represents a FieldMask. + * @implements IFieldMask + * @constructor + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + */ + function FieldMask(properties) { + this.paths = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask + * @instance + */ + FieldMask.prototype.paths = $util.emptyArray; + + /** + * Creates a new FieldMask instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance + */ + FieldMask.create = function create(properties) { + return new FieldMask(properties); + }; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); + return writer; + }; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldMask message. + * @function verify + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldMask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } + return null; + }; + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldMask} FieldMask + */ + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) + return object; + var message = new $root.google.protobuf.FieldMask(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.protobuf.FieldMask.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + return message; + }; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.FieldMask} message FieldMask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldMask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + return object; + }; + + /** + * Converts this FieldMask to JSON. + * @function toJSON + * @memberof google.protobuf.FieldMask + * @instance + * @returns {Object.} JSON object + */ + FieldMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldMask + * @function getTypeUrl + * @memberof google.protobuf.FieldMask + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldMask"; + }; + + return FieldMask; + })(); + + return protobuf; + })(); + + google.longrunning = (function() { + + /** + * Namespace longrunning. + * @memberof google + * @namespace + */ + var longrunning = {}; + + longrunning.Operations = (function() { + + /** + * Constructs a new Operations service. + * @memberof google.longrunning + * @classdesc Represents an Operations + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Operations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; + + /** + * Creates new Operations service using the specified rpc implementation. + * @function create + * @memberof google.longrunning.Operations + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Operations} RPC service. Useful where requests and/or responses are streamed. + */ + Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @memberof google.longrunning.Operations + * @typedef ListOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse + */ + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { + return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); + }, "name", { value: "ListOperations" }); + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @memberof google.longrunning.Operations + * @typedef GetOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { + return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "GetOperation" }); + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @memberof google.longrunning.Operations + * @typedef DeleteOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { + return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteOperation" }); + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @memberof google.longrunning.Operations + * @typedef CancelOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { + return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "CancelOperation" }); + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @memberof google.longrunning.Operations + * @typedef WaitOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { + return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "WaitOperation" }); + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Operations; + })(); + + longrunning.Operation = (function() { + + /** + * Properties of an Operation. + * @memberof google.longrunning + * @interface IOperation + * @property {string|null} [name] Operation name + * @property {google.protobuf.IAny|null} [metadata] Operation metadata + * @property {boolean|null} [done] Operation done + * @property {google.rpc.IStatus|null} [error] Operation error + * @property {google.protobuf.IAny|null} [response] Operation response + */ + + /** + * Constructs a new Operation. + * @memberof google.longrunning + * @classdesc Represents an Operation. + * @implements IOperation + * @constructor + * @param {google.longrunning.IOperation=} [properties] Properties to set + */ + function Operation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Operation name. + * @member {string} name + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.name = ""; + + /** + * Operation metadata. + * @member {google.protobuf.IAny|null|undefined} metadata + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.metadata = null; + + /** + * Operation done. + * @member {boolean} done + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.done = false; + + /** + * Operation error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.error = null; + + /** + * Operation response. + * @member {google.protobuf.IAny|null|undefined} response + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Operation result. + * @member {"error"|"response"|undefined} result + * @memberof google.longrunning.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["error", "response"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Operation instance using the specified properties. + * @function create + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation=} [properties] Properties to set + * @returns {google.longrunning.Operation} Operation instance + */ + Operation.create = function create(properties) { + return new Operation(properties); + }; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encode + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.done != null && Object.hasOwnProperty.call(message, "done")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + case 3: { + message.done = reader.bool(); + break; + } + case 4: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 5: { + message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Operation message. + * @function verify + * @memberof google.longrunning.Operation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Operation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Any.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.done != null && message.hasOwnProperty("done")) + if (typeof message.done !== "boolean") + return "done: boolean expected"; + if (message.error != null && message.hasOwnProperty("error")) { + properties.result = 1; + { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.response != null && message.hasOwnProperty("response")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.protobuf.Any.verify(message.response); + if (error) + return "response." + error; + } + } + return null; + }; + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.Operation + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.Operation} Operation + */ + Operation.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.Operation) + return object; + var message = new $root.google.longrunning.Operation(); + if (object.name != null) + message.name = String(object.name); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.longrunning.Operation.metadata: object expected"); + message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); + } + if (object.done != null) + message.done = Boolean(object.done); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.longrunning.Operation.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.longrunning.Operation.response: object expected"); + message.response = $root.google.protobuf.Any.fromObject(object.response); + } + return message; + }; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.Operation} message Operation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Operation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.metadata = null; + object.done = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); + if (message.done != null && message.hasOwnProperty("done")) + object.done = message.done; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; + } + if (message.response != null && message.hasOwnProperty("response")) { + object.response = $root.google.protobuf.Any.toObject(message.response, options); + if (options.oneofs) + object.result = "response"; + } + return object; + }; + + /** + * Converts this Operation to JSON. + * @function toJSON + * @memberof google.longrunning.Operation + * @instance + * @returns {Object.} JSON object + */ + Operation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Operation + * @function getTypeUrl + * @memberof google.longrunning.Operation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.Operation"; + }; + + return Operation; + })(); + + longrunning.GetOperationRequest = (function() { + + /** + * Properties of a GetOperationRequest. + * @memberof google.longrunning + * @interface IGetOperationRequest + * @property {string|null} [name] GetOperationRequest name + */ + + /** + * Constructs a new GetOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a GetOperationRequest. + * @implements IGetOperationRequest + * @constructor + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + */ + function GetOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetOperationRequest name. + * @member {string} name + * @memberof google.longrunning.GetOperationRequest + * @instance + */ + GetOperationRequest.prototype.name = ""; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance + */ + GetOperationRequest.create = function create(properties) { + return new GetOperationRequest(properties); + }; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOperationRequest message. + * @function verify + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + */ + GetOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.GetOperationRequest) + return object; + var message = new $root.google.longrunning.GetOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.GetOperationRequest} message GetOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.GetOperationRequest + * @instance + * @returns {Object.} JSON object + */ + GetOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; + }; + + return GetOperationRequest; + })(); + + longrunning.ListOperationsRequest = (function() { + + /** + * Properties of a ListOperationsRequest. + * @memberof google.longrunning + * @interface IListOperationsRequest + * @property {string|null} [name] ListOperationsRequest name + * @property {string|null} [filter] ListOperationsRequest filter + * @property {number|null} [pageSize] ListOperationsRequest pageSize + * @property {string|null} [pageToken] ListOperationsRequest pageToken + */ + + /** + * Constructs a new ListOperationsRequest. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsRequest. + * @implements IListOperationsRequest + * @constructor + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + */ + function ListOperationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsRequest name. + * @member {string} name + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.name = ""; + + /** + * ListOperationsRequest filter. + * @member {string} filter + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.filter = ""; + + /** + * ListOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageSize = 0; + + /** + * ListOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance + */ + ListOperationsRequest.create = function create(properties) { + return new ListOperationsRequest(properties); + }; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + return writer; + }; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 4: { + message.name = reader.string(); + break; + } + case 1: { + message.filter = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsRequest message. + * @function verify + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + */ + ListOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsRequest) + return object; + var message = new $root.google.longrunning.ListOperationsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.name = ""; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this ListOperationsRequest to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsRequest + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; + }; + + return ListOperationsRequest; + })(); + + longrunning.ListOperationsResponse = (function() { + + /** + * Properties of a ListOperationsResponse. + * @memberof google.longrunning + * @interface IListOperationsResponse + * @property {Array.|null} [operations] ListOperationsResponse operations + * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken + */ + + /** + * Constructs a new ListOperationsResponse. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsResponse. + * @implements IListOperationsResponse + * @constructor + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + */ + function ListOperationsResponse(properties) { + this.operations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsResponse operations. + * @member {Array.} operations + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.operations = $util.emptyArray; + + /** + * ListOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance + */ + ListOperationsResponse.create = function create(properties) { + return new ListOperationsResponse(properties); + }; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsResponse message. + * @function verify + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + */ + ListOperationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsResponse) + return object; + var message = new $root.google.longrunning.ListOperationsResponse(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); + message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListOperationsResponse to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListOperationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsResponse + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; + }; + + return ListOperationsResponse; + })(); + + longrunning.CancelOperationRequest = (function() { + + /** + * Properties of a CancelOperationRequest. + * @memberof google.longrunning + * @interface ICancelOperationRequest + * @property {string|null} [name] CancelOperationRequest name + */ + + /** + * Constructs a new CancelOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a CancelOperationRequest. + * @implements ICancelOperationRequest + * @constructor + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + */ + function CancelOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CancelOperationRequest name. + * @member {string} name + * @memberof google.longrunning.CancelOperationRequest + * @instance + */ + CancelOperationRequest.prototype.name = ""; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance + */ + CancelOperationRequest.create = function create(properties) { + return new CancelOperationRequest(properties); + }; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelOperationRequest message. + * @function verify + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + */ + CancelOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.CancelOperationRequest) + return object; + var message = new $root.google.longrunning.CancelOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this CancelOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.CancelOperationRequest + * @instance + * @returns {Object.} JSON object + */ + CancelOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; + }; + + return CancelOperationRequest; + })(); + + longrunning.DeleteOperationRequest = (function() { + + /** + * Properties of a DeleteOperationRequest. + * @memberof google.longrunning + * @interface IDeleteOperationRequest + * @property {string|null} [name] DeleteOperationRequest name + */ + + /** + * Constructs a new DeleteOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a DeleteOperationRequest. + * @implements IDeleteOperationRequest + * @constructor + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + */ + function DeleteOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteOperationRequest name. + * @member {string} name + * @memberof google.longrunning.DeleteOperationRequest + * @instance + */ + DeleteOperationRequest.prototype.name = ""; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance + */ + DeleteOperationRequest.create = function create(properties) { + return new DeleteOperationRequest(properties); + }; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteOperationRequest message. + * @function verify + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + */ + DeleteOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.DeleteOperationRequest) + return object; + var message = new $root.google.longrunning.DeleteOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.DeleteOperationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; + }; + + return DeleteOperationRequest; + })(); + + longrunning.WaitOperationRequest = (function() { + + /** + * Properties of a WaitOperationRequest. + * @memberof google.longrunning + * @interface IWaitOperationRequest + * @property {string|null} [name] WaitOperationRequest name + * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout + */ + + /** + * Constructs a new WaitOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a WaitOperationRequest. + * @implements IWaitOperationRequest + * @constructor + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + */ + function WaitOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WaitOperationRequest name. + * @member {string} name + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.name = ""; + + /** + * WaitOperationRequest timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.timeout = null; + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance + */ + WaitOperationRequest.create = function create(properties) { + return new WaitOperationRequest(properties); + }; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitOperationRequest message. + * @function verify + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + return null; + }; + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + */ + WaitOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.WaitOperationRequest) + return object; + var message = new $root.google.longrunning.WaitOperationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + return message; + }; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.timeout = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + return object; + }; + + /** + * Converts this WaitOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.WaitOperationRequest + * @instance + * @returns {Object.} JSON object + */ + WaitOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WaitOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; + }; + + return WaitOperationRequest; + })(); + + longrunning.OperationInfo = (function() { + + /** + * Properties of an OperationInfo. + * @memberof google.longrunning + * @interface IOperationInfo + * @property {string|null} [responseType] OperationInfo responseType + * @property {string|null} [metadataType] OperationInfo metadataType + */ + + /** + * Constructs a new OperationInfo. + * @memberof google.longrunning + * @classdesc Represents an OperationInfo. + * @implements IOperationInfo + * @constructor + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + */ + function OperationInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationInfo responseType. + * @member {string} responseType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.responseType = ""; + + /** + * OperationInfo metadataType. + * @member {string} metadataType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.metadataType = ""; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @function create + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + * @returns {google.longrunning.OperationInfo} OperationInfo instance + */ + OperationInfo.create = function create(properties) { + return new OperationInfo(properties); + }; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encode + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); + if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); + return writer; + }; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.responseType = reader.string(); + break; + } + case 2: { + message.metadataType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationInfo message. + * @function verify + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responseType != null && message.hasOwnProperty("responseType")) + if (!$util.isString(message.responseType)) + return "responseType: string expected"; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + if (!$util.isString(message.metadataType)) + return "metadataType: string expected"; + return null; + }; + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.OperationInfo} OperationInfo + */ + OperationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.OperationInfo) + return object; + var message = new $root.google.longrunning.OperationInfo(); + if (object.responseType != null) + message.responseType = String(object.responseType); + if (object.metadataType != null) + message.metadataType = String(object.metadataType); + return message; + }; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.OperationInfo} message OperationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.responseType = ""; + object.metadataType = ""; + } + if (message.responseType != null && message.hasOwnProperty("responseType")) + object.responseType = message.responseType; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + object.metadataType = message.metadataType; + return object; + }; + + /** + * Converts this OperationInfo to JSON. + * @function toJSON + * @memberof google.longrunning.OperationInfo + * @instance + * @returns {Object.} JSON object + */ + OperationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationInfo + * @function getTypeUrl + * @memberof google.longrunning.OperationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.OperationInfo"; + }; + + return OperationInfo; + })(); + + return longrunning; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + + return Status; + })(); + + return rpc; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/protos/protos.json b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/protos/protos.json new file mode 100644 index 00000000000..4ef5e6cc248 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/protos/protos.json @@ -0,0 +1,3393 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "speech": { + "nested": { + "v1": { + "options": { + "cc_enable_arenas": true, + "go_package": "cloud.google.com/go/speech/apiv1/speechpb;speechpb", + "java_multiple_files": true, + "java_outer_classname": "SpeechAdaptationProto", + "java_package": "com.google.cloud.speech.v1", + "objc_class_prefix": "GCS" + }, + "nested": { + "Speech": { + "options": { + "(google.api.default_host)": "speech.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "Recognize": { + "requestType": "RecognizeRequest", + "responseType": "RecognizeResponse", + "options": { + "(google.api.http).post": "/v1/speech:recognize", + "(google.api.http).body": "*", + "(google.api.method_signature)": "config,audio" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/speech:recognize", + "body": "*" + } + }, + { + "(google.api.method_signature)": "config,audio" + } + ] + }, + "LongRunningRecognize": { + "requestType": "LongRunningRecognizeRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/speech:longrunningrecognize", + "(google.api.http).body": "*", + "(google.api.method_signature)": "config,audio", + "(google.longrunning.operation_info).response_type": "LongRunningRecognizeResponse", + "(google.longrunning.operation_info).metadata_type": "LongRunningRecognizeMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/speech:longrunningrecognize", + "body": "*" + } + }, + { + "(google.api.method_signature)": "config,audio" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "LongRunningRecognizeResponse", + "metadata_type": "LongRunningRecognizeMetadata" + } + } + ] + }, + "StreamingRecognize": { + "requestType": "StreamingRecognizeRequest", + "requestStream": true, + "responseType": "StreamingRecognizeResponse", + "responseStream": true + } + } + }, + "RecognizeRequest": { + "fields": { + "config": { + "type": "RecognitionConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "audio": { + "type": "RecognitionAudio", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "LongRunningRecognizeRequest": { + "fields": { + "config": { + "type": "RecognitionConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "audio": { + "type": "RecognitionAudio", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "outputConfig": { + "type": "TranscriptOutputConfig", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "TranscriptOutputConfig": { + "oneofs": { + "outputType": { + "oneof": [ + "gcsUri" + ] + } + }, + "fields": { + "gcsUri": { + "type": "string", + "id": 1 + } + } + }, + "StreamingRecognizeRequest": { + "oneofs": { + "streamingRequest": { + "oneof": [ + "streamingConfig", + "audioContent" + ] + } + }, + "fields": { + "streamingConfig": { + "type": "StreamingRecognitionConfig", + "id": 1 + }, + "audioContent": { + "type": "bytes", + "id": 2 + } + } + }, + "StreamingRecognitionConfig": { + "fields": { + "config": { + "type": "RecognitionConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "singleUtterance": { + "type": "bool", + "id": 2 + }, + "interimResults": { + "type": "bool", + "id": 3 + }, + "enableVoiceActivityEvents": { + "type": "bool", + "id": 5 + }, + "voiceActivityTimeout": { + "type": "VoiceActivityTimeout", + "id": 6 + } + }, + "nested": { + "VoiceActivityTimeout": { + "fields": { + "speechStartTimeout": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "speechEndTimeout": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + } + } + }, + "RecognitionConfig": { + "fields": { + "encoding": { + "type": "AudioEncoding", + "id": 1 + }, + "sampleRateHertz": { + "type": "int32", + "id": 2 + }, + "audioChannelCount": { + "type": "int32", + "id": 7 + }, + "enableSeparateRecognitionPerChannel": { + "type": "bool", + "id": 12 + }, + "languageCode": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "alternativeLanguageCodes": { + "rule": "repeated", + "type": "string", + "id": 18 + }, + "maxAlternatives": { + "type": "int32", + "id": 4 + }, + "profanityFilter": { + "type": "bool", + "id": 5 + }, + "adaptation": { + "type": "SpeechAdaptation", + "id": 20 + }, + "transcriptNormalization": { + "type": "TranscriptNormalization", + "id": 24, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "speechContexts": { + "rule": "repeated", + "type": "SpeechContext", + "id": 6 + }, + "enableWordTimeOffsets": { + "type": "bool", + "id": 8 + }, + "enableWordConfidence": { + "type": "bool", + "id": 15 + }, + "enableAutomaticPunctuation": { + "type": "bool", + "id": 11 + }, + "enableSpokenPunctuation": { + "type": "google.protobuf.BoolValue", + "id": 22 + }, + "enableSpokenEmojis": { + "type": "google.protobuf.BoolValue", + "id": 23 + }, + "diarizationConfig": { + "type": "SpeakerDiarizationConfig", + "id": 19 + }, + "metadata": { + "type": "RecognitionMetadata", + "id": 9 + }, + "model": { + "type": "string", + "id": 13 + }, + "useEnhanced": { + "type": "bool", + "id": 14 + } + }, + "nested": { + "AudioEncoding": { + "values": { + "ENCODING_UNSPECIFIED": 0, + "LINEAR16": 1, + "FLAC": 2, + "MULAW": 3, + "AMR": 4, + "AMR_WB": 5, + "OGG_OPUS": 6, + "SPEEX_WITH_HEADER_BYTE": 7, + "MP3": 8, + "WEBM_OPUS": 9 + } + } + } + }, + "SpeakerDiarizationConfig": { + "fields": { + "enableSpeakerDiarization": { + "type": "bool", + "id": 1 + }, + "minSpeakerCount": { + "type": "int32", + "id": 2 + }, + "maxSpeakerCount": { + "type": "int32", + "id": 3 + }, + "speakerTag": { + "type": "int32", + "id": 5, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "RecognitionMetadata": { + "options": { + "deprecated": true + }, + "fields": { + "interactionType": { + "type": "InteractionType", + "id": 1 + }, + "industryNaicsCodeOfAudio": { + "type": "uint32", + "id": 3 + }, + "microphoneDistance": { + "type": "MicrophoneDistance", + "id": 4 + }, + "originalMediaType": { + "type": "OriginalMediaType", + "id": 5 + }, + "recordingDeviceType": { + "type": "RecordingDeviceType", + "id": 6 + }, + "recordingDeviceName": { + "type": "string", + "id": 7 + }, + "originalMimeType": { + "type": "string", + "id": 8 + }, + "audioTopic": { + "type": "string", + "id": 10 + } + }, + "nested": { + "InteractionType": { + "values": { + "INTERACTION_TYPE_UNSPECIFIED": 0, + "DISCUSSION": 1, + "PRESENTATION": 2, + "PHONE_CALL": 3, + "VOICEMAIL": 4, + "PROFESSIONALLY_PRODUCED": 5, + "VOICE_SEARCH": 6, + "VOICE_COMMAND": 7, + "DICTATION": 8 + } + }, + "MicrophoneDistance": { + "values": { + "MICROPHONE_DISTANCE_UNSPECIFIED": 0, + "NEARFIELD": 1, + "MIDFIELD": 2, + "FARFIELD": 3 + } + }, + "OriginalMediaType": { + "values": { + "ORIGINAL_MEDIA_TYPE_UNSPECIFIED": 0, + "AUDIO": 1, + "VIDEO": 2 + } + }, + "RecordingDeviceType": { + "values": { + "RECORDING_DEVICE_TYPE_UNSPECIFIED": 0, + "SMARTPHONE": 1, + "PC": 2, + "PHONE_LINE": 3, + "VEHICLE": 4, + "OTHER_OUTDOOR_DEVICE": 5, + "OTHER_INDOOR_DEVICE": 6 + } + } + } + }, + "SpeechContext": { + "fields": { + "phrases": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "boost": { + "type": "float", + "id": 4 + } + } + }, + "RecognitionAudio": { + "oneofs": { + "audioSource": { + "oneof": [ + "content", + "uri" + ] + } + }, + "fields": { + "content": { + "type": "bytes", + "id": 1 + }, + "uri": { + "type": "string", + "id": 2 + } + } + }, + "RecognizeResponse": { + "fields": { + "results": { + "rule": "repeated", + "type": "SpeechRecognitionResult", + "id": 2 + }, + "totalBilledTime": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "speechAdaptationInfo": { + "type": "SpeechAdaptationInfo", + "id": 7 + }, + "requestId": { + "type": "int64", + "id": 8 + } + } + }, + "LongRunningRecognizeResponse": { + "fields": { + "results": { + "rule": "repeated", + "type": "SpeechRecognitionResult", + "id": 2 + }, + "totalBilledTime": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "outputConfig": { + "type": "TranscriptOutputConfig", + "id": 6 + }, + "outputError": { + "type": "google.rpc.Status", + "id": 7 + }, + "speechAdaptationInfo": { + "type": "SpeechAdaptationInfo", + "id": 8 + }, + "requestId": { + "type": "int64", + "id": 9 + } + } + }, + "LongRunningRecognizeMetadata": { + "fields": { + "progressPercent": { + "type": "int32", + "id": 1 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "lastUpdateTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "uri": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "StreamingRecognizeResponse": { + "fields": { + "error": { + "type": "google.rpc.Status", + "id": 1 + }, + "results": { + "rule": "repeated", + "type": "StreamingRecognitionResult", + "id": 2 + }, + "speechEventType": { + "type": "SpeechEventType", + "id": 4 + }, + "speechEventTime": { + "type": "google.protobuf.Duration", + "id": 8 + }, + "totalBilledTime": { + "type": "google.protobuf.Duration", + "id": 5 + }, + "speechAdaptationInfo": { + "type": "SpeechAdaptationInfo", + "id": 9 + }, + "requestId": { + "type": "int64", + "id": 10 + } + }, + "nested": { + "SpeechEventType": { + "values": { + "SPEECH_EVENT_UNSPECIFIED": 0, + "END_OF_SINGLE_UTTERANCE": 1, + "SPEECH_ACTIVITY_BEGIN": 2, + "SPEECH_ACTIVITY_END": 3, + "SPEECH_ACTIVITY_TIMEOUT": 4 + } + } + } + }, + "StreamingRecognitionResult": { + "fields": { + "alternatives": { + "rule": "repeated", + "type": "SpeechRecognitionAlternative", + "id": 1 + }, + "isFinal": { + "type": "bool", + "id": 2 + }, + "stability": { + "type": "float", + "id": 3 + }, + "resultEndTime": { + "type": "google.protobuf.Duration", + "id": 4 + }, + "channelTag": { + "type": "int32", + "id": 5 + }, + "languageCode": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "SpeechRecognitionResult": { + "fields": { + "alternatives": { + "rule": "repeated", + "type": "SpeechRecognitionAlternative", + "id": 1 + }, + "channelTag": { + "type": "int32", + "id": 2 + }, + "resultEndTime": { + "type": "google.protobuf.Duration", + "id": 4 + }, + "languageCode": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "SpeechRecognitionAlternative": { + "fields": { + "transcript": { + "type": "string", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2 + }, + "words": { + "rule": "repeated", + "type": "WordInfo", + "id": 3 + } + } + }, + "WordInfo": { + "fields": { + "startTime": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Duration", + "id": 2 + }, + "word": { + "type": "string", + "id": 3 + }, + "confidence": { + "type": "float", + "id": 4 + }, + "speakerTag": { + "type": "int32", + "id": 5, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "speakerLabel": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "SpeechAdaptationInfo": { + "fields": { + "adaptationTimeout": { + "type": "bool", + "id": 1 + }, + "timeoutMessage": { + "type": "string", + "id": 4 + } + } + }, + "CustomClass": { + "options": { + "(google.api.resource).type": "speech.googleapis.com/CustomClass", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/customClasses/{custom_class}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "customClassId": { + "type": "string", + "id": 2 + }, + "items": { + "rule": "repeated", + "type": "ClassItem", + "id": 3 + } + }, + "nested": { + "ClassItem": { + "fields": { + "value": { + "type": "string", + "id": 1 + } + } + } + } + }, + "PhraseSet": { + "options": { + "(google.api.resource).type": "speech.googleapis.com/PhraseSet", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/phraseSets/{phrase_set}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "phrases": { + "rule": "repeated", + "type": "Phrase", + "id": 2 + }, + "boost": { + "type": "float", + "id": 4 + } + }, + "nested": { + "Phrase": { + "fields": { + "value": { + "type": "string", + "id": 1 + }, + "boost": { + "type": "float", + "id": 2 + } + } + } + } + }, + "SpeechAdaptation": { + "fields": { + "phraseSets": { + "rule": "repeated", + "type": "PhraseSet", + "id": 1 + }, + "phraseSetReferences": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "speech.googleapis.com/PhraseSet" + } + }, + "customClasses": { + "rule": "repeated", + "type": "CustomClass", + "id": 3 + }, + "abnfGrammar": { + "type": "ABNFGrammar", + "id": 4 + } + }, + "nested": { + "ABNFGrammar": { + "fields": { + "abnfStrings": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + } + } + }, + "TranscriptNormalization": { + "fields": { + "entries": { + "rule": "repeated", + "type": "Entry", + "id": 1 + } + }, + "nested": { + "Entry": { + "fields": { + "search": { + "type": "string", + "id": 1 + }, + "replace": { + "type": "string", + "id": 2 + }, + "caseSensitive": { + "type": "bool", + "id": 3 + } + } + } + } + }, + "Adaptation": { + "options": { + "(google.api.default_host)": "speech.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreatePhraseSet": { + "requestType": "CreatePhraseSetRequest", + "responseType": "PhraseSet", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/phraseSets", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,phrase_set,phrase_set_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/phraseSets", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,phrase_set,phrase_set_id" + } + ] + }, + "GetPhraseSet": { + "requestType": "GetPhraseSetRequest", + "responseType": "PhraseSet", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/phraseSets/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/phraseSets/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListPhraseSet": { + "requestType": "ListPhraseSetRequest", + "responseType": "ListPhraseSetResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/phraseSets", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/phraseSets" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdatePhraseSet": { + "requestType": "UpdatePhraseSetRequest", + "responseType": "PhraseSet", + "options": { + "(google.api.http).patch": "/v1/{phrase_set.name=projects/*/locations/*/phraseSets/*}", + "(google.api.http).body": "phrase_set", + "(google.api.method_signature)": "phrase_set,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{phrase_set.name=projects/*/locations/*/phraseSets/*}", + "body": "phrase_set" + } + }, + { + "(google.api.method_signature)": "phrase_set,update_mask" + } + ] + }, + "DeletePhraseSet": { + "requestType": "DeletePhraseSetRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/phraseSets/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/phraseSets/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateCustomClass": { + "requestType": "CreateCustomClassRequest", + "responseType": "CustomClass", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/customClasses", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,custom_class,custom_class_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/customClasses", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,custom_class,custom_class_id" + } + ] + }, + "GetCustomClass": { + "requestType": "GetCustomClassRequest", + "responseType": "CustomClass", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/customClasses/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/customClasses/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListCustomClasses": { + "requestType": "ListCustomClassesRequest", + "responseType": "ListCustomClassesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/customClasses", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/customClasses" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdateCustomClass": { + "requestType": "UpdateCustomClassRequest", + "responseType": "CustomClass", + "options": { + "(google.api.http).patch": "/v1/{custom_class.name=projects/*/locations/*/customClasses/*}", + "(google.api.http).body": "custom_class", + "(google.api.method_signature)": "custom_class,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{custom_class.name=projects/*/locations/*/customClasses/*}", + "body": "custom_class" + } + }, + { + "(google.api.method_signature)": "custom_class,update_mask" + } + ] + }, + "DeleteCustomClass": { + "requestType": "DeleteCustomClassRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/customClasses/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/customClasses/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "CreatePhraseSetRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "speech.googleapis.com/PhraseSet" + } + }, + "phraseSetId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "phraseSet": { + "type": "PhraseSet", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdatePhraseSetRequest": { + "fields": { + "phraseSet": { + "type": "PhraseSet", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "GetPhraseSetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "speech.googleapis.com/PhraseSet" + } + } + } + }, + "ListPhraseSetRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "speech.googleapis.com/PhraseSet" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListPhraseSetResponse": { + "fields": { + "phraseSets": { + "rule": "repeated", + "type": "PhraseSet", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DeletePhraseSetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "speech.googleapis.com/PhraseSet" + } + } + } + }, + "CreateCustomClassRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "speech.googleapis.com/CustomClass" + } + }, + "customClassId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "customClass": { + "type": "CustomClass", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateCustomClassRequest": { + "fields": { + "customClass": { + "type": "CustomClass", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "GetCustomClassRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "speech.googleapis.com/CustomClass" + } + } + } + }, + "ListCustomClassesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "speech.googleapis.com/CustomClass" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListCustomClassesResponse": { + "fields": { + "customClasses": { + "rule": "repeated", + "type": "CustomClass", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DeleteCustomClassRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "speech.googleapis.com/CustomClass" + } + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "ResourceProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + }, + "apiVersion": { + "type": "string", + "id": 525000001, + "extend": "google.protobuf.ServiceOptions" + }, + "CommonLanguageSettings": { + "fields": { + "referenceDocsUri": { + "type": "string", + "id": 1, + "options": { + "deprecated": true + } + }, + "destinations": { + "rule": "repeated", + "type": "ClientLibraryDestination", + "id": 2 + } + } + }, + "ClientLibrarySettings": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "launchStage": { + "type": "LaunchStage", + "id": 2 + }, + "restNumericEnums": { + "type": "bool", + "id": 3 + }, + "javaSettings": { + "type": "JavaSettings", + "id": 21 + }, + "cppSettings": { + "type": "CppSettings", + "id": 22 + }, + "phpSettings": { + "type": "PhpSettings", + "id": 23 + }, + "pythonSettings": { + "type": "PythonSettings", + "id": 24 + }, + "nodeSettings": { + "type": "NodeSettings", + "id": 25 + }, + "dotnetSettings": { + "type": "DotnetSettings", + "id": 26 + }, + "rubySettings": { + "type": "RubySettings", + "id": 27 + }, + "goSettings": { + "type": "GoSettings", + "id": 28 + } + } + }, + "Publishing": { + "fields": { + "methodSettings": { + "rule": "repeated", + "type": "MethodSettings", + "id": 2 + }, + "newIssueUri": { + "type": "string", + "id": 101 + }, + "documentationUri": { + "type": "string", + "id": 102 + }, + "apiShortName": { + "type": "string", + "id": 103 + }, + "githubLabel": { + "type": "string", + "id": 104 + }, + "codeownerGithubTeams": { + "rule": "repeated", + "type": "string", + "id": 105 + }, + "docTagPrefix": { + "type": "string", + "id": 106 + }, + "organization": { + "type": "ClientLibraryOrganization", + "id": 107 + }, + "librarySettings": { + "rule": "repeated", + "type": "ClientLibrarySettings", + "id": 109 + }, + "protoReferenceDocumentationUri": { + "type": "string", + "id": 110 + }, + "restReferenceDocumentationUri": { + "type": "string", + "id": 111 + } + } + }, + "JavaSettings": { + "fields": { + "libraryPackage": { + "type": "string", + "id": 1 + }, + "serviceClassNames": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "common": { + "type": "CommonLanguageSettings", + "id": 3 + } + } + }, + "CppSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PhpSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PythonSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "NodeSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "DotnetSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "renamedResources": { + "keyType": "string", + "type": "string", + "id": 3 + }, + "ignoredResources": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "forcedNamespaceAliases": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "handwrittenSignatures": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + }, + "RubySettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "GoSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "MethodSettings": { + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "longRunning": { + "type": "LongRunning", + "id": 2 + }, + "autoPopulatedFields": { + "rule": "repeated", + "type": "string", + "id": 3 + } + }, + "nested": { + "LongRunning": { + "fields": { + "initialPollDelay": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "pollDelayMultiplier": { + "type": "float", + "id": 2 + }, + "maxPollDelay": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "totalPollTimeout": { + "type": "google.protobuf.Duration", + "id": 4 + } + } + } + } + }, + "ClientLibraryOrganization": { + "values": { + "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, + "CLOUD": 1, + "ADS": 2, + "PHOTOS": 3, + "STREET_VIEW": 4, + "SHOPPING": 5, + "GEO": 6, + "GENERATIVE_AI": 7 + } + }, + "ClientLibraryDestination": { + "values": { + "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, + "GITHUB": 10, + "PACKAGE_MANAGER": 20 + } + }, + "LaunchStage": { + "values": { + "LAUNCH_STAGE_UNSPECIFIED": 0, + "UNIMPLEMENTED": 6, + "PRELAUNCH": 7, + "EARLY_ACCESS": 1, + "ALPHA": 2, + "BETA": 3, + "GA": 4, + "DEPRECATED": 5 + } + }, + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions", + "options": { + "packed": false + } + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5, + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7, + "IDENTIFIER": 8 + } + }, + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "protobuf": { + "options": { + "go_package": "google.golang.org/protobuf/types/descriptorpb", + "java_package": "com.google.protobuf", + "java_outer_classname": "DescriptorProtos", + "csharp_namespace": "Google.Protobuf.Reflection", + "objc_class_prefix": "GPB", + "cc_enable_arenas": true, + "optimize_for": "SPEED" + }, + "nested": { + "FileDescriptorSet": { + "edition": "proto2", + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "Edition": { + "edition": "proto2", + "values": { + "EDITION_UNKNOWN": 0, + "EDITION_PROTO2": 998, + "EDITION_PROTO3": 999, + "EDITION_2023": 1000, + "EDITION_2024": 1001, + "EDITION_1_TEST_ONLY": 1, + "EDITION_2_TEST_ONLY": 2, + "EDITION_99997_TEST_ONLY": 99997, + "EDITION_99998_TEST_ONLY": 99998, + "EDITION_99999_TEST_ONLY": 99999, + "EDITION_MAX": 2147483647 + } + }, + "FileDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "package": { + "type": "string", + "id": 2 + }, + "dependency": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "publicDependency": { + "rule": "repeated", + "type": "int32", + "id": 10 + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11 + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + }, + "edition": { + "type": "Edition", + "id": 14 + } + } + }, + "DescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "ExtensionRangeOptions": { + "edition": "proto2", + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + }, + "declaration": { + "rule": "repeated", + "type": "Declaration", + "id": 2, + "options": { + "retention": "RETENTION_SOURCE" + } + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "verification": { + "type": "VerificationState", + "id": 3, + "options": { + "default": "UNVERIFIED", + "retention": "RETENTION_SOURCE" + } + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "Declaration": { + "fields": { + "number": { + "type": "int32", + "id": 1 + }, + "fullName": { + "type": "string", + "id": 2 + }, + "type": { + "type": "string", + "id": 3 + }, + "reserved": { + "type": "bool", + "id": 5 + }, + "repeated": { + "type": "bool", + "id": 6 + } + }, + "reserved": [ + [ + 4, + 4 + ] + ] + }, + "VerificationState": { + "values": { + "DECLARATION": 0, + "UNVERIFIED": 1 + } + } + } + }, + "FieldDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REPEATED": 3, + "LABEL_REQUIRED": 2 + } + } + } + }, + "OneofDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputType": { + "type": "string", + "id": 2 + }, + "outputType": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "clientStreaming": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "serverStreaming": { + "type": "bool", + "id": 6, + "options": { + "default": false + } + } + } + }, + "FileOptions": { + "edition": "proto2", + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 42, + 42 + ], + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "edition": "proto2", + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 11, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 12 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "edition": "proto2", + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "debugRedact": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "retention": { + "type": "OptionRetention", + "id": 17 + }, + "targets": { + "rule": "repeated", + "type": "OptionTargetType", + "id": 19 + }, + "editionDefaults": { + "rule": "repeated", + "type": "EditionDefault", + "id": 20 + }, + "features": { + "type": "FeatureSet", + "id": 21 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 18, + 18 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + }, + "OptionRetention": { + "values": { + "RETENTION_UNKNOWN": 0, + "RETENTION_RUNTIME": 1, + "RETENTION_SOURCE": 2 + } + }, + "OptionTargetType": { + "values": { + "TARGET_TYPE_UNKNOWN": 0, + "TARGET_TYPE_FILE": 1, + "TARGET_TYPE_EXTENSION_RANGE": 2, + "TARGET_TYPE_MESSAGE": 3, + "TARGET_TYPE_FIELD": 4, + "TARGET_TYPE_ONEOF": 5, + "TARGET_TYPE_ENUM": 6, + "TARGET_TYPE_ENUM_ENTRY": 7, + "TARGET_TYPE_SERVICE": 8, + "TARGET_TYPE_METHOD": 9 + } + }, + "EditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "value": { + "type": "string", + "id": 2 + } + } + } + } + }, + "OneofOptions": { + "edition": "proto2", + "fields": { + "features": { + "type": "FeatureSet", + "id": 1 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "edition": "proto2", + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 6, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "edition": "proto2", + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "features": { + "type": "FeatureSet", + "id": 2 + }, + "debugRedact": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "edition": "proto2", + "fields": { + "features": { + "type": "FeatureSet", + "id": 34 + }, + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "edition": "proto2", + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "features": { + "type": "FeatureSet", + "id": 35 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "edition": "proto2", + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "FeatureSet": { + "edition": "proto2", + "fields": { + "fieldPresence": { + "type": "FieldPresence", + "id": 1, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_2023", + "edition_defaults.value": "EXPLICIT" + } + }, + "enumType": { + "type": "EnumType", + "id": 2, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "OPEN" + } + }, + "repeatedFieldEncoding": { + "type": "RepeatedFieldEncoding", + "id": 3, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "PACKED" + } + }, + "utf8Validation": { + "type": "Utf8Validation", + "id": 4, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "VERIFY" + } + }, + "messageEncoding": { + "type": "MessageEncoding", + "id": 5, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO2", + "edition_defaults.value": "LENGTH_PREFIXED" + } + }, + "jsonFormat": { + "type": "JsonFormat", + "id": 6, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "ALLOW" + } + } + }, + "extensions": [ + [ + 1000, + 1000 + ], + [ + 1001, + 1001 + ], + [ + 1002, + 1002 + ], + [ + 9990, + 9990 + ], + [ + 9995, + 9999 + ], + [ + 10000, + 10000 + ] + ], + "reserved": [ + [ + 999, + 999 + ] + ], + "nested": { + "FieldPresence": { + "values": { + "FIELD_PRESENCE_UNKNOWN": 0, + "EXPLICIT": 1, + "IMPLICIT": 2, + "LEGACY_REQUIRED": 3 + } + }, + "EnumType": { + "values": { + "ENUM_TYPE_UNKNOWN": 0, + "OPEN": 1, + "CLOSED": 2 + } + }, + "RepeatedFieldEncoding": { + "values": { + "REPEATED_FIELD_ENCODING_UNKNOWN": 0, + "PACKED": 1, + "EXPANDED": 2 + } + }, + "Utf8Validation": { + "values": { + "UTF8_VALIDATION_UNKNOWN": 0, + "VERIFY": 2, + "NONE": 3 + } + }, + "MessageEncoding": { + "values": { + "MESSAGE_ENCODING_UNKNOWN": 0, + "LENGTH_PREFIXED": 1, + "DELIMITED": 2 + } + }, + "JsonFormat": { + "values": { + "JSON_FORMAT_UNKNOWN": 0, + "ALLOW": 1, + "LEGACY_BEST_EFFORT": 2 + } + } + } + }, + "FeatureSetDefaults": { + "edition": "proto2", + "fields": { + "defaults": { + "rule": "repeated", + "type": "FeatureSetEditionDefault", + "id": 1 + }, + "minimumEdition": { + "type": "Edition", + "id": 4 + }, + "maximumEdition": { + "type": "Edition", + "id": 5 + } + }, + "nested": { + "FeatureSetEditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "features": { + "type": "FeatureSet", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "edition": "proto2", + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1, + "options": { + "packed": true + } + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2, + "options": { + "packed": true + } + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "edition": "proto2", + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1, + "options": { + "packed": true + } + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } + } + } + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "DoubleValue": { + "fields": { + "value": { + "type": "double", + "id": 1 + } + } + }, + "FloatValue": { + "fields": { + "value": { + "type": "float", + "id": 1 + } + } + }, + "Int64Value": { + "fields": { + "value": { + "type": "int64", + "id": 1 + } + } + }, + "UInt64Value": { + "fields": { + "value": { + "type": "uint64", + "id": 1 + } + } + }, + "Int32Value": { + "fields": { + "value": { + "type": "int32", + "id": 1 + } + } + }, + "UInt32Value": { + "fields": { + "value": { + "type": "uint32", + "id": 1 + } + } + }, + "BoolValue": { + "fields": { + "value": { + "type": "bool", + "id": 1 + } + } + }, + "StringValue": { + "fields": { + "value": { + "type": "string", + "id": 1 + } + } + }, + "BytesValue": { + "fields": { + "value": { + "type": "bytes", + "id": 1 + } + } + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "cloud.google.com/go/longrunning/autogen/longrunningpb;longrunningpb", + "java_multiple_files": true, + "java_outer_classname": "OperationsProto", + "java_package": "com.google.longrunning", + "php_namespace": "Google\\LongRunning" + }, + "nested": { + "operationInfo": { + "type": "google.longrunning.OperationInfo", + "id": 1049, + "extend": "google.protobuf.MethodOptions" + }, + "Operations": { + "options": { + "(google.api.default_host)": "longrunning.googleapis.com" + }, + "methods": { + "ListOperations": { + "requestType": "ListOperationsRequest", + "responseType": "ListOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{name=operations}", + "(google.api.method_signature)": "name,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations}" + } + }, + { + "(google.api.method_signature)": "name,filter" + } + ] + }, + "GetOperation": { + "requestType": "GetOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).get": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteOperation": { + "requestType": "DeleteOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CancelOperation": { + "requestType": "CancelOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=operations/**}:cancel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=operations/**}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "WaitOperation": { + "requestType": "WaitOperationRequest", + "responseType": "Operation" + } + } + }, + "Operation": { + "oneofs": { + "result": { + "oneof": [ + "error", + "response" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "metadata": { + "type": "google.protobuf.Any", + "id": 2 + }, + "done": { + "type": "bool", + "id": 3 + }, + "error": { + "type": "google.rpc.Status", + "id": 4 + }, + "response": { + "type": "google.protobuf.Any", + "id": 5 + } + } + }, + "GetOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListOperationsRequest": { + "fields": { + "name": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListOperationsResponse": { + "fields": { + "operations": { + "rule": "repeated", + "type": "Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CancelOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DeleteOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "WaitOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "OperationInfo": { + "fields": { + "responseType": { + "type": "string", + "id": 1 + }, + "metadataType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1/adaptation.create_custom_class.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1/adaptation.create_custom_class.js new file mode 100644 index 00000000000..f7a91e2c9da --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1/adaptation.create_custom_class.js @@ -0,0 +1,81 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, customClassId, customClass) { + // [START speech_v1_generated_Adaptation_CreateCustomClass_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource where this custom class will be created. + * Format: + * `projects/{project}/locations/{location}/customClasses` + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * regional endpoint (https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + */ + // const parent = 'abc123' + /** + * Required. The ID to use for the custom class, which will become the final + * component of the custom class' resource name. + * This value should restrict to letters, numbers, and hyphens, with the first + * character a letter, the last a letter or a number, and be 4-63 characters. + */ + // const customClassId = 'abc123' + /** + * Required. The custom class to create. + */ + // const customClass = {} + + // Imports the Speech library + const {AdaptationClient} = require('@google-cloud/speech').v1; + + // Instantiates a client + const speechClient = new AdaptationClient(); + + async function callCreateCustomClass() { + // Construct request + const request = { + parent, + customClassId, + customClass, + }; + + // Run request + const response = await speechClient.createCustomClass(request); + console.log(response); + } + + callCreateCustomClass(); + // [END speech_v1_generated_Adaptation_CreateCustomClass_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1/adaptation.create_phrase_set.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1/adaptation.create_phrase_set.js new file mode 100644 index 00000000000..ad7724130bc --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1/adaptation.create_phrase_set.js @@ -0,0 +1,81 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, phraseSetId, phraseSet) { + // [START speech_v1_generated_Adaptation_CreatePhraseSet_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource where this phrase set will be created. + * Format: + * `projects/{project}/locations/{location}` + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * regional endpoint (https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + */ + // const parent = 'abc123' + /** + * Required. The ID to use for the phrase set, which will become the final + * component of the phrase set's resource name. + * This value should restrict to letters, numbers, and hyphens, with the first + * character a letter, the last a letter or a number, and be 4-63 characters. + */ + // const phraseSetId = 'abc123' + /** + * Required. The phrase set to create. + */ + // const phraseSet = {} + + // Imports the Speech library + const {AdaptationClient} = require('@google-cloud/speech').v1; + + // Instantiates a client + const speechClient = new AdaptationClient(); + + async function callCreatePhraseSet() { + // Construct request + const request = { + parent, + phraseSetId, + phraseSet, + }; + + // Run request + const response = await speechClient.createPhraseSet(request); + console.log(response); + } + + callCreatePhraseSet(); + // [END speech_v1_generated_Adaptation_CreatePhraseSet_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1/adaptation.delete_custom_class.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1/adaptation.delete_custom_class.js new file mode 100644 index 00000000000..fb804f9fead --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1/adaptation.delete_custom_class.js @@ -0,0 +1,67 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START speech_v1_generated_Adaptation_DeleteCustomClass_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the custom class to delete. Format: + * `projects/{project}/locations/{location}/customClasses/{custom_class}` + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * regional endpoint (https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + */ + // const name = 'abc123' + + // Imports the Speech library + const {AdaptationClient} = require('@google-cloud/speech').v1; + + // Instantiates a client + const speechClient = new AdaptationClient(); + + async function callDeleteCustomClass() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await speechClient.deleteCustomClass(request); + console.log(response); + } + + callDeleteCustomClass(); + // [END speech_v1_generated_Adaptation_DeleteCustomClass_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1/adaptation.delete_phrase_set.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1/adaptation.delete_phrase_set.js new file mode 100644 index 00000000000..d9d6a9c9e2b --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1/adaptation.delete_phrase_set.js @@ -0,0 +1,62 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START speech_v1_generated_Adaptation_DeletePhraseSet_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the phrase set to delete. Format: + * `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + */ + // const name = 'abc123' + + // Imports the Speech library + const {AdaptationClient} = require('@google-cloud/speech').v1; + + // Instantiates a client + const speechClient = new AdaptationClient(); + + async function callDeletePhraseSet() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await speechClient.deletePhraseSet(request); + console.log(response); + } + + callDeletePhraseSet(); + // [END speech_v1_generated_Adaptation_DeletePhraseSet_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1/adaptation.get_custom_class.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1/adaptation.get_custom_class.js new file mode 100644 index 00000000000..0ecc0638127 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1/adaptation.get_custom_class.js @@ -0,0 +1,62 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START speech_v1_generated_Adaptation_GetCustomClass_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the custom class to retrieve. Format: + * `projects/{project}/locations/{location}/customClasses/{custom_class}` + */ + // const name = 'abc123' + + // Imports the Speech library + const {AdaptationClient} = require('@google-cloud/speech').v1; + + // Instantiates a client + const speechClient = new AdaptationClient(); + + async function callGetCustomClass() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await speechClient.getCustomClass(request); + console.log(response); + } + + callGetCustomClass(); + // [END speech_v1_generated_Adaptation_GetCustomClass_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1/adaptation.get_phrase_set.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1/adaptation.get_phrase_set.js new file mode 100644 index 00000000000..cbed15e15a0 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1/adaptation.get_phrase_set.js @@ -0,0 +1,67 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START speech_v1_generated_Adaptation_GetPhraseSet_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the phrase set to retrieve. Format: + * `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * regional endpoint (https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + */ + // const name = 'abc123' + + // Imports the Speech library + const {AdaptationClient} = require('@google-cloud/speech').v1; + + // Instantiates a client + const speechClient = new AdaptationClient(); + + async function callGetPhraseSet() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await speechClient.getPhraseSet(request); + console.log(response); + } + + callGetPhraseSet(); + // [END speech_v1_generated_Adaptation_GetPhraseSet_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1/adaptation.list_custom_classes.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1/adaptation.list_custom_classes.js new file mode 100644 index 00000000000..b0346689174 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1/adaptation.list_custom_classes.js @@ -0,0 +1,83 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START speech_v1_generated_Adaptation_ListCustomClasses_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent, which owns this collection of custom classes. Format: + * `projects/{project}/locations/{location}/customClasses` + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * regional endpoint (https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + */ + // const parent = 'abc123' + /** + * The maximum number of custom classes to return. The service may return + * fewer than this value. If unspecified, at most 50 custom classes will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListCustomClass` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListCustomClass` must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Speech library + const {AdaptationClient} = require('@google-cloud/speech').v1; + + // Instantiates a client + const speechClient = new AdaptationClient(); + + async function callListCustomClasses() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = speechClient.listCustomClassesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListCustomClasses(); + // [END speech_v1_generated_Adaptation_ListCustomClasses_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1/adaptation.list_phrase_set.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1/adaptation.list_phrase_set.js new file mode 100644 index 00000000000..1d26f21ab37 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1/adaptation.list_phrase_set.js @@ -0,0 +1,83 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START speech_v1_generated_Adaptation_ListPhraseSet_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent, which owns this collection of phrase set. Format: + * `projects/{project}/locations/{location}` + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * regional endpoint (https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + */ + // const parent = 'abc123' + /** + * The maximum number of phrase sets to return. The service may return + * fewer than this value. If unspecified, at most 50 phrase sets will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListPhraseSet` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListPhraseSet` must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Speech library + const {AdaptationClient} = require('@google-cloud/speech').v1; + + // Instantiates a client + const speechClient = new AdaptationClient(); + + async function callListPhraseSet() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = speechClient.listPhraseSetAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListPhraseSet(); + // [END speech_v1_generated_Adaptation_ListPhraseSet_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1/adaptation.update_custom_class.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1/adaptation.update_custom_class.js new file mode 100644 index 00000000000..54b2bbbcfa4 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1/adaptation.update_custom_class.js @@ -0,0 +1,73 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(customClass) { + // [START speech_v1_generated_Adaptation_UpdateCustomClass_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The custom class to update. + * The custom class's `name` field is used to identify the custom class to be + * updated. Format: + * `projects/{project}/locations/{location}/customClasses/{custom_class}` + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * regional endpoint (https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + */ + // const customClass = {} + /** + * The list of fields to be updated. + */ + // const updateMask = {} + + // Imports the Speech library + const {AdaptationClient} = require('@google-cloud/speech').v1; + + // Instantiates a client + const speechClient = new AdaptationClient(); + + async function callUpdateCustomClass() { + // Construct request + const request = { + customClass, + }; + + // Run request + const response = await speechClient.updateCustomClass(request); + console.log(response); + } + + callUpdateCustomClass(); + // [END speech_v1_generated_Adaptation_UpdateCustomClass_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1/adaptation.update_phrase_set.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1/adaptation.update_phrase_set.js new file mode 100644 index 00000000000..8bb22ee893f --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1/adaptation.update_phrase_set.js @@ -0,0 +1,73 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(phraseSet) { + // [START speech_v1_generated_Adaptation_UpdatePhraseSet_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The phrase set to update. + * The phrase set's `name` field is used to identify the set to be + * updated. Format: + * `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * regional endpoint (https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + */ + // const phraseSet = {} + /** + * The list of fields to be updated. + */ + // const updateMask = {} + + // Imports the Speech library + const {AdaptationClient} = require('@google-cloud/speech').v1; + + // Instantiates a client + const speechClient = new AdaptationClient(); + + async function callUpdatePhraseSet() { + // Construct request + const request = { + phraseSet, + }; + + // Run request + const response = await speechClient.updatePhraseSet(request); + console.log(response); + } + + callUpdatePhraseSet(); + // [END speech_v1_generated_Adaptation_UpdatePhraseSet_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1/snippet_metadata_google.cloud.speech.v1.json b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1/snippet_metadata_google.cloud.speech.v1.json new file mode 100644 index 00000000000..dee670aa1b6 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1/snippet_metadata_google.cloud.speech.v1.json @@ -0,0 +1,591 @@ +{ + "clientLibrary": { + "name": "nodejs-speech", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.speech.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "speech_v1_generated_Adaptation_CreatePhraseSet_async", + "title": "Adaptation createPhraseSet Sample", + "origin": "API_DEFINITION", + "description": " Create a set of phrase hints. Each item in the set can be a single word or a multi-word phrase. The items in the PhraseSet are favored by the recognition model when you send a call that includes the PhraseSet.", + "canonical": true, + "file": "adaptation.create_phrase_set.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreatePhraseSet", + "fullName": "google.cloud.speech.v1.Adaptation.CreatePhraseSet", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "phrase_set_id", + "type": "TYPE_STRING" + }, + { + "name": "phrase_set", + "type": ".google.cloud.speech.v1.PhraseSet" + } + ], + "resultType": ".google.cloud.speech.v1.PhraseSet", + "client": { + "shortName": "AdaptationClient", + "fullName": "google.cloud.speech.v1.AdaptationClient" + }, + "method": { + "shortName": "CreatePhraseSet", + "fullName": "google.cloud.speech.v1.Adaptation.CreatePhraseSet", + "service": { + "shortName": "Adaptation", + "fullName": "google.cloud.speech.v1.Adaptation" + } + } + } + }, + { + "regionTag": "speech_v1_generated_Adaptation_GetPhraseSet_async", + "title": "Adaptation getPhraseSet Sample", + "origin": "API_DEFINITION", + "description": " Get a phrase set.", + "canonical": true, + "file": "adaptation.get_phrase_set.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetPhraseSet", + "fullName": "google.cloud.speech.v1.Adaptation.GetPhraseSet", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.speech.v1.PhraseSet", + "client": { + "shortName": "AdaptationClient", + "fullName": "google.cloud.speech.v1.AdaptationClient" + }, + "method": { + "shortName": "GetPhraseSet", + "fullName": "google.cloud.speech.v1.Adaptation.GetPhraseSet", + "service": { + "shortName": "Adaptation", + "fullName": "google.cloud.speech.v1.Adaptation" + } + } + } + }, + { + "regionTag": "speech_v1_generated_Adaptation_ListPhraseSet_async", + "title": "Adaptation listPhraseSet Sample", + "origin": "API_DEFINITION", + "description": " List phrase sets.", + "canonical": true, + "file": "adaptation.list_phrase_set.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListPhraseSet", + "fullName": "google.cloud.speech.v1.Adaptation.ListPhraseSet", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.speech.v1.ListPhraseSetResponse", + "client": { + "shortName": "AdaptationClient", + "fullName": "google.cloud.speech.v1.AdaptationClient" + }, + "method": { + "shortName": "ListPhraseSet", + "fullName": "google.cloud.speech.v1.Adaptation.ListPhraseSet", + "service": { + "shortName": "Adaptation", + "fullName": "google.cloud.speech.v1.Adaptation" + } + } + } + }, + { + "regionTag": "speech_v1_generated_Adaptation_UpdatePhraseSet_async", + "title": "Adaptation updatePhraseSet Sample", + "origin": "API_DEFINITION", + "description": " Update a phrase set.", + "canonical": true, + "file": "adaptation.update_phrase_set.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdatePhraseSet", + "fullName": "google.cloud.speech.v1.Adaptation.UpdatePhraseSet", + "async": true, + "parameters": [ + { + "name": "phrase_set", + "type": ".google.cloud.speech.v1.PhraseSet" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.speech.v1.PhraseSet", + "client": { + "shortName": "AdaptationClient", + "fullName": "google.cloud.speech.v1.AdaptationClient" + }, + "method": { + "shortName": "UpdatePhraseSet", + "fullName": "google.cloud.speech.v1.Adaptation.UpdatePhraseSet", + "service": { + "shortName": "Adaptation", + "fullName": "google.cloud.speech.v1.Adaptation" + } + } + } + }, + { + "regionTag": "speech_v1_generated_Adaptation_DeletePhraseSet_async", + "title": "Adaptation deletePhraseSet Sample", + "origin": "API_DEFINITION", + "description": " Delete a phrase set.", + "canonical": true, + "file": "adaptation.delete_phrase_set.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeletePhraseSet", + "fullName": "google.cloud.speech.v1.Adaptation.DeletePhraseSet", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AdaptationClient", + "fullName": "google.cloud.speech.v1.AdaptationClient" + }, + "method": { + "shortName": "DeletePhraseSet", + "fullName": "google.cloud.speech.v1.Adaptation.DeletePhraseSet", + "service": { + "shortName": "Adaptation", + "fullName": "google.cloud.speech.v1.Adaptation" + } + } + } + }, + { + "regionTag": "speech_v1_generated_Adaptation_CreateCustomClass_async", + "title": "Adaptation createCustomClass Sample", + "origin": "API_DEFINITION", + "description": " Create a custom class.", + "canonical": true, + "file": "adaptation.create_custom_class.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateCustomClass", + "fullName": "google.cloud.speech.v1.Adaptation.CreateCustomClass", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "custom_class_id", + "type": "TYPE_STRING" + }, + { + "name": "custom_class", + "type": ".google.cloud.speech.v1.CustomClass" + } + ], + "resultType": ".google.cloud.speech.v1.CustomClass", + "client": { + "shortName": "AdaptationClient", + "fullName": "google.cloud.speech.v1.AdaptationClient" + }, + "method": { + "shortName": "CreateCustomClass", + "fullName": "google.cloud.speech.v1.Adaptation.CreateCustomClass", + "service": { + "shortName": "Adaptation", + "fullName": "google.cloud.speech.v1.Adaptation" + } + } + } + }, + { + "regionTag": "speech_v1_generated_Adaptation_GetCustomClass_async", + "title": "Adaptation getCustomClass Sample", + "origin": "API_DEFINITION", + "description": " Get a custom class.", + "canonical": true, + "file": "adaptation.get_custom_class.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetCustomClass", + "fullName": "google.cloud.speech.v1.Adaptation.GetCustomClass", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.speech.v1.CustomClass", + "client": { + "shortName": "AdaptationClient", + "fullName": "google.cloud.speech.v1.AdaptationClient" + }, + "method": { + "shortName": "GetCustomClass", + "fullName": "google.cloud.speech.v1.Adaptation.GetCustomClass", + "service": { + "shortName": "Adaptation", + "fullName": "google.cloud.speech.v1.Adaptation" + } + } + } + }, + { + "regionTag": "speech_v1_generated_Adaptation_ListCustomClasses_async", + "title": "Adaptation listCustomClasses Sample", + "origin": "API_DEFINITION", + "description": " List custom classes.", + "canonical": true, + "file": "adaptation.list_custom_classes.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListCustomClasses", + "fullName": "google.cloud.speech.v1.Adaptation.ListCustomClasses", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.speech.v1.ListCustomClassesResponse", + "client": { + "shortName": "AdaptationClient", + "fullName": "google.cloud.speech.v1.AdaptationClient" + }, + "method": { + "shortName": "ListCustomClasses", + "fullName": "google.cloud.speech.v1.Adaptation.ListCustomClasses", + "service": { + "shortName": "Adaptation", + "fullName": "google.cloud.speech.v1.Adaptation" + } + } + } + }, + { + "regionTag": "speech_v1_generated_Adaptation_UpdateCustomClass_async", + "title": "Adaptation updateCustomClass Sample", + "origin": "API_DEFINITION", + "description": " Update a custom class.", + "canonical": true, + "file": "adaptation.update_custom_class.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateCustomClass", + "fullName": "google.cloud.speech.v1.Adaptation.UpdateCustomClass", + "async": true, + "parameters": [ + { + "name": "custom_class", + "type": ".google.cloud.speech.v1.CustomClass" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.speech.v1.CustomClass", + "client": { + "shortName": "AdaptationClient", + "fullName": "google.cloud.speech.v1.AdaptationClient" + }, + "method": { + "shortName": "UpdateCustomClass", + "fullName": "google.cloud.speech.v1.Adaptation.UpdateCustomClass", + "service": { + "shortName": "Adaptation", + "fullName": "google.cloud.speech.v1.Adaptation" + } + } + } + }, + { + "regionTag": "speech_v1_generated_Adaptation_DeleteCustomClass_async", + "title": "Adaptation deleteCustomClass Sample", + "origin": "API_DEFINITION", + "description": " Delete a custom class.", + "canonical": true, + "file": "adaptation.delete_custom_class.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteCustomClass", + "fullName": "google.cloud.speech.v1.Adaptation.DeleteCustomClass", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AdaptationClient", + "fullName": "google.cloud.speech.v1.AdaptationClient" + }, + "method": { + "shortName": "DeleteCustomClass", + "fullName": "google.cloud.speech.v1.Adaptation.DeleteCustomClass", + "service": { + "shortName": "Adaptation", + "fullName": "google.cloud.speech.v1.Adaptation" + } + } + } + }, + { + "regionTag": "speech_v1_generated_Speech_Recognize_async", + "title": "Adaptation recognize Sample", + "origin": "API_DEFINITION", + "description": " Performs synchronous speech recognition: receive results after all audio has been sent and processed.", + "canonical": true, + "file": "speech.recognize.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "Recognize", + "fullName": "google.cloud.speech.v1.Speech.Recognize", + "async": true, + "parameters": [ + { + "name": "config", + "type": ".google.cloud.speech.v1.RecognitionConfig" + }, + { + "name": "audio", + "type": ".google.cloud.speech.v1.RecognitionAudio" + } + ], + "resultType": ".google.cloud.speech.v1.RecognizeResponse", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v1.SpeechClient" + }, + "method": { + "shortName": "Recognize", + "fullName": "google.cloud.speech.v1.Speech.Recognize", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v1.Speech" + } + } + } + }, + { + "regionTag": "speech_v1_generated_Speech_LongRunningRecognize_async", + "title": "Adaptation longRunningRecognize Sample", + "origin": "API_DEFINITION", + "description": " Performs asynchronous speech recognition: receive results via the google.longrunning.Operations interface. Returns either an `Operation.error` or an `Operation.response` which contains a `LongRunningRecognizeResponse` message. For more information on asynchronous speech recognition, see the [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize).", + "canonical": true, + "file": "speech.long_running_recognize.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "LongRunningRecognize", + "fullName": "google.cloud.speech.v1.Speech.LongRunningRecognize", + "async": true, + "parameters": [ + { + "name": "config", + "type": ".google.cloud.speech.v1.RecognitionConfig" + }, + { + "name": "audio", + "type": ".google.cloud.speech.v1.RecognitionAudio" + }, + { + "name": "output_config", + "type": ".google.cloud.speech.v1.TranscriptOutputConfig" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v1.SpeechClient" + }, + "method": { + "shortName": "LongRunningRecognize", + "fullName": "google.cloud.speech.v1.Speech.LongRunningRecognize", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v1.Speech" + } + } + } + }, + { + "regionTag": "speech_v1_generated_Speech_StreamingRecognize_async", + "title": "Adaptation streamingRecognize Sample", + "origin": "API_DEFINITION", + "description": " Performs bidirectional streaming speech recognition: receive results while sending audio. This method is only available via the gRPC API (not REST).", + "canonical": true, + "file": "speech.streaming_recognize.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "StreamingRecognize", + "fullName": "google.cloud.speech.v1.Speech.StreamingRecognize", + "async": true, + "parameters": [ + { + "name": "streaming_config", + "type": ".google.cloud.speech.v1.StreamingRecognitionConfig" + }, + { + "name": "audio_content", + "type": "TYPE_BYTES" + } + ], + "resultType": ".google.cloud.speech.v1.StreamingRecognizeResponse", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v1.SpeechClient" + }, + "method": { + "shortName": "StreamingRecognize", + "fullName": "google.cloud.speech.v1.Speech.StreamingRecognize", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v1.Speech" + } + } + } + } + ] +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1/speech.long_running_recognize.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1/speech.long_running_recognize.js new file mode 100644 index 00000000000..f2887a67c53 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1/speech.long_running_recognize.js @@ -0,0 +1,72 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(config, audio) { + // [START speech_v1_generated_Speech_LongRunningRecognize_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Provides information to the recognizer that specifies how to + * process the request. + */ + // const config = {} + /** + * Required. The audio data to be recognized. + */ + // const audio = {} + /** + * Optional. Specifies an optional destination for the recognition results. + */ + // const outputConfig = {} + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v1; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callLongRunningRecognize() { + // Construct request + const request = { + config, + audio, + }; + + // Run request + const [operation] = await speechClient.longRunningRecognize(request); + const [response] = await operation.promise(); + console.log(response); + } + + callLongRunningRecognize(); + // [END speech_v1_generated_Speech_LongRunningRecognize_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1/speech.recognize.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1/speech.recognize.js new file mode 100644 index 00000000000..1fdc0c79122 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1/speech.recognize.js @@ -0,0 +1,67 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(config, audio) { + // [START speech_v1_generated_Speech_Recognize_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Provides information to the recognizer that specifies how to + * process the request. + */ + // const config = {} + /** + * Required. The audio data to be recognized. + */ + // const audio = {} + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v1; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callRecognize() { + // Construct request + const request = { + config, + audio, + }; + + // Run request + const response = await speechClient.recognize(request); + console.log(response); + } + + callRecognize(); + // [END speech_v1_generated_Speech_Recognize_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1/speech.streaming_recognize.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1/speech.streaming_recognize.js new file mode 100644 index 00000000000..7e29fc0819c --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1/speech.streaming_recognize.js @@ -0,0 +1,77 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START speech_v1_generated_Speech_StreamingRecognize_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Provides information to the recognizer that specifies how to process the + * request. The first `StreamingRecognizeRequest` message must contain a + * `streaming_config` message. + */ + // const streamingConfig = {} + /** + * The audio data to be recognized. Sequential chunks of audio data are sent + * in sequential `StreamingRecognizeRequest` messages. The first + * `StreamingRecognizeRequest` message must not contain `audio_content` data + * and all subsequent `StreamingRecognizeRequest` messages must contain + * `audio_content` data. The audio bytes must be encoded as specified in + * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a + * pure binary representation (not base64). See + * content limits (https://cloud.google.com/speech-to-text/quotas#content). + */ + // const audioContent = Buffer.from('string') + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v1; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callStreamingRecognize() { + // Construct request + const request = { + }; + + // Run request + const stream = await speechClient.streamingRecognize(); + stream.on('data', (response) => { console.log(response) }); + stream.on('error', (err) => { throw(err) }); + stream.on('end', () => { /* API call completed */ }); + stream.write(request); + stream.end(); + } + + callStreamingRecognize(); + // [END speech_v1_generated_Speech_StreamingRecognize_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1p1beta1/adaptation.create_custom_class.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1p1beta1/adaptation.create_custom_class.js new file mode 100644 index 00000000000..dad2dd5b94f --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1p1beta1/adaptation.create_custom_class.js @@ -0,0 +1,81 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, customClassId, customClass) { + // [START speech_v1p1beta1_generated_Adaptation_CreateCustomClass_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource where this custom class will be created. + * Format: + * `projects/{project}/locations/{location}/customClasses` + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * regional endpoint (https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + */ + // const parent = 'abc123' + /** + * Required. The ID to use for the custom class, which will become the final + * component of the custom class' resource name. + * This value should restrict to letters, numbers, and hyphens, with the first + * character a letter, the last a letter or a number, and be 4-63 characters. + */ + // const customClassId = 'abc123' + /** + * Required. The custom class to create. + */ + // const customClass = {} + + // Imports the Speech library + const {AdaptationClient} = require('@google-cloud/speech').v1p1beta1; + + // Instantiates a client + const speechClient = new AdaptationClient(); + + async function callCreateCustomClass() { + // Construct request + const request = { + parent, + customClassId, + customClass, + }; + + // Run request + const response = await speechClient.createCustomClass(request); + console.log(response); + } + + callCreateCustomClass(); + // [END speech_v1p1beta1_generated_Adaptation_CreateCustomClass_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1p1beta1/adaptation.create_phrase_set.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1p1beta1/adaptation.create_phrase_set.js new file mode 100644 index 00000000000..bd57fe02ef4 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1p1beta1/adaptation.create_phrase_set.js @@ -0,0 +1,81 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, phraseSetId, phraseSet) { + // [START speech_v1p1beta1_generated_Adaptation_CreatePhraseSet_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource where this phrase set will be created. + * Format: + * `projects/{project}/locations/{location}` + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * regional endpoint (https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + */ + // const parent = 'abc123' + /** + * Required. The ID to use for the phrase set, which will become the final + * component of the phrase set's resource name. + * This value should restrict to letters, numbers, and hyphens, with the first + * character a letter, the last a letter or a number, and be 4-63 characters. + */ + // const phraseSetId = 'abc123' + /** + * Required. The phrase set to create. + */ + // const phraseSet = {} + + // Imports the Speech library + const {AdaptationClient} = require('@google-cloud/speech').v1p1beta1; + + // Instantiates a client + const speechClient = new AdaptationClient(); + + async function callCreatePhraseSet() { + // Construct request + const request = { + parent, + phraseSetId, + phraseSet, + }; + + // Run request + const response = await speechClient.createPhraseSet(request); + console.log(response); + } + + callCreatePhraseSet(); + // [END speech_v1p1beta1_generated_Adaptation_CreatePhraseSet_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1p1beta1/adaptation.delete_custom_class.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1p1beta1/adaptation.delete_custom_class.js new file mode 100644 index 00000000000..d87b51cc5db --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1p1beta1/adaptation.delete_custom_class.js @@ -0,0 +1,67 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START speech_v1p1beta1_generated_Adaptation_DeleteCustomClass_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the custom class to delete. Format: + * `projects/{project}/locations/{location}/customClasses/{custom_class}` + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * regional endpoint (https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + */ + // const name = 'abc123' + + // Imports the Speech library + const {AdaptationClient} = require('@google-cloud/speech').v1p1beta1; + + // Instantiates a client + const speechClient = new AdaptationClient(); + + async function callDeleteCustomClass() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await speechClient.deleteCustomClass(request); + console.log(response); + } + + callDeleteCustomClass(); + // [END speech_v1p1beta1_generated_Adaptation_DeleteCustomClass_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1p1beta1/adaptation.delete_phrase_set.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1p1beta1/adaptation.delete_phrase_set.js new file mode 100644 index 00000000000..de932c57949 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1p1beta1/adaptation.delete_phrase_set.js @@ -0,0 +1,62 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START speech_v1p1beta1_generated_Adaptation_DeletePhraseSet_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the phrase set to delete. Format: + * `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + */ + // const name = 'abc123' + + // Imports the Speech library + const {AdaptationClient} = require('@google-cloud/speech').v1p1beta1; + + // Instantiates a client + const speechClient = new AdaptationClient(); + + async function callDeletePhraseSet() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await speechClient.deletePhraseSet(request); + console.log(response); + } + + callDeletePhraseSet(); + // [END speech_v1p1beta1_generated_Adaptation_DeletePhraseSet_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1p1beta1/adaptation.get_custom_class.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1p1beta1/adaptation.get_custom_class.js new file mode 100644 index 00000000000..8b4ed02d0b4 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1p1beta1/adaptation.get_custom_class.js @@ -0,0 +1,62 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START speech_v1p1beta1_generated_Adaptation_GetCustomClass_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the custom class to retrieve. Format: + * `projects/{project}/locations/{location}/customClasses/{custom_class}` + */ + // const name = 'abc123' + + // Imports the Speech library + const {AdaptationClient} = require('@google-cloud/speech').v1p1beta1; + + // Instantiates a client + const speechClient = new AdaptationClient(); + + async function callGetCustomClass() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await speechClient.getCustomClass(request); + console.log(response); + } + + callGetCustomClass(); + // [END speech_v1p1beta1_generated_Adaptation_GetCustomClass_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1p1beta1/adaptation.get_phrase_set.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1p1beta1/adaptation.get_phrase_set.js new file mode 100644 index 00000000000..ef0d6e0ac0b --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1p1beta1/adaptation.get_phrase_set.js @@ -0,0 +1,67 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START speech_v1p1beta1_generated_Adaptation_GetPhraseSet_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the phrase set to retrieve. Format: + * `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * regional endpoint (https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + */ + // const name = 'abc123' + + // Imports the Speech library + const {AdaptationClient} = require('@google-cloud/speech').v1p1beta1; + + // Instantiates a client + const speechClient = new AdaptationClient(); + + async function callGetPhraseSet() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await speechClient.getPhraseSet(request); + console.log(response); + } + + callGetPhraseSet(); + // [END speech_v1p1beta1_generated_Adaptation_GetPhraseSet_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1p1beta1/adaptation.list_custom_classes.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1p1beta1/adaptation.list_custom_classes.js new file mode 100644 index 00000000000..d02480a5b5c --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1p1beta1/adaptation.list_custom_classes.js @@ -0,0 +1,83 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START speech_v1p1beta1_generated_Adaptation_ListCustomClasses_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent, which owns this collection of custom classes. Format: + * `projects/{project}/locations/{location}/customClasses` + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * regional endpoint (https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + */ + // const parent = 'abc123' + /** + * The maximum number of custom classes to return. The service may return + * fewer than this value. If unspecified, at most 50 custom classes will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListCustomClass` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListCustomClass` must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Speech library + const {AdaptationClient} = require('@google-cloud/speech').v1p1beta1; + + // Instantiates a client + const speechClient = new AdaptationClient(); + + async function callListCustomClasses() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = speechClient.listCustomClassesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListCustomClasses(); + // [END speech_v1p1beta1_generated_Adaptation_ListCustomClasses_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1p1beta1/adaptation.list_phrase_set.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1p1beta1/adaptation.list_phrase_set.js new file mode 100644 index 00000000000..e3d6ddb46ef --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1p1beta1/adaptation.list_phrase_set.js @@ -0,0 +1,83 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START speech_v1p1beta1_generated_Adaptation_ListPhraseSet_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent, which owns this collection of phrase set. Format: + * `projects/{project}/locations/{location}` + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * regional endpoint (https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + */ + // const parent = 'abc123' + /** + * The maximum number of phrase sets to return. The service may return + * fewer than this value. If unspecified, at most 50 phrase sets will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListPhraseSet` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListPhraseSet` must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Speech library + const {AdaptationClient} = require('@google-cloud/speech').v1p1beta1; + + // Instantiates a client + const speechClient = new AdaptationClient(); + + async function callListPhraseSet() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = speechClient.listPhraseSetAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListPhraseSet(); + // [END speech_v1p1beta1_generated_Adaptation_ListPhraseSet_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1p1beta1/adaptation.update_custom_class.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1p1beta1/adaptation.update_custom_class.js new file mode 100644 index 00000000000..a76a29ded99 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1p1beta1/adaptation.update_custom_class.js @@ -0,0 +1,73 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(customClass) { + // [START speech_v1p1beta1_generated_Adaptation_UpdateCustomClass_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The custom class to update. + * The custom class's `name` field is used to identify the custom class to be + * updated. Format: + * `projects/{project}/locations/{location}/customClasses/{custom_class}` + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * regional endpoint (https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + */ + // const customClass = {} + /** + * The list of fields to be updated. + */ + // const updateMask = {} + + // Imports the Speech library + const {AdaptationClient} = require('@google-cloud/speech').v1p1beta1; + + // Instantiates a client + const speechClient = new AdaptationClient(); + + async function callUpdateCustomClass() { + // Construct request + const request = { + customClass, + }; + + // Run request + const response = await speechClient.updateCustomClass(request); + console.log(response); + } + + callUpdateCustomClass(); + // [END speech_v1p1beta1_generated_Adaptation_UpdateCustomClass_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1p1beta1/adaptation.update_phrase_set.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1p1beta1/adaptation.update_phrase_set.js new file mode 100644 index 00000000000..1c63d468db8 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1p1beta1/adaptation.update_phrase_set.js @@ -0,0 +1,73 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(phraseSet) { + // [START speech_v1p1beta1_generated_Adaptation_UpdatePhraseSet_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The phrase set to update. + * The phrase set's `name` field is used to identify the set to be + * updated. Format: + * `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * regional endpoint (https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + */ + // const phraseSet = {} + /** + * The list of fields to be updated. + */ + // const updateMask = {} + + // Imports the Speech library + const {AdaptationClient} = require('@google-cloud/speech').v1p1beta1; + + // Instantiates a client + const speechClient = new AdaptationClient(); + + async function callUpdatePhraseSet() { + // Construct request + const request = { + phraseSet, + }; + + // Run request + const response = await speechClient.updatePhraseSet(request); + console.log(response); + } + + callUpdatePhraseSet(); + // [END speech_v1p1beta1_generated_Adaptation_UpdatePhraseSet_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1p1beta1/snippet_metadata_google.cloud.speech.v1p1beta1.json b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1p1beta1/snippet_metadata_google.cloud.speech.v1p1beta1.json new file mode 100644 index 00000000000..c50b1efcefd --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1p1beta1/snippet_metadata_google.cloud.speech.v1p1beta1.json @@ -0,0 +1,591 @@ +{ + "clientLibrary": { + "name": "nodejs-speech", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.speech.v1p1beta1", + "version": "v1p1beta1" + } + ] + }, + "snippets": [ + { + "regionTag": "speech_v1p1beta1_generated_Adaptation_CreatePhraseSet_async", + "title": "Adaptation createPhraseSet Sample", + "origin": "API_DEFINITION", + "description": " Create a set of phrase hints. Each item in the set can be a single word or a multi-word phrase. The items in the PhraseSet are favored by the recognition model when you send a call that includes the PhraseSet.", + "canonical": true, + "file": "adaptation.create_phrase_set.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreatePhraseSet", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation.CreatePhraseSet", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "phrase_set_id", + "type": "TYPE_STRING" + }, + { + "name": "phrase_set", + "type": ".google.cloud.speech.v1p1beta1.PhraseSet" + } + ], + "resultType": ".google.cloud.speech.v1p1beta1.PhraseSet", + "client": { + "shortName": "AdaptationClient", + "fullName": "google.cloud.speech.v1p1beta1.AdaptationClient" + }, + "method": { + "shortName": "CreatePhraseSet", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation.CreatePhraseSet", + "service": { + "shortName": "Adaptation", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation" + } + } + } + }, + { + "regionTag": "speech_v1p1beta1_generated_Adaptation_GetPhraseSet_async", + "title": "Adaptation getPhraseSet Sample", + "origin": "API_DEFINITION", + "description": " Get a phrase set.", + "canonical": true, + "file": "adaptation.get_phrase_set.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetPhraseSet", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation.GetPhraseSet", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.speech.v1p1beta1.PhraseSet", + "client": { + "shortName": "AdaptationClient", + "fullName": "google.cloud.speech.v1p1beta1.AdaptationClient" + }, + "method": { + "shortName": "GetPhraseSet", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation.GetPhraseSet", + "service": { + "shortName": "Adaptation", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation" + } + } + } + }, + { + "regionTag": "speech_v1p1beta1_generated_Adaptation_ListPhraseSet_async", + "title": "Adaptation listPhraseSet Sample", + "origin": "API_DEFINITION", + "description": " List phrase sets.", + "canonical": true, + "file": "adaptation.list_phrase_set.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListPhraseSet", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation.ListPhraseSet", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.speech.v1p1beta1.ListPhraseSetResponse", + "client": { + "shortName": "AdaptationClient", + "fullName": "google.cloud.speech.v1p1beta1.AdaptationClient" + }, + "method": { + "shortName": "ListPhraseSet", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation.ListPhraseSet", + "service": { + "shortName": "Adaptation", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation" + } + } + } + }, + { + "regionTag": "speech_v1p1beta1_generated_Adaptation_UpdatePhraseSet_async", + "title": "Adaptation updatePhraseSet Sample", + "origin": "API_DEFINITION", + "description": " Update a phrase set.", + "canonical": true, + "file": "adaptation.update_phrase_set.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdatePhraseSet", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation.UpdatePhraseSet", + "async": true, + "parameters": [ + { + "name": "phrase_set", + "type": ".google.cloud.speech.v1p1beta1.PhraseSet" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.speech.v1p1beta1.PhraseSet", + "client": { + "shortName": "AdaptationClient", + "fullName": "google.cloud.speech.v1p1beta1.AdaptationClient" + }, + "method": { + "shortName": "UpdatePhraseSet", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation.UpdatePhraseSet", + "service": { + "shortName": "Adaptation", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation" + } + } + } + }, + { + "regionTag": "speech_v1p1beta1_generated_Adaptation_DeletePhraseSet_async", + "title": "Adaptation deletePhraseSet Sample", + "origin": "API_DEFINITION", + "description": " Delete a phrase set.", + "canonical": true, + "file": "adaptation.delete_phrase_set.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeletePhraseSet", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation.DeletePhraseSet", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AdaptationClient", + "fullName": "google.cloud.speech.v1p1beta1.AdaptationClient" + }, + "method": { + "shortName": "DeletePhraseSet", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation.DeletePhraseSet", + "service": { + "shortName": "Adaptation", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation" + } + } + } + }, + { + "regionTag": "speech_v1p1beta1_generated_Adaptation_CreateCustomClass_async", + "title": "Adaptation createCustomClass Sample", + "origin": "API_DEFINITION", + "description": " Create a custom class.", + "canonical": true, + "file": "adaptation.create_custom_class.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateCustomClass", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation.CreateCustomClass", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "custom_class_id", + "type": "TYPE_STRING" + }, + { + "name": "custom_class", + "type": ".google.cloud.speech.v1p1beta1.CustomClass" + } + ], + "resultType": ".google.cloud.speech.v1p1beta1.CustomClass", + "client": { + "shortName": "AdaptationClient", + "fullName": "google.cloud.speech.v1p1beta1.AdaptationClient" + }, + "method": { + "shortName": "CreateCustomClass", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation.CreateCustomClass", + "service": { + "shortName": "Adaptation", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation" + } + } + } + }, + { + "regionTag": "speech_v1p1beta1_generated_Adaptation_GetCustomClass_async", + "title": "Adaptation getCustomClass Sample", + "origin": "API_DEFINITION", + "description": " Get a custom class.", + "canonical": true, + "file": "adaptation.get_custom_class.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetCustomClass", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation.GetCustomClass", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.speech.v1p1beta1.CustomClass", + "client": { + "shortName": "AdaptationClient", + "fullName": "google.cloud.speech.v1p1beta1.AdaptationClient" + }, + "method": { + "shortName": "GetCustomClass", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation.GetCustomClass", + "service": { + "shortName": "Adaptation", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation" + } + } + } + }, + { + "regionTag": "speech_v1p1beta1_generated_Adaptation_ListCustomClasses_async", + "title": "Adaptation listCustomClasses Sample", + "origin": "API_DEFINITION", + "description": " List custom classes.", + "canonical": true, + "file": "adaptation.list_custom_classes.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListCustomClasses", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation.ListCustomClasses", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.speech.v1p1beta1.ListCustomClassesResponse", + "client": { + "shortName": "AdaptationClient", + "fullName": "google.cloud.speech.v1p1beta1.AdaptationClient" + }, + "method": { + "shortName": "ListCustomClasses", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation.ListCustomClasses", + "service": { + "shortName": "Adaptation", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation" + } + } + } + }, + { + "regionTag": "speech_v1p1beta1_generated_Adaptation_UpdateCustomClass_async", + "title": "Adaptation updateCustomClass Sample", + "origin": "API_DEFINITION", + "description": " Update a custom class.", + "canonical": true, + "file": "adaptation.update_custom_class.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateCustomClass", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation.UpdateCustomClass", + "async": true, + "parameters": [ + { + "name": "custom_class", + "type": ".google.cloud.speech.v1p1beta1.CustomClass" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.speech.v1p1beta1.CustomClass", + "client": { + "shortName": "AdaptationClient", + "fullName": "google.cloud.speech.v1p1beta1.AdaptationClient" + }, + "method": { + "shortName": "UpdateCustomClass", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation.UpdateCustomClass", + "service": { + "shortName": "Adaptation", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation" + } + } + } + }, + { + "regionTag": "speech_v1p1beta1_generated_Adaptation_DeleteCustomClass_async", + "title": "Adaptation deleteCustomClass Sample", + "origin": "API_DEFINITION", + "description": " Delete a custom class.", + "canonical": true, + "file": "adaptation.delete_custom_class.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteCustomClass", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation.DeleteCustomClass", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AdaptationClient", + "fullName": "google.cloud.speech.v1p1beta1.AdaptationClient" + }, + "method": { + "shortName": "DeleteCustomClass", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation.DeleteCustomClass", + "service": { + "shortName": "Adaptation", + "fullName": "google.cloud.speech.v1p1beta1.Adaptation" + } + } + } + }, + { + "regionTag": "speech_v1p1beta1_generated_Speech_Recognize_async", + "title": "Adaptation recognize Sample", + "origin": "API_DEFINITION", + "description": " Performs synchronous speech recognition: receive results after all audio has been sent and processed.", + "canonical": true, + "file": "speech.recognize.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "Recognize", + "fullName": "google.cloud.speech.v1p1beta1.Speech.Recognize", + "async": true, + "parameters": [ + { + "name": "config", + "type": ".google.cloud.speech.v1p1beta1.RecognitionConfig" + }, + { + "name": "audio", + "type": ".google.cloud.speech.v1p1beta1.RecognitionAudio" + } + ], + "resultType": ".google.cloud.speech.v1p1beta1.RecognizeResponse", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v1p1beta1.SpeechClient" + }, + "method": { + "shortName": "Recognize", + "fullName": "google.cloud.speech.v1p1beta1.Speech.Recognize", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v1p1beta1.Speech" + } + } + } + }, + { + "regionTag": "speech_v1p1beta1_generated_Speech_LongRunningRecognize_async", + "title": "Adaptation longRunningRecognize Sample", + "origin": "API_DEFINITION", + "description": " Performs asynchronous speech recognition: receive results via the google.longrunning.Operations interface. Returns either an `Operation.error` or an `Operation.response` which contains a `LongRunningRecognizeResponse` message. For more information on asynchronous speech recognition, see the [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize).", + "canonical": true, + "file": "speech.long_running_recognize.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "LongRunningRecognize", + "fullName": "google.cloud.speech.v1p1beta1.Speech.LongRunningRecognize", + "async": true, + "parameters": [ + { + "name": "config", + "type": ".google.cloud.speech.v1p1beta1.RecognitionConfig" + }, + { + "name": "audio", + "type": ".google.cloud.speech.v1p1beta1.RecognitionAudio" + }, + { + "name": "output_config", + "type": ".google.cloud.speech.v1p1beta1.TranscriptOutputConfig" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v1p1beta1.SpeechClient" + }, + "method": { + "shortName": "LongRunningRecognize", + "fullName": "google.cloud.speech.v1p1beta1.Speech.LongRunningRecognize", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v1p1beta1.Speech" + } + } + } + }, + { + "regionTag": "speech_v1p1beta1_generated_Speech_StreamingRecognize_async", + "title": "Adaptation streamingRecognize Sample", + "origin": "API_DEFINITION", + "description": " Performs bidirectional streaming speech recognition: receive results while sending audio. This method is only available via the gRPC API (not REST).", + "canonical": true, + "file": "speech.streaming_recognize.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "StreamingRecognize", + "fullName": "google.cloud.speech.v1p1beta1.Speech.StreamingRecognize", + "async": true, + "parameters": [ + { + "name": "streaming_config", + "type": ".google.cloud.speech.v1p1beta1.StreamingRecognitionConfig" + }, + { + "name": "audio_content", + "type": "TYPE_BYTES" + } + ], + "resultType": ".google.cloud.speech.v1p1beta1.StreamingRecognizeResponse", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v1p1beta1.SpeechClient" + }, + "method": { + "shortName": "StreamingRecognize", + "fullName": "google.cloud.speech.v1p1beta1.Speech.StreamingRecognize", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v1p1beta1.Speech" + } + } + } + } + ] +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1p1beta1/speech.long_running_recognize.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1p1beta1/speech.long_running_recognize.js new file mode 100644 index 00000000000..5fe33ac00f8 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1p1beta1/speech.long_running_recognize.js @@ -0,0 +1,72 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(config, audio) { + // [START speech_v1p1beta1_generated_Speech_LongRunningRecognize_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Provides information to the recognizer that specifies how to + * process the request. + */ + // const config = {} + /** + * Required. The audio data to be recognized. + */ + // const audio = {} + /** + * Optional. Specifies an optional destination for the recognition results. + */ + // const outputConfig = {} + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v1p1beta1; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callLongRunningRecognize() { + // Construct request + const request = { + config, + audio, + }; + + // Run request + const [operation] = await speechClient.longRunningRecognize(request); + const [response] = await operation.promise(); + console.log(response); + } + + callLongRunningRecognize(); + // [END speech_v1p1beta1_generated_Speech_LongRunningRecognize_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1p1beta1/speech.recognize.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1p1beta1/speech.recognize.js new file mode 100644 index 00000000000..6c672fea3a2 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1p1beta1/speech.recognize.js @@ -0,0 +1,67 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(config, audio) { + // [START speech_v1p1beta1_generated_Speech_Recognize_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Provides information to the recognizer that specifies how to + * process the request. + */ + // const config = {} + /** + * Required. The audio data to be recognized. + */ + // const audio = {} + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v1p1beta1; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callRecognize() { + // Construct request + const request = { + config, + audio, + }; + + // Run request + const response = await speechClient.recognize(request); + console.log(response); + } + + callRecognize(); + // [END speech_v1p1beta1_generated_Speech_Recognize_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1p1beta1/speech.streaming_recognize.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1p1beta1/speech.streaming_recognize.js new file mode 100644 index 00000000000..954ef4a6dfb --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1p1beta1/speech.streaming_recognize.js @@ -0,0 +1,77 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START speech_v1p1beta1_generated_Speech_StreamingRecognize_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Provides information to the recognizer that specifies how to process the + * request. The first `StreamingRecognizeRequest` message must contain a + * `streaming_config` message. + */ + // const streamingConfig = {} + /** + * The audio data to be recognized. Sequential chunks of audio data are sent + * in sequential `StreamingRecognizeRequest` messages. The first + * `StreamingRecognizeRequest` message must not contain `audio_content` data + * and all subsequent `StreamingRecognizeRequest` messages must contain + * `audio_content` data. The audio bytes must be encoded as specified in + * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a + * pure binary representation (not base64). See + * content limits (https://cloud.google.com/speech-to-text/quotas#content). + */ + // const audioContent = Buffer.from('string') + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v1p1beta1; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callStreamingRecognize() { + // Construct request + const request = { + }; + + // Run request + const stream = await speechClient.streamingRecognize(); + stream.on('data', (response) => { console.log(response) }); + stream.on('error', (err) => { throw(err) }); + stream.on('end', () => { /* API call completed */ }); + stream.write(request); + stream.end(); + } + + callStreamingRecognize(); + // [END speech_v1p1beta1_generated_Speech_StreamingRecognize_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/snippet_metadata_google.cloud.speech.v2.json b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/snippet_metadata_google.cloud.speech.v2.json new file mode 100644 index 00000000000..544187db993 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/snippet_metadata_google.cloud.speech.v2.json @@ -0,0 +1,1139 @@ +{ + "clientLibrary": { + "name": "nodejs-speech", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.speech.v2", + "version": "v2" + } + ] + }, + "snippets": [ + { + "regionTag": "speech_v2_generated_Speech_CreateRecognizer_async", + "title": "Speech createRecognizer Sample", + "origin": "API_DEFINITION", + "description": " Creates a [Recognizer][google.cloud.speech.v2.Recognizer].", + "canonical": true, + "file": "speech.create_recognizer.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateRecognizer", + "fullName": "google.cloud.speech.v2.Speech.CreateRecognizer", + "async": true, + "parameters": [ + { + "name": "recognizer", + "type": ".google.cloud.speech.v2.Recognizer" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "recognizer_id", + "type": "TYPE_STRING" + }, + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v2.SpeechClient" + }, + "method": { + "shortName": "CreateRecognizer", + "fullName": "google.cloud.speech.v2.Speech.CreateRecognizer", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v2.Speech" + } + } + } + }, + { + "regionTag": "speech_v2_generated_Speech_ListRecognizers_async", + "title": "Speech listRecognizers Sample", + "origin": "API_DEFINITION", + "description": " Lists Recognizers.", + "canonical": true, + "file": "speech.list_recognizers.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListRecognizers", + "fullName": "google.cloud.speech.v2.Speech.ListRecognizers", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "show_deleted", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.speech.v2.ListRecognizersResponse", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v2.SpeechClient" + }, + "method": { + "shortName": "ListRecognizers", + "fullName": "google.cloud.speech.v2.Speech.ListRecognizers", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v2.Speech" + } + } + } + }, + { + "regionTag": "speech_v2_generated_Speech_GetRecognizer_async", + "title": "Speech getRecognizer Sample", + "origin": "API_DEFINITION", + "description": " Returns the requested [Recognizer][google.cloud.speech.v2.Recognizer]. Fails with [NOT_FOUND][google.rpc.Code.NOT_FOUND] if the requested Recognizer doesn't exist.", + "canonical": true, + "file": "speech.get_recognizer.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetRecognizer", + "fullName": "google.cloud.speech.v2.Speech.GetRecognizer", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.speech.v2.Recognizer", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v2.SpeechClient" + }, + "method": { + "shortName": "GetRecognizer", + "fullName": "google.cloud.speech.v2.Speech.GetRecognizer", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v2.Speech" + } + } + } + }, + { + "regionTag": "speech_v2_generated_Speech_UpdateRecognizer_async", + "title": "Speech updateRecognizer Sample", + "origin": "API_DEFINITION", + "description": " Updates the [Recognizer][google.cloud.speech.v2.Recognizer].", + "canonical": true, + "file": "speech.update_recognizer.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateRecognizer", + "fullName": "google.cloud.speech.v2.Speech.UpdateRecognizer", + "async": true, + "parameters": [ + { + "name": "recognizer", + "type": ".google.cloud.speech.v2.Recognizer" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v2.SpeechClient" + }, + "method": { + "shortName": "UpdateRecognizer", + "fullName": "google.cloud.speech.v2.Speech.UpdateRecognizer", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v2.Speech" + } + } + } + }, + { + "regionTag": "speech_v2_generated_Speech_DeleteRecognizer_async", + "title": "Speech deleteRecognizer Sample", + "origin": "API_DEFINITION", + "description": " Deletes the [Recognizer][google.cloud.speech.v2.Recognizer].", + "canonical": true, + "file": "speech.delete_recognizer.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteRecognizer", + "fullName": "google.cloud.speech.v2.Speech.DeleteRecognizer", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v2.SpeechClient" + }, + "method": { + "shortName": "DeleteRecognizer", + "fullName": "google.cloud.speech.v2.Speech.DeleteRecognizer", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v2.Speech" + } + } + } + }, + { + "regionTag": "speech_v2_generated_Speech_UndeleteRecognizer_async", + "title": "Speech undeleteRecognizer Sample", + "origin": "API_DEFINITION", + "description": " Undeletes the [Recognizer][google.cloud.speech.v2.Recognizer].", + "canonical": true, + "file": "speech.undelete_recognizer.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UndeleteRecognizer", + "fullName": "google.cloud.speech.v2.Speech.UndeleteRecognizer", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v2.SpeechClient" + }, + "method": { + "shortName": "UndeleteRecognizer", + "fullName": "google.cloud.speech.v2.Speech.UndeleteRecognizer", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v2.Speech" + } + } + } + }, + { + "regionTag": "speech_v2_generated_Speech_Recognize_async", + "title": "Speech recognize Sample", + "origin": "API_DEFINITION", + "description": " Performs synchronous Speech recognition: receive results after all audio has been sent and processed.", + "canonical": true, + "file": "speech.recognize.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 99, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "Recognize", + "fullName": "google.cloud.speech.v2.Speech.Recognize", + "async": true, + "parameters": [ + { + "name": "recognizer", + "type": "TYPE_STRING" + }, + { + "name": "config", + "type": ".google.cloud.speech.v2.RecognitionConfig" + }, + { + "name": "config_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "content", + "type": "TYPE_BYTES" + }, + { + "name": "uri", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.speech.v2.RecognizeResponse", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v2.SpeechClient" + }, + "method": { + "shortName": "Recognize", + "fullName": "google.cloud.speech.v2.Speech.Recognize", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v2.Speech" + } + } + } + }, + { + "regionTag": "speech_v2_generated_Speech_StreamingRecognize_async", + "title": "Speech streamingRecognize Sample", + "origin": "API_DEFINITION", + "description": " Performs bidirectional streaming speech recognition: receive results while sending audio. This method is only available via the gRPC API (not REST).", + "canonical": true, + "file": "speech.streaming_recognize.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "StreamingRecognize", + "fullName": "google.cloud.speech.v2.Speech.StreamingRecognize", + "async": true, + "parameters": [ + { + "name": "recognizer", + "type": "TYPE_STRING" + }, + { + "name": "streaming_config", + "type": ".google.cloud.speech.v2.StreamingRecognitionConfig" + }, + { + "name": "audio", + "type": "TYPE_BYTES" + } + ], + "resultType": ".google.cloud.speech.v2.StreamingRecognizeResponse", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v2.SpeechClient" + }, + "method": { + "shortName": "StreamingRecognize", + "fullName": "google.cloud.speech.v2.Speech.StreamingRecognize", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v2.Speech" + } + } + } + }, + { + "regionTag": "speech_v2_generated_Speech_BatchRecognize_async", + "title": "Speech batchRecognize Sample", + "origin": "API_DEFINITION", + "description": " Performs batch asynchronous speech recognition: send a request with N audio files and receive a long running operation that can be polled to see when the transcriptions are finished.", + "canonical": true, + "file": "speech.batch_recognize.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 95, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchRecognize", + "fullName": "google.cloud.speech.v2.Speech.BatchRecognize", + "async": true, + "parameters": [ + { + "name": "recognizer", + "type": "TYPE_STRING" + }, + { + "name": "config", + "type": ".google.cloud.speech.v2.RecognitionConfig" + }, + { + "name": "config_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "files", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "recognition_output_config", + "type": ".google.cloud.speech.v2.RecognitionOutputConfig" + }, + { + "name": "processing_strategy", + "type": ".google.cloud.speech.v2.BatchRecognizeRequest.ProcessingStrategy" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v2.SpeechClient" + }, + "method": { + "shortName": "BatchRecognize", + "fullName": "google.cloud.speech.v2.Speech.BatchRecognize", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v2.Speech" + } + } + } + }, + { + "regionTag": "speech_v2_generated_Speech_GetConfig_async", + "title": "Speech getConfig Sample", + "origin": "API_DEFINITION", + "description": " Returns the requested [Config][google.cloud.speech.v2.Config].", + "canonical": true, + "file": "speech.get_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetConfig", + "fullName": "google.cloud.speech.v2.Speech.GetConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.speech.v2.Config", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v2.SpeechClient" + }, + "method": { + "shortName": "GetConfig", + "fullName": "google.cloud.speech.v2.Speech.GetConfig", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v2.Speech" + } + } + } + }, + { + "regionTag": "speech_v2_generated_Speech_UpdateConfig_async", + "title": "Speech updateConfig Sample", + "origin": "API_DEFINITION", + "description": " Updates the [Config][google.cloud.speech.v2.Config].", + "canonical": true, + "file": "speech.update_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateConfig", + "fullName": "google.cloud.speech.v2.Speech.UpdateConfig", + "async": true, + "parameters": [ + { + "name": "config", + "type": ".google.cloud.speech.v2.Config" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.speech.v2.Config", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v2.SpeechClient" + }, + "method": { + "shortName": "UpdateConfig", + "fullName": "google.cloud.speech.v2.Speech.UpdateConfig", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v2.Speech" + } + } + } + }, + { + "regionTag": "speech_v2_generated_Speech_CreateCustomClass_async", + "title": "Speech createCustomClass Sample", + "origin": "API_DEFINITION", + "description": " Creates a [CustomClass][google.cloud.speech.v2.CustomClass].", + "canonical": true, + "file": "speech.create_custom_class.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateCustomClass", + "fullName": "google.cloud.speech.v2.Speech.CreateCustomClass", + "async": true, + "parameters": [ + { + "name": "custom_class", + "type": ".google.cloud.speech.v2.CustomClass" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "custom_class_id", + "type": "TYPE_STRING" + }, + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v2.SpeechClient" + }, + "method": { + "shortName": "CreateCustomClass", + "fullName": "google.cloud.speech.v2.Speech.CreateCustomClass", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v2.Speech" + } + } + } + }, + { + "regionTag": "speech_v2_generated_Speech_ListCustomClasses_async", + "title": "Speech listCustomClasses Sample", + "origin": "API_DEFINITION", + "description": " Lists CustomClasses.", + "canonical": true, + "file": "speech.list_custom_classes.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListCustomClasses", + "fullName": "google.cloud.speech.v2.Speech.ListCustomClasses", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "show_deleted", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.speech.v2.ListCustomClassesResponse", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v2.SpeechClient" + }, + "method": { + "shortName": "ListCustomClasses", + "fullName": "google.cloud.speech.v2.Speech.ListCustomClasses", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v2.Speech" + } + } + } + }, + { + "regionTag": "speech_v2_generated_Speech_GetCustomClass_async", + "title": "Speech getCustomClass Sample", + "origin": "API_DEFINITION", + "description": " Returns the requested [CustomClass][google.cloud.speech.v2.CustomClass].", + "canonical": true, + "file": "speech.get_custom_class.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetCustomClass", + "fullName": "google.cloud.speech.v2.Speech.GetCustomClass", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.speech.v2.CustomClass", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v2.SpeechClient" + }, + "method": { + "shortName": "GetCustomClass", + "fullName": "google.cloud.speech.v2.Speech.GetCustomClass", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v2.Speech" + } + } + } + }, + { + "regionTag": "speech_v2_generated_Speech_UpdateCustomClass_async", + "title": "Speech updateCustomClass Sample", + "origin": "API_DEFINITION", + "description": " Updates the [CustomClass][google.cloud.speech.v2.CustomClass].", + "canonical": true, + "file": "speech.update_custom_class.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateCustomClass", + "fullName": "google.cloud.speech.v2.Speech.UpdateCustomClass", + "async": true, + "parameters": [ + { + "name": "custom_class", + "type": ".google.cloud.speech.v2.CustomClass" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v2.SpeechClient" + }, + "method": { + "shortName": "UpdateCustomClass", + "fullName": "google.cloud.speech.v2.Speech.UpdateCustomClass", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v2.Speech" + } + } + } + }, + { + "regionTag": "speech_v2_generated_Speech_DeleteCustomClass_async", + "title": "Speech deleteCustomClass Sample", + "origin": "API_DEFINITION", + "description": " Deletes the [CustomClass][google.cloud.speech.v2.CustomClass].", + "canonical": true, + "file": "speech.delete_custom_class.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteCustomClass", + "fullName": "google.cloud.speech.v2.Speech.DeleteCustomClass", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v2.SpeechClient" + }, + "method": { + "shortName": "DeleteCustomClass", + "fullName": "google.cloud.speech.v2.Speech.DeleteCustomClass", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v2.Speech" + } + } + } + }, + { + "regionTag": "speech_v2_generated_Speech_UndeleteCustomClass_async", + "title": "Speech undeleteCustomClass Sample", + "origin": "API_DEFINITION", + "description": " Undeletes the [CustomClass][google.cloud.speech.v2.CustomClass].", + "canonical": true, + "file": "speech.undelete_custom_class.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UndeleteCustomClass", + "fullName": "google.cloud.speech.v2.Speech.UndeleteCustomClass", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v2.SpeechClient" + }, + "method": { + "shortName": "UndeleteCustomClass", + "fullName": "google.cloud.speech.v2.Speech.UndeleteCustomClass", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v2.Speech" + } + } + } + }, + { + "regionTag": "speech_v2_generated_Speech_CreatePhraseSet_async", + "title": "Speech createPhraseSet Sample", + "origin": "API_DEFINITION", + "description": " Creates a [PhraseSet][google.cloud.speech.v2.PhraseSet].", + "canonical": true, + "file": "speech.create_phrase_set.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreatePhraseSet", + "fullName": "google.cloud.speech.v2.Speech.CreatePhraseSet", + "async": true, + "parameters": [ + { + "name": "phrase_set", + "type": ".google.cloud.speech.v2.PhraseSet" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "phrase_set_id", + "type": "TYPE_STRING" + }, + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v2.SpeechClient" + }, + "method": { + "shortName": "CreatePhraseSet", + "fullName": "google.cloud.speech.v2.Speech.CreatePhraseSet", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v2.Speech" + } + } + } + }, + { + "regionTag": "speech_v2_generated_Speech_ListPhraseSets_async", + "title": "Speech listPhraseSets Sample", + "origin": "API_DEFINITION", + "description": " Lists PhraseSets.", + "canonical": true, + "file": "speech.list_phrase_sets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListPhraseSets", + "fullName": "google.cloud.speech.v2.Speech.ListPhraseSets", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "show_deleted", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.speech.v2.ListPhraseSetsResponse", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v2.SpeechClient" + }, + "method": { + "shortName": "ListPhraseSets", + "fullName": "google.cloud.speech.v2.Speech.ListPhraseSets", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v2.Speech" + } + } + } + }, + { + "regionTag": "speech_v2_generated_Speech_GetPhraseSet_async", + "title": "Speech getPhraseSet Sample", + "origin": "API_DEFINITION", + "description": " Returns the requested [PhraseSet][google.cloud.speech.v2.PhraseSet].", + "canonical": true, + "file": "speech.get_phrase_set.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetPhraseSet", + "fullName": "google.cloud.speech.v2.Speech.GetPhraseSet", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.speech.v2.PhraseSet", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v2.SpeechClient" + }, + "method": { + "shortName": "GetPhraseSet", + "fullName": "google.cloud.speech.v2.Speech.GetPhraseSet", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v2.Speech" + } + } + } + }, + { + "regionTag": "speech_v2_generated_Speech_UpdatePhraseSet_async", + "title": "Speech updatePhraseSet Sample", + "origin": "API_DEFINITION", + "description": " Updates the [PhraseSet][google.cloud.speech.v2.PhraseSet].", + "canonical": true, + "file": "speech.update_phrase_set.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdatePhraseSet", + "fullName": "google.cloud.speech.v2.Speech.UpdatePhraseSet", + "async": true, + "parameters": [ + { + "name": "phrase_set", + "type": ".google.cloud.speech.v2.PhraseSet" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v2.SpeechClient" + }, + "method": { + "shortName": "UpdatePhraseSet", + "fullName": "google.cloud.speech.v2.Speech.UpdatePhraseSet", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v2.Speech" + } + } + } + }, + { + "regionTag": "speech_v2_generated_Speech_DeletePhraseSet_async", + "title": "Speech deletePhraseSet Sample", + "origin": "API_DEFINITION", + "description": " Deletes the [PhraseSet][google.cloud.speech.v2.PhraseSet].", + "canonical": true, + "file": "speech.delete_phrase_set.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeletePhraseSet", + "fullName": "google.cloud.speech.v2.Speech.DeletePhraseSet", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v2.SpeechClient" + }, + "method": { + "shortName": "DeletePhraseSet", + "fullName": "google.cloud.speech.v2.Speech.DeletePhraseSet", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v2.Speech" + } + } + } + }, + { + "regionTag": "speech_v2_generated_Speech_UndeletePhraseSet_async", + "title": "Speech undeletePhraseSet Sample", + "origin": "API_DEFINITION", + "description": " Undeletes the [PhraseSet][google.cloud.speech.v2.PhraseSet].", + "canonical": true, + "file": "speech.undelete_phrase_set.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UndeletePhraseSet", + "fullName": "google.cloud.speech.v2.Speech.UndeletePhraseSet", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "SpeechClient", + "fullName": "google.cloud.speech.v2.SpeechClient" + }, + "method": { + "shortName": "UndeletePhraseSet", + "fullName": "google.cloud.speech.v2.Speech.UndeletePhraseSet", + "service": { + "shortName": "Speech", + "fullName": "google.cloud.speech.v2.Speech" + } + } + } + } + ] +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.batch_recognize.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.batch_recognize.js new file mode 100644 index 00000000000..87de5b6f9f0 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.batch_recognize.js @@ -0,0 +1,103 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(recognizer) { + // [START speech_v2_generated_Speech_BatchRecognize_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the Recognizer to use during recognition. The + * expected format is + * `projects/{project}/locations/{location}/recognizers/{recognizer}`. The + * {recognizer} segment may be set to `_` to use an empty implicit Recognizer. + */ + // const recognizer = 'abc123' + /** + * Features and audio metadata to use for the Automatic Speech Recognition. + * This field in combination with the + * config_mask google.cloud.speech.v2.BatchRecognizeRequest.config_mask + * field can be used to override parts of the + * default_recognition_config google.cloud.speech.v2.Recognizer.default_recognition_config + * of the Recognizer resource. + */ + // const config = {} + /** + * The list of fields in + * config google.cloud.speech.v2.BatchRecognizeRequest.config that override + * the values in the + * default_recognition_config google.cloud.speech.v2.Recognizer.default_recognition_config + * of the recognizer during this recognition request. If no mask is provided, + * all given fields in + * config google.cloud.speech.v2.BatchRecognizeRequest.config override the + * values in the recognizer for this recognition request. If a mask is + * provided, only the fields listed in the mask override the config in the + * recognizer for this recognition request. If a wildcard (`*`) is provided, + * config google.cloud.speech.v2.BatchRecognizeRequest.config completely + * overrides and replaces the config in the recognizer for this recognition + * request. + */ + // const configMask = {} + /** + * Audio files with file metadata for ASR. + * The maximum number of files allowed to be specified is 15. + */ + // const files = [1,2,3,4] + /** + * Configuration options for where to output the transcripts of each file. + */ + // const recognitionOutputConfig = {} + /** + * Processing strategy to use for this request. + */ + // const processingStrategy = {} + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v2; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callBatchRecognize() { + // Construct request + const request = { + recognizer, + }; + + // Run request + const [operation] = await speechClient.batchRecognize(request); + const [response] = await operation.promise(); + console.log(response); + } + + callBatchRecognize(); + // [END speech_v2_generated_Speech_BatchRecognize_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.create_custom_class.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.create_custom_class.js new file mode 100644 index 00000000000..84e001a85df --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.create_custom_class.js @@ -0,0 +1,80 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(customClass, parent) { + // [START speech_v2_generated_Speech_CreateCustomClass_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The CustomClass to create. + */ + // const customClass = {} + /** + * If set, validate the request and preview the CustomClass, but do not + * actually create it. + */ + // const validateOnly = true + /** + * The ID to use for the CustomClass, which will become the final component of + * the CustomClass's resource name. + * This value should be 4-63 characters, and valid characters + * are /[a-z][0-9]-/. + */ + // const customClassId = 'abc123' + /** + * Required. The project and location where this CustomClass will be created. + * The expected format is `projects/{project}/locations/{location}`. + */ + // const parent = 'abc123' + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v2; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callCreateCustomClass() { + // Construct request + const request = { + customClass, + parent, + }; + + // Run request + const [operation] = await speechClient.createCustomClass(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateCustomClass(); + // [END speech_v2_generated_Speech_CreateCustomClass_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.create_phrase_set.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.create_phrase_set.js new file mode 100644 index 00000000000..17a0804080d --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.create_phrase_set.js @@ -0,0 +1,80 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(phraseSet, parent) { + // [START speech_v2_generated_Speech_CreatePhraseSet_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The PhraseSet to create. + */ + // const phraseSet = {} + /** + * If set, validate the request and preview the PhraseSet, but do not + * actually create it. + */ + // const validateOnly = true + /** + * The ID to use for the PhraseSet, which will become the final component of + * the PhraseSet's resource name. + * This value should be 4-63 characters, and valid characters + * are /[a-z][0-9]-/. + */ + // const phraseSetId = 'abc123' + /** + * Required. The project and location where this PhraseSet will be created. + * The expected format is `projects/{project}/locations/{location}`. + */ + // const parent = 'abc123' + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v2; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callCreatePhraseSet() { + // Construct request + const request = { + phraseSet, + parent, + }; + + // Run request + const [operation] = await speechClient.createPhraseSet(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreatePhraseSet(); + // [END speech_v2_generated_Speech_CreatePhraseSet_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.create_recognizer.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.create_recognizer.js new file mode 100644 index 00000000000..7f884f990fc --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.create_recognizer.js @@ -0,0 +1,80 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(recognizer, parent) { + // [START speech_v2_generated_Speech_CreateRecognizer_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The Recognizer to create. + */ + // const recognizer = {} + /** + * If set, validate the request and preview the Recognizer, but do not + * actually create it. + */ + // const validateOnly = true + /** + * The ID to use for the Recognizer, which will become the final component of + * the Recognizer's resource name. + * This value should be 4-63 characters, and valid characters + * are /[a-z][0-9]-/. + */ + // const recognizerId = 'abc123' + /** + * Required. The project and location where this Recognizer will be created. + * The expected format is `projects/{project}/locations/{location}`. + */ + // const parent = 'abc123' + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v2; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callCreateRecognizer() { + // Construct request + const request = { + recognizer, + parent, + }; + + // Run request + const [operation] = await speechClient.createRecognizer(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateRecognizer(); + // [END speech_v2_generated_Speech_CreateRecognizer_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.delete_custom_class.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.delete_custom_class.js new file mode 100644 index 00000000000..844b34da68b --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.delete_custom_class.js @@ -0,0 +1,80 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START speech_v2_generated_Speech_DeleteCustomClass_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the CustomClass to delete. + * Format: + * `projects/{project}/locations/{location}/customClasses/{custom_class}` + */ + // const name = 'abc123' + /** + * If set, validate the request and preview the deleted CustomClass, but do + * not actually delete it. + */ + // const validateOnly = true + /** + * If set to true, and the CustomClass is not found, the request will succeed + * and be a no-op (no Operation is recorded in this case). + */ + // const allowMissing = true + /** + * This checksum is computed by the server based on the value of other + * fields. This may be sent on update, undelete, and delete requests to ensure + * the client has an up-to-date value before proceeding. + */ + // const etag = 'abc123' + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v2; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callDeleteCustomClass() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await speechClient.deleteCustomClass(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteCustomClass(); + // [END speech_v2_generated_Speech_DeleteCustomClass_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.delete_phrase_set.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.delete_phrase_set.js new file mode 100644 index 00000000000..2c2ee36a4e6 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.delete_phrase_set.js @@ -0,0 +1,79 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START speech_v2_generated_Speech_DeletePhraseSet_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the PhraseSet to delete. + * Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + */ + // const name = 'abc123' + /** + * If set, validate the request and preview the deleted PhraseSet, but do not + * actually delete it. + */ + // const validateOnly = true + /** + * If set to true, and the PhraseSet is not found, the request will succeed + * and be a no-op (no Operation is recorded in this case). + */ + // const allowMissing = true + /** + * This checksum is computed by the server based on the value of other + * fields. This may be sent on update, undelete, and delete requests to ensure + * the client has an up-to-date value before proceeding. + */ + // const etag = 'abc123' + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v2; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callDeletePhraseSet() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await speechClient.deletePhraseSet(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeletePhraseSet(); + // [END speech_v2_generated_Speech_DeletePhraseSet_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.delete_recognizer.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.delete_recognizer.js new file mode 100644 index 00000000000..8f464dd40da --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.delete_recognizer.js @@ -0,0 +1,79 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START speech_v2_generated_Speech_DeleteRecognizer_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the Recognizer to delete. + * Format: `projects/{project}/locations/{location}/recognizers/{recognizer}` + */ + // const name = 'abc123' + /** + * If set, validate the request and preview the deleted Recognizer, but do not + * actually delete it. + */ + // const validateOnly = true + /** + * If set to true, and the Recognizer is not found, the request will succeed + * and be a no-op (no Operation is recorded in this case). + */ + // const allowMissing = true + /** + * This checksum is computed by the server based on the value of other + * fields. This may be sent on update, undelete, and delete requests to ensure + * the client has an up-to-date value before proceeding. + */ + // const etag = 'abc123' + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v2; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callDeleteRecognizer() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await speechClient.deleteRecognizer(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteRecognizer(); + // [END speech_v2_generated_Speech_DeleteRecognizer_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.get_config.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.get_config.js new file mode 100644 index 00000000000..028ba882112 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.get_config.js @@ -0,0 +1,63 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START speech_v2_generated_Speech_GetConfig_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the config to retrieve. There is exactly one config + * resource per project per location. The expected format is + * `projects/{project}/locations/{location}/config`. + */ + // const name = 'abc123' + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v2; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callGetConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await speechClient.getConfig(request); + console.log(response); + } + + callGetConfig(); + // [END speech_v2_generated_Speech_GetConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.get_custom_class.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.get_custom_class.js new file mode 100644 index 00000000000..2d2ac465fd7 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.get_custom_class.js @@ -0,0 +1,62 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START speech_v2_generated_Speech_GetCustomClass_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the CustomClass to retrieve. The expected format is + * `projects/{project}/locations/{location}/customClasses/{custom_class}`. + */ + // const name = 'abc123' + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v2; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callGetCustomClass() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await speechClient.getCustomClass(request); + console.log(response); + } + + callGetCustomClass(); + // [END speech_v2_generated_Speech_GetCustomClass_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.get_phrase_set.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.get_phrase_set.js new file mode 100644 index 00000000000..e41eabf977e --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.get_phrase_set.js @@ -0,0 +1,62 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START speech_v2_generated_Speech_GetPhraseSet_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the PhraseSet to retrieve. The expected format is + * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`. + */ + // const name = 'abc123' + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v2; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callGetPhraseSet() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await speechClient.getPhraseSet(request); + console.log(response); + } + + callGetPhraseSet(); + // [END speech_v2_generated_Speech_GetPhraseSet_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.get_recognizer.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.get_recognizer.js new file mode 100644 index 00000000000..3cdbd55a1df --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.get_recognizer.js @@ -0,0 +1,62 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START speech_v2_generated_Speech_GetRecognizer_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the Recognizer to retrieve. The expected format is + * `projects/{project}/locations/{location}/recognizers/{recognizer}`. + */ + // const name = 'abc123' + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v2; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callGetRecognizer() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await speechClient.getRecognizer(request); + console.log(response); + } + + callGetRecognizer(); + // [END speech_v2_generated_Speech_GetRecognizer_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.list_custom_classes.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.list_custom_classes.js new file mode 100644 index 00000000000..cfb1fec8a53 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.list_custom_classes.js @@ -0,0 +1,84 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START speech_v2_generated_Speech_ListCustomClasses_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The project and location of CustomClass resources to list. The + * expected format is `projects/{project}/locations/{location}`. + */ + // const parent = 'abc123' + /** + * Number of results per requests. A valid page_size ranges from 0 to 100 + * inclusive. If the page_size is zero or unspecified, a page size of 5 will + * be chosen. If the page size exceeds 100, it will be coerced down to 100. + * Note that a call might return fewer results than the requested page size. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous + * ListCustomClasses google.cloud.speech.v2.Speech.ListCustomClasses call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to + * ListCustomClasses google.cloud.speech.v2.Speech.ListCustomClasses must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * Whether, or not, to show resources that have been deleted. + */ + // const showDeleted = true + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v2; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callListCustomClasses() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = speechClient.listCustomClassesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListCustomClasses(); + // [END speech_v2_generated_Speech_ListCustomClasses_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.list_phrase_sets.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.list_phrase_sets.js new file mode 100644 index 00000000000..ed1f045272b --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.list_phrase_sets.js @@ -0,0 +1,83 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START speech_v2_generated_Speech_ListPhraseSets_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The project and location of PhraseSet resources to list. The + * expected format is `projects/{project}/locations/{location}`. + */ + // const parent = 'abc123' + /** + * The maximum number of PhraseSets to return. The service may return fewer + * than this value. If unspecified, at most 5 PhraseSets will be returned. + * The maximum value is 100; values above 100 will be coerced to 100. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous + * ListPhraseSets google.cloud.speech.v2.Speech.ListPhraseSets call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to + * ListPhraseSets google.cloud.speech.v2.Speech.ListPhraseSets must match + * the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * Whether, or not, to show resources that have been deleted. + */ + // const showDeleted = true + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v2; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callListPhraseSets() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = speechClient.listPhraseSetsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListPhraseSets(); + // [END speech_v2_generated_Speech_ListPhraseSets_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.list_recognizers.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.list_recognizers.js new file mode 100644 index 00000000000..84d5190c9b5 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.list_recognizers.js @@ -0,0 +1,83 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START speech_v2_generated_Speech_ListRecognizers_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The project and location of Recognizers to list. The expected + * format is `projects/{project}/locations/{location}`. + */ + // const parent = 'abc123' + /** + * The maximum number of Recognizers to return. The service may return fewer + * than this value. If unspecified, at most 5 Recognizers will be returned. + * The maximum value is 100; values above 100 will be coerced to 100. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous + * ListRecognizers google.cloud.speech.v2.Speech.ListRecognizers call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to + * ListRecognizers google.cloud.speech.v2.Speech.ListRecognizers must match + * the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * Whether, or not, to show resources that have been deleted. + */ + // const showDeleted = true + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v2; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callListRecognizers() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = speechClient.listRecognizersAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListRecognizers(); + // [END speech_v2_generated_Speech_ListRecognizers_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.recognize.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.recognize.js new file mode 100644 index 00000000000..9d85603a46d --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.recognize.js @@ -0,0 +1,107 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(recognizer) { + // [START speech_v2_generated_Speech_Recognize_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the Recognizer to use during recognition. The + * expected format is + * `projects/{project}/locations/{location}/recognizers/{recognizer}`. The + * {recognizer} segment may be set to `_` to use an empty implicit Recognizer. + */ + // const recognizer = 'abc123' + /** + * Features and audio metadata to use for the Automatic Speech Recognition. + * This field in combination with the + * config_mask google.cloud.speech.v2.RecognizeRequest.config_mask field + * can be used to override parts of the + * default_recognition_config google.cloud.speech.v2.Recognizer.default_recognition_config + * of the Recognizer resource. + */ + // const config = {} + /** + * The list of fields in + * config google.cloud.speech.v2.RecognizeRequest.config that override the + * values in the + * default_recognition_config google.cloud.speech.v2.Recognizer.default_recognition_config + * of the recognizer during this recognition request. If no mask is provided, + * all non-default valued fields in + * config google.cloud.speech.v2.RecognizeRequest.config override the + * values in the recognizer for this recognition request. If a mask is + * provided, only the fields listed in the mask override the config in the + * recognizer for this recognition request. If a wildcard (`*`) is provided, + * config google.cloud.speech.v2.RecognizeRequest.config completely + * overrides and replaces the config in the recognizer for this recognition + * request. + */ + // const configMask = {} + /** + * The audio data bytes encoded as specified in + * RecognitionConfig google.cloud.speech.v2.RecognitionConfig. As + * with all bytes fields, proto buffers use a pure binary representation, + * whereas JSON representations use base64. + */ + // const content = Buffer.from('string') + /** + * URI that points to a file that contains audio data bytes as specified in + * RecognitionConfig google.cloud.speech.v2.RecognitionConfig. The file + * must not be compressed (for example, gzip). Currently, only Google Cloud + * Storage URIs are supported, which must be specified in the following + * format: `gs://bucket_name/object_name` (other URI formats return + * INVALID_ARGUMENT google.rpc.Code.INVALID_ARGUMENT). For more + * information, see Request + * URIs (https://cloud.google.com/storage/docs/reference-uris). + */ + // const uri = 'abc123' + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v2; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callRecognize() { + // Construct request + const request = { + recognizer, + }; + + // Run request + const response = await speechClient.recognize(request); + console.log(response); + } + + callRecognize(); + // [END speech_v2_generated_Speech_Recognize_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.streaming_recognize.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.streaming_recognize.js new file mode 100644 index 00000000000..e6a9e03be29 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.streaming_recognize.js @@ -0,0 +1,79 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(recognizer) { + // [START speech_v2_generated_Speech_StreamingRecognize_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the Recognizer to use during recognition. The + * expected format is + * `projects/{project}/locations/{location}/recognizers/{recognizer}`. The + * {recognizer} segment may be set to `_` to use an empty implicit Recognizer. + */ + // const recognizer = 'abc123' + /** + * StreamingRecognitionConfig to be used in this recognition attempt. + * If provided, it will override the default RecognitionConfig stored in the + * Recognizer. + */ + // const streamingConfig = {} + /** + * Inline audio bytes to be Recognized. + * Maximum size for this field is 15 KB per request. + */ + // const audio = Buffer.from('string') + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v2; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callStreamingRecognize() { + // Construct request + const request = { + recognizer, + }; + + // Run request + const stream = await speechClient.streamingRecognize(); + stream.on('data', (response) => { console.log(response) }); + stream.on('error', (err) => { throw(err) }); + stream.on('end', () => { /* API call completed */ }); + stream.write(request); + stream.end(); + } + + callStreamingRecognize(); + // [END speech_v2_generated_Speech_StreamingRecognize_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.undelete_custom_class.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.undelete_custom_class.js new file mode 100644 index 00000000000..73a28da90fa --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.undelete_custom_class.js @@ -0,0 +1,75 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START speech_v2_generated_Speech_UndeleteCustomClass_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the CustomClass to undelete. + * Format: + * `projects/{project}/locations/{location}/customClasses/{custom_class}` + */ + // const name = 'abc123' + /** + * If set, validate the request and preview the undeleted CustomClass, but do + * not actually undelete it. + */ + // const validateOnly = true + /** + * This checksum is computed by the server based on the value of other + * fields. This may be sent on update, undelete, and delete requests to ensure + * the client has an up-to-date value before proceeding. + */ + // const etag = 'abc123' + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v2; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callUndeleteCustomClass() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await speechClient.undeleteCustomClass(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUndeleteCustomClass(); + // [END speech_v2_generated_Speech_UndeleteCustomClass_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.undelete_phrase_set.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.undelete_phrase_set.js new file mode 100644 index 00000000000..0e507ce74b4 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.undelete_phrase_set.js @@ -0,0 +1,74 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START speech_v2_generated_Speech_UndeletePhraseSet_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the PhraseSet to undelete. + * Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + */ + // const name = 'abc123' + /** + * If set, validate the request and preview the undeleted PhraseSet, but do + * not actually undelete it. + */ + // const validateOnly = true + /** + * This checksum is computed by the server based on the value of other + * fields. This may be sent on update, undelete, and delete requests to ensure + * the client has an up-to-date value before proceeding. + */ + // const etag = 'abc123' + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v2; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callUndeletePhraseSet() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await speechClient.undeletePhraseSet(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUndeletePhraseSet(); + // [END speech_v2_generated_Speech_UndeletePhraseSet_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.undelete_recognizer.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.undelete_recognizer.js new file mode 100644 index 00000000000..c52274c303b --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.undelete_recognizer.js @@ -0,0 +1,74 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START speech_v2_generated_Speech_UndeleteRecognizer_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the Recognizer to undelete. + * Format: `projects/{project}/locations/{location}/recognizers/{recognizer}` + */ + // const name = 'abc123' + /** + * If set, validate the request and preview the undeleted Recognizer, but do + * not actually undelete it. + */ + // const validateOnly = true + /** + * This checksum is computed by the server based on the value of other + * fields. This may be sent on update, undelete, and delete requests to ensure + * the client has an up-to-date value before proceeding. + */ + // const etag = 'abc123' + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v2; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callUndeleteRecognizer() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await speechClient.undeleteRecognizer(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUndeleteRecognizer(); + // [END speech_v2_generated_Speech_UndeleteRecognizer_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.update_config.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.update_config.js new file mode 100644 index 00000000000..d75dcb59281 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.update_config.js @@ -0,0 +1,67 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(config) { + // [START speech_v2_generated_Speech_UpdateConfig_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The config to update. + * The config's `name` field is used to identify the config to be updated. + * The expected format is `projects/{project}/locations/{location}/config`. + */ + // const config = {} + /** + * The list of fields to be updated. + */ + // const updateMask = {} + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v2; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callUpdateConfig() { + // Construct request + const request = { + config, + }; + + // Run request + const response = await speechClient.updateConfig(request); + console.log(response); + } + + callUpdateConfig(); + // [END speech_v2_generated_Speech_UpdateConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.update_custom_class.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.update_custom_class.js new file mode 100644 index 00000000000..8671945fa95 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.update_custom_class.js @@ -0,0 +1,75 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(customClass) { + // [START speech_v2_generated_Speech_UpdateCustomClass_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The CustomClass to update. + * The CustomClass's `name` field is used to identify the CustomClass to + * update. Format: + * `projects/{project}/locations/{location}/customClasses/{custom_class}`. + */ + // const customClass = {} + /** + * The list of fields to be updated. If empty, all fields are considered for + * update. + */ + // const updateMask = {} + /** + * If set, validate the request and preview the updated CustomClass, but do + * not actually update it. + */ + // const validateOnly = true + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v2; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callUpdateCustomClass() { + // Construct request + const request = { + customClass, + }; + + // Run request + const [operation] = await speechClient.updateCustomClass(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateCustomClass(); + // [END speech_v2_generated_Speech_UpdateCustomClass_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.update_phrase_set.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.update_phrase_set.js new file mode 100644 index 00000000000..fabf80e21b0 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.update_phrase_set.js @@ -0,0 +1,74 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(phraseSet) { + // [START speech_v2_generated_Speech_UpdatePhraseSet_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The PhraseSet to update. + * The PhraseSet's `name` field is used to identify the PhraseSet to update. + * Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}`. + */ + // const phraseSet = {} + /** + * The list of fields to update. If empty, all non-default valued fields are + * considered for update. Use `*` to update the entire PhraseSet resource. + */ + // const updateMask = {} + /** + * If set, validate the request and preview the updated PhraseSet, but do not + * actually update it. + */ + // const validateOnly = true + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v2; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callUpdatePhraseSet() { + // Construct request + const request = { + phraseSet, + }; + + // Run request + const [operation] = await speechClient.updatePhraseSet(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdatePhraseSet(); + // [END speech_v2_generated_Speech_UpdatePhraseSet_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.update_recognizer.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.update_recognizer.js new file mode 100644 index 00000000000..cd10914e834 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v2/speech.update_recognizer.js @@ -0,0 +1,74 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(recognizer) { + // [START speech_v2_generated_Speech_UpdateRecognizer_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The Recognizer to update. + * The Recognizer's `name` field is used to identify the Recognizer to update. + * Format: `projects/{project}/locations/{location}/recognizers/{recognizer}`. + */ + // const recognizer = {} + /** + * The list of fields to update. If empty, all non-default valued fields are + * considered for update. Use `*` to update the entire Recognizer resource. + */ + // const updateMask = {} + /** + * If set, validate the request and preview the updated Recognizer, but do not + * actually update it. + */ + // const validateOnly = true + + // Imports the Speech library + const {SpeechClient} = require('@google-cloud/speech').v2; + + // Instantiates a client + const speechClient = new SpeechClient(); + + async function callUpdateRecognizer() { + // Construct request + const request = { + recognizer, + }; + + // Run request + const [operation] = await speechClient.updateRecognizer(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateRecognizer(); + // [END speech_v2_generated_Speech_UpdateRecognizer_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/index.ts b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/index.ts new file mode 100644 index 00000000000..fe67084db43 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/index.ts @@ -0,0 +1,27 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as v1 from './v1'; +const AdaptationClient = v1.AdaptationClient; +type AdaptationClient = v1.AdaptationClient; +const SpeechClient = v1.SpeechClient; +type SpeechClient = v1.SpeechClient; +export {v1, AdaptationClient, SpeechClient}; +export default {v1, AdaptationClient, SpeechClient}; +import * as protos from '../protos/protos'; +export {protos} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v1/adaptation_client.ts b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v1/adaptation_client.ts new file mode 100644 index 00000000000..e8f102750e8 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v1/adaptation_client.ts @@ -0,0 +1,1834 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1/adaptation_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './adaptation_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service that implements Google Cloud Speech Adaptation API. + * @class + * @memberof v1 + */ +export class AdaptationClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('speech'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + adaptationStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of AdaptationClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new AdaptationClient({fallback: true}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof AdaptationClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'speech.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + customClassPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/customClasses/{custom_class}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + phraseSetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/phraseSets/{phrase_set}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listPhraseSet: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'phraseSets'), + listCustomClasses: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'customClasses') + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.speech.v1.Adaptation', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.adaptationStub) { + return this.adaptationStub; + } + + // Put together the "service stub" for + // google.cloud.speech.v1.Adaptation. + this.adaptationStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.speech.v1.Adaptation') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.speech.v1.Adaptation, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const adaptationStubMethods = + ['createPhraseSet', 'getPhraseSet', 'listPhraseSet', 'updatePhraseSet', 'deletePhraseSet', 'createCustomClass', 'getCustomClass', 'listCustomClasses', 'updateCustomClass', 'deleteCustomClass']; + for (const methodName of adaptationStubMethods) { + const callPromise = this.adaptationStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.adaptationStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'speech.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'speech.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Create a set of phrase hints. Each item in the set can be a single word or + * a multi-word phrase. The items in the PhraseSet are favored by the + * recognition model when you send a call that includes the PhraseSet. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource where this phrase set will be created. + * Format: + * + * `projects/{project}/locations/{location}` + * + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + * @param {string} request.phraseSetId + * Required. The ID to use for the phrase set, which will become the final + * component of the phrase set's resource name. + * + * This value should restrict to letters, numbers, and hyphens, with the first + * character a letter, the last a letter or a number, and be 4-63 characters. + * @param {google.cloud.speech.v1.PhraseSet} request.phraseSet + * Required. The phrase set to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.speech.v1.PhraseSet|PhraseSet}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/adaptation.create_phrase_set.js + * region_tag:speech_v1_generated_Adaptation_CreatePhraseSet_async + */ + createPhraseSet( + request?: protos.google.cloud.speech.v1.ICreatePhraseSetRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.speech.v1.IPhraseSet, + protos.google.cloud.speech.v1.ICreatePhraseSetRequest|undefined, {}|undefined + ]>; + createPhraseSet( + request: protos.google.cloud.speech.v1.ICreatePhraseSetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.speech.v1.IPhraseSet, + protos.google.cloud.speech.v1.ICreatePhraseSetRequest|null|undefined, + {}|null|undefined>): void; + createPhraseSet( + request: protos.google.cloud.speech.v1.ICreatePhraseSetRequest, + callback: Callback< + protos.google.cloud.speech.v1.IPhraseSet, + protos.google.cloud.speech.v1.ICreatePhraseSetRequest|null|undefined, + {}|null|undefined>): void; + createPhraseSet( + request?: protos.google.cloud.speech.v1.ICreatePhraseSetRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.speech.v1.IPhraseSet, + protos.google.cloud.speech.v1.ICreatePhraseSetRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.speech.v1.IPhraseSet, + protos.google.cloud.speech.v1.ICreatePhraseSetRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.speech.v1.IPhraseSet, + protos.google.cloud.speech.v1.ICreatePhraseSetRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createPhraseSet request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.speech.v1.IPhraseSet, + protos.google.cloud.speech.v1.ICreatePhraseSetRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createPhraseSet response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createPhraseSet(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.speech.v1.IPhraseSet, + protos.google.cloud.speech.v1.ICreatePhraseSetRequest|undefined, + {}|undefined + ]) => { + this._log.info('createPhraseSet response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Get a phrase set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the phrase set to retrieve. Format: + * + * `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + * + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.speech.v1.PhraseSet|PhraseSet}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/adaptation.get_phrase_set.js + * region_tag:speech_v1_generated_Adaptation_GetPhraseSet_async + */ + getPhraseSet( + request?: protos.google.cloud.speech.v1.IGetPhraseSetRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.speech.v1.IPhraseSet, + protos.google.cloud.speech.v1.IGetPhraseSetRequest|undefined, {}|undefined + ]>; + getPhraseSet( + request: protos.google.cloud.speech.v1.IGetPhraseSetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.speech.v1.IPhraseSet, + protos.google.cloud.speech.v1.IGetPhraseSetRequest|null|undefined, + {}|null|undefined>): void; + getPhraseSet( + request: protos.google.cloud.speech.v1.IGetPhraseSetRequest, + callback: Callback< + protos.google.cloud.speech.v1.IPhraseSet, + protos.google.cloud.speech.v1.IGetPhraseSetRequest|null|undefined, + {}|null|undefined>): void; + getPhraseSet( + request?: protos.google.cloud.speech.v1.IGetPhraseSetRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.speech.v1.IPhraseSet, + protos.google.cloud.speech.v1.IGetPhraseSetRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.speech.v1.IPhraseSet, + protos.google.cloud.speech.v1.IGetPhraseSetRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.speech.v1.IPhraseSet, + protos.google.cloud.speech.v1.IGetPhraseSetRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getPhraseSet request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.speech.v1.IPhraseSet, + protos.google.cloud.speech.v1.IGetPhraseSetRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getPhraseSet response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getPhraseSet(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.speech.v1.IPhraseSet, + protos.google.cloud.speech.v1.IGetPhraseSetRequest|undefined, + {}|undefined + ]) => { + this._log.info('getPhraseSet response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Update a phrase set. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.speech.v1.PhraseSet} request.phraseSet + * Required. The phrase set to update. + * + * The phrase set's `name` field is used to identify the set to be + * updated. Format: + * + * `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + * + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + * @param {google.protobuf.FieldMask} request.updateMask + * The list of fields to be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.speech.v1.PhraseSet|PhraseSet}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/adaptation.update_phrase_set.js + * region_tag:speech_v1_generated_Adaptation_UpdatePhraseSet_async + */ + updatePhraseSet( + request?: protos.google.cloud.speech.v1.IUpdatePhraseSetRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.speech.v1.IPhraseSet, + protos.google.cloud.speech.v1.IUpdatePhraseSetRequest|undefined, {}|undefined + ]>; + updatePhraseSet( + request: protos.google.cloud.speech.v1.IUpdatePhraseSetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.speech.v1.IPhraseSet, + protos.google.cloud.speech.v1.IUpdatePhraseSetRequest|null|undefined, + {}|null|undefined>): void; + updatePhraseSet( + request: protos.google.cloud.speech.v1.IUpdatePhraseSetRequest, + callback: Callback< + protos.google.cloud.speech.v1.IPhraseSet, + protos.google.cloud.speech.v1.IUpdatePhraseSetRequest|null|undefined, + {}|null|undefined>): void; + updatePhraseSet( + request?: protos.google.cloud.speech.v1.IUpdatePhraseSetRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.speech.v1.IPhraseSet, + protos.google.cloud.speech.v1.IUpdatePhraseSetRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.speech.v1.IPhraseSet, + protos.google.cloud.speech.v1.IUpdatePhraseSetRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.speech.v1.IPhraseSet, + protos.google.cloud.speech.v1.IUpdatePhraseSetRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'phrase_set.name': request.phraseSet!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updatePhraseSet request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.speech.v1.IPhraseSet, + protos.google.cloud.speech.v1.IUpdatePhraseSetRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updatePhraseSet response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updatePhraseSet(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.speech.v1.IPhraseSet, + protos.google.cloud.speech.v1.IUpdatePhraseSetRequest|undefined, + {}|undefined + ]) => { + this._log.info('updatePhraseSet response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Delete a phrase set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the phrase set to delete. Format: + * + * `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/adaptation.delete_phrase_set.js + * region_tag:speech_v1_generated_Adaptation_DeletePhraseSet_async + */ + deletePhraseSet( + request?: protos.google.cloud.speech.v1.IDeletePhraseSetRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1.IDeletePhraseSetRequest|undefined, {}|undefined + ]>; + deletePhraseSet( + request: protos.google.cloud.speech.v1.IDeletePhraseSetRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1.IDeletePhraseSetRequest|null|undefined, + {}|null|undefined>): void; + deletePhraseSet( + request: protos.google.cloud.speech.v1.IDeletePhraseSetRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1.IDeletePhraseSetRequest|null|undefined, + {}|null|undefined>): void; + deletePhraseSet( + request?: protos.google.cloud.speech.v1.IDeletePhraseSetRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1.IDeletePhraseSetRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1.IDeletePhraseSetRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1.IDeletePhraseSetRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('deletePhraseSet request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1.IDeletePhraseSetRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deletePhraseSet response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deletePhraseSet(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1.IDeletePhraseSetRequest|undefined, + {}|undefined + ]) => { + this._log.info('deletePhraseSet response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Create a custom class. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource where this custom class will be created. + * Format: + * + * `projects/{project}/locations/{location}/customClasses` + * + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + * @param {string} request.customClassId + * Required. The ID to use for the custom class, which will become the final + * component of the custom class' resource name. + * + * This value should restrict to letters, numbers, and hyphens, with the first + * character a letter, the last a letter or a number, and be 4-63 characters. + * @param {google.cloud.speech.v1.CustomClass} request.customClass + * Required. The custom class to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.speech.v1.CustomClass|CustomClass}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/adaptation.create_custom_class.js + * region_tag:speech_v1_generated_Adaptation_CreateCustomClass_async + */ + createCustomClass( + request?: protos.google.cloud.speech.v1.ICreateCustomClassRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.speech.v1.ICustomClass, + protos.google.cloud.speech.v1.ICreateCustomClassRequest|undefined, {}|undefined + ]>; + createCustomClass( + request: protos.google.cloud.speech.v1.ICreateCustomClassRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.speech.v1.ICustomClass, + protos.google.cloud.speech.v1.ICreateCustomClassRequest|null|undefined, + {}|null|undefined>): void; + createCustomClass( + request: protos.google.cloud.speech.v1.ICreateCustomClassRequest, + callback: Callback< + protos.google.cloud.speech.v1.ICustomClass, + protos.google.cloud.speech.v1.ICreateCustomClassRequest|null|undefined, + {}|null|undefined>): void; + createCustomClass( + request?: protos.google.cloud.speech.v1.ICreateCustomClassRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.speech.v1.ICustomClass, + protos.google.cloud.speech.v1.ICreateCustomClassRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.speech.v1.ICustomClass, + protos.google.cloud.speech.v1.ICreateCustomClassRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.speech.v1.ICustomClass, + protos.google.cloud.speech.v1.ICreateCustomClassRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createCustomClass request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.speech.v1.ICustomClass, + protos.google.cloud.speech.v1.ICreateCustomClassRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createCustomClass response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createCustomClass(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.speech.v1.ICustomClass, + protos.google.cloud.speech.v1.ICreateCustomClassRequest|undefined, + {}|undefined + ]) => { + this._log.info('createCustomClass response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Get a custom class. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the custom class to retrieve. Format: + * + * `projects/{project}/locations/{location}/customClasses/{custom_class}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.speech.v1.CustomClass|CustomClass}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/adaptation.get_custom_class.js + * region_tag:speech_v1_generated_Adaptation_GetCustomClass_async + */ + getCustomClass( + request?: protos.google.cloud.speech.v1.IGetCustomClassRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.speech.v1.ICustomClass, + protos.google.cloud.speech.v1.IGetCustomClassRequest|undefined, {}|undefined + ]>; + getCustomClass( + request: protos.google.cloud.speech.v1.IGetCustomClassRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.speech.v1.ICustomClass, + protos.google.cloud.speech.v1.IGetCustomClassRequest|null|undefined, + {}|null|undefined>): void; + getCustomClass( + request: protos.google.cloud.speech.v1.IGetCustomClassRequest, + callback: Callback< + protos.google.cloud.speech.v1.ICustomClass, + protos.google.cloud.speech.v1.IGetCustomClassRequest|null|undefined, + {}|null|undefined>): void; + getCustomClass( + request?: protos.google.cloud.speech.v1.IGetCustomClassRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.speech.v1.ICustomClass, + protos.google.cloud.speech.v1.IGetCustomClassRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.speech.v1.ICustomClass, + protos.google.cloud.speech.v1.IGetCustomClassRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.speech.v1.ICustomClass, + protos.google.cloud.speech.v1.IGetCustomClassRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getCustomClass request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.speech.v1.ICustomClass, + protos.google.cloud.speech.v1.IGetCustomClassRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getCustomClass response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getCustomClass(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.speech.v1.ICustomClass, + protos.google.cloud.speech.v1.IGetCustomClassRequest|undefined, + {}|undefined + ]) => { + this._log.info('getCustomClass response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Update a custom class. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.speech.v1.CustomClass} request.customClass + * Required. The custom class to update. + * + * The custom class's `name` field is used to identify the custom class to be + * updated. Format: + * + * `projects/{project}/locations/{location}/customClasses/{custom_class}` + * + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + * @param {google.protobuf.FieldMask} request.updateMask + * The list of fields to be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.speech.v1.CustomClass|CustomClass}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/adaptation.update_custom_class.js + * region_tag:speech_v1_generated_Adaptation_UpdateCustomClass_async + */ + updateCustomClass( + request?: protos.google.cloud.speech.v1.IUpdateCustomClassRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.speech.v1.ICustomClass, + protos.google.cloud.speech.v1.IUpdateCustomClassRequest|undefined, {}|undefined + ]>; + updateCustomClass( + request: protos.google.cloud.speech.v1.IUpdateCustomClassRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.speech.v1.ICustomClass, + protos.google.cloud.speech.v1.IUpdateCustomClassRequest|null|undefined, + {}|null|undefined>): void; + updateCustomClass( + request: protos.google.cloud.speech.v1.IUpdateCustomClassRequest, + callback: Callback< + protos.google.cloud.speech.v1.ICustomClass, + protos.google.cloud.speech.v1.IUpdateCustomClassRequest|null|undefined, + {}|null|undefined>): void; + updateCustomClass( + request?: protos.google.cloud.speech.v1.IUpdateCustomClassRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.speech.v1.ICustomClass, + protos.google.cloud.speech.v1.IUpdateCustomClassRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.speech.v1.ICustomClass, + protos.google.cloud.speech.v1.IUpdateCustomClassRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.speech.v1.ICustomClass, + protos.google.cloud.speech.v1.IUpdateCustomClassRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'custom_class.name': request.customClass!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateCustomClass request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.speech.v1.ICustomClass, + protos.google.cloud.speech.v1.IUpdateCustomClassRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateCustomClass response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateCustomClass(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.speech.v1.ICustomClass, + protos.google.cloud.speech.v1.IUpdateCustomClassRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateCustomClass response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Delete a custom class. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the custom class to delete. Format: + * + * `projects/{project}/locations/{location}/customClasses/{custom_class}` + * + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/adaptation.delete_custom_class.js + * region_tag:speech_v1_generated_Adaptation_DeleteCustomClass_async + */ + deleteCustomClass( + request?: protos.google.cloud.speech.v1.IDeleteCustomClassRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1.IDeleteCustomClassRequest|undefined, {}|undefined + ]>; + deleteCustomClass( + request: protos.google.cloud.speech.v1.IDeleteCustomClassRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1.IDeleteCustomClassRequest|null|undefined, + {}|null|undefined>): void; + deleteCustomClass( + request: protos.google.cloud.speech.v1.IDeleteCustomClassRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1.IDeleteCustomClassRequest|null|undefined, + {}|null|undefined>): void; + deleteCustomClass( + request?: protos.google.cloud.speech.v1.IDeleteCustomClassRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1.IDeleteCustomClassRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1.IDeleteCustomClassRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1.IDeleteCustomClassRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('deleteCustomClass request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1.IDeleteCustomClassRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteCustomClass response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteCustomClass(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1.IDeleteCustomClassRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteCustomClass response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } + + /** + * List phrase sets. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of phrase set. Format: + * + * `projects/{project}/locations/{location}` + * + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + * @param {number} request.pageSize + * The maximum number of phrase sets to return. The service may return + * fewer than this value. If unspecified, at most 50 phrase sets will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListPhraseSet` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListPhraseSet` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.speech.v1.PhraseSet|PhraseSet}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listPhraseSetAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listPhraseSet( + request?: protos.google.cloud.speech.v1.IListPhraseSetRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.speech.v1.IPhraseSet[], + protos.google.cloud.speech.v1.IListPhraseSetRequest|null, + protos.google.cloud.speech.v1.IListPhraseSetResponse + ]>; + listPhraseSet( + request: protos.google.cloud.speech.v1.IListPhraseSetRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.speech.v1.IListPhraseSetRequest, + protos.google.cloud.speech.v1.IListPhraseSetResponse|null|undefined, + protos.google.cloud.speech.v1.IPhraseSet>): void; + listPhraseSet( + request: protos.google.cloud.speech.v1.IListPhraseSetRequest, + callback: PaginationCallback< + protos.google.cloud.speech.v1.IListPhraseSetRequest, + protos.google.cloud.speech.v1.IListPhraseSetResponse|null|undefined, + protos.google.cloud.speech.v1.IPhraseSet>): void; + listPhraseSet( + request?: protos.google.cloud.speech.v1.IListPhraseSetRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.speech.v1.IListPhraseSetRequest, + protos.google.cloud.speech.v1.IListPhraseSetResponse|null|undefined, + protos.google.cloud.speech.v1.IPhraseSet>, + callback?: PaginationCallback< + protos.google.cloud.speech.v1.IListPhraseSetRequest, + protos.google.cloud.speech.v1.IListPhraseSetResponse|null|undefined, + protos.google.cloud.speech.v1.IPhraseSet>): + Promise<[ + protos.google.cloud.speech.v1.IPhraseSet[], + protos.google.cloud.speech.v1.IListPhraseSetRequest|null, + protos.google.cloud.speech.v1.IListPhraseSetResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.speech.v1.IListPhraseSetRequest, + protos.google.cloud.speech.v1.IListPhraseSetResponse|null|undefined, + protos.google.cloud.speech.v1.IPhraseSet>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listPhraseSet values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listPhraseSet request %j', request); + return this.innerApiCalls + .listPhraseSet(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.speech.v1.IPhraseSet[], + protos.google.cloud.speech.v1.IListPhraseSetRequest|null, + protos.google.cloud.speech.v1.IListPhraseSetResponse + ]) => { + this._log.info('listPhraseSet values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listPhraseSet`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of phrase set. Format: + * + * `projects/{project}/locations/{location}` + * + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + * @param {number} request.pageSize + * The maximum number of phrase sets to return. The service may return + * fewer than this value. If unspecified, at most 50 phrase sets will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListPhraseSet` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListPhraseSet` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.speech.v1.PhraseSet|PhraseSet} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listPhraseSetAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listPhraseSetStream( + request?: protos.google.cloud.speech.v1.IListPhraseSetRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listPhraseSet']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listPhraseSet stream %j', request); + return this.descriptors.page.listPhraseSet.createStream( + this.innerApiCalls.listPhraseSet as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listPhraseSet`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of phrase set. Format: + * + * `projects/{project}/locations/{location}` + * + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + * @param {number} request.pageSize + * The maximum number of phrase sets to return. The service may return + * fewer than this value. If unspecified, at most 50 phrase sets will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListPhraseSet` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListPhraseSet` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.speech.v1.PhraseSet|PhraseSet}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/adaptation.list_phrase_set.js + * region_tag:speech_v1_generated_Adaptation_ListPhraseSet_async + */ + listPhraseSetAsync( + request?: protos.google.cloud.speech.v1.IListPhraseSetRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listPhraseSet']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listPhraseSet iterate %j', request); + return this.descriptors.page.listPhraseSet.asyncIterate( + this.innerApiCalls['listPhraseSet'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * List custom classes. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of custom classes. Format: + * + * `projects/{project}/locations/{location}/customClasses` + * + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + * @param {number} request.pageSize + * The maximum number of custom classes to return. The service may return + * fewer than this value. If unspecified, at most 50 custom classes will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListCustomClass` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListCustomClass` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.speech.v1.CustomClass|CustomClass}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listCustomClassesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listCustomClasses( + request?: protos.google.cloud.speech.v1.IListCustomClassesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.speech.v1.ICustomClass[], + protos.google.cloud.speech.v1.IListCustomClassesRequest|null, + protos.google.cloud.speech.v1.IListCustomClassesResponse + ]>; + listCustomClasses( + request: protos.google.cloud.speech.v1.IListCustomClassesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.speech.v1.IListCustomClassesRequest, + protos.google.cloud.speech.v1.IListCustomClassesResponse|null|undefined, + protos.google.cloud.speech.v1.ICustomClass>): void; + listCustomClasses( + request: protos.google.cloud.speech.v1.IListCustomClassesRequest, + callback: PaginationCallback< + protos.google.cloud.speech.v1.IListCustomClassesRequest, + protos.google.cloud.speech.v1.IListCustomClassesResponse|null|undefined, + protos.google.cloud.speech.v1.ICustomClass>): void; + listCustomClasses( + request?: protos.google.cloud.speech.v1.IListCustomClassesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.speech.v1.IListCustomClassesRequest, + protos.google.cloud.speech.v1.IListCustomClassesResponse|null|undefined, + protos.google.cloud.speech.v1.ICustomClass>, + callback?: PaginationCallback< + protos.google.cloud.speech.v1.IListCustomClassesRequest, + protos.google.cloud.speech.v1.IListCustomClassesResponse|null|undefined, + protos.google.cloud.speech.v1.ICustomClass>): + Promise<[ + protos.google.cloud.speech.v1.ICustomClass[], + protos.google.cloud.speech.v1.IListCustomClassesRequest|null, + protos.google.cloud.speech.v1.IListCustomClassesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.speech.v1.IListCustomClassesRequest, + protos.google.cloud.speech.v1.IListCustomClassesResponse|null|undefined, + protos.google.cloud.speech.v1.ICustomClass>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listCustomClasses values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listCustomClasses request %j', request); + return this.innerApiCalls + .listCustomClasses(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.speech.v1.ICustomClass[], + protos.google.cloud.speech.v1.IListCustomClassesRequest|null, + protos.google.cloud.speech.v1.IListCustomClassesResponse + ]) => { + this._log.info('listCustomClasses values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listCustomClasses`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of custom classes. Format: + * + * `projects/{project}/locations/{location}/customClasses` + * + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + * @param {number} request.pageSize + * The maximum number of custom classes to return. The service may return + * fewer than this value. If unspecified, at most 50 custom classes will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListCustomClass` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListCustomClass` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.speech.v1.CustomClass|CustomClass} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listCustomClassesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listCustomClassesStream( + request?: protos.google.cloud.speech.v1.IListCustomClassesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listCustomClasses']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listCustomClasses stream %j', request); + return this.descriptors.page.listCustomClasses.createStream( + this.innerApiCalls.listCustomClasses as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listCustomClasses`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of custom classes. Format: + * + * `projects/{project}/locations/{location}/customClasses` + * + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + * @param {number} request.pageSize + * The maximum number of custom classes to return. The service may return + * fewer than this value. If unspecified, at most 50 custom classes will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListCustomClass` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListCustomClass` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.speech.v1.CustomClass|CustomClass}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/adaptation.list_custom_classes.js + * region_tag:speech_v1_generated_Adaptation_ListCustomClasses_async + */ + listCustomClassesAsync( + request?: protos.google.cloud.speech.v1.IListCustomClassesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listCustomClasses']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listCustomClasses iterate %j', request); + return this.descriptors.page.listCustomClasses.asyncIterate( + this.innerApiCalls['listCustomClasses'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified customClass resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} custom_class + * @returns {string} Resource name string. + */ + customClassPath(project:string,location:string,customClass:string) { + return this.pathTemplates.customClassPathTemplate.render({ + project: project, + location: location, + custom_class: customClass, + }); + } + + /** + * Parse the project from CustomClass resource. + * + * @param {string} customClassName + * A fully-qualified path representing CustomClass resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCustomClassName(customClassName: string) { + return this.pathTemplates.customClassPathTemplate.match(customClassName).project; + } + + /** + * Parse the location from CustomClass resource. + * + * @param {string} customClassName + * A fully-qualified path representing CustomClass resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCustomClassName(customClassName: string) { + return this.pathTemplates.customClassPathTemplate.match(customClassName).location; + } + + /** + * Parse the custom_class from CustomClass resource. + * + * @param {string} customClassName + * A fully-qualified path representing CustomClass resource. + * @returns {string} A string representing the custom_class. + */ + matchCustomClassFromCustomClassName(customClassName: string) { + return this.pathTemplates.customClassPathTemplate.match(customClassName).custom_class; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified phraseSet resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} phrase_set + * @returns {string} Resource name string. + */ + phraseSetPath(project:string,location:string,phraseSet:string) { + return this.pathTemplates.phraseSetPathTemplate.render({ + project: project, + location: location, + phrase_set: phraseSet, + }); + } + + /** + * Parse the project from PhraseSet resource. + * + * @param {string} phraseSetName + * A fully-qualified path representing PhraseSet resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPhraseSetName(phraseSetName: string) { + return this.pathTemplates.phraseSetPathTemplate.match(phraseSetName).project; + } + + /** + * Parse the location from PhraseSet resource. + * + * @param {string} phraseSetName + * A fully-qualified path representing PhraseSet resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPhraseSetName(phraseSetName: string) { + return this.pathTemplates.phraseSetPathTemplate.match(phraseSetName).location; + } + + /** + * Parse the phrase_set from PhraseSet resource. + * + * @param {string} phraseSetName + * A fully-qualified path representing PhraseSet resource. + * @returns {string} A string representing the phrase_set. + */ + matchPhraseSetFromPhraseSetName(phraseSetName: string) { + return this.pathTemplates.phraseSetPathTemplate.match(phraseSetName).phrase_set; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project:string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.adaptationStub && !this._terminated) { + return this.adaptationStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v1/adaptation_client_config.json b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v1/adaptation_client_config.json new file mode 100644 index 00000000000..029e9b88558 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v1/adaptation_client_config.json @@ -0,0 +1,66 @@ +{ + "interfaces": { + "google.cloud.speech.v1.Adaptation": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreatePhraseSet": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetPhraseSet": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListPhraseSet": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdatePhraseSet": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeletePhraseSet": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateCustomClass": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetCustomClass": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListCustomClasses": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateCustomClass": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteCustomClass": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v1/adaptation_proto_list.json b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v1/adaptation_proto_list.json new file mode 100644 index 00000000000..46afac3f942 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v1/adaptation_proto_list.json @@ -0,0 +1,5 @@ +[ + "../../protos/google/cloud/speech/v1/cloud_speech.proto", + "../../protos/google/cloud/speech/v1/cloud_speech_adaptation.proto", + "../../protos/google/cloud/speech/v1/resource.proto" +] diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v1/gapic_metadata.json b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..96f60b3cd28 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v1/gapic_metadata.json @@ -0,0 +1,170 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.speech.v1", + "libraryPackage": "@google-cloud/speech", + "services": { + "Adaptation": { + "clients": { + "grpc": { + "libraryClient": "AdaptationClient", + "rpcs": { + "CreatePhraseSet": { + "methods": [ + "createPhraseSet" + ] + }, + "GetPhraseSet": { + "methods": [ + "getPhraseSet" + ] + }, + "UpdatePhraseSet": { + "methods": [ + "updatePhraseSet" + ] + }, + "DeletePhraseSet": { + "methods": [ + "deletePhraseSet" + ] + }, + "CreateCustomClass": { + "methods": [ + "createCustomClass" + ] + }, + "GetCustomClass": { + "methods": [ + "getCustomClass" + ] + }, + "UpdateCustomClass": { + "methods": [ + "updateCustomClass" + ] + }, + "DeleteCustomClass": { + "methods": [ + "deleteCustomClass" + ] + }, + "ListPhraseSet": { + "methods": [ + "listPhraseSet", + "listPhraseSetStream", + "listPhraseSetAsync" + ] + }, + "ListCustomClasses": { + "methods": [ + "listCustomClasses", + "listCustomClassesStream", + "listCustomClassesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "AdaptationClient", + "rpcs": { + "CreatePhraseSet": { + "methods": [ + "createPhraseSet" + ] + }, + "GetPhraseSet": { + "methods": [ + "getPhraseSet" + ] + }, + "UpdatePhraseSet": { + "methods": [ + "updatePhraseSet" + ] + }, + "DeletePhraseSet": { + "methods": [ + "deletePhraseSet" + ] + }, + "CreateCustomClass": { + "methods": [ + "createCustomClass" + ] + }, + "GetCustomClass": { + "methods": [ + "getCustomClass" + ] + }, + "UpdateCustomClass": { + "methods": [ + "updateCustomClass" + ] + }, + "DeleteCustomClass": { + "methods": [ + "deleteCustomClass" + ] + }, + "ListPhraseSet": { + "methods": [ + "listPhraseSet", + "listPhraseSetStream", + "listPhraseSetAsync" + ] + }, + "ListCustomClasses": { + "methods": [ + "listCustomClasses", + "listCustomClassesStream", + "listCustomClassesAsync" + ] + } + } + } + } + }, + "Speech": { + "clients": { + "grpc": { + "libraryClient": "SpeechClient", + "rpcs": { + "Recognize": { + "methods": [ + "recognize" + ] + }, + "StreamingRecognize": { + "methods": [ + "streamingRecognize" + ] + }, + "LongRunningRecognize": { + "methods": [ + "longRunningRecognize" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "SpeechClient", + "rpcs": { + "Recognize": { + "methods": [ + "recognize" + ] + }, + "LongRunningRecognize": { + "methods": [ + "longRunningRecognize" + ] + } + } + } + } + } + } +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v1/index.ts b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v1/index.ts new file mode 100644 index 00000000000..4a66bbeb5ff --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v1/index.ts @@ -0,0 +1,20 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {AdaptationClient} from './adaptation_client'; +export {SpeechClient} from './speech_client'; diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v1/speech_client.ts b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v1/speech_client.ts new file mode 100644 index 00000000000..d4610409334 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v1/speech_client.ts @@ -0,0 +1,946 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation} from 'google-gax'; +import {PassThrough} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1/speech_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './speech_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service that implements Google Cloud Speech API. + * @class + * @memberof v1 + */ +export class SpeechClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('speech'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + speechStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of SpeechClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new SpeechClient({fallback: true}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof SpeechClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'speech.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + customClassPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/customClasses/{custom_class}' + ), + phraseSetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/phraseSets/{phrase_set}' + ), + }; + + // Some of the methods on this service provide streaming responses. + // Provide descriptors for these. + this.descriptors.stream = { + streamingRecognize: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.BIDI_STREAMING, !!opts.fallback, !!opts.gaxServerStreamingRetries) + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.longrunning.Operations.GetOperation',get: '/v1/operations/{name=**}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v1/operations',}]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); + const longRunningRecognizeResponse = protoFilesRoot.lookup( + '.google.cloud.speech.v1.LongRunningRecognizeResponse') as gax.protobuf.Type; + const longRunningRecognizeMetadata = protoFilesRoot.lookup( + '.google.cloud.speech.v1.LongRunningRecognizeMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + longRunningRecognize: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + longRunningRecognizeResponse.decode.bind(longRunningRecognizeResponse), + longRunningRecognizeMetadata.decode.bind(longRunningRecognizeMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.speech.v1.Speech', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.speechStub) { + return this.speechStub; + } + + // Put together the "service stub" for + // google.cloud.speech.v1.Speech. + this.speechStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.speech.v1.Speech') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.speech.v1.Speech, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const speechStubMethods = + ['recognize', 'longRunningRecognize', 'streamingRecognize']; + for (const methodName of speechStubMethods) { + const callPromise = this.speechStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + if (methodName in this.descriptors.stream) { + const stream = new PassThrough({objectMode: true}); + setImmediate(() => { + stream.emit('error', new this._gaxModule.GoogleError('The client has already been closed.')); + }); + return stream; + } + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.stream[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.speechStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'speech.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'speech.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Performs synchronous speech recognition: receive results after all audio + * has been sent and processed. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.speech.v1.RecognitionConfig} request.config + * Required. Provides information to the recognizer that specifies how to + * process the request. + * @param {google.cloud.speech.v1.RecognitionAudio} request.audio + * Required. The audio data to be recognized. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.speech.v1.RecognizeResponse|RecognizeResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/speech.recognize.js + * region_tag:speech_v1_generated_Speech_Recognize_async + */ + recognize( + request?: protos.google.cloud.speech.v1.IRecognizeRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.speech.v1.IRecognizeResponse, + protos.google.cloud.speech.v1.IRecognizeRequest|undefined, {}|undefined + ]>; + recognize( + request: protos.google.cloud.speech.v1.IRecognizeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.speech.v1.IRecognizeResponse, + protos.google.cloud.speech.v1.IRecognizeRequest|null|undefined, + {}|null|undefined>): void; + recognize( + request: protos.google.cloud.speech.v1.IRecognizeRequest, + callback: Callback< + protos.google.cloud.speech.v1.IRecognizeResponse, + protos.google.cloud.speech.v1.IRecognizeRequest|null|undefined, + {}|null|undefined>): void; + recognize( + request?: protos.google.cloud.speech.v1.IRecognizeRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.speech.v1.IRecognizeResponse, + protos.google.cloud.speech.v1.IRecognizeRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.speech.v1.IRecognizeResponse, + protos.google.cloud.speech.v1.IRecognizeRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.speech.v1.IRecognizeResponse, + protos.google.cloud.speech.v1.IRecognizeRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + this.initialize().catch(err => {throw err}); + this._log.info('recognize request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.speech.v1.IRecognizeResponse, + protos.google.cloud.speech.v1.IRecognizeRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('recognize response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.recognize(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.speech.v1.IRecognizeResponse, + protos.google.cloud.speech.v1.IRecognizeRequest|undefined, + {}|undefined + ]) => { + this._log.info('recognize response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } + +/** + * Performs bidirectional streaming speech recognition: receive results while + * sending audio. This method is only available via the gRPC API (not REST). + * + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which is both readable and writable. It accepts objects + * representing {@link protos.google.cloud.speech.v1.StreamingRecognizeRequest|StreamingRecognizeRequest} for write() method, and + * will emit objects representing {@link protos.google.cloud.speech.v1.StreamingRecognizeResponse|StreamingRecognizeResponse} on 'data' event asynchronously. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#bi-directional-streaming | documentation } + * for more details and examples. + * @example include:samples/generated/v1/speech.streaming_recognize.js + * region_tag:speech_v1_generated_Speech_StreamingRecognize_async + */ + streamingRecognize( + options?: CallOptions): + gax.CancellableStream { + this.initialize().catch(err => {throw err}); + this._log.info('streamingRecognize stream %j', options); + return this.innerApiCalls.streamingRecognize(null, options); + } + +/** + * Performs asynchronous speech recognition: receive results via the + * google.longrunning.Operations interface. Returns either an + * `Operation.error` or an `Operation.response` which contains + * a `LongRunningRecognizeResponse` message. + * For more information on asynchronous speech recognition, see the + * [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.speech.v1.RecognitionConfig} request.config + * Required. Provides information to the recognizer that specifies how to + * process the request. + * @param {google.cloud.speech.v1.RecognitionAudio} request.audio + * Required. The audio data to be recognized. + * @param {google.cloud.speech.v1.TranscriptOutputConfig} [request.outputConfig] + * Optional. Specifies an optional destination for the recognition results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/speech.long_running_recognize.js + * region_tag:speech_v1_generated_Speech_LongRunningRecognize_async + */ + longRunningRecognize( + request?: protos.google.cloud.speech.v1.ILongRunningRecognizeRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + longRunningRecognize( + request: protos.google.cloud.speech.v1.ILongRunningRecognizeRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + longRunningRecognize( + request: protos.google.cloud.speech.v1.ILongRunningRecognizeRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + longRunningRecognize( + request?: protos.google.cloud.speech.v1.ILongRunningRecognizeRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('longRunningRecognize response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('longRunningRecognize request %j', request); + return this.innerApiCalls.longRunningRecognize(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('longRunningRecognize response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `longRunningRecognize()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/speech.long_running_recognize.js + * region_tag:speech_v1_generated_Speech_LongRunningRecognize_async + */ + async checkLongRunningRecognizeProgress(name: string): Promise>{ + this._log.info('longRunningRecognize long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.longRunningRecognize, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified customClass resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} custom_class + * @returns {string} Resource name string. + */ + customClassPath(project:string,location:string,customClass:string) { + return this.pathTemplates.customClassPathTemplate.render({ + project: project, + location: location, + custom_class: customClass, + }); + } + + /** + * Parse the project from CustomClass resource. + * + * @param {string} customClassName + * A fully-qualified path representing CustomClass resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCustomClassName(customClassName: string) { + return this.pathTemplates.customClassPathTemplate.match(customClassName).project; + } + + /** + * Parse the location from CustomClass resource. + * + * @param {string} customClassName + * A fully-qualified path representing CustomClass resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCustomClassName(customClassName: string) { + return this.pathTemplates.customClassPathTemplate.match(customClassName).location; + } + + /** + * Parse the custom_class from CustomClass resource. + * + * @param {string} customClassName + * A fully-qualified path representing CustomClass resource. + * @returns {string} A string representing the custom_class. + */ + matchCustomClassFromCustomClassName(customClassName: string) { + return this.pathTemplates.customClassPathTemplate.match(customClassName).custom_class; + } + + /** + * Return a fully-qualified phraseSet resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} phrase_set + * @returns {string} Resource name string. + */ + phraseSetPath(project:string,location:string,phraseSet:string) { + return this.pathTemplates.phraseSetPathTemplate.render({ + project: project, + location: location, + phrase_set: phraseSet, + }); + } + + /** + * Parse the project from PhraseSet resource. + * + * @param {string} phraseSetName + * A fully-qualified path representing PhraseSet resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPhraseSetName(phraseSetName: string) { + return this.pathTemplates.phraseSetPathTemplate.match(phraseSetName).project; + } + + /** + * Parse the location from PhraseSet resource. + * + * @param {string} phraseSetName + * A fully-qualified path representing PhraseSet resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPhraseSetName(phraseSetName: string) { + return this.pathTemplates.phraseSetPathTemplate.match(phraseSetName).location; + } + + /** + * Parse the phrase_set from PhraseSet resource. + * + * @param {string} phraseSetName + * A fully-qualified path representing PhraseSet resource. + * @returns {string} A string representing the phrase_set. + */ + matchPhraseSetFromPhraseSetName(phraseSetName: string) { + return this.pathTemplates.phraseSetPathTemplate.match(phraseSetName).phrase_set; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.speechStub && !this._terminated) { + return this.speechStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v1/speech_client_config.json b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v1/speech_client_config.json new file mode 100644 index 00000000000..35b04f64cd2 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v1/speech_client_config.json @@ -0,0 +1,41 @@ +{ + "interfaces": { + "google.cloud.speech.v1.Speech": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "Recognize": { + "timeout_millis": 5000000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "LongRunningRecognize": { + "timeout_millis": 5000000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "StreamingRecognize": { + "timeout_millis": 5000000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v1/speech_proto_list.json b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v1/speech_proto_list.json new file mode 100644 index 00000000000..46afac3f942 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v1/speech_proto_list.json @@ -0,0 +1,5 @@ +[ + "../../protos/google/cloud/speech/v1/cloud_speech.proto", + "../../protos/google/cloud/speech/v1/cloud_speech_adaptation.proto", + "../../protos/google/cloud/speech/v1/resource.proto" +] diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v1p1beta1/adaptation_client.ts b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v1p1beta1/adaptation_client.ts new file mode 100644 index 00000000000..68c23341e54 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v1p1beta1/adaptation_client.ts @@ -0,0 +1,1834 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1p1beta1/adaptation_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './adaptation_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service that implements Google Cloud Speech Adaptation API. + * @class + * @memberof v1p1beta1 + */ +export class AdaptationClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('speech'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + adaptationStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of AdaptationClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new AdaptationClient({fallback: true}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof AdaptationClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'speech.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + customClassPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/customClasses/{custom_class}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + phraseSetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/phraseSets/{phrase_set}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listPhraseSet: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'phraseSets'), + listCustomClasses: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'customClasses') + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.speech.v1p1beta1.Adaptation', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.adaptationStub) { + return this.adaptationStub; + } + + // Put together the "service stub" for + // google.cloud.speech.v1p1beta1.Adaptation. + this.adaptationStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.speech.v1p1beta1.Adaptation') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.speech.v1p1beta1.Adaptation, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const adaptationStubMethods = + ['createPhraseSet', 'getPhraseSet', 'listPhraseSet', 'updatePhraseSet', 'deletePhraseSet', 'createCustomClass', 'getCustomClass', 'listCustomClasses', 'updateCustomClass', 'deleteCustomClass']; + for (const methodName of adaptationStubMethods) { + const callPromise = this.adaptationStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.adaptationStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'speech.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'speech.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Create a set of phrase hints. Each item in the set can be a single word or + * a multi-word phrase. The items in the PhraseSet are favored by the + * recognition model when you send a call that includes the PhraseSet. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource where this phrase set will be created. + * Format: + * + * `projects/{project}/locations/{location}` + * + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + * @param {string} request.phraseSetId + * Required. The ID to use for the phrase set, which will become the final + * component of the phrase set's resource name. + * + * This value should restrict to letters, numbers, and hyphens, with the first + * character a letter, the last a letter or a number, and be 4-63 characters. + * @param {google.cloud.speech.v1p1beta1.PhraseSet} request.phraseSet + * Required. The phrase set to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.speech.v1p1beta1.PhraseSet|PhraseSet}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1p1beta1/adaptation.create_phrase_set.js + * region_tag:speech_v1p1beta1_generated_Adaptation_CreatePhraseSet_async + */ + createPhraseSet( + request?: protos.google.cloud.speech.v1p1beta1.ICreatePhraseSetRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.speech.v1p1beta1.IPhraseSet, + protos.google.cloud.speech.v1p1beta1.ICreatePhraseSetRequest|undefined, {}|undefined + ]>; + createPhraseSet( + request: protos.google.cloud.speech.v1p1beta1.ICreatePhraseSetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.speech.v1p1beta1.IPhraseSet, + protos.google.cloud.speech.v1p1beta1.ICreatePhraseSetRequest|null|undefined, + {}|null|undefined>): void; + createPhraseSet( + request: protos.google.cloud.speech.v1p1beta1.ICreatePhraseSetRequest, + callback: Callback< + protos.google.cloud.speech.v1p1beta1.IPhraseSet, + protos.google.cloud.speech.v1p1beta1.ICreatePhraseSetRequest|null|undefined, + {}|null|undefined>): void; + createPhraseSet( + request?: protos.google.cloud.speech.v1p1beta1.ICreatePhraseSetRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.speech.v1p1beta1.IPhraseSet, + protos.google.cloud.speech.v1p1beta1.ICreatePhraseSetRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.speech.v1p1beta1.IPhraseSet, + protos.google.cloud.speech.v1p1beta1.ICreatePhraseSetRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.speech.v1p1beta1.IPhraseSet, + protos.google.cloud.speech.v1p1beta1.ICreatePhraseSetRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createPhraseSet request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.speech.v1p1beta1.IPhraseSet, + protos.google.cloud.speech.v1p1beta1.ICreatePhraseSetRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createPhraseSet response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createPhraseSet(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.speech.v1p1beta1.IPhraseSet, + protos.google.cloud.speech.v1p1beta1.ICreatePhraseSetRequest|undefined, + {}|undefined + ]) => { + this._log.info('createPhraseSet response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Get a phrase set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the phrase set to retrieve. Format: + * + * `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + * + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.speech.v1p1beta1.PhraseSet|PhraseSet}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1p1beta1/adaptation.get_phrase_set.js + * region_tag:speech_v1p1beta1_generated_Adaptation_GetPhraseSet_async + */ + getPhraseSet( + request?: protos.google.cloud.speech.v1p1beta1.IGetPhraseSetRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.speech.v1p1beta1.IPhraseSet, + protos.google.cloud.speech.v1p1beta1.IGetPhraseSetRequest|undefined, {}|undefined + ]>; + getPhraseSet( + request: protos.google.cloud.speech.v1p1beta1.IGetPhraseSetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.speech.v1p1beta1.IPhraseSet, + protos.google.cloud.speech.v1p1beta1.IGetPhraseSetRequest|null|undefined, + {}|null|undefined>): void; + getPhraseSet( + request: protos.google.cloud.speech.v1p1beta1.IGetPhraseSetRequest, + callback: Callback< + protos.google.cloud.speech.v1p1beta1.IPhraseSet, + protos.google.cloud.speech.v1p1beta1.IGetPhraseSetRequest|null|undefined, + {}|null|undefined>): void; + getPhraseSet( + request?: protos.google.cloud.speech.v1p1beta1.IGetPhraseSetRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.speech.v1p1beta1.IPhraseSet, + protos.google.cloud.speech.v1p1beta1.IGetPhraseSetRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.speech.v1p1beta1.IPhraseSet, + protos.google.cloud.speech.v1p1beta1.IGetPhraseSetRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.speech.v1p1beta1.IPhraseSet, + protos.google.cloud.speech.v1p1beta1.IGetPhraseSetRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getPhraseSet request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.speech.v1p1beta1.IPhraseSet, + protos.google.cloud.speech.v1p1beta1.IGetPhraseSetRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getPhraseSet response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getPhraseSet(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.speech.v1p1beta1.IPhraseSet, + protos.google.cloud.speech.v1p1beta1.IGetPhraseSetRequest|undefined, + {}|undefined + ]) => { + this._log.info('getPhraseSet response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Update a phrase set. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.speech.v1p1beta1.PhraseSet} request.phraseSet + * Required. The phrase set to update. + * + * The phrase set's `name` field is used to identify the set to be + * updated. Format: + * + * `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + * + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + * @param {google.protobuf.FieldMask} request.updateMask + * The list of fields to be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.speech.v1p1beta1.PhraseSet|PhraseSet}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1p1beta1/adaptation.update_phrase_set.js + * region_tag:speech_v1p1beta1_generated_Adaptation_UpdatePhraseSet_async + */ + updatePhraseSet( + request?: protos.google.cloud.speech.v1p1beta1.IUpdatePhraseSetRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.speech.v1p1beta1.IPhraseSet, + protos.google.cloud.speech.v1p1beta1.IUpdatePhraseSetRequest|undefined, {}|undefined + ]>; + updatePhraseSet( + request: protos.google.cloud.speech.v1p1beta1.IUpdatePhraseSetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.speech.v1p1beta1.IPhraseSet, + protos.google.cloud.speech.v1p1beta1.IUpdatePhraseSetRequest|null|undefined, + {}|null|undefined>): void; + updatePhraseSet( + request: protos.google.cloud.speech.v1p1beta1.IUpdatePhraseSetRequest, + callback: Callback< + protos.google.cloud.speech.v1p1beta1.IPhraseSet, + protos.google.cloud.speech.v1p1beta1.IUpdatePhraseSetRequest|null|undefined, + {}|null|undefined>): void; + updatePhraseSet( + request?: protos.google.cloud.speech.v1p1beta1.IUpdatePhraseSetRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.speech.v1p1beta1.IPhraseSet, + protos.google.cloud.speech.v1p1beta1.IUpdatePhraseSetRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.speech.v1p1beta1.IPhraseSet, + protos.google.cloud.speech.v1p1beta1.IUpdatePhraseSetRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.speech.v1p1beta1.IPhraseSet, + protos.google.cloud.speech.v1p1beta1.IUpdatePhraseSetRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'phrase_set.name': request.phraseSet!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updatePhraseSet request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.speech.v1p1beta1.IPhraseSet, + protos.google.cloud.speech.v1p1beta1.IUpdatePhraseSetRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updatePhraseSet response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updatePhraseSet(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.speech.v1p1beta1.IPhraseSet, + protos.google.cloud.speech.v1p1beta1.IUpdatePhraseSetRequest|undefined, + {}|undefined + ]) => { + this._log.info('updatePhraseSet response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Delete a phrase set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the phrase set to delete. Format: + * + * `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1p1beta1/adaptation.delete_phrase_set.js + * region_tag:speech_v1p1beta1_generated_Adaptation_DeletePhraseSet_async + */ + deletePhraseSet( + request?: protos.google.cloud.speech.v1p1beta1.IDeletePhraseSetRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1p1beta1.IDeletePhraseSetRequest|undefined, {}|undefined + ]>; + deletePhraseSet( + request: protos.google.cloud.speech.v1p1beta1.IDeletePhraseSetRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1p1beta1.IDeletePhraseSetRequest|null|undefined, + {}|null|undefined>): void; + deletePhraseSet( + request: protos.google.cloud.speech.v1p1beta1.IDeletePhraseSetRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1p1beta1.IDeletePhraseSetRequest|null|undefined, + {}|null|undefined>): void; + deletePhraseSet( + request?: protos.google.cloud.speech.v1p1beta1.IDeletePhraseSetRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1p1beta1.IDeletePhraseSetRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1p1beta1.IDeletePhraseSetRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1p1beta1.IDeletePhraseSetRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('deletePhraseSet request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1p1beta1.IDeletePhraseSetRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deletePhraseSet response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deletePhraseSet(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1p1beta1.IDeletePhraseSetRequest|undefined, + {}|undefined + ]) => { + this._log.info('deletePhraseSet response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Create a custom class. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource where this custom class will be created. + * Format: + * + * `projects/{project}/locations/{location}/customClasses` + * + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + * @param {string} request.customClassId + * Required. The ID to use for the custom class, which will become the final + * component of the custom class' resource name. + * + * This value should restrict to letters, numbers, and hyphens, with the first + * character a letter, the last a letter or a number, and be 4-63 characters. + * @param {google.cloud.speech.v1p1beta1.CustomClass} request.customClass + * Required. The custom class to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.speech.v1p1beta1.CustomClass|CustomClass}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1p1beta1/adaptation.create_custom_class.js + * region_tag:speech_v1p1beta1_generated_Adaptation_CreateCustomClass_async + */ + createCustomClass( + request?: protos.google.cloud.speech.v1p1beta1.ICreateCustomClassRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.speech.v1p1beta1.ICustomClass, + protos.google.cloud.speech.v1p1beta1.ICreateCustomClassRequest|undefined, {}|undefined + ]>; + createCustomClass( + request: protos.google.cloud.speech.v1p1beta1.ICreateCustomClassRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.speech.v1p1beta1.ICustomClass, + protos.google.cloud.speech.v1p1beta1.ICreateCustomClassRequest|null|undefined, + {}|null|undefined>): void; + createCustomClass( + request: protos.google.cloud.speech.v1p1beta1.ICreateCustomClassRequest, + callback: Callback< + protos.google.cloud.speech.v1p1beta1.ICustomClass, + protos.google.cloud.speech.v1p1beta1.ICreateCustomClassRequest|null|undefined, + {}|null|undefined>): void; + createCustomClass( + request?: protos.google.cloud.speech.v1p1beta1.ICreateCustomClassRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.speech.v1p1beta1.ICustomClass, + protos.google.cloud.speech.v1p1beta1.ICreateCustomClassRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.speech.v1p1beta1.ICustomClass, + protos.google.cloud.speech.v1p1beta1.ICreateCustomClassRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.speech.v1p1beta1.ICustomClass, + protos.google.cloud.speech.v1p1beta1.ICreateCustomClassRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createCustomClass request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.speech.v1p1beta1.ICustomClass, + protos.google.cloud.speech.v1p1beta1.ICreateCustomClassRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createCustomClass response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createCustomClass(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.speech.v1p1beta1.ICustomClass, + protos.google.cloud.speech.v1p1beta1.ICreateCustomClassRequest|undefined, + {}|undefined + ]) => { + this._log.info('createCustomClass response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Get a custom class. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the custom class to retrieve. Format: + * + * `projects/{project}/locations/{location}/customClasses/{custom_class}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.speech.v1p1beta1.CustomClass|CustomClass}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1p1beta1/adaptation.get_custom_class.js + * region_tag:speech_v1p1beta1_generated_Adaptation_GetCustomClass_async + */ + getCustomClass( + request?: protos.google.cloud.speech.v1p1beta1.IGetCustomClassRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.speech.v1p1beta1.ICustomClass, + protos.google.cloud.speech.v1p1beta1.IGetCustomClassRequest|undefined, {}|undefined + ]>; + getCustomClass( + request: protos.google.cloud.speech.v1p1beta1.IGetCustomClassRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.speech.v1p1beta1.ICustomClass, + protos.google.cloud.speech.v1p1beta1.IGetCustomClassRequest|null|undefined, + {}|null|undefined>): void; + getCustomClass( + request: protos.google.cloud.speech.v1p1beta1.IGetCustomClassRequest, + callback: Callback< + protos.google.cloud.speech.v1p1beta1.ICustomClass, + protos.google.cloud.speech.v1p1beta1.IGetCustomClassRequest|null|undefined, + {}|null|undefined>): void; + getCustomClass( + request?: protos.google.cloud.speech.v1p1beta1.IGetCustomClassRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.speech.v1p1beta1.ICustomClass, + protos.google.cloud.speech.v1p1beta1.IGetCustomClassRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.speech.v1p1beta1.ICustomClass, + protos.google.cloud.speech.v1p1beta1.IGetCustomClassRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.speech.v1p1beta1.ICustomClass, + protos.google.cloud.speech.v1p1beta1.IGetCustomClassRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getCustomClass request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.speech.v1p1beta1.ICustomClass, + protos.google.cloud.speech.v1p1beta1.IGetCustomClassRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getCustomClass response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getCustomClass(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.speech.v1p1beta1.ICustomClass, + protos.google.cloud.speech.v1p1beta1.IGetCustomClassRequest|undefined, + {}|undefined + ]) => { + this._log.info('getCustomClass response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Update a custom class. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.speech.v1p1beta1.CustomClass} request.customClass + * Required. The custom class to update. + * + * The custom class's `name` field is used to identify the custom class to be + * updated. Format: + * + * `projects/{project}/locations/{location}/customClasses/{custom_class}` + * + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + * @param {google.protobuf.FieldMask} request.updateMask + * The list of fields to be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.speech.v1p1beta1.CustomClass|CustomClass}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1p1beta1/adaptation.update_custom_class.js + * region_tag:speech_v1p1beta1_generated_Adaptation_UpdateCustomClass_async + */ + updateCustomClass( + request?: protos.google.cloud.speech.v1p1beta1.IUpdateCustomClassRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.speech.v1p1beta1.ICustomClass, + protos.google.cloud.speech.v1p1beta1.IUpdateCustomClassRequest|undefined, {}|undefined + ]>; + updateCustomClass( + request: protos.google.cloud.speech.v1p1beta1.IUpdateCustomClassRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.speech.v1p1beta1.ICustomClass, + protos.google.cloud.speech.v1p1beta1.IUpdateCustomClassRequest|null|undefined, + {}|null|undefined>): void; + updateCustomClass( + request: protos.google.cloud.speech.v1p1beta1.IUpdateCustomClassRequest, + callback: Callback< + protos.google.cloud.speech.v1p1beta1.ICustomClass, + protos.google.cloud.speech.v1p1beta1.IUpdateCustomClassRequest|null|undefined, + {}|null|undefined>): void; + updateCustomClass( + request?: protos.google.cloud.speech.v1p1beta1.IUpdateCustomClassRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.speech.v1p1beta1.ICustomClass, + protos.google.cloud.speech.v1p1beta1.IUpdateCustomClassRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.speech.v1p1beta1.ICustomClass, + protos.google.cloud.speech.v1p1beta1.IUpdateCustomClassRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.speech.v1p1beta1.ICustomClass, + protos.google.cloud.speech.v1p1beta1.IUpdateCustomClassRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'custom_class.name': request.customClass!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateCustomClass request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.speech.v1p1beta1.ICustomClass, + protos.google.cloud.speech.v1p1beta1.IUpdateCustomClassRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateCustomClass response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateCustomClass(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.speech.v1p1beta1.ICustomClass, + protos.google.cloud.speech.v1p1beta1.IUpdateCustomClassRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateCustomClass response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Delete a custom class. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the custom class to delete. Format: + * + * `projects/{project}/locations/{location}/customClasses/{custom_class}` + * + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1p1beta1/adaptation.delete_custom_class.js + * region_tag:speech_v1p1beta1_generated_Adaptation_DeleteCustomClass_async + */ + deleteCustomClass( + request?: protos.google.cloud.speech.v1p1beta1.IDeleteCustomClassRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1p1beta1.IDeleteCustomClassRequest|undefined, {}|undefined + ]>; + deleteCustomClass( + request: protos.google.cloud.speech.v1p1beta1.IDeleteCustomClassRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1p1beta1.IDeleteCustomClassRequest|null|undefined, + {}|null|undefined>): void; + deleteCustomClass( + request: protos.google.cloud.speech.v1p1beta1.IDeleteCustomClassRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1p1beta1.IDeleteCustomClassRequest|null|undefined, + {}|null|undefined>): void; + deleteCustomClass( + request?: protos.google.cloud.speech.v1p1beta1.IDeleteCustomClassRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1p1beta1.IDeleteCustomClassRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1p1beta1.IDeleteCustomClassRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1p1beta1.IDeleteCustomClassRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('deleteCustomClass request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1p1beta1.IDeleteCustomClassRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteCustomClass response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteCustomClass(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.speech.v1p1beta1.IDeleteCustomClassRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteCustomClass response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } + + /** + * List phrase sets. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of phrase set. Format: + * + * `projects/{project}/locations/{location}` + * + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + * @param {number} request.pageSize + * The maximum number of phrase sets to return. The service may return + * fewer than this value. If unspecified, at most 50 phrase sets will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListPhraseSet` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListPhraseSet` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.speech.v1p1beta1.PhraseSet|PhraseSet}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listPhraseSetAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listPhraseSet( + request?: protos.google.cloud.speech.v1p1beta1.IListPhraseSetRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.speech.v1p1beta1.IPhraseSet[], + protos.google.cloud.speech.v1p1beta1.IListPhraseSetRequest|null, + protos.google.cloud.speech.v1p1beta1.IListPhraseSetResponse + ]>; + listPhraseSet( + request: protos.google.cloud.speech.v1p1beta1.IListPhraseSetRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.speech.v1p1beta1.IListPhraseSetRequest, + protos.google.cloud.speech.v1p1beta1.IListPhraseSetResponse|null|undefined, + protos.google.cloud.speech.v1p1beta1.IPhraseSet>): void; + listPhraseSet( + request: protos.google.cloud.speech.v1p1beta1.IListPhraseSetRequest, + callback: PaginationCallback< + protos.google.cloud.speech.v1p1beta1.IListPhraseSetRequest, + protos.google.cloud.speech.v1p1beta1.IListPhraseSetResponse|null|undefined, + protos.google.cloud.speech.v1p1beta1.IPhraseSet>): void; + listPhraseSet( + request?: protos.google.cloud.speech.v1p1beta1.IListPhraseSetRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.speech.v1p1beta1.IListPhraseSetRequest, + protos.google.cloud.speech.v1p1beta1.IListPhraseSetResponse|null|undefined, + protos.google.cloud.speech.v1p1beta1.IPhraseSet>, + callback?: PaginationCallback< + protos.google.cloud.speech.v1p1beta1.IListPhraseSetRequest, + protos.google.cloud.speech.v1p1beta1.IListPhraseSetResponse|null|undefined, + protos.google.cloud.speech.v1p1beta1.IPhraseSet>): + Promise<[ + protos.google.cloud.speech.v1p1beta1.IPhraseSet[], + protos.google.cloud.speech.v1p1beta1.IListPhraseSetRequest|null, + protos.google.cloud.speech.v1p1beta1.IListPhraseSetResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.speech.v1p1beta1.IListPhraseSetRequest, + protos.google.cloud.speech.v1p1beta1.IListPhraseSetResponse|null|undefined, + protos.google.cloud.speech.v1p1beta1.IPhraseSet>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listPhraseSet values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listPhraseSet request %j', request); + return this.innerApiCalls + .listPhraseSet(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.speech.v1p1beta1.IPhraseSet[], + protos.google.cloud.speech.v1p1beta1.IListPhraseSetRequest|null, + protos.google.cloud.speech.v1p1beta1.IListPhraseSetResponse + ]) => { + this._log.info('listPhraseSet values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listPhraseSet`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of phrase set. Format: + * + * `projects/{project}/locations/{location}` + * + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + * @param {number} request.pageSize + * The maximum number of phrase sets to return. The service may return + * fewer than this value. If unspecified, at most 50 phrase sets will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListPhraseSet` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListPhraseSet` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.speech.v1p1beta1.PhraseSet|PhraseSet} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listPhraseSetAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listPhraseSetStream( + request?: protos.google.cloud.speech.v1p1beta1.IListPhraseSetRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listPhraseSet']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listPhraseSet stream %j', request); + return this.descriptors.page.listPhraseSet.createStream( + this.innerApiCalls.listPhraseSet as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listPhraseSet`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of phrase set. Format: + * + * `projects/{project}/locations/{location}` + * + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + * @param {number} request.pageSize + * The maximum number of phrase sets to return. The service may return + * fewer than this value. If unspecified, at most 50 phrase sets will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListPhraseSet` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListPhraseSet` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.speech.v1p1beta1.PhraseSet|PhraseSet}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1p1beta1/adaptation.list_phrase_set.js + * region_tag:speech_v1p1beta1_generated_Adaptation_ListPhraseSet_async + */ + listPhraseSetAsync( + request?: protos.google.cloud.speech.v1p1beta1.IListPhraseSetRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listPhraseSet']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listPhraseSet iterate %j', request); + return this.descriptors.page.listPhraseSet.asyncIterate( + this.innerApiCalls['listPhraseSet'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * List custom classes. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of custom classes. Format: + * + * `projects/{project}/locations/{location}/customClasses` + * + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + * @param {number} request.pageSize + * The maximum number of custom classes to return. The service may return + * fewer than this value. If unspecified, at most 50 custom classes will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListCustomClass` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListCustomClass` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.speech.v1p1beta1.CustomClass|CustomClass}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listCustomClassesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listCustomClasses( + request?: protos.google.cloud.speech.v1p1beta1.IListCustomClassesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.speech.v1p1beta1.ICustomClass[], + protos.google.cloud.speech.v1p1beta1.IListCustomClassesRequest|null, + protos.google.cloud.speech.v1p1beta1.IListCustomClassesResponse + ]>; + listCustomClasses( + request: protos.google.cloud.speech.v1p1beta1.IListCustomClassesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.speech.v1p1beta1.IListCustomClassesRequest, + protos.google.cloud.speech.v1p1beta1.IListCustomClassesResponse|null|undefined, + protos.google.cloud.speech.v1p1beta1.ICustomClass>): void; + listCustomClasses( + request: protos.google.cloud.speech.v1p1beta1.IListCustomClassesRequest, + callback: PaginationCallback< + protos.google.cloud.speech.v1p1beta1.IListCustomClassesRequest, + protos.google.cloud.speech.v1p1beta1.IListCustomClassesResponse|null|undefined, + protos.google.cloud.speech.v1p1beta1.ICustomClass>): void; + listCustomClasses( + request?: protos.google.cloud.speech.v1p1beta1.IListCustomClassesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.speech.v1p1beta1.IListCustomClassesRequest, + protos.google.cloud.speech.v1p1beta1.IListCustomClassesResponse|null|undefined, + protos.google.cloud.speech.v1p1beta1.ICustomClass>, + callback?: PaginationCallback< + protos.google.cloud.speech.v1p1beta1.IListCustomClassesRequest, + protos.google.cloud.speech.v1p1beta1.IListCustomClassesResponse|null|undefined, + protos.google.cloud.speech.v1p1beta1.ICustomClass>): + Promise<[ + protos.google.cloud.speech.v1p1beta1.ICustomClass[], + protos.google.cloud.speech.v1p1beta1.IListCustomClassesRequest|null, + protos.google.cloud.speech.v1p1beta1.IListCustomClassesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.speech.v1p1beta1.IListCustomClassesRequest, + protos.google.cloud.speech.v1p1beta1.IListCustomClassesResponse|null|undefined, + protos.google.cloud.speech.v1p1beta1.ICustomClass>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listCustomClasses values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listCustomClasses request %j', request); + return this.innerApiCalls + .listCustomClasses(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.speech.v1p1beta1.ICustomClass[], + protos.google.cloud.speech.v1p1beta1.IListCustomClassesRequest|null, + protos.google.cloud.speech.v1p1beta1.IListCustomClassesResponse + ]) => { + this._log.info('listCustomClasses values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listCustomClasses`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of custom classes. Format: + * + * `projects/{project}/locations/{location}/customClasses` + * + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + * @param {number} request.pageSize + * The maximum number of custom classes to return. The service may return + * fewer than this value. If unspecified, at most 50 custom classes will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListCustomClass` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListCustomClass` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.speech.v1p1beta1.CustomClass|CustomClass} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listCustomClassesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listCustomClassesStream( + request?: protos.google.cloud.speech.v1p1beta1.IListCustomClassesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listCustomClasses']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listCustomClasses stream %j', request); + return this.descriptors.page.listCustomClasses.createStream( + this.innerApiCalls.listCustomClasses as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listCustomClasses`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of custom classes. Format: + * + * `projects/{project}/locations/{location}/customClasses` + * + * Speech-to-Text supports three locations: `global`, `us` (US North America), + * and `eu` (Europe). If you are calling the `speech.googleapis.com` + * endpoint, use the `global` location. To specify a region, use a + * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + * with matching `us` or `eu` location value. + * @param {number} request.pageSize + * The maximum number of custom classes to return. The service may return + * fewer than this value. If unspecified, at most 50 custom classes will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListCustomClass` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListCustomClass` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.speech.v1p1beta1.CustomClass|CustomClass}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1p1beta1/adaptation.list_custom_classes.js + * region_tag:speech_v1p1beta1_generated_Adaptation_ListCustomClasses_async + */ + listCustomClassesAsync( + request?: protos.google.cloud.speech.v1p1beta1.IListCustomClassesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listCustomClasses']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listCustomClasses iterate %j', request); + return this.descriptors.page.listCustomClasses.asyncIterate( + this.innerApiCalls['listCustomClasses'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified customClass resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} custom_class + * @returns {string} Resource name string. + */ + customClassPath(project:string,location:string,customClass:string) { + return this.pathTemplates.customClassPathTemplate.render({ + project: project, + location: location, + custom_class: customClass, + }); + } + + /** + * Parse the project from CustomClass resource. + * + * @param {string} customClassName + * A fully-qualified path representing CustomClass resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCustomClassName(customClassName: string) { + return this.pathTemplates.customClassPathTemplate.match(customClassName).project; + } + + /** + * Parse the location from CustomClass resource. + * + * @param {string} customClassName + * A fully-qualified path representing CustomClass resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCustomClassName(customClassName: string) { + return this.pathTemplates.customClassPathTemplate.match(customClassName).location; + } + + /** + * Parse the custom_class from CustomClass resource. + * + * @param {string} customClassName + * A fully-qualified path representing CustomClass resource. + * @returns {string} A string representing the custom_class. + */ + matchCustomClassFromCustomClassName(customClassName: string) { + return this.pathTemplates.customClassPathTemplate.match(customClassName).custom_class; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified phraseSet resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} phrase_set + * @returns {string} Resource name string. + */ + phraseSetPath(project:string,location:string,phraseSet:string) { + return this.pathTemplates.phraseSetPathTemplate.render({ + project: project, + location: location, + phrase_set: phraseSet, + }); + } + + /** + * Parse the project from PhraseSet resource. + * + * @param {string} phraseSetName + * A fully-qualified path representing PhraseSet resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPhraseSetName(phraseSetName: string) { + return this.pathTemplates.phraseSetPathTemplate.match(phraseSetName).project; + } + + /** + * Parse the location from PhraseSet resource. + * + * @param {string} phraseSetName + * A fully-qualified path representing PhraseSet resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPhraseSetName(phraseSetName: string) { + return this.pathTemplates.phraseSetPathTemplate.match(phraseSetName).location; + } + + /** + * Parse the phrase_set from PhraseSet resource. + * + * @param {string} phraseSetName + * A fully-qualified path representing PhraseSet resource. + * @returns {string} A string representing the phrase_set. + */ + matchPhraseSetFromPhraseSetName(phraseSetName: string) { + return this.pathTemplates.phraseSetPathTemplate.match(phraseSetName).phrase_set; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project:string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.adaptationStub && !this._terminated) { + return this.adaptationStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v1p1beta1/adaptation_client_config.json b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v1p1beta1/adaptation_client_config.json new file mode 100644 index 00000000000..9de684473a2 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v1p1beta1/adaptation_client_config.json @@ -0,0 +1,66 @@ +{ + "interfaces": { + "google.cloud.speech.v1p1beta1.Adaptation": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreatePhraseSet": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetPhraseSet": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListPhraseSet": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdatePhraseSet": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeletePhraseSet": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateCustomClass": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetCustomClass": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListCustomClasses": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateCustomClass": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteCustomClass": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v1p1beta1/adaptation_proto_list.json b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v1p1beta1/adaptation_proto_list.json new file mode 100644 index 00000000000..d05ded22dc9 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v1p1beta1/adaptation_proto_list.json @@ -0,0 +1,5 @@ +[ + "../../protos/google/cloud/speech/v1p1beta1/cloud_speech.proto", + "../../protos/google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto", + "../../protos/google/cloud/speech/v1p1beta1/resource.proto" +] diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v1p1beta1/gapic_metadata.json b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v1p1beta1/gapic_metadata.json new file mode 100644 index 00000000000..deb25a92d68 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v1p1beta1/gapic_metadata.json @@ -0,0 +1,170 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.speech.v1p1beta1", + "libraryPackage": "@google-cloud/speech", + "services": { + "Adaptation": { + "clients": { + "grpc": { + "libraryClient": "AdaptationClient", + "rpcs": { + "CreatePhraseSet": { + "methods": [ + "createPhraseSet" + ] + }, + "GetPhraseSet": { + "methods": [ + "getPhraseSet" + ] + }, + "UpdatePhraseSet": { + "methods": [ + "updatePhraseSet" + ] + }, + "DeletePhraseSet": { + "methods": [ + "deletePhraseSet" + ] + }, + "CreateCustomClass": { + "methods": [ + "createCustomClass" + ] + }, + "GetCustomClass": { + "methods": [ + "getCustomClass" + ] + }, + "UpdateCustomClass": { + "methods": [ + "updateCustomClass" + ] + }, + "DeleteCustomClass": { + "methods": [ + "deleteCustomClass" + ] + }, + "ListPhraseSet": { + "methods": [ + "listPhraseSet", + "listPhraseSetStream", + "listPhraseSetAsync" + ] + }, + "ListCustomClasses": { + "methods": [ + "listCustomClasses", + "listCustomClassesStream", + "listCustomClassesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "AdaptationClient", + "rpcs": { + "CreatePhraseSet": { + "methods": [ + "createPhraseSet" + ] + }, + "GetPhraseSet": { + "methods": [ + "getPhraseSet" + ] + }, + "UpdatePhraseSet": { + "methods": [ + "updatePhraseSet" + ] + }, + "DeletePhraseSet": { + "methods": [ + "deletePhraseSet" + ] + }, + "CreateCustomClass": { + "methods": [ + "createCustomClass" + ] + }, + "GetCustomClass": { + "methods": [ + "getCustomClass" + ] + }, + "UpdateCustomClass": { + "methods": [ + "updateCustomClass" + ] + }, + "DeleteCustomClass": { + "methods": [ + "deleteCustomClass" + ] + }, + "ListPhraseSet": { + "methods": [ + "listPhraseSet", + "listPhraseSetStream", + "listPhraseSetAsync" + ] + }, + "ListCustomClasses": { + "methods": [ + "listCustomClasses", + "listCustomClassesStream", + "listCustomClassesAsync" + ] + } + } + } + } + }, + "Speech": { + "clients": { + "grpc": { + "libraryClient": "SpeechClient", + "rpcs": { + "Recognize": { + "methods": [ + "recognize" + ] + }, + "StreamingRecognize": { + "methods": [ + "streamingRecognize" + ] + }, + "LongRunningRecognize": { + "methods": [ + "longRunningRecognize" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "SpeechClient", + "rpcs": { + "Recognize": { + "methods": [ + "recognize" + ] + }, + "LongRunningRecognize": { + "methods": [ + "longRunningRecognize" + ] + } + } + } + } + } + } +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v1p1beta1/index.ts b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v1p1beta1/index.ts new file mode 100644 index 00000000000..4a66bbeb5ff --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v1p1beta1/index.ts @@ -0,0 +1,20 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {AdaptationClient} from './adaptation_client'; +export {SpeechClient} from './speech_client'; diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v1p1beta1/speech_client.ts b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v1p1beta1/speech_client.ts new file mode 100644 index 00000000000..9a9273a3f47 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v1p1beta1/speech_client.ts @@ -0,0 +1,946 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation} from 'google-gax'; +import {PassThrough} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1p1beta1/speech_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './speech_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service that implements Google Cloud Speech API. + * @class + * @memberof v1p1beta1 + */ +export class SpeechClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('speech'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + speechStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of SpeechClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new SpeechClient({fallback: true}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof SpeechClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'speech.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + customClassPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/customClasses/{custom_class}' + ), + phraseSetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/phraseSets/{phrase_set}' + ), + }; + + // Some of the methods on this service provide streaming responses. + // Provide descriptors for these. + this.descriptors.stream = { + streamingRecognize: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.BIDI_STREAMING, !!opts.fallback, !!opts.gaxServerStreamingRetries) + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.longrunning.Operations.GetOperation',get: '/v1p1beta1/operations/{name=**}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v1p1beta1/operations',}]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); + const longRunningRecognizeResponse = protoFilesRoot.lookup( + '.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse') as gax.protobuf.Type; + const longRunningRecognizeMetadata = protoFilesRoot.lookup( + '.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + longRunningRecognize: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + longRunningRecognizeResponse.decode.bind(longRunningRecognizeResponse), + longRunningRecognizeMetadata.decode.bind(longRunningRecognizeMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.speech.v1p1beta1.Speech', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.speechStub) { + return this.speechStub; + } + + // Put together the "service stub" for + // google.cloud.speech.v1p1beta1.Speech. + this.speechStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.speech.v1p1beta1.Speech') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.speech.v1p1beta1.Speech, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const speechStubMethods = + ['recognize', 'longRunningRecognize', 'streamingRecognize']; + for (const methodName of speechStubMethods) { + const callPromise = this.speechStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + if (methodName in this.descriptors.stream) { + const stream = new PassThrough({objectMode: true}); + setImmediate(() => { + stream.emit('error', new this._gaxModule.GoogleError('The client has already been closed.')); + }); + return stream; + } + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.stream[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.speechStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'speech.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'speech.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Performs synchronous speech recognition: receive results after all audio + * has been sent and processed. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.speech.v1p1beta1.RecognitionConfig} request.config + * Required. Provides information to the recognizer that specifies how to + * process the request. + * @param {google.cloud.speech.v1p1beta1.RecognitionAudio} request.audio + * Required. The audio data to be recognized. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.speech.v1p1beta1.RecognizeResponse|RecognizeResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1p1beta1/speech.recognize.js + * region_tag:speech_v1p1beta1_generated_Speech_Recognize_async + */ + recognize( + request?: protos.google.cloud.speech.v1p1beta1.IRecognizeRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.speech.v1p1beta1.IRecognizeResponse, + protos.google.cloud.speech.v1p1beta1.IRecognizeRequest|undefined, {}|undefined + ]>; + recognize( + request: protos.google.cloud.speech.v1p1beta1.IRecognizeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.speech.v1p1beta1.IRecognizeResponse, + protos.google.cloud.speech.v1p1beta1.IRecognizeRequest|null|undefined, + {}|null|undefined>): void; + recognize( + request: protos.google.cloud.speech.v1p1beta1.IRecognizeRequest, + callback: Callback< + protos.google.cloud.speech.v1p1beta1.IRecognizeResponse, + protos.google.cloud.speech.v1p1beta1.IRecognizeRequest|null|undefined, + {}|null|undefined>): void; + recognize( + request?: protos.google.cloud.speech.v1p1beta1.IRecognizeRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.speech.v1p1beta1.IRecognizeResponse, + protos.google.cloud.speech.v1p1beta1.IRecognizeRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.speech.v1p1beta1.IRecognizeResponse, + protos.google.cloud.speech.v1p1beta1.IRecognizeRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.speech.v1p1beta1.IRecognizeResponse, + protos.google.cloud.speech.v1p1beta1.IRecognizeRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + this.initialize().catch(err => {throw err}); + this._log.info('recognize request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.speech.v1p1beta1.IRecognizeResponse, + protos.google.cloud.speech.v1p1beta1.IRecognizeRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('recognize response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.recognize(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.speech.v1p1beta1.IRecognizeResponse, + protos.google.cloud.speech.v1p1beta1.IRecognizeRequest|undefined, + {}|undefined + ]) => { + this._log.info('recognize response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } + +/** + * Performs bidirectional streaming speech recognition: receive results while + * sending audio. This method is only available via the gRPC API (not REST). + * + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which is both readable and writable. It accepts objects + * representing {@link protos.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest|StreamingRecognizeRequest} for write() method, and + * will emit objects representing {@link protos.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse|StreamingRecognizeResponse} on 'data' event asynchronously. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#bi-directional-streaming | documentation } + * for more details and examples. + * @example include:samples/generated/v1p1beta1/speech.streaming_recognize.js + * region_tag:speech_v1p1beta1_generated_Speech_StreamingRecognize_async + */ + streamingRecognize( + options?: CallOptions): + gax.CancellableStream { + this.initialize().catch(err => {throw err}); + this._log.info('streamingRecognize stream %j', options); + return this.innerApiCalls.streamingRecognize(null, options); + } + +/** + * Performs asynchronous speech recognition: receive results via the + * google.longrunning.Operations interface. Returns either an + * `Operation.error` or an `Operation.response` which contains + * a `LongRunningRecognizeResponse` message. + * For more information on asynchronous speech recognition, see the + * [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.speech.v1p1beta1.RecognitionConfig} request.config + * Required. Provides information to the recognizer that specifies how to + * process the request. + * @param {google.cloud.speech.v1p1beta1.RecognitionAudio} request.audio + * Required. The audio data to be recognized. + * @param {google.cloud.speech.v1p1beta1.TranscriptOutputConfig} [request.outputConfig] + * Optional. Specifies an optional destination for the recognition results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1p1beta1/speech.long_running_recognize.js + * region_tag:speech_v1p1beta1_generated_Speech_LongRunningRecognize_async + */ + longRunningRecognize( + request?: protos.google.cloud.speech.v1p1beta1.ILongRunningRecognizeRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + longRunningRecognize( + request: protos.google.cloud.speech.v1p1beta1.ILongRunningRecognizeRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + longRunningRecognize( + request: protos.google.cloud.speech.v1p1beta1.ILongRunningRecognizeRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + longRunningRecognize( + request?: protos.google.cloud.speech.v1p1beta1.ILongRunningRecognizeRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('longRunningRecognize response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('longRunningRecognize request %j', request); + return this.innerApiCalls.longRunningRecognize(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('longRunningRecognize response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `longRunningRecognize()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1p1beta1/speech.long_running_recognize.js + * region_tag:speech_v1p1beta1_generated_Speech_LongRunningRecognize_async + */ + async checkLongRunningRecognizeProgress(name: string): Promise>{ + this._log.info('longRunningRecognize long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.longRunningRecognize, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified customClass resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} custom_class + * @returns {string} Resource name string. + */ + customClassPath(project:string,location:string,customClass:string) { + return this.pathTemplates.customClassPathTemplate.render({ + project: project, + location: location, + custom_class: customClass, + }); + } + + /** + * Parse the project from CustomClass resource. + * + * @param {string} customClassName + * A fully-qualified path representing CustomClass resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCustomClassName(customClassName: string) { + return this.pathTemplates.customClassPathTemplate.match(customClassName).project; + } + + /** + * Parse the location from CustomClass resource. + * + * @param {string} customClassName + * A fully-qualified path representing CustomClass resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCustomClassName(customClassName: string) { + return this.pathTemplates.customClassPathTemplate.match(customClassName).location; + } + + /** + * Parse the custom_class from CustomClass resource. + * + * @param {string} customClassName + * A fully-qualified path representing CustomClass resource. + * @returns {string} A string representing the custom_class. + */ + matchCustomClassFromCustomClassName(customClassName: string) { + return this.pathTemplates.customClassPathTemplate.match(customClassName).custom_class; + } + + /** + * Return a fully-qualified phraseSet resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} phrase_set + * @returns {string} Resource name string. + */ + phraseSetPath(project:string,location:string,phraseSet:string) { + return this.pathTemplates.phraseSetPathTemplate.render({ + project: project, + location: location, + phrase_set: phraseSet, + }); + } + + /** + * Parse the project from PhraseSet resource. + * + * @param {string} phraseSetName + * A fully-qualified path representing PhraseSet resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPhraseSetName(phraseSetName: string) { + return this.pathTemplates.phraseSetPathTemplate.match(phraseSetName).project; + } + + /** + * Parse the location from PhraseSet resource. + * + * @param {string} phraseSetName + * A fully-qualified path representing PhraseSet resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPhraseSetName(phraseSetName: string) { + return this.pathTemplates.phraseSetPathTemplate.match(phraseSetName).location; + } + + /** + * Parse the phrase_set from PhraseSet resource. + * + * @param {string} phraseSetName + * A fully-qualified path representing PhraseSet resource. + * @returns {string} A string representing the phrase_set. + */ + matchPhraseSetFromPhraseSetName(phraseSetName: string) { + return this.pathTemplates.phraseSetPathTemplate.match(phraseSetName).phrase_set; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.speechStub && !this._terminated) { + return this.speechStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v1p1beta1/speech_client_config.json b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v1p1beta1/speech_client_config.json new file mode 100644 index 00000000000..c5e1b104db1 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v1p1beta1/speech_client_config.json @@ -0,0 +1,41 @@ +{ + "interfaces": { + "google.cloud.speech.v1p1beta1.Speech": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "Recognize": { + "timeout_millis": 5000000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "LongRunningRecognize": { + "timeout_millis": 5000000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "StreamingRecognize": { + "timeout_millis": 5000000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v1p1beta1/speech_proto_list.json b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v1p1beta1/speech_proto_list.json new file mode 100644 index 00000000000..d05ded22dc9 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v1p1beta1/speech_proto_list.json @@ -0,0 +1,5 @@ +[ + "../../protos/google/cloud/speech/v1p1beta1/cloud_speech.proto", + "../../protos/google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto", + "../../protos/google/cloud/speech/v1p1beta1/resource.proto" +] diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v2/gapic_metadata.json b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v2/gapic_metadata.json new file mode 100644 index 00000000000..9024d779705 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v2/gapic_metadata.json @@ -0,0 +1,260 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.speech.v2", + "libraryPackage": "@google-cloud/speech", + "services": { + "Speech": { + "clients": { + "grpc": { + "libraryClient": "SpeechClient", + "rpcs": { + "GetRecognizer": { + "methods": [ + "getRecognizer" + ] + }, + "Recognize": { + "methods": [ + "recognize" + ] + }, + "GetConfig": { + "methods": [ + "getConfig" + ] + }, + "UpdateConfig": { + "methods": [ + "updateConfig" + ] + }, + "GetCustomClass": { + "methods": [ + "getCustomClass" + ] + }, + "GetPhraseSet": { + "methods": [ + "getPhraseSet" + ] + }, + "StreamingRecognize": { + "methods": [ + "streamingRecognize" + ] + }, + "CreateRecognizer": { + "methods": [ + "createRecognizer" + ] + }, + "UpdateRecognizer": { + "methods": [ + "updateRecognizer" + ] + }, + "DeleteRecognizer": { + "methods": [ + "deleteRecognizer" + ] + }, + "UndeleteRecognizer": { + "methods": [ + "undeleteRecognizer" + ] + }, + "BatchRecognize": { + "methods": [ + "batchRecognize" + ] + }, + "CreateCustomClass": { + "methods": [ + "createCustomClass" + ] + }, + "UpdateCustomClass": { + "methods": [ + "updateCustomClass" + ] + }, + "DeleteCustomClass": { + "methods": [ + "deleteCustomClass" + ] + }, + "UndeleteCustomClass": { + "methods": [ + "undeleteCustomClass" + ] + }, + "CreatePhraseSet": { + "methods": [ + "createPhraseSet" + ] + }, + "UpdatePhraseSet": { + "methods": [ + "updatePhraseSet" + ] + }, + "DeletePhraseSet": { + "methods": [ + "deletePhraseSet" + ] + }, + "UndeletePhraseSet": { + "methods": [ + "undeletePhraseSet" + ] + }, + "ListRecognizers": { + "methods": [ + "listRecognizers", + "listRecognizersStream", + "listRecognizersAsync" + ] + }, + "ListCustomClasses": { + "methods": [ + "listCustomClasses", + "listCustomClassesStream", + "listCustomClassesAsync" + ] + }, + "ListPhraseSets": { + "methods": [ + "listPhraseSets", + "listPhraseSetsStream", + "listPhraseSetsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "SpeechClient", + "rpcs": { + "GetRecognizer": { + "methods": [ + "getRecognizer" + ] + }, + "Recognize": { + "methods": [ + "recognize" + ] + }, + "GetConfig": { + "methods": [ + "getConfig" + ] + }, + "UpdateConfig": { + "methods": [ + "updateConfig" + ] + }, + "GetCustomClass": { + "methods": [ + "getCustomClass" + ] + }, + "GetPhraseSet": { + "methods": [ + "getPhraseSet" + ] + }, + "CreateRecognizer": { + "methods": [ + "createRecognizer" + ] + }, + "UpdateRecognizer": { + "methods": [ + "updateRecognizer" + ] + }, + "DeleteRecognizer": { + "methods": [ + "deleteRecognizer" + ] + }, + "UndeleteRecognizer": { + "methods": [ + "undeleteRecognizer" + ] + }, + "BatchRecognize": { + "methods": [ + "batchRecognize" + ] + }, + "CreateCustomClass": { + "methods": [ + "createCustomClass" + ] + }, + "UpdateCustomClass": { + "methods": [ + "updateCustomClass" + ] + }, + "DeleteCustomClass": { + "methods": [ + "deleteCustomClass" + ] + }, + "UndeleteCustomClass": { + "methods": [ + "undeleteCustomClass" + ] + }, + "CreatePhraseSet": { + "methods": [ + "createPhraseSet" + ] + }, + "UpdatePhraseSet": { + "methods": [ + "updatePhraseSet" + ] + }, + "DeletePhraseSet": { + "methods": [ + "deletePhraseSet" + ] + }, + "UndeletePhraseSet": { + "methods": [ + "undeletePhraseSet" + ] + }, + "ListRecognizers": { + "methods": [ + "listRecognizers", + "listRecognizersStream", + "listRecognizersAsync" + ] + }, + "ListCustomClasses": { + "methods": [ + "listCustomClasses", + "listCustomClassesStream", + "listCustomClassesAsync" + ] + }, + "ListPhraseSets": { + "methods": [ + "listPhraseSets", + "listPhraseSetsStream", + "listPhraseSetsAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v2/index.ts b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v2/index.ts new file mode 100644 index 00000000000..99820fa04f6 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v2/index.ts @@ -0,0 +1,19 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {SpeechClient} from './speech_client'; diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v2/speech_client.ts b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v2/speech_client.ts new file mode 100644 index 00000000000..16e9d8877ba --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v2/speech_client.ts @@ -0,0 +1,4074 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, LocationsClient, LocationProtos} from 'google-gax'; +import {Transform, PassThrough} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v2/speech_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './speech_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Enables speech transcription and resource management. + * @class + * @memberof v2 + */ +export class SpeechClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('speech'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + speechStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of SpeechClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new SpeechClient({fallback: true}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof SpeechClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'speech.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + configPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/config' + ), + cryptoKeyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}' + ), + cryptoKeyVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}' + ), + customClassPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/customClasses/{custom_class}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + phraseSetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/phraseSets/{phrase_set}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + recognizerPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/recognizers/{recognizer}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listRecognizers: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'recognizers'), + listCustomClasses: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'customClasses'), + listPhraseSets: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'phraseSets') + }; + + // Some of the methods on this service provide streaming responses. + // Provide descriptors for these. + this.descriptors.stream = { + streamingRecognize: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.BIDI_STREAMING, !!opts.fallback, !!opts.gaxServerStreamingRetries) + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/v2/{name=projects/*/locations/*}',},{selector: 'google.cloud.location.Locations.ListLocations',get: '/v2/{name=projects/*}/locations',},{selector: 'google.longrunning.Operations.CancelOperation',post: '/v2/{name=projects/*/locations/*/operations/*}:cancel',body: '*',},{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v2/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v2/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v2/{name=projects/*/locations/*}/operations',}]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); + const createRecognizerResponse = protoFilesRoot.lookup( + '.google.cloud.speech.v2.Recognizer') as gax.protobuf.Type; + const createRecognizerMetadata = protoFilesRoot.lookup( + '.google.cloud.speech.v2.OperationMetadata') as gax.protobuf.Type; + const updateRecognizerResponse = protoFilesRoot.lookup( + '.google.cloud.speech.v2.Recognizer') as gax.protobuf.Type; + const updateRecognizerMetadata = protoFilesRoot.lookup( + '.google.cloud.speech.v2.OperationMetadata') as gax.protobuf.Type; + const deleteRecognizerResponse = protoFilesRoot.lookup( + '.google.cloud.speech.v2.Recognizer') as gax.protobuf.Type; + const deleteRecognizerMetadata = protoFilesRoot.lookup( + '.google.cloud.speech.v2.OperationMetadata') as gax.protobuf.Type; + const undeleteRecognizerResponse = protoFilesRoot.lookup( + '.google.cloud.speech.v2.Recognizer') as gax.protobuf.Type; + const undeleteRecognizerMetadata = protoFilesRoot.lookup( + '.google.cloud.speech.v2.OperationMetadata') as gax.protobuf.Type; + const batchRecognizeResponse = protoFilesRoot.lookup( + '.google.cloud.speech.v2.BatchRecognizeResponse') as gax.protobuf.Type; + const batchRecognizeMetadata = protoFilesRoot.lookup( + '.google.cloud.speech.v2.OperationMetadata') as gax.protobuf.Type; + const createCustomClassResponse = protoFilesRoot.lookup( + '.google.cloud.speech.v2.CustomClass') as gax.protobuf.Type; + const createCustomClassMetadata = protoFilesRoot.lookup( + '.google.cloud.speech.v2.OperationMetadata') as gax.protobuf.Type; + const updateCustomClassResponse = protoFilesRoot.lookup( + '.google.cloud.speech.v2.CustomClass') as gax.protobuf.Type; + const updateCustomClassMetadata = protoFilesRoot.lookup( + '.google.cloud.speech.v2.OperationMetadata') as gax.protobuf.Type; + const deleteCustomClassResponse = protoFilesRoot.lookup( + '.google.cloud.speech.v2.CustomClass') as gax.protobuf.Type; + const deleteCustomClassMetadata = protoFilesRoot.lookup( + '.google.cloud.speech.v2.OperationMetadata') as gax.protobuf.Type; + const undeleteCustomClassResponse = protoFilesRoot.lookup( + '.google.cloud.speech.v2.CustomClass') as gax.protobuf.Type; + const undeleteCustomClassMetadata = protoFilesRoot.lookup( + '.google.cloud.speech.v2.OperationMetadata') as gax.protobuf.Type; + const createPhraseSetResponse = protoFilesRoot.lookup( + '.google.cloud.speech.v2.PhraseSet') as gax.protobuf.Type; + const createPhraseSetMetadata = protoFilesRoot.lookup( + '.google.cloud.speech.v2.OperationMetadata') as gax.protobuf.Type; + const updatePhraseSetResponse = protoFilesRoot.lookup( + '.google.cloud.speech.v2.PhraseSet') as gax.protobuf.Type; + const updatePhraseSetMetadata = protoFilesRoot.lookup( + '.google.cloud.speech.v2.OperationMetadata') as gax.protobuf.Type; + const deletePhraseSetResponse = protoFilesRoot.lookup( + '.google.cloud.speech.v2.PhraseSet') as gax.protobuf.Type; + const deletePhraseSetMetadata = protoFilesRoot.lookup( + '.google.cloud.speech.v2.OperationMetadata') as gax.protobuf.Type; + const undeletePhraseSetResponse = protoFilesRoot.lookup( + '.google.cloud.speech.v2.PhraseSet') as gax.protobuf.Type; + const undeletePhraseSetMetadata = protoFilesRoot.lookup( + '.google.cloud.speech.v2.OperationMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + createRecognizer: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createRecognizerResponse.decode.bind(createRecognizerResponse), + createRecognizerMetadata.decode.bind(createRecognizerMetadata)), + updateRecognizer: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateRecognizerResponse.decode.bind(updateRecognizerResponse), + updateRecognizerMetadata.decode.bind(updateRecognizerMetadata)), + deleteRecognizer: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteRecognizerResponse.decode.bind(deleteRecognizerResponse), + deleteRecognizerMetadata.decode.bind(deleteRecognizerMetadata)), + undeleteRecognizer: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + undeleteRecognizerResponse.decode.bind(undeleteRecognizerResponse), + undeleteRecognizerMetadata.decode.bind(undeleteRecognizerMetadata)), + batchRecognize: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + batchRecognizeResponse.decode.bind(batchRecognizeResponse), + batchRecognizeMetadata.decode.bind(batchRecognizeMetadata)), + createCustomClass: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createCustomClassResponse.decode.bind(createCustomClassResponse), + createCustomClassMetadata.decode.bind(createCustomClassMetadata)), + updateCustomClass: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateCustomClassResponse.decode.bind(updateCustomClassResponse), + updateCustomClassMetadata.decode.bind(updateCustomClassMetadata)), + deleteCustomClass: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteCustomClassResponse.decode.bind(deleteCustomClassResponse), + deleteCustomClassMetadata.decode.bind(deleteCustomClassMetadata)), + undeleteCustomClass: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + undeleteCustomClassResponse.decode.bind(undeleteCustomClassResponse), + undeleteCustomClassMetadata.decode.bind(undeleteCustomClassMetadata)), + createPhraseSet: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createPhraseSetResponse.decode.bind(createPhraseSetResponse), + createPhraseSetMetadata.decode.bind(createPhraseSetMetadata)), + updatePhraseSet: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updatePhraseSetResponse.decode.bind(updatePhraseSetResponse), + updatePhraseSetMetadata.decode.bind(updatePhraseSetMetadata)), + deletePhraseSet: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deletePhraseSetResponse.decode.bind(deletePhraseSetResponse), + deletePhraseSetMetadata.decode.bind(deletePhraseSetMetadata)), + undeletePhraseSet: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + undeletePhraseSetResponse.decode.bind(undeletePhraseSetResponse), + undeletePhraseSetMetadata.decode.bind(undeletePhraseSetMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.speech.v2.Speech', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.speechStub) { + return this.speechStub; + } + + // Put together the "service stub" for + // google.cloud.speech.v2.Speech. + this.speechStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.speech.v2.Speech') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.speech.v2.Speech, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const speechStubMethods = + ['createRecognizer', 'listRecognizers', 'getRecognizer', 'updateRecognizer', 'deleteRecognizer', 'undeleteRecognizer', 'recognize', 'streamingRecognize', 'batchRecognize', 'getConfig', 'updateConfig', 'createCustomClass', 'listCustomClasses', 'getCustomClass', 'updateCustomClass', 'deleteCustomClass', 'undeleteCustomClass', 'createPhraseSet', 'listPhraseSets', 'getPhraseSet', 'updatePhraseSet', 'deletePhraseSet', 'undeletePhraseSet']; + for (const methodName of speechStubMethods) { + const callPromise = this.speechStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + if (methodName in this.descriptors.stream) { + const stream = new PassThrough({objectMode: true}); + setImmediate(() => { + stream.emit('error', new this._gaxModule.GoogleError('The client has already been closed.')); + }); + return stream; + } + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.stream[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.speechStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'speech.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'speech.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Returns the requested + * {@link protos.google.cloud.speech.v2.Recognizer|Recognizer}. Fails with + * {@link protos.google.rpc.Code.NOT_FOUND|NOT_FOUND} if the requested Recognizer doesn't + * exist. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Recognizer to retrieve. The expected format is + * `projects/{project}/locations/{location}/recognizers/{recognizer}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.speech.v2.Recognizer|Recognizer}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.get_recognizer.js + * region_tag:speech_v2_generated_Speech_GetRecognizer_async + */ + getRecognizer( + request?: protos.google.cloud.speech.v2.IGetRecognizerRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.speech.v2.IRecognizer, + protos.google.cloud.speech.v2.IGetRecognizerRequest|undefined, {}|undefined + ]>; + getRecognizer( + request: protos.google.cloud.speech.v2.IGetRecognizerRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.speech.v2.IRecognizer, + protos.google.cloud.speech.v2.IGetRecognizerRequest|null|undefined, + {}|null|undefined>): void; + getRecognizer( + request: protos.google.cloud.speech.v2.IGetRecognizerRequest, + callback: Callback< + protos.google.cloud.speech.v2.IRecognizer, + protos.google.cloud.speech.v2.IGetRecognizerRequest|null|undefined, + {}|null|undefined>): void; + getRecognizer( + request?: protos.google.cloud.speech.v2.IGetRecognizerRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.speech.v2.IRecognizer, + protos.google.cloud.speech.v2.IGetRecognizerRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.speech.v2.IRecognizer, + protos.google.cloud.speech.v2.IGetRecognizerRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.speech.v2.IRecognizer, + protos.google.cloud.speech.v2.IGetRecognizerRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getRecognizer request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.speech.v2.IRecognizer, + protos.google.cloud.speech.v2.IGetRecognizerRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getRecognizer response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getRecognizer(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.speech.v2.IRecognizer, + protos.google.cloud.speech.v2.IGetRecognizerRequest|undefined, + {}|undefined + ]) => { + this._log.info('getRecognizer response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Performs synchronous Speech recognition: receive results after all audio + * has been sent and processed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.recognizer + * Required. The name of the Recognizer to use during recognition. The + * expected format is + * `projects/{project}/locations/{location}/recognizers/{recognizer}`. The + * {recognizer} segment may be set to `_` to use an empty implicit Recognizer. + * @param {google.cloud.speech.v2.RecognitionConfig} request.config + * Features and audio metadata to use for the Automatic Speech Recognition. + * This field in combination with the + * {@link protos.google.cloud.speech.v2.RecognizeRequest.config_mask|config_mask} field + * can be used to override parts of the + * {@link protos.google.cloud.speech.v2.Recognizer.default_recognition_config|default_recognition_config} + * of the Recognizer resource. + * @param {google.protobuf.FieldMask} request.configMask + * The list of fields in + * {@link protos.google.cloud.speech.v2.RecognizeRequest.config|config} that override the + * values in the + * {@link protos.google.cloud.speech.v2.Recognizer.default_recognition_config|default_recognition_config} + * of the recognizer during this recognition request. If no mask is provided, + * all non-default valued fields in + * {@link protos.google.cloud.speech.v2.RecognizeRequest.config|config} override the + * values in the recognizer for this recognition request. If a mask is + * provided, only the fields listed in the mask override the config in the + * recognizer for this recognition request. If a wildcard (`*`) is provided, + * {@link protos.google.cloud.speech.v2.RecognizeRequest.config|config} completely + * overrides and replaces the config in the recognizer for this recognition + * request. + * @param {Buffer} request.content + * The audio data bytes encoded as specified in + * {@link protos.google.cloud.speech.v2.RecognitionConfig|RecognitionConfig}. As + * with all bytes fields, proto buffers use a pure binary representation, + * whereas JSON representations use base64. + * @param {string} request.uri + * URI that points to a file that contains audio data bytes as specified in + * {@link protos.google.cloud.speech.v2.RecognitionConfig|RecognitionConfig}. The file + * must not be compressed (for example, gzip). Currently, only Google Cloud + * Storage URIs are supported, which must be specified in the following + * format: `gs://bucket_name/object_name` (other URI formats return + * {@link protos.google.rpc.Code.INVALID_ARGUMENT|INVALID_ARGUMENT}). For more + * information, see [Request + * URIs](https://cloud.google.com/storage/docs/reference-uris). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.speech.v2.RecognizeResponse|RecognizeResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.recognize.js + * region_tag:speech_v2_generated_Speech_Recognize_async + */ + recognize( + request?: protos.google.cloud.speech.v2.IRecognizeRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.speech.v2.IRecognizeResponse, + protos.google.cloud.speech.v2.IRecognizeRequest|undefined, {}|undefined + ]>; + recognize( + request: protos.google.cloud.speech.v2.IRecognizeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.speech.v2.IRecognizeResponse, + protos.google.cloud.speech.v2.IRecognizeRequest|null|undefined, + {}|null|undefined>): void; + recognize( + request: protos.google.cloud.speech.v2.IRecognizeRequest, + callback: Callback< + protos.google.cloud.speech.v2.IRecognizeResponse, + protos.google.cloud.speech.v2.IRecognizeRequest|null|undefined, + {}|null|undefined>): void; + recognize( + request?: protos.google.cloud.speech.v2.IRecognizeRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.speech.v2.IRecognizeResponse, + protos.google.cloud.speech.v2.IRecognizeRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.speech.v2.IRecognizeResponse, + protos.google.cloud.speech.v2.IRecognizeRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.speech.v2.IRecognizeResponse, + protos.google.cloud.speech.v2.IRecognizeRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'recognizer': request.recognizer ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('recognize request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.speech.v2.IRecognizeResponse, + protos.google.cloud.speech.v2.IRecognizeRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('recognize response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.recognize(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.speech.v2.IRecognizeResponse, + protos.google.cloud.speech.v2.IRecognizeRequest|undefined, + {}|undefined + ]) => { + this._log.info('recognize response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Returns the requested {@link protos.google.cloud.speech.v2.Config|Config}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the config to retrieve. There is exactly one config + * resource per project per location. The expected format is + * `projects/{project}/locations/{location}/config`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.speech.v2.Config|Config}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.get_config.js + * region_tag:speech_v2_generated_Speech_GetConfig_async + */ + getConfig( + request?: protos.google.cloud.speech.v2.IGetConfigRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.speech.v2.IConfig, + protos.google.cloud.speech.v2.IGetConfigRequest|undefined, {}|undefined + ]>; + getConfig( + request: protos.google.cloud.speech.v2.IGetConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.speech.v2.IConfig, + protos.google.cloud.speech.v2.IGetConfigRequest|null|undefined, + {}|null|undefined>): void; + getConfig( + request: protos.google.cloud.speech.v2.IGetConfigRequest, + callback: Callback< + protos.google.cloud.speech.v2.IConfig, + protos.google.cloud.speech.v2.IGetConfigRequest|null|undefined, + {}|null|undefined>): void; + getConfig( + request?: protos.google.cloud.speech.v2.IGetConfigRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.speech.v2.IConfig, + protos.google.cloud.speech.v2.IGetConfigRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.speech.v2.IConfig, + protos.google.cloud.speech.v2.IGetConfigRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.speech.v2.IConfig, + protos.google.cloud.speech.v2.IGetConfigRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getConfig request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.speech.v2.IConfig, + protos.google.cloud.speech.v2.IGetConfigRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getConfig(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.speech.v2.IConfig, + protos.google.cloud.speech.v2.IGetConfigRequest|undefined, + {}|undefined + ]) => { + this._log.info('getConfig response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Updates the {@link protos.google.cloud.speech.v2.Config|Config}. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.speech.v2.Config} request.config + * Required. The config to update. + * + * The config's `name` field is used to identify the config to be updated. + * The expected format is `projects/{project}/locations/{location}/config`. + * @param {google.protobuf.FieldMask} request.updateMask + * The list of fields to be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.speech.v2.Config|Config}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.update_config.js + * region_tag:speech_v2_generated_Speech_UpdateConfig_async + */ + updateConfig( + request?: protos.google.cloud.speech.v2.IUpdateConfigRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.speech.v2.IConfig, + protos.google.cloud.speech.v2.IUpdateConfigRequest|undefined, {}|undefined + ]>; + updateConfig( + request: protos.google.cloud.speech.v2.IUpdateConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.speech.v2.IConfig, + protos.google.cloud.speech.v2.IUpdateConfigRequest|null|undefined, + {}|null|undefined>): void; + updateConfig( + request: protos.google.cloud.speech.v2.IUpdateConfigRequest, + callback: Callback< + protos.google.cloud.speech.v2.IConfig, + protos.google.cloud.speech.v2.IUpdateConfigRequest|null|undefined, + {}|null|undefined>): void; + updateConfig( + request?: protos.google.cloud.speech.v2.IUpdateConfigRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.speech.v2.IConfig, + protos.google.cloud.speech.v2.IUpdateConfigRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.speech.v2.IConfig, + protos.google.cloud.speech.v2.IUpdateConfigRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.speech.v2.IConfig, + protos.google.cloud.speech.v2.IUpdateConfigRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'config.name': request.config!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateConfig request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.speech.v2.IConfig, + protos.google.cloud.speech.v2.IUpdateConfigRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateConfig(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.speech.v2.IConfig, + protos.google.cloud.speech.v2.IUpdateConfigRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateConfig response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Returns the requested + * {@link protos.google.cloud.speech.v2.CustomClass|CustomClass}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the CustomClass to retrieve. The expected format is + * `projects/{project}/locations/{location}/customClasses/{custom_class}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.speech.v2.CustomClass|CustomClass}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.get_custom_class.js + * region_tag:speech_v2_generated_Speech_GetCustomClass_async + */ + getCustomClass( + request?: protos.google.cloud.speech.v2.IGetCustomClassRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.speech.v2.ICustomClass, + protos.google.cloud.speech.v2.IGetCustomClassRequest|undefined, {}|undefined + ]>; + getCustomClass( + request: protos.google.cloud.speech.v2.IGetCustomClassRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.speech.v2.ICustomClass, + protos.google.cloud.speech.v2.IGetCustomClassRequest|null|undefined, + {}|null|undefined>): void; + getCustomClass( + request: protos.google.cloud.speech.v2.IGetCustomClassRequest, + callback: Callback< + protos.google.cloud.speech.v2.ICustomClass, + protos.google.cloud.speech.v2.IGetCustomClassRequest|null|undefined, + {}|null|undefined>): void; + getCustomClass( + request?: protos.google.cloud.speech.v2.IGetCustomClassRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.speech.v2.ICustomClass, + protos.google.cloud.speech.v2.IGetCustomClassRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.speech.v2.ICustomClass, + protos.google.cloud.speech.v2.IGetCustomClassRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.speech.v2.ICustomClass, + protos.google.cloud.speech.v2.IGetCustomClassRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getCustomClass request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.speech.v2.ICustomClass, + protos.google.cloud.speech.v2.IGetCustomClassRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getCustomClass response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getCustomClass(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.speech.v2.ICustomClass, + protos.google.cloud.speech.v2.IGetCustomClassRequest|undefined, + {}|undefined + ]) => { + this._log.info('getCustomClass response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Returns the requested + * {@link protos.google.cloud.speech.v2.PhraseSet|PhraseSet}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the PhraseSet to retrieve. The expected format is + * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.speech.v2.PhraseSet|PhraseSet}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.get_phrase_set.js + * region_tag:speech_v2_generated_Speech_GetPhraseSet_async + */ + getPhraseSet( + request?: protos.google.cloud.speech.v2.IGetPhraseSetRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.speech.v2.IPhraseSet, + protos.google.cloud.speech.v2.IGetPhraseSetRequest|undefined, {}|undefined + ]>; + getPhraseSet( + request: protos.google.cloud.speech.v2.IGetPhraseSetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.speech.v2.IPhraseSet, + protos.google.cloud.speech.v2.IGetPhraseSetRequest|null|undefined, + {}|null|undefined>): void; + getPhraseSet( + request: protos.google.cloud.speech.v2.IGetPhraseSetRequest, + callback: Callback< + protos.google.cloud.speech.v2.IPhraseSet, + protos.google.cloud.speech.v2.IGetPhraseSetRequest|null|undefined, + {}|null|undefined>): void; + getPhraseSet( + request?: protos.google.cloud.speech.v2.IGetPhraseSetRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.speech.v2.IPhraseSet, + protos.google.cloud.speech.v2.IGetPhraseSetRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.speech.v2.IPhraseSet, + protos.google.cloud.speech.v2.IGetPhraseSetRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.speech.v2.IPhraseSet, + protos.google.cloud.speech.v2.IGetPhraseSetRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getPhraseSet request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.speech.v2.IPhraseSet, + protos.google.cloud.speech.v2.IGetPhraseSetRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getPhraseSet response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getPhraseSet(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.speech.v2.IPhraseSet, + protos.google.cloud.speech.v2.IGetPhraseSetRequest|undefined, + {}|undefined + ]) => { + this._log.info('getPhraseSet response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } + +/** + * Performs bidirectional streaming speech recognition: receive results while + * sending audio. This method is only available via the gRPC API (not REST). + * + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which is both readable and writable. It accepts objects + * representing {@link protos.google.cloud.speech.v2.StreamingRecognizeRequest|StreamingRecognizeRequest} for write() method, and + * will emit objects representing {@link protos.google.cloud.speech.v2.StreamingRecognizeResponse|StreamingRecognizeResponse} on 'data' event asynchronously. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#bi-directional-streaming | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.streaming_recognize.js + * region_tag:speech_v2_generated_Speech_StreamingRecognize_async + */ + streamingRecognize( + options?: CallOptions): + gax.CancellableStream { + this.initialize().catch(err => {throw err}); + this._log.info('streamingRecognize stream %j', options); + return this.innerApiCalls.streamingRecognize(null, options); + } + +/** + * Creates a {@link protos.google.cloud.speech.v2.Recognizer|Recognizer}. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.speech.v2.Recognizer} request.recognizer + * Required. The Recognizer to create. + * @param {boolean} request.validateOnly + * If set, validate the request and preview the Recognizer, but do not + * actually create it. + * @param {string} request.recognizerId + * The ID to use for the Recognizer, which will become the final component of + * the Recognizer's resource name. + * + * This value should be 4-63 characters, and valid characters + * are /{@link protos.0-9|a-z}-/. + * @param {string} request.parent + * Required. The project and location where this Recognizer will be created. + * The expected format is `projects/{project}/locations/{location}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.create_recognizer.js + * region_tag:speech_v2_generated_Speech_CreateRecognizer_async + */ + createRecognizer( + request?: protos.google.cloud.speech.v2.ICreateRecognizerRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createRecognizer( + request: protos.google.cloud.speech.v2.ICreateRecognizerRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createRecognizer( + request: protos.google.cloud.speech.v2.ICreateRecognizerRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createRecognizer( + request?: protos.google.cloud.speech.v2.ICreateRecognizerRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createRecognizer response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createRecognizer request %j', request); + return this.innerApiCalls.createRecognizer(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createRecognizer response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `createRecognizer()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.create_recognizer.js + * region_tag:speech_v2_generated_Speech_CreateRecognizer_async + */ + async checkCreateRecognizerProgress(name: string): Promise>{ + this._log.info('createRecognizer long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createRecognizer, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates the {@link protos.google.cloud.speech.v2.Recognizer|Recognizer}. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.speech.v2.Recognizer} request.recognizer + * Required. The Recognizer to update. + * + * The Recognizer's `name` field is used to identify the Recognizer to update. + * Format: `projects/{project}/locations/{location}/recognizers/{recognizer}`. + * @param {google.protobuf.FieldMask} request.updateMask + * The list of fields to update. If empty, all non-default valued fields are + * considered for update. Use `*` to update the entire Recognizer resource. + * @param {boolean} request.validateOnly + * If set, validate the request and preview the updated Recognizer, but do not + * actually update it. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.update_recognizer.js + * region_tag:speech_v2_generated_Speech_UpdateRecognizer_async + */ + updateRecognizer( + request?: protos.google.cloud.speech.v2.IUpdateRecognizerRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateRecognizer( + request: protos.google.cloud.speech.v2.IUpdateRecognizerRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateRecognizer( + request: protos.google.cloud.speech.v2.IUpdateRecognizerRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateRecognizer( + request?: protos.google.cloud.speech.v2.IUpdateRecognizerRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'recognizer.name': request.recognizer!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateRecognizer response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateRecognizer request %j', request); + return this.innerApiCalls.updateRecognizer(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('updateRecognizer response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `updateRecognizer()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.update_recognizer.js + * region_tag:speech_v2_generated_Speech_UpdateRecognizer_async + */ + async checkUpdateRecognizerProgress(name: string): Promise>{ + this._log.info('updateRecognizer long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateRecognizer, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes the {@link protos.google.cloud.speech.v2.Recognizer|Recognizer}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Recognizer to delete. + * Format: `projects/{project}/locations/{location}/recognizers/{recognizer}` + * @param {boolean} request.validateOnly + * If set, validate the request and preview the deleted Recognizer, but do not + * actually delete it. + * @param {boolean} request.allowMissing + * If set to true, and the Recognizer is not found, the request will succeed + * and be a no-op (no Operation is recorded in this case). + * @param {string} request.etag + * This checksum is computed by the server based on the value of other + * fields. This may be sent on update, undelete, and delete requests to ensure + * the client has an up-to-date value before proceeding. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.delete_recognizer.js + * region_tag:speech_v2_generated_Speech_DeleteRecognizer_async + */ + deleteRecognizer( + request?: protos.google.cloud.speech.v2.IDeleteRecognizerRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteRecognizer( + request: protos.google.cloud.speech.v2.IDeleteRecognizerRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteRecognizer( + request: protos.google.cloud.speech.v2.IDeleteRecognizerRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteRecognizer( + request?: protos.google.cloud.speech.v2.IDeleteRecognizerRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteRecognizer response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteRecognizer request %j', request); + return this.innerApiCalls.deleteRecognizer(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deleteRecognizer response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `deleteRecognizer()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.delete_recognizer.js + * region_tag:speech_v2_generated_Speech_DeleteRecognizer_async + */ + async checkDeleteRecognizerProgress(name: string): Promise>{ + this._log.info('deleteRecognizer long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteRecognizer, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Undeletes the {@link protos.google.cloud.speech.v2.Recognizer|Recognizer}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Recognizer to undelete. + * Format: `projects/{project}/locations/{location}/recognizers/{recognizer}` + * @param {boolean} request.validateOnly + * If set, validate the request and preview the undeleted Recognizer, but do + * not actually undelete it. + * @param {string} request.etag + * This checksum is computed by the server based on the value of other + * fields. This may be sent on update, undelete, and delete requests to ensure + * the client has an up-to-date value before proceeding. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.undelete_recognizer.js + * region_tag:speech_v2_generated_Speech_UndeleteRecognizer_async + */ + undeleteRecognizer( + request?: protos.google.cloud.speech.v2.IUndeleteRecognizerRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + undeleteRecognizer( + request: protos.google.cloud.speech.v2.IUndeleteRecognizerRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + undeleteRecognizer( + request: protos.google.cloud.speech.v2.IUndeleteRecognizerRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + undeleteRecognizer( + request?: protos.google.cloud.speech.v2.IUndeleteRecognizerRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('undeleteRecognizer response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('undeleteRecognizer request %j', request); + return this.innerApiCalls.undeleteRecognizer(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('undeleteRecognizer response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `undeleteRecognizer()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.undelete_recognizer.js + * region_tag:speech_v2_generated_Speech_UndeleteRecognizer_async + */ + async checkUndeleteRecognizerProgress(name: string): Promise>{ + this._log.info('undeleteRecognizer long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.undeleteRecognizer, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Performs batch asynchronous speech recognition: send a request with N + * audio files and receive a long running operation that can be polled to see + * when the transcriptions are finished. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.recognizer + * Required. The name of the Recognizer to use during recognition. The + * expected format is + * `projects/{project}/locations/{location}/recognizers/{recognizer}`. The + * {recognizer} segment may be set to `_` to use an empty implicit Recognizer. + * @param {google.cloud.speech.v2.RecognitionConfig} request.config + * Features and audio metadata to use for the Automatic Speech Recognition. + * This field in combination with the + * {@link protos.google.cloud.speech.v2.BatchRecognizeRequest.config_mask|config_mask} + * field can be used to override parts of the + * {@link protos.google.cloud.speech.v2.Recognizer.default_recognition_config|default_recognition_config} + * of the Recognizer resource. + * @param {google.protobuf.FieldMask} request.configMask + * The list of fields in + * {@link protos.google.cloud.speech.v2.BatchRecognizeRequest.config|config} that override + * the values in the + * {@link protos.google.cloud.speech.v2.Recognizer.default_recognition_config|default_recognition_config} + * of the recognizer during this recognition request. If no mask is provided, + * all given fields in + * {@link protos.google.cloud.speech.v2.BatchRecognizeRequest.config|config} override the + * values in the recognizer for this recognition request. If a mask is + * provided, only the fields listed in the mask override the config in the + * recognizer for this recognition request. If a wildcard (`*`) is provided, + * {@link protos.google.cloud.speech.v2.BatchRecognizeRequest.config|config} completely + * overrides and replaces the config in the recognizer for this recognition + * request. + * @param {number[]} request.files + * Audio files with file metadata for ASR. + * The maximum number of files allowed to be specified is 15. + * @param {google.cloud.speech.v2.RecognitionOutputConfig} request.recognitionOutputConfig + * Configuration options for where to output the transcripts of each file. + * @param {google.cloud.speech.v2.BatchRecognizeRequest.ProcessingStrategy} request.processingStrategy + * Processing strategy to use for this request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.batch_recognize.js + * region_tag:speech_v2_generated_Speech_BatchRecognize_async + */ + batchRecognize( + request?: protos.google.cloud.speech.v2.IBatchRecognizeRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + batchRecognize( + request: protos.google.cloud.speech.v2.IBatchRecognizeRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + batchRecognize( + request: protos.google.cloud.speech.v2.IBatchRecognizeRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + batchRecognize( + request?: protos.google.cloud.speech.v2.IBatchRecognizeRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'recognizer': request.recognizer ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('batchRecognize response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('batchRecognize request %j', request); + return this.innerApiCalls.batchRecognize(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('batchRecognize response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `batchRecognize()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.batch_recognize.js + * region_tag:speech_v2_generated_Speech_BatchRecognize_async + */ + async checkBatchRecognizeProgress(name: string): Promise>{ + this._log.info('batchRecognize long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.batchRecognize, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Creates a {@link protos.google.cloud.speech.v2.CustomClass|CustomClass}. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.speech.v2.CustomClass} request.customClass + * Required. The CustomClass to create. + * @param {boolean} request.validateOnly + * If set, validate the request and preview the CustomClass, but do not + * actually create it. + * @param {string} request.customClassId + * The ID to use for the CustomClass, which will become the final component of + * the CustomClass's resource name. + * + * This value should be 4-63 characters, and valid characters + * are /{@link protos.0-9|a-z}-/. + * @param {string} request.parent + * Required. The project and location where this CustomClass will be created. + * The expected format is `projects/{project}/locations/{location}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.create_custom_class.js + * region_tag:speech_v2_generated_Speech_CreateCustomClass_async + */ + createCustomClass( + request?: protos.google.cloud.speech.v2.ICreateCustomClassRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createCustomClass( + request: protos.google.cloud.speech.v2.ICreateCustomClassRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createCustomClass( + request: protos.google.cloud.speech.v2.ICreateCustomClassRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createCustomClass( + request?: protos.google.cloud.speech.v2.ICreateCustomClassRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createCustomClass response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createCustomClass request %j', request); + return this.innerApiCalls.createCustomClass(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createCustomClass response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `createCustomClass()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.create_custom_class.js + * region_tag:speech_v2_generated_Speech_CreateCustomClass_async + */ + async checkCreateCustomClassProgress(name: string): Promise>{ + this._log.info('createCustomClass long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createCustomClass, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates the {@link protos.google.cloud.speech.v2.CustomClass|CustomClass}. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.speech.v2.CustomClass} request.customClass + * Required. The CustomClass to update. + * + * The CustomClass's `name` field is used to identify the CustomClass to + * update. Format: + * `projects/{project}/locations/{location}/customClasses/{custom_class}`. + * @param {google.protobuf.FieldMask} request.updateMask + * The list of fields to be updated. If empty, all fields are considered for + * update. + * @param {boolean} request.validateOnly + * If set, validate the request and preview the updated CustomClass, but do + * not actually update it. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.update_custom_class.js + * region_tag:speech_v2_generated_Speech_UpdateCustomClass_async + */ + updateCustomClass( + request?: protos.google.cloud.speech.v2.IUpdateCustomClassRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateCustomClass( + request: protos.google.cloud.speech.v2.IUpdateCustomClassRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateCustomClass( + request: protos.google.cloud.speech.v2.IUpdateCustomClassRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateCustomClass( + request?: protos.google.cloud.speech.v2.IUpdateCustomClassRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'custom_class.name': request.customClass!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateCustomClass response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateCustomClass request %j', request); + return this.innerApiCalls.updateCustomClass(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('updateCustomClass response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `updateCustomClass()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.update_custom_class.js + * region_tag:speech_v2_generated_Speech_UpdateCustomClass_async + */ + async checkUpdateCustomClassProgress(name: string): Promise>{ + this._log.info('updateCustomClass long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateCustomClass, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes the {@link protos.google.cloud.speech.v2.CustomClass|CustomClass}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the CustomClass to delete. + * Format: + * `projects/{project}/locations/{location}/customClasses/{custom_class}` + * @param {boolean} request.validateOnly + * If set, validate the request and preview the deleted CustomClass, but do + * not actually delete it. + * @param {boolean} request.allowMissing + * If set to true, and the CustomClass is not found, the request will succeed + * and be a no-op (no Operation is recorded in this case). + * @param {string} request.etag + * This checksum is computed by the server based on the value of other + * fields. This may be sent on update, undelete, and delete requests to ensure + * the client has an up-to-date value before proceeding. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.delete_custom_class.js + * region_tag:speech_v2_generated_Speech_DeleteCustomClass_async + */ + deleteCustomClass( + request?: protos.google.cloud.speech.v2.IDeleteCustomClassRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteCustomClass( + request: protos.google.cloud.speech.v2.IDeleteCustomClassRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteCustomClass( + request: protos.google.cloud.speech.v2.IDeleteCustomClassRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteCustomClass( + request?: protos.google.cloud.speech.v2.IDeleteCustomClassRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteCustomClass response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteCustomClass request %j', request); + return this.innerApiCalls.deleteCustomClass(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deleteCustomClass response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `deleteCustomClass()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.delete_custom_class.js + * region_tag:speech_v2_generated_Speech_DeleteCustomClass_async + */ + async checkDeleteCustomClassProgress(name: string): Promise>{ + this._log.info('deleteCustomClass long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteCustomClass, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Undeletes the {@link protos.google.cloud.speech.v2.CustomClass|CustomClass}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the CustomClass to undelete. + * Format: + * `projects/{project}/locations/{location}/customClasses/{custom_class}` + * @param {boolean} request.validateOnly + * If set, validate the request and preview the undeleted CustomClass, but do + * not actually undelete it. + * @param {string} request.etag + * This checksum is computed by the server based on the value of other + * fields. This may be sent on update, undelete, and delete requests to ensure + * the client has an up-to-date value before proceeding. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.undelete_custom_class.js + * region_tag:speech_v2_generated_Speech_UndeleteCustomClass_async + */ + undeleteCustomClass( + request?: protos.google.cloud.speech.v2.IUndeleteCustomClassRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + undeleteCustomClass( + request: protos.google.cloud.speech.v2.IUndeleteCustomClassRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + undeleteCustomClass( + request: protos.google.cloud.speech.v2.IUndeleteCustomClassRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + undeleteCustomClass( + request?: protos.google.cloud.speech.v2.IUndeleteCustomClassRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('undeleteCustomClass response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('undeleteCustomClass request %j', request); + return this.innerApiCalls.undeleteCustomClass(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('undeleteCustomClass response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `undeleteCustomClass()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.undelete_custom_class.js + * region_tag:speech_v2_generated_Speech_UndeleteCustomClass_async + */ + async checkUndeleteCustomClassProgress(name: string): Promise>{ + this._log.info('undeleteCustomClass long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.undeleteCustomClass, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Creates a {@link protos.google.cloud.speech.v2.PhraseSet|PhraseSet}. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.speech.v2.PhraseSet} request.phraseSet + * Required. The PhraseSet to create. + * @param {boolean} request.validateOnly + * If set, validate the request and preview the PhraseSet, but do not + * actually create it. + * @param {string} request.phraseSetId + * The ID to use for the PhraseSet, which will become the final component of + * the PhraseSet's resource name. + * + * This value should be 4-63 characters, and valid characters + * are /{@link protos.0-9|a-z}-/. + * @param {string} request.parent + * Required. The project and location where this PhraseSet will be created. + * The expected format is `projects/{project}/locations/{location}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.create_phrase_set.js + * region_tag:speech_v2_generated_Speech_CreatePhraseSet_async + */ + createPhraseSet( + request?: protos.google.cloud.speech.v2.ICreatePhraseSetRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createPhraseSet( + request: protos.google.cloud.speech.v2.ICreatePhraseSetRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createPhraseSet( + request: protos.google.cloud.speech.v2.ICreatePhraseSetRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createPhraseSet( + request?: protos.google.cloud.speech.v2.ICreatePhraseSetRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createPhraseSet response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createPhraseSet request %j', request); + return this.innerApiCalls.createPhraseSet(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createPhraseSet response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `createPhraseSet()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.create_phrase_set.js + * region_tag:speech_v2_generated_Speech_CreatePhraseSet_async + */ + async checkCreatePhraseSetProgress(name: string): Promise>{ + this._log.info('createPhraseSet long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createPhraseSet, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates the {@link protos.google.cloud.speech.v2.PhraseSet|PhraseSet}. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.speech.v2.PhraseSet} request.phraseSet + * Required. The PhraseSet to update. + * + * The PhraseSet's `name` field is used to identify the PhraseSet to update. + * Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}`. + * @param {google.protobuf.FieldMask} request.updateMask + * The list of fields to update. If empty, all non-default valued fields are + * considered for update. Use `*` to update the entire PhraseSet resource. + * @param {boolean} request.validateOnly + * If set, validate the request and preview the updated PhraseSet, but do not + * actually update it. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.update_phrase_set.js + * region_tag:speech_v2_generated_Speech_UpdatePhraseSet_async + */ + updatePhraseSet( + request?: protos.google.cloud.speech.v2.IUpdatePhraseSetRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updatePhraseSet( + request: protos.google.cloud.speech.v2.IUpdatePhraseSetRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updatePhraseSet( + request: protos.google.cloud.speech.v2.IUpdatePhraseSetRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updatePhraseSet( + request?: protos.google.cloud.speech.v2.IUpdatePhraseSetRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'phrase_set.name': request.phraseSet!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updatePhraseSet response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updatePhraseSet request %j', request); + return this.innerApiCalls.updatePhraseSet(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('updatePhraseSet response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `updatePhraseSet()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.update_phrase_set.js + * region_tag:speech_v2_generated_Speech_UpdatePhraseSet_async + */ + async checkUpdatePhraseSetProgress(name: string): Promise>{ + this._log.info('updatePhraseSet long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updatePhraseSet, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes the {@link protos.google.cloud.speech.v2.PhraseSet|PhraseSet}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the PhraseSet to delete. + * Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + * @param {boolean} request.validateOnly + * If set, validate the request and preview the deleted PhraseSet, but do not + * actually delete it. + * @param {boolean} request.allowMissing + * If set to true, and the PhraseSet is not found, the request will succeed + * and be a no-op (no Operation is recorded in this case). + * @param {string} request.etag + * This checksum is computed by the server based on the value of other + * fields. This may be sent on update, undelete, and delete requests to ensure + * the client has an up-to-date value before proceeding. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.delete_phrase_set.js + * region_tag:speech_v2_generated_Speech_DeletePhraseSet_async + */ + deletePhraseSet( + request?: protos.google.cloud.speech.v2.IDeletePhraseSetRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deletePhraseSet( + request: protos.google.cloud.speech.v2.IDeletePhraseSetRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deletePhraseSet( + request: protos.google.cloud.speech.v2.IDeletePhraseSetRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deletePhraseSet( + request?: protos.google.cloud.speech.v2.IDeletePhraseSetRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deletePhraseSet response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deletePhraseSet request %j', request); + return this.innerApiCalls.deletePhraseSet(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deletePhraseSet response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `deletePhraseSet()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.delete_phrase_set.js + * region_tag:speech_v2_generated_Speech_DeletePhraseSet_async + */ + async checkDeletePhraseSetProgress(name: string): Promise>{ + this._log.info('deletePhraseSet long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deletePhraseSet, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Undeletes the {@link protos.google.cloud.speech.v2.PhraseSet|PhraseSet}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the PhraseSet to undelete. + * Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + * @param {boolean} request.validateOnly + * If set, validate the request and preview the undeleted PhraseSet, but do + * not actually undelete it. + * @param {string} request.etag + * This checksum is computed by the server based on the value of other + * fields. This may be sent on update, undelete, and delete requests to ensure + * the client has an up-to-date value before proceeding. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.undelete_phrase_set.js + * region_tag:speech_v2_generated_Speech_UndeletePhraseSet_async + */ + undeletePhraseSet( + request?: protos.google.cloud.speech.v2.IUndeletePhraseSetRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + undeletePhraseSet( + request: protos.google.cloud.speech.v2.IUndeletePhraseSetRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + undeletePhraseSet( + request: protos.google.cloud.speech.v2.IUndeletePhraseSetRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + undeletePhraseSet( + request?: protos.google.cloud.speech.v2.IUndeletePhraseSetRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('undeletePhraseSet response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('undeletePhraseSet request %j', request); + return this.innerApiCalls.undeletePhraseSet(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('undeletePhraseSet response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `undeletePhraseSet()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.undelete_phrase_set.js + * region_tag:speech_v2_generated_Speech_UndeletePhraseSet_async + */ + async checkUndeletePhraseSetProgress(name: string): Promise>{ + this._log.info('undeletePhraseSet long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.undeletePhraseSet, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists Recognizers. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location of Recognizers to list. The expected + * format is `projects/{project}/locations/{location}`. + * @param {number} request.pageSize + * The maximum number of Recognizers to return. The service may return fewer + * than this value. If unspecified, at most 5 Recognizers will be returned. + * The maximum value is 100; values above 100 will be coerced to 100. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link protos.google.cloud.speech.v2.Speech.ListRecognizers|ListRecognizers} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link protos.google.cloud.speech.v2.Speech.ListRecognizers|ListRecognizers} must match + * the call that provided the page token. + * @param {boolean} request.showDeleted + * Whether, or not, to show resources that have been deleted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.speech.v2.Recognizer|Recognizer}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listRecognizersAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listRecognizers( + request?: protos.google.cloud.speech.v2.IListRecognizersRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.speech.v2.IRecognizer[], + protos.google.cloud.speech.v2.IListRecognizersRequest|null, + protos.google.cloud.speech.v2.IListRecognizersResponse + ]>; + listRecognizers( + request: protos.google.cloud.speech.v2.IListRecognizersRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.speech.v2.IListRecognizersRequest, + protos.google.cloud.speech.v2.IListRecognizersResponse|null|undefined, + protos.google.cloud.speech.v2.IRecognizer>): void; + listRecognizers( + request: protos.google.cloud.speech.v2.IListRecognizersRequest, + callback: PaginationCallback< + protos.google.cloud.speech.v2.IListRecognizersRequest, + protos.google.cloud.speech.v2.IListRecognizersResponse|null|undefined, + protos.google.cloud.speech.v2.IRecognizer>): void; + listRecognizers( + request?: protos.google.cloud.speech.v2.IListRecognizersRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.speech.v2.IListRecognizersRequest, + protos.google.cloud.speech.v2.IListRecognizersResponse|null|undefined, + protos.google.cloud.speech.v2.IRecognizer>, + callback?: PaginationCallback< + protos.google.cloud.speech.v2.IListRecognizersRequest, + protos.google.cloud.speech.v2.IListRecognizersResponse|null|undefined, + protos.google.cloud.speech.v2.IRecognizer>): + Promise<[ + protos.google.cloud.speech.v2.IRecognizer[], + protos.google.cloud.speech.v2.IListRecognizersRequest|null, + protos.google.cloud.speech.v2.IListRecognizersResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.speech.v2.IListRecognizersRequest, + protos.google.cloud.speech.v2.IListRecognizersResponse|null|undefined, + protos.google.cloud.speech.v2.IRecognizer>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listRecognizers values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listRecognizers request %j', request); + return this.innerApiCalls + .listRecognizers(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.speech.v2.IRecognizer[], + protos.google.cloud.speech.v2.IListRecognizersRequest|null, + protos.google.cloud.speech.v2.IListRecognizersResponse + ]) => { + this._log.info('listRecognizers values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listRecognizers`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location of Recognizers to list. The expected + * format is `projects/{project}/locations/{location}`. + * @param {number} request.pageSize + * The maximum number of Recognizers to return. The service may return fewer + * than this value. If unspecified, at most 5 Recognizers will be returned. + * The maximum value is 100; values above 100 will be coerced to 100. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link protos.google.cloud.speech.v2.Speech.ListRecognizers|ListRecognizers} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link protos.google.cloud.speech.v2.Speech.ListRecognizers|ListRecognizers} must match + * the call that provided the page token. + * @param {boolean} request.showDeleted + * Whether, or not, to show resources that have been deleted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.speech.v2.Recognizer|Recognizer} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listRecognizersAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listRecognizersStream( + request?: protos.google.cloud.speech.v2.IListRecognizersRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listRecognizers']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listRecognizers stream %j', request); + return this.descriptors.page.listRecognizers.createStream( + this.innerApiCalls.listRecognizers as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listRecognizers`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location of Recognizers to list. The expected + * format is `projects/{project}/locations/{location}`. + * @param {number} request.pageSize + * The maximum number of Recognizers to return. The service may return fewer + * than this value. If unspecified, at most 5 Recognizers will be returned. + * The maximum value is 100; values above 100 will be coerced to 100. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link protos.google.cloud.speech.v2.Speech.ListRecognizers|ListRecognizers} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link protos.google.cloud.speech.v2.Speech.ListRecognizers|ListRecognizers} must match + * the call that provided the page token. + * @param {boolean} request.showDeleted + * Whether, or not, to show resources that have been deleted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.speech.v2.Recognizer|Recognizer}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.list_recognizers.js + * region_tag:speech_v2_generated_Speech_ListRecognizers_async + */ + listRecognizersAsync( + request?: protos.google.cloud.speech.v2.IListRecognizersRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listRecognizers']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listRecognizers iterate %j', request); + return this.descriptors.page.listRecognizers.asyncIterate( + this.innerApiCalls['listRecognizers'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists CustomClasses. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location of CustomClass resources to list. The + * expected format is `projects/{project}/locations/{location}`. + * @param {number} request.pageSize + * Number of results per requests. A valid page_size ranges from 0 to 100 + * inclusive. If the page_size is zero or unspecified, a page size of 5 will + * be chosen. If the page size exceeds 100, it will be coerced down to 100. + * Note that a call might return fewer results than the requested page size. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link protos.google.cloud.speech.v2.Speech.ListCustomClasses|ListCustomClasses} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link protos.google.cloud.speech.v2.Speech.ListCustomClasses|ListCustomClasses} must + * match the call that provided the page token. + * @param {boolean} request.showDeleted + * Whether, or not, to show resources that have been deleted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.speech.v2.CustomClass|CustomClass}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listCustomClassesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listCustomClasses( + request?: protos.google.cloud.speech.v2.IListCustomClassesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.speech.v2.ICustomClass[], + protos.google.cloud.speech.v2.IListCustomClassesRequest|null, + protos.google.cloud.speech.v2.IListCustomClassesResponse + ]>; + listCustomClasses( + request: protos.google.cloud.speech.v2.IListCustomClassesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.speech.v2.IListCustomClassesRequest, + protos.google.cloud.speech.v2.IListCustomClassesResponse|null|undefined, + protos.google.cloud.speech.v2.ICustomClass>): void; + listCustomClasses( + request: protos.google.cloud.speech.v2.IListCustomClassesRequest, + callback: PaginationCallback< + protos.google.cloud.speech.v2.IListCustomClassesRequest, + protos.google.cloud.speech.v2.IListCustomClassesResponse|null|undefined, + protos.google.cloud.speech.v2.ICustomClass>): void; + listCustomClasses( + request?: protos.google.cloud.speech.v2.IListCustomClassesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.speech.v2.IListCustomClassesRequest, + protos.google.cloud.speech.v2.IListCustomClassesResponse|null|undefined, + protos.google.cloud.speech.v2.ICustomClass>, + callback?: PaginationCallback< + protos.google.cloud.speech.v2.IListCustomClassesRequest, + protos.google.cloud.speech.v2.IListCustomClassesResponse|null|undefined, + protos.google.cloud.speech.v2.ICustomClass>): + Promise<[ + protos.google.cloud.speech.v2.ICustomClass[], + protos.google.cloud.speech.v2.IListCustomClassesRequest|null, + protos.google.cloud.speech.v2.IListCustomClassesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.speech.v2.IListCustomClassesRequest, + protos.google.cloud.speech.v2.IListCustomClassesResponse|null|undefined, + protos.google.cloud.speech.v2.ICustomClass>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listCustomClasses values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listCustomClasses request %j', request); + return this.innerApiCalls + .listCustomClasses(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.speech.v2.ICustomClass[], + protos.google.cloud.speech.v2.IListCustomClassesRequest|null, + protos.google.cloud.speech.v2.IListCustomClassesResponse + ]) => { + this._log.info('listCustomClasses values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listCustomClasses`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location of CustomClass resources to list. The + * expected format is `projects/{project}/locations/{location}`. + * @param {number} request.pageSize + * Number of results per requests. A valid page_size ranges from 0 to 100 + * inclusive. If the page_size is zero or unspecified, a page size of 5 will + * be chosen. If the page size exceeds 100, it will be coerced down to 100. + * Note that a call might return fewer results than the requested page size. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link protos.google.cloud.speech.v2.Speech.ListCustomClasses|ListCustomClasses} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link protos.google.cloud.speech.v2.Speech.ListCustomClasses|ListCustomClasses} must + * match the call that provided the page token. + * @param {boolean} request.showDeleted + * Whether, or not, to show resources that have been deleted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.speech.v2.CustomClass|CustomClass} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listCustomClassesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listCustomClassesStream( + request?: protos.google.cloud.speech.v2.IListCustomClassesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listCustomClasses']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listCustomClasses stream %j', request); + return this.descriptors.page.listCustomClasses.createStream( + this.innerApiCalls.listCustomClasses as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listCustomClasses`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location of CustomClass resources to list. The + * expected format is `projects/{project}/locations/{location}`. + * @param {number} request.pageSize + * Number of results per requests. A valid page_size ranges from 0 to 100 + * inclusive. If the page_size is zero or unspecified, a page size of 5 will + * be chosen. If the page size exceeds 100, it will be coerced down to 100. + * Note that a call might return fewer results than the requested page size. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link protos.google.cloud.speech.v2.Speech.ListCustomClasses|ListCustomClasses} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link protos.google.cloud.speech.v2.Speech.ListCustomClasses|ListCustomClasses} must + * match the call that provided the page token. + * @param {boolean} request.showDeleted + * Whether, or not, to show resources that have been deleted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.speech.v2.CustomClass|CustomClass}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.list_custom_classes.js + * region_tag:speech_v2_generated_Speech_ListCustomClasses_async + */ + listCustomClassesAsync( + request?: protos.google.cloud.speech.v2.IListCustomClassesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listCustomClasses']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listCustomClasses iterate %j', request); + return this.descriptors.page.listCustomClasses.asyncIterate( + this.innerApiCalls['listCustomClasses'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists PhraseSets. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location of PhraseSet resources to list. The + * expected format is `projects/{project}/locations/{location}`. + * @param {number} request.pageSize + * The maximum number of PhraseSets to return. The service may return fewer + * than this value. If unspecified, at most 5 PhraseSets will be returned. + * The maximum value is 100; values above 100 will be coerced to 100. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link protos.google.cloud.speech.v2.Speech.ListPhraseSets|ListPhraseSets} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link protos.google.cloud.speech.v2.Speech.ListPhraseSets|ListPhraseSets} must match + * the call that provided the page token. + * @param {boolean} request.showDeleted + * Whether, or not, to show resources that have been deleted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.speech.v2.PhraseSet|PhraseSet}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listPhraseSetsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listPhraseSets( + request?: protos.google.cloud.speech.v2.IListPhraseSetsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.speech.v2.IPhraseSet[], + protos.google.cloud.speech.v2.IListPhraseSetsRequest|null, + protos.google.cloud.speech.v2.IListPhraseSetsResponse + ]>; + listPhraseSets( + request: protos.google.cloud.speech.v2.IListPhraseSetsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.speech.v2.IListPhraseSetsRequest, + protos.google.cloud.speech.v2.IListPhraseSetsResponse|null|undefined, + protos.google.cloud.speech.v2.IPhraseSet>): void; + listPhraseSets( + request: protos.google.cloud.speech.v2.IListPhraseSetsRequest, + callback: PaginationCallback< + protos.google.cloud.speech.v2.IListPhraseSetsRequest, + protos.google.cloud.speech.v2.IListPhraseSetsResponse|null|undefined, + protos.google.cloud.speech.v2.IPhraseSet>): void; + listPhraseSets( + request?: protos.google.cloud.speech.v2.IListPhraseSetsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.speech.v2.IListPhraseSetsRequest, + protos.google.cloud.speech.v2.IListPhraseSetsResponse|null|undefined, + protos.google.cloud.speech.v2.IPhraseSet>, + callback?: PaginationCallback< + protos.google.cloud.speech.v2.IListPhraseSetsRequest, + protos.google.cloud.speech.v2.IListPhraseSetsResponse|null|undefined, + protos.google.cloud.speech.v2.IPhraseSet>): + Promise<[ + protos.google.cloud.speech.v2.IPhraseSet[], + protos.google.cloud.speech.v2.IListPhraseSetsRequest|null, + protos.google.cloud.speech.v2.IListPhraseSetsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.speech.v2.IListPhraseSetsRequest, + protos.google.cloud.speech.v2.IListPhraseSetsResponse|null|undefined, + protos.google.cloud.speech.v2.IPhraseSet>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listPhraseSets values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listPhraseSets request %j', request); + return this.innerApiCalls + .listPhraseSets(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.speech.v2.IPhraseSet[], + protos.google.cloud.speech.v2.IListPhraseSetsRequest|null, + protos.google.cloud.speech.v2.IListPhraseSetsResponse + ]) => { + this._log.info('listPhraseSets values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listPhraseSets`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location of PhraseSet resources to list. The + * expected format is `projects/{project}/locations/{location}`. + * @param {number} request.pageSize + * The maximum number of PhraseSets to return. The service may return fewer + * than this value. If unspecified, at most 5 PhraseSets will be returned. + * The maximum value is 100; values above 100 will be coerced to 100. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link protos.google.cloud.speech.v2.Speech.ListPhraseSets|ListPhraseSets} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link protos.google.cloud.speech.v2.Speech.ListPhraseSets|ListPhraseSets} must match + * the call that provided the page token. + * @param {boolean} request.showDeleted + * Whether, or not, to show resources that have been deleted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.speech.v2.PhraseSet|PhraseSet} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listPhraseSetsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listPhraseSetsStream( + request?: protos.google.cloud.speech.v2.IListPhraseSetsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listPhraseSets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listPhraseSets stream %j', request); + return this.descriptors.page.listPhraseSets.createStream( + this.innerApiCalls.listPhraseSets as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listPhraseSets`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location of PhraseSet resources to list. The + * expected format is `projects/{project}/locations/{location}`. + * @param {number} request.pageSize + * The maximum number of PhraseSets to return. The service may return fewer + * than this value. If unspecified, at most 5 PhraseSets will be returned. + * The maximum value is 100; values above 100 will be coerced to 100. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link protos.google.cloud.speech.v2.Speech.ListPhraseSets|ListPhraseSets} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link protos.google.cloud.speech.v2.Speech.ListPhraseSets|ListPhraseSets} must match + * the call that provided the page token. + * @param {boolean} request.showDeleted + * Whether, or not, to show resources that have been deleted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.speech.v2.PhraseSet|PhraseSet}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v2/speech.list_phrase_sets.js + * region_tag:speech_v2_generated_Speech_ListPhraseSets_async + */ + listPhraseSetsAsync( + request?: protos.google.cloud.speech.v2.IListPhraseSetsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listPhraseSets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listPhraseSets iterate %j', request); + return this.descriptors.page.listPhraseSets.asyncIterate( + this.innerApiCalls['listPhraseSets'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. Returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified config resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + configPath(project:string,location:string) { + return this.pathTemplates.configPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Config resource. + * + * @param {string} configName + * A fully-qualified path representing Config resource. + * @returns {string} A string representing the project. + */ + matchProjectFromConfigName(configName: string) { + return this.pathTemplates.configPathTemplate.match(configName).project; + } + + /** + * Parse the location from Config resource. + * + * @param {string} configName + * A fully-qualified path representing Config resource. + * @returns {string} A string representing the location. + */ + matchLocationFromConfigName(configName: string) { + return this.pathTemplates.configPathTemplate.match(configName).location; + } + + /** + * Return a fully-qualified cryptoKey resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} key_ring + * @param {string} crypto_key + * @returns {string} Resource name string. + */ + cryptoKeyPath(project:string,location:string,keyRing:string,cryptoKey:string) { + return this.pathTemplates.cryptoKeyPathTemplate.render({ + project: project, + location: location, + key_ring: keyRing, + crypto_key: cryptoKey, + }); + } + + /** + * Parse the project from CryptoKey resource. + * + * @param {string} cryptoKeyName + * A fully-qualified path representing CryptoKey resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCryptoKeyName(cryptoKeyName: string) { + return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName).project; + } + + /** + * Parse the location from CryptoKey resource. + * + * @param {string} cryptoKeyName + * A fully-qualified path representing CryptoKey resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCryptoKeyName(cryptoKeyName: string) { + return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName).location; + } + + /** + * Parse the key_ring from CryptoKey resource. + * + * @param {string} cryptoKeyName + * A fully-qualified path representing CryptoKey resource. + * @returns {string} A string representing the key_ring. + */ + matchKeyRingFromCryptoKeyName(cryptoKeyName: string) { + return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName).key_ring; + } + + /** + * Parse the crypto_key from CryptoKey resource. + * + * @param {string} cryptoKeyName + * A fully-qualified path representing CryptoKey resource. + * @returns {string} A string representing the crypto_key. + */ + matchCryptoKeyFromCryptoKeyName(cryptoKeyName: string) { + return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName).crypto_key; + } + + /** + * Return a fully-qualified cryptoKeyVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} key_ring + * @param {string} crypto_key + * @param {string} crypto_key_version + * @returns {string} Resource name string. + */ + cryptoKeyVersionPath(project:string,location:string,keyRing:string,cryptoKey:string,cryptoKeyVersion:string) { + return this.pathTemplates.cryptoKeyVersionPathTemplate.render({ + project: project, + location: location, + key_ring: keyRing, + crypto_key: cryptoKey, + crypto_key_version: cryptoKeyVersion, + }); + } + + /** + * Parse the project from CryptoKeyVersion resource. + * + * @param {string} cryptoKeyVersionName + * A fully-qualified path representing CryptoKeyVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCryptoKeyVersionName(cryptoKeyVersionName: string) { + return this.pathTemplates.cryptoKeyVersionPathTemplate.match(cryptoKeyVersionName).project; + } + + /** + * Parse the location from CryptoKeyVersion resource. + * + * @param {string} cryptoKeyVersionName + * A fully-qualified path representing CryptoKeyVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCryptoKeyVersionName(cryptoKeyVersionName: string) { + return this.pathTemplates.cryptoKeyVersionPathTemplate.match(cryptoKeyVersionName).location; + } + + /** + * Parse the key_ring from CryptoKeyVersion resource. + * + * @param {string} cryptoKeyVersionName + * A fully-qualified path representing CryptoKeyVersion resource. + * @returns {string} A string representing the key_ring. + */ + matchKeyRingFromCryptoKeyVersionName(cryptoKeyVersionName: string) { + return this.pathTemplates.cryptoKeyVersionPathTemplate.match(cryptoKeyVersionName).key_ring; + } + + /** + * Parse the crypto_key from CryptoKeyVersion resource. + * + * @param {string} cryptoKeyVersionName + * A fully-qualified path representing CryptoKeyVersion resource. + * @returns {string} A string representing the crypto_key. + */ + matchCryptoKeyFromCryptoKeyVersionName(cryptoKeyVersionName: string) { + return this.pathTemplates.cryptoKeyVersionPathTemplate.match(cryptoKeyVersionName).crypto_key; + } + + /** + * Parse the crypto_key_version from CryptoKeyVersion resource. + * + * @param {string} cryptoKeyVersionName + * A fully-qualified path representing CryptoKeyVersion resource. + * @returns {string} A string representing the crypto_key_version. + */ + matchCryptoKeyVersionFromCryptoKeyVersionName(cryptoKeyVersionName: string) { + return this.pathTemplates.cryptoKeyVersionPathTemplate.match(cryptoKeyVersionName).crypto_key_version; + } + + /** + * Return a fully-qualified customClass resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} custom_class + * @returns {string} Resource name string. + */ + customClassPath(project:string,location:string,customClass:string) { + return this.pathTemplates.customClassPathTemplate.render({ + project: project, + location: location, + custom_class: customClass, + }); + } + + /** + * Parse the project from CustomClass resource. + * + * @param {string} customClassName + * A fully-qualified path representing CustomClass resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCustomClassName(customClassName: string) { + return this.pathTemplates.customClassPathTemplate.match(customClassName).project; + } + + /** + * Parse the location from CustomClass resource. + * + * @param {string} customClassName + * A fully-qualified path representing CustomClass resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCustomClassName(customClassName: string) { + return this.pathTemplates.customClassPathTemplate.match(customClassName).location; + } + + /** + * Parse the custom_class from CustomClass resource. + * + * @param {string} customClassName + * A fully-qualified path representing CustomClass resource. + * @returns {string} A string representing the custom_class. + */ + matchCustomClassFromCustomClassName(customClassName: string) { + return this.pathTemplates.customClassPathTemplate.match(customClassName).custom_class; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified phraseSet resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} phrase_set + * @returns {string} Resource name string. + */ + phraseSetPath(project:string,location:string,phraseSet:string) { + return this.pathTemplates.phraseSetPathTemplate.render({ + project: project, + location: location, + phrase_set: phraseSet, + }); + } + + /** + * Parse the project from PhraseSet resource. + * + * @param {string} phraseSetName + * A fully-qualified path representing PhraseSet resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPhraseSetName(phraseSetName: string) { + return this.pathTemplates.phraseSetPathTemplate.match(phraseSetName).project; + } + + /** + * Parse the location from PhraseSet resource. + * + * @param {string} phraseSetName + * A fully-qualified path representing PhraseSet resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPhraseSetName(phraseSetName: string) { + return this.pathTemplates.phraseSetPathTemplate.match(phraseSetName).location; + } + + /** + * Parse the phrase_set from PhraseSet resource. + * + * @param {string} phraseSetName + * A fully-qualified path representing PhraseSet resource. + * @returns {string} A string representing the phrase_set. + */ + matchPhraseSetFromPhraseSetName(phraseSetName: string) { + return this.pathTemplates.phraseSetPathTemplate.match(phraseSetName).phrase_set; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project:string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified recognizer resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} recognizer + * @returns {string} Resource name string. + */ + recognizerPath(project:string,location:string,recognizer:string) { + return this.pathTemplates.recognizerPathTemplate.render({ + project: project, + location: location, + recognizer: recognizer, + }); + } + + /** + * Parse the project from Recognizer resource. + * + * @param {string} recognizerName + * A fully-qualified path representing Recognizer resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRecognizerName(recognizerName: string) { + return this.pathTemplates.recognizerPathTemplate.match(recognizerName).project; + } + + /** + * Parse the location from Recognizer resource. + * + * @param {string} recognizerName + * A fully-qualified path representing Recognizer resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRecognizerName(recognizerName: string) { + return this.pathTemplates.recognizerPathTemplate.match(recognizerName).location; + } + + /** + * Parse the recognizer from Recognizer resource. + * + * @param {string} recognizerName + * A fully-qualified path representing Recognizer resource. + * @returns {string} A string representing the recognizer. + */ + matchRecognizerFromRecognizerName(recognizerName: string) { + return this.pathTemplates.recognizerPathTemplate.match(recognizerName).recognizer; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.speechStub && !this._terminated) { + return this.speechStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch(err => {throw err}); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v2/speech_client_config.json b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v2/speech_client_config.json new file mode 100644 index 00000000000..3809c643739 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v2/speech_client_config.json @@ -0,0 +1,141 @@ +{ + "interfaces": { + "google.cloud.speech.v2.Speech": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateRecognizer": { + "timeout_millis": 5000000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListRecognizers": { + "timeout_millis": 5000000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetRecognizer": { + "timeout_millis": 5000000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateRecognizer": { + "timeout_millis": 5000000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeleteRecognizer": { + "timeout_millis": 5000000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UndeleteRecognizer": { + "timeout_millis": 5000000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "Recognize": { + "timeout_millis": 5000000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "StreamingRecognize": { + "timeout_millis": 5000000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "BatchRecognize": { + "timeout_millis": 5000000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetConfig": { + "timeout_millis": 5000000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateConfig": { + "timeout_millis": 5000000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CreateCustomClass": { + "timeout_millis": 5000000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListCustomClasses": { + "timeout_millis": 5000000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetCustomClass": { + "timeout_millis": 5000000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateCustomClass": { + "timeout_millis": 5000000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeleteCustomClass": { + "timeout_millis": 5000000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UndeleteCustomClass": { + "timeout_millis": 5000000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CreatePhraseSet": { + "timeout_millis": 5000000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListPhraseSets": { + "timeout_millis": 5000000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetPhraseSet": { + "timeout_millis": 5000000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdatePhraseSet": { + "timeout_millis": 5000000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeletePhraseSet": { + "timeout_millis": 5000000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UndeletePhraseSet": { + "timeout_millis": 5000000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v2/speech_proto_list.json b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v2/speech_proto_list.json new file mode 100644 index 00000000000..024cfd7d41d --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/src/v2/speech_proto_list.json @@ -0,0 +1,4 @@ +[ + "../../protos/google/cloud/speech/v2/cloud_speech.proto", + "../../protos/google/cloud/speech/v2/locations_metadata.proto" +] diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/system-test/fixtures/sample/src/index.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..96a3a1b3b8e --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/system-test/fixtures/sample/src/index.js @@ -0,0 +1,28 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const speech = require('@google-cloud/speech'); + +function main() { + const adaptationClient = new speech.AdaptationClient(); + const speechClient = new speech.SpeechClient(); +} + +main(); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/system-test/fixtures/sample/src/index.ts b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..3f61a9c89c4 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,38 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {AdaptationClient, SpeechClient} from '@google-cloud/speech'; + +// check that the client class type name can be used +function doStuffWithAdaptationClient(client: AdaptationClient) { + client.close(); +} +function doStuffWithSpeechClient(client: SpeechClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const adaptationClient = new AdaptationClient(); + doStuffWithAdaptationClient(adaptationClient); + // check that the client instance can be created + const speechClient = new SpeechClient(); + doStuffWithSpeechClient(speechClient); +} + +main(); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/system-test/install.ts b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/system-test/install.ts new file mode 100644 index 00000000000..2a505d6df0c --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/system-test/install.ts @@ -0,0 +1,49 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + + it('TypeScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() + } + }; + await packNTest(options); + }); + + it('JavaScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() + } + }; + await packNTest(options); + }); + +}); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/test/gapic_adaptation_v1.ts b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/test/gapic_adaptation_v1.ts new file mode 100644 index 00000000000..7283e141bd7 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/test/gapic_adaptation_v1.ts @@ -0,0 +1,1786 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as adaptationModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.AdaptationClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new adaptationModule.v1.AdaptationClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'speech.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new adaptationModule.v1.AdaptationClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = adaptationModule.v1.AdaptationClient.servicePath; + assert.strictEqual(servicePath, 'speech.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = adaptationModule.v1.AdaptationClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'speech.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new adaptationModule.v1.AdaptationClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'speech.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new adaptationModule.v1.AdaptationClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'speech.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new adaptationModule.v1.AdaptationClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'speech.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new adaptationModule.v1.AdaptationClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'speech.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new adaptationModule.v1.AdaptationClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = adaptationModule.v1.AdaptationClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new adaptationModule.v1.AdaptationClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new adaptationModule.v1.AdaptationClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.adaptationStub, undefined); + await client.initialize(); + assert(client.adaptationStub); + }); + + it('has close method for the initialized client', done => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.adaptationStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.adaptationStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('createPhraseSet', () => { + it('invokes createPhraseSet without error', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.CreatePhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.CreatePhraseSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1.PhraseSet() + ); + client.innerApiCalls.createPhraseSet = stubSimpleCall(expectedResponse); + const [response] = await client.createPhraseSet(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createPhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createPhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPhraseSet without error using callback', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.CreatePhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.CreatePhraseSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1.PhraseSet() + ); + client.innerApiCalls.createPhraseSet = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createPhraseSet( + request, + (err?: Error|null, result?: protos.google.cloud.speech.v1.IPhraseSet|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createPhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createPhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPhraseSet with error', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.CreatePhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.CreatePhraseSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createPhraseSet = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createPhraseSet(request), expectedError); + const actualRequest = (client.innerApiCalls.createPhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createPhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPhraseSet with closed client', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.CreatePhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.CreatePhraseSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createPhraseSet(request), expectedError); + }); + }); + + describe('getPhraseSet', () => { + it('invokes getPhraseSet without error', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.GetPhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.GetPhraseSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1.PhraseSet() + ); + client.innerApiCalls.getPhraseSet = stubSimpleCall(expectedResponse); + const [response] = await client.getPhraseSet(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getPhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getPhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPhraseSet without error using callback', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.GetPhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.GetPhraseSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1.PhraseSet() + ); + client.innerApiCalls.getPhraseSet = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getPhraseSet( + request, + (err?: Error|null, result?: protos.google.cloud.speech.v1.IPhraseSet|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getPhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getPhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPhraseSet with error', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.GetPhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.GetPhraseSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getPhraseSet = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getPhraseSet(request), expectedError); + const actualRequest = (client.innerApiCalls.getPhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getPhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPhraseSet with closed client', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.GetPhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.GetPhraseSetRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getPhraseSet(request), expectedError); + }); + }); + + describe('updatePhraseSet', () => { + it('invokes updatePhraseSet without error', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.UpdatePhraseSetRequest() + ); + request.phraseSet ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.UpdatePhraseSetRequest', ['phraseSet', 'name']); + request.phraseSet.name = defaultValue1; + const expectedHeaderRequestParams = `phrase_set.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1.PhraseSet() + ); + client.innerApiCalls.updatePhraseSet = stubSimpleCall(expectedResponse); + const [response] = await client.updatePhraseSet(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updatePhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updatePhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updatePhraseSet without error using callback', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.UpdatePhraseSetRequest() + ); + request.phraseSet ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.UpdatePhraseSetRequest', ['phraseSet', 'name']); + request.phraseSet.name = defaultValue1; + const expectedHeaderRequestParams = `phrase_set.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1.PhraseSet() + ); + client.innerApiCalls.updatePhraseSet = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updatePhraseSet( + request, + (err?: Error|null, result?: protos.google.cloud.speech.v1.IPhraseSet|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updatePhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updatePhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updatePhraseSet with error', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.UpdatePhraseSetRequest() + ); + request.phraseSet ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.UpdatePhraseSetRequest', ['phraseSet', 'name']); + request.phraseSet.name = defaultValue1; + const expectedHeaderRequestParams = `phrase_set.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updatePhraseSet = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updatePhraseSet(request), expectedError); + const actualRequest = (client.innerApiCalls.updatePhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updatePhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updatePhraseSet with closed client', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.UpdatePhraseSetRequest() + ); + request.phraseSet ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.UpdatePhraseSetRequest', ['phraseSet', 'name']); + request.phraseSet.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updatePhraseSet(request), expectedError); + }); + }); + + describe('deletePhraseSet', () => { + it('invokes deletePhraseSet without error', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.DeletePhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.DeletePhraseSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deletePhraseSet = stubSimpleCall(expectedResponse); + const [response] = await client.deletePhraseSet(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deletePhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deletePhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePhraseSet without error using callback', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.DeletePhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.DeletePhraseSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deletePhraseSet = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deletePhraseSet( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deletePhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deletePhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePhraseSet with error', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.DeletePhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.DeletePhraseSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deletePhraseSet = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deletePhraseSet(request), expectedError); + const actualRequest = (client.innerApiCalls.deletePhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deletePhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePhraseSet with closed client', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.DeletePhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.DeletePhraseSetRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deletePhraseSet(request), expectedError); + }); + }); + + describe('createCustomClass', () => { + it('invokes createCustomClass without error', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.CreateCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.CreateCustomClassRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1.CustomClass() + ); + client.innerApiCalls.createCustomClass = stubSimpleCall(expectedResponse); + const [response] = await client.createCustomClass(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCustomClass without error using callback', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.CreateCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.CreateCustomClassRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1.CustomClass() + ); + client.innerApiCalls.createCustomClass = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createCustomClass( + request, + (err?: Error|null, result?: protos.google.cloud.speech.v1.ICustomClass|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCustomClass with error', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.CreateCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.CreateCustomClassRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCustomClass = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createCustomClass(request), expectedError); + const actualRequest = (client.innerApiCalls.createCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCustomClass with closed client', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.CreateCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.CreateCustomClassRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createCustomClass(request), expectedError); + }); + }); + + describe('getCustomClass', () => { + it('invokes getCustomClass without error', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.GetCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.GetCustomClassRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1.CustomClass() + ); + client.innerApiCalls.getCustomClass = stubSimpleCall(expectedResponse); + const [response] = await client.getCustomClass(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCustomClass without error using callback', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.GetCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.GetCustomClassRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1.CustomClass() + ); + client.innerApiCalls.getCustomClass = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getCustomClass( + request, + (err?: Error|null, result?: protos.google.cloud.speech.v1.ICustomClass|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCustomClass with error', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.GetCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.GetCustomClassRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getCustomClass = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getCustomClass(request), expectedError); + const actualRequest = (client.innerApiCalls.getCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCustomClass with closed client', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.GetCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.GetCustomClassRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getCustomClass(request), expectedError); + }); + }); + + describe('updateCustomClass', () => { + it('invokes updateCustomClass without error', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.UpdateCustomClassRequest() + ); + request.customClass ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.UpdateCustomClassRequest', ['customClass', 'name']); + request.customClass.name = defaultValue1; + const expectedHeaderRequestParams = `custom_class.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1.CustomClass() + ); + client.innerApiCalls.updateCustomClass = stubSimpleCall(expectedResponse); + const [response] = await client.updateCustomClass(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCustomClass without error using callback', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.UpdateCustomClassRequest() + ); + request.customClass ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.UpdateCustomClassRequest', ['customClass', 'name']); + request.customClass.name = defaultValue1; + const expectedHeaderRequestParams = `custom_class.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1.CustomClass() + ); + client.innerApiCalls.updateCustomClass = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateCustomClass( + request, + (err?: Error|null, result?: protos.google.cloud.speech.v1.ICustomClass|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCustomClass with error', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.UpdateCustomClassRequest() + ); + request.customClass ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.UpdateCustomClassRequest', ['customClass', 'name']); + request.customClass.name = defaultValue1; + const expectedHeaderRequestParams = `custom_class.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCustomClass = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateCustomClass(request), expectedError); + const actualRequest = (client.innerApiCalls.updateCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCustomClass with closed client', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.UpdateCustomClassRequest() + ); + request.customClass ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.UpdateCustomClassRequest', ['customClass', 'name']); + request.customClass.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateCustomClass(request), expectedError); + }); + }); + + describe('deleteCustomClass', () => { + it('invokes deleteCustomClass without error', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.DeleteCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.DeleteCustomClassRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteCustomClass = stubSimpleCall(expectedResponse); + const [response] = await client.deleteCustomClass(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCustomClass without error using callback', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.DeleteCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.DeleteCustomClassRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteCustomClass = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteCustomClass( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCustomClass with error', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.DeleteCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.DeleteCustomClassRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCustomClass = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteCustomClass(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCustomClass with closed client', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.DeleteCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.DeleteCustomClassRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteCustomClass(request), expectedError); + }); + }); + + describe('listPhraseSet', () => { + it('invokes listPhraseSet without error', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.ListPhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.ListPhraseSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.speech.v1.PhraseSet()), + generateSampleMessage(new protos.google.cloud.speech.v1.PhraseSet()), + generateSampleMessage(new protos.google.cloud.speech.v1.PhraseSet()), + ]; + client.innerApiCalls.listPhraseSet = stubSimpleCall(expectedResponse); + const [response] = await client.listPhraseSet(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listPhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listPhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPhraseSet without error using callback', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.ListPhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.ListPhraseSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.speech.v1.PhraseSet()), + generateSampleMessage(new protos.google.cloud.speech.v1.PhraseSet()), + generateSampleMessage(new protos.google.cloud.speech.v1.PhraseSet()), + ]; + client.innerApiCalls.listPhraseSet = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listPhraseSet( + request, + (err?: Error|null, result?: protos.google.cloud.speech.v1.IPhraseSet[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listPhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listPhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPhraseSet with error', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.ListPhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.ListPhraseSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listPhraseSet = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listPhraseSet(request), expectedError); + const actualRequest = (client.innerApiCalls.listPhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listPhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPhraseSetStream without error', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.ListPhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.ListPhraseSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.speech.v1.PhraseSet()), + generateSampleMessage(new protos.google.cloud.speech.v1.PhraseSet()), + generateSampleMessage(new protos.google.cloud.speech.v1.PhraseSet()), + ]; + client.descriptors.page.listPhraseSet.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listPhraseSetStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.speech.v1.PhraseSet[] = []; + stream.on('data', (response: protos.google.cloud.speech.v1.PhraseSet) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listPhraseSet.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listPhraseSet, request)); + assert( + (client.descriptors.page.listPhraseSet.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listPhraseSetStream with error', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.ListPhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.ListPhraseSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listPhraseSet.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listPhraseSetStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.speech.v1.PhraseSet[] = []; + stream.on('data', (response: protos.google.cloud.speech.v1.PhraseSet) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listPhraseSet.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listPhraseSet, request)); + assert( + (client.descriptors.page.listPhraseSet.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listPhraseSet without error', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.ListPhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.ListPhraseSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.speech.v1.PhraseSet()), + generateSampleMessage(new protos.google.cloud.speech.v1.PhraseSet()), + generateSampleMessage(new protos.google.cloud.speech.v1.PhraseSet()), + ]; + client.descriptors.page.listPhraseSet.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.speech.v1.IPhraseSet[] = []; + const iterable = client.listPhraseSetAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listPhraseSet.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listPhraseSet.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listPhraseSet with error', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.ListPhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.ListPhraseSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listPhraseSet.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listPhraseSetAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.speech.v1.IPhraseSet[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listPhraseSet.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listPhraseSet.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listCustomClasses', () => { + it('invokes listCustomClasses without error', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.ListCustomClassesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.ListCustomClassesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.speech.v1.CustomClass()), + generateSampleMessage(new protos.google.cloud.speech.v1.CustomClass()), + generateSampleMessage(new protos.google.cloud.speech.v1.CustomClass()), + ]; + client.innerApiCalls.listCustomClasses = stubSimpleCall(expectedResponse); + const [response] = await client.listCustomClasses(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listCustomClasses as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listCustomClasses as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCustomClasses without error using callback', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.ListCustomClassesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.ListCustomClassesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.speech.v1.CustomClass()), + generateSampleMessage(new protos.google.cloud.speech.v1.CustomClass()), + generateSampleMessage(new protos.google.cloud.speech.v1.CustomClass()), + ]; + client.innerApiCalls.listCustomClasses = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listCustomClasses( + request, + (err?: Error|null, result?: protos.google.cloud.speech.v1.ICustomClass[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listCustomClasses as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listCustomClasses as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCustomClasses with error', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.ListCustomClassesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.ListCustomClassesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listCustomClasses = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listCustomClasses(request), expectedError); + const actualRequest = (client.innerApiCalls.listCustomClasses as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listCustomClasses as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCustomClassesStream without error', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.ListCustomClassesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.ListCustomClassesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.speech.v1.CustomClass()), + generateSampleMessage(new protos.google.cloud.speech.v1.CustomClass()), + generateSampleMessage(new protos.google.cloud.speech.v1.CustomClass()), + ]; + client.descriptors.page.listCustomClasses.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listCustomClassesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.speech.v1.CustomClass[] = []; + stream.on('data', (response: protos.google.cloud.speech.v1.CustomClass) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listCustomClasses.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listCustomClasses, request)); + assert( + (client.descriptors.page.listCustomClasses.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listCustomClassesStream with error', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.ListCustomClassesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.ListCustomClassesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listCustomClasses.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listCustomClassesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.speech.v1.CustomClass[] = []; + stream.on('data', (response: protos.google.cloud.speech.v1.CustomClass) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listCustomClasses.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listCustomClasses, request)); + assert( + (client.descriptors.page.listCustomClasses.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listCustomClasses without error', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.ListCustomClassesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.ListCustomClassesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.speech.v1.CustomClass()), + generateSampleMessage(new protos.google.cloud.speech.v1.CustomClass()), + generateSampleMessage(new protos.google.cloud.speech.v1.CustomClass()), + ]; + client.descriptors.page.listCustomClasses.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.speech.v1.ICustomClass[] = []; + const iterable = client.listCustomClassesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listCustomClasses.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listCustomClasses.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listCustomClasses with error', async () => { + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.ListCustomClassesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1.ListCustomClassesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listCustomClasses.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listCustomClassesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.speech.v1.ICustomClass[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listCustomClasses.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listCustomClasses.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + + describe('customClass', async () => { + const fakePath = "/rendered/path/customClass"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + custom_class: "customClassValue", + }; + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.customClassPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.customClassPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('customClassPath', () => { + const result = client.customClassPath("projectValue", "locationValue", "customClassValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.customClassPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromCustomClassName', () => { + const result = client.matchProjectFromCustomClassName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.customClassPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromCustomClassName', () => { + const result = client.matchLocationFromCustomClassName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.customClassPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCustomClassFromCustomClassName', () => { + const result = client.matchCustomClassFromCustomClassName(fakePath); + assert.strictEqual(result, "customClassValue"); + assert((client.pathTemplates.customClassPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', async () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('phraseSet', async () => { + const fakePath = "/rendered/path/phraseSet"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + phrase_set: "phraseSetValue", + }; + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.phraseSetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.phraseSetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('phraseSetPath', () => { + const result = client.phraseSetPath("projectValue", "locationValue", "phraseSetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.phraseSetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromPhraseSetName', () => { + const result = client.matchProjectFromPhraseSetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.phraseSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromPhraseSetName', () => { + const result = client.matchLocationFromPhraseSetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.phraseSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPhraseSetFromPhraseSetName', () => { + const result = client.matchPhraseSetFromPhraseSetName(fakePath); + assert.strictEqual(result, "phraseSetValue"); + assert((client.pathTemplates.phraseSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('project', async () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new adaptationModule.v1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/test/gapic_adaptation_v1p1beta1.ts b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/test/gapic_adaptation_v1p1beta1.ts new file mode 100644 index 00000000000..7a3233960e6 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/test/gapic_adaptation_v1p1beta1.ts @@ -0,0 +1,1786 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as adaptationModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1p1beta1.AdaptationClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'speech.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = adaptationModule.v1p1beta1.AdaptationClient.servicePath; + assert.strictEqual(servicePath, 'speech.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = adaptationModule.v1p1beta1.AdaptationClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'speech.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'speech.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'speech.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new adaptationModule.v1p1beta1.AdaptationClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'speech.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new adaptationModule.v1p1beta1.AdaptationClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'speech.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new adaptationModule.v1p1beta1.AdaptationClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = adaptationModule.v1p1beta1.AdaptationClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.adaptationStub, undefined); + await client.initialize(); + assert(client.adaptationStub); + }); + + it('has close method for the initialized client', done => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.adaptationStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.adaptationStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('createPhraseSet', () => { + it('invokes createPhraseSet without error', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.PhraseSet() + ); + client.innerApiCalls.createPhraseSet = stubSimpleCall(expectedResponse); + const [response] = await client.createPhraseSet(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createPhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createPhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPhraseSet without error using callback', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.PhraseSet() + ); + client.innerApiCalls.createPhraseSet = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createPhraseSet( + request, + (err?: Error|null, result?: protos.google.cloud.speech.v1p1beta1.IPhraseSet|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createPhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createPhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPhraseSet with error', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createPhraseSet = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createPhraseSet(request), expectedError); + const actualRequest = (client.innerApiCalls.createPhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createPhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPhraseSet with closed client', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createPhraseSet(request), expectedError); + }); + }); + + describe('getPhraseSet', () => { + it('invokes getPhraseSet without error', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.GetPhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.GetPhraseSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.PhraseSet() + ); + client.innerApiCalls.getPhraseSet = stubSimpleCall(expectedResponse); + const [response] = await client.getPhraseSet(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getPhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getPhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPhraseSet without error using callback', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.GetPhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.GetPhraseSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.PhraseSet() + ); + client.innerApiCalls.getPhraseSet = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getPhraseSet( + request, + (err?: Error|null, result?: protos.google.cloud.speech.v1p1beta1.IPhraseSet|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getPhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getPhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPhraseSet with error', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.GetPhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.GetPhraseSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getPhraseSet = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getPhraseSet(request), expectedError); + const actualRequest = (client.innerApiCalls.getPhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getPhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPhraseSet with closed client', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.GetPhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.GetPhraseSetRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getPhraseSet(request), expectedError); + }); + }); + + describe('updatePhraseSet', () => { + it('invokes updatePhraseSet without error', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest() + ); + request.phraseSet ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest', ['phraseSet', 'name']); + request.phraseSet.name = defaultValue1; + const expectedHeaderRequestParams = `phrase_set.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.PhraseSet() + ); + client.innerApiCalls.updatePhraseSet = stubSimpleCall(expectedResponse); + const [response] = await client.updatePhraseSet(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updatePhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updatePhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updatePhraseSet without error using callback', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest() + ); + request.phraseSet ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest', ['phraseSet', 'name']); + request.phraseSet.name = defaultValue1; + const expectedHeaderRequestParams = `phrase_set.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.PhraseSet() + ); + client.innerApiCalls.updatePhraseSet = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updatePhraseSet( + request, + (err?: Error|null, result?: protos.google.cloud.speech.v1p1beta1.IPhraseSet|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updatePhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updatePhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updatePhraseSet with error', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest() + ); + request.phraseSet ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest', ['phraseSet', 'name']); + request.phraseSet.name = defaultValue1; + const expectedHeaderRequestParams = `phrase_set.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updatePhraseSet = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updatePhraseSet(request), expectedError); + const actualRequest = (client.innerApiCalls.updatePhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updatePhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updatePhraseSet with closed client', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest() + ); + request.phraseSet ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest', ['phraseSet', 'name']); + request.phraseSet.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updatePhraseSet(request), expectedError); + }); + }); + + describe('deletePhraseSet', () => { + it('invokes deletePhraseSet without error', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deletePhraseSet = stubSimpleCall(expectedResponse); + const [response] = await client.deletePhraseSet(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deletePhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deletePhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePhraseSet without error using callback', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deletePhraseSet = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deletePhraseSet( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deletePhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deletePhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePhraseSet with error', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deletePhraseSet = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deletePhraseSet(request), expectedError); + const actualRequest = (client.innerApiCalls.deletePhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deletePhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePhraseSet with closed client', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deletePhraseSet(request), expectedError); + }); + }); + + describe('createCustomClass', () => { + it('invokes createCustomClass without error', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.CreateCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.CreateCustomClassRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.CustomClass() + ); + client.innerApiCalls.createCustomClass = stubSimpleCall(expectedResponse); + const [response] = await client.createCustomClass(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCustomClass without error using callback', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.CreateCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.CreateCustomClassRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.CustomClass() + ); + client.innerApiCalls.createCustomClass = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createCustomClass( + request, + (err?: Error|null, result?: protos.google.cloud.speech.v1p1beta1.ICustomClass|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCustomClass with error', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.CreateCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.CreateCustomClassRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCustomClass = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createCustomClass(request), expectedError); + const actualRequest = (client.innerApiCalls.createCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCustomClass with closed client', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.CreateCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.CreateCustomClassRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createCustomClass(request), expectedError); + }); + }); + + describe('getCustomClass', () => { + it('invokes getCustomClass without error', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.GetCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.GetCustomClassRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.CustomClass() + ); + client.innerApiCalls.getCustomClass = stubSimpleCall(expectedResponse); + const [response] = await client.getCustomClass(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCustomClass without error using callback', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.GetCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.GetCustomClassRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.CustomClass() + ); + client.innerApiCalls.getCustomClass = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getCustomClass( + request, + (err?: Error|null, result?: protos.google.cloud.speech.v1p1beta1.ICustomClass|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCustomClass with error', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.GetCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.GetCustomClassRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getCustomClass = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getCustomClass(request), expectedError); + const actualRequest = (client.innerApiCalls.getCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCustomClass with closed client', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.GetCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.GetCustomClassRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getCustomClass(request), expectedError); + }); + }); + + describe('updateCustomClass', () => { + it('invokes updateCustomClass without error', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest() + ); + request.customClass ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest', ['customClass', 'name']); + request.customClass.name = defaultValue1; + const expectedHeaderRequestParams = `custom_class.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.CustomClass() + ); + client.innerApiCalls.updateCustomClass = stubSimpleCall(expectedResponse); + const [response] = await client.updateCustomClass(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCustomClass without error using callback', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest() + ); + request.customClass ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest', ['customClass', 'name']); + request.customClass.name = defaultValue1; + const expectedHeaderRequestParams = `custom_class.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.CustomClass() + ); + client.innerApiCalls.updateCustomClass = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateCustomClass( + request, + (err?: Error|null, result?: protos.google.cloud.speech.v1p1beta1.ICustomClass|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCustomClass with error', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest() + ); + request.customClass ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest', ['customClass', 'name']); + request.customClass.name = defaultValue1; + const expectedHeaderRequestParams = `custom_class.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCustomClass = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateCustomClass(request), expectedError); + const actualRequest = (client.innerApiCalls.updateCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCustomClass with closed client', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest() + ); + request.customClass ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest', ['customClass', 'name']); + request.customClass.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateCustomClass(request), expectedError); + }); + }); + + describe('deleteCustomClass', () => { + it('invokes deleteCustomClass without error', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteCustomClass = stubSimpleCall(expectedResponse); + const [response] = await client.deleteCustomClass(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCustomClass without error using callback', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteCustomClass = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteCustomClass( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCustomClass with error', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCustomClass = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteCustomClass(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCustomClass with closed client', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteCustomClass(request), expectedError); + }); + }); + + describe('listPhraseSet', () => { + it('invokes listPhraseSet without error', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.ListPhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.ListPhraseSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.speech.v1p1beta1.PhraseSet()), + generateSampleMessage(new protos.google.cloud.speech.v1p1beta1.PhraseSet()), + generateSampleMessage(new protos.google.cloud.speech.v1p1beta1.PhraseSet()), + ]; + client.innerApiCalls.listPhraseSet = stubSimpleCall(expectedResponse); + const [response] = await client.listPhraseSet(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listPhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listPhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPhraseSet without error using callback', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.ListPhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.ListPhraseSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.speech.v1p1beta1.PhraseSet()), + generateSampleMessage(new protos.google.cloud.speech.v1p1beta1.PhraseSet()), + generateSampleMessage(new protos.google.cloud.speech.v1p1beta1.PhraseSet()), + ]; + client.innerApiCalls.listPhraseSet = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listPhraseSet( + request, + (err?: Error|null, result?: protos.google.cloud.speech.v1p1beta1.IPhraseSet[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listPhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listPhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPhraseSet with error', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.ListPhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.ListPhraseSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listPhraseSet = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listPhraseSet(request), expectedError); + const actualRequest = (client.innerApiCalls.listPhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listPhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPhraseSetStream without error', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.ListPhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.ListPhraseSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.speech.v1p1beta1.PhraseSet()), + generateSampleMessage(new protos.google.cloud.speech.v1p1beta1.PhraseSet()), + generateSampleMessage(new protos.google.cloud.speech.v1p1beta1.PhraseSet()), + ]; + client.descriptors.page.listPhraseSet.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listPhraseSetStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.speech.v1p1beta1.PhraseSet[] = []; + stream.on('data', (response: protos.google.cloud.speech.v1p1beta1.PhraseSet) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listPhraseSet.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listPhraseSet, request)); + assert( + (client.descriptors.page.listPhraseSet.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listPhraseSetStream with error', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.ListPhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.ListPhraseSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listPhraseSet.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listPhraseSetStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.speech.v1p1beta1.PhraseSet[] = []; + stream.on('data', (response: protos.google.cloud.speech.v1p1beta1.PhraseSet) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listPhraseSet.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listPhraseSet, request)); + assert( + (client.descriptors.page.listPhraseSet.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listPhraseSet without error', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.ListPhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.ListPhraseSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.speech.v1p1beta1.PhraseSet()), + generateSampleMessage(new protos.google.cloud.speech.v1p1beta1.PhraseSet()), + generateSampleMessage(new protos.google.cloud.speech.v1p1beta1.PhraseSet()), + ]; + client.descriptors.page.listPhraseSet.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.speech.v1p1beta1.IPhraseSet[] = []; + const iterable = client.listPhraseSetAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listPhraseSet.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listPhraseSet.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listPhraseSet with error', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.ListPhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.ListPhraseSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listPhraseSet.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listPhraseSetAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.speech.v1p1beta1.IPhraseSet[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listPhraseSet.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listPhraseSet.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listCustomClasses', () => { + it('invokes listCustomClasses without error', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.ListCustomClassesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.ListCustomClassesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.speech.v1p1beta1.CustomClass()), + generateSampleMessage(new protos.google.cloud.speech.v1p1beta1.CustomClass()), + generateSampleMessage(new protos.google.cloud.speech.v1p1beta1.CustomClass()), + ]; + client.innerApiCalls.listCustomClasses = stubSimpleCall(expectedResponse); + const [response] = await client.listCustomClasses(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listCustomClasses as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listCustomClasses as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCustomClasses without error using callback', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.ListCustomClassesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.ListCustomClassesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.speech.v1p1beta1.CustomClass()), + generateSampleMessage(new protos.google.cloud.speech.v1p1beta1.CustomClass()), + generateSampleMessage(new protos.google.cloud.speech.v1p1beta1.CustomClass()), + ]; + client.innerApiCalls.listCustomClasses = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listCustomClasses( + request, + (err?: Error|null, result?: protos.google.cloud.speech.v1p1beta1.ICustomClass[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listCustomClasses as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listCustomClasses as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCustomClasses with error', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.ListCustomClassesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.ListCustomClassesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listCustomClasses = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listCustomClasses(request), expectedError); + const actualRequest = (client.innerApiCalls.listCustomClasses as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listCustomClasses as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCustomClassesStream without error', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.ListCustomClassesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.ListCustomClassesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.speech.v1p1beta1.CustomClass()), + generateSampleMessage(new protos.google.cloud.speech.v1p1beta1.CustomClass()), + generateSampleMessage(new protos.google.cloud.speech.v1p1beta1.CustomClass()), + ]; + client.descriptors.page.listCustomClasses.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listCustomClassesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.speech.v1p1beta1.CustomClass[] = []; + stream.on('data', (response: protos.google.cloud.speech.v1p1beta1.CustomClass) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listCustomClasses.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listCustomClasses, request)); + assert( + (client.descriptors.page.listCustomClasses.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listCustomClassesStream with error', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.ListCustomClassesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.ListCustomClassesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listCustomClasses.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listCustomClassesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.speech.v1p1beta1.CustomClass[] = []; + stream.on('data', (response: protos.google.cloud.speech.v1p1beta1.CustomClass) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listCustomClasses.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listCustomClasses, request)); + assert( + (client.descriptors.page.listCustomClasses.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listCustomClasses without error', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.ListCustomClassesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.ListCustomClassesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.speech.v1p1beta1.CustomClass()), + generateSampleMessage(new protos.google.cloud.speech.v1p1beta1.CustomClass()), + generateSampleMessage(new protos.google.cloud.speech.v1p1beta1.CustomClass()), + ]; + client.descriptors.page.listCustomClasses.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.speech.v1p1beta1.ICustomClass[] = []; + const iterable = client.listCustomClassesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listCustomClasses.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listCustomClasses.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listCustomClasses with error', async () => { + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.ListCustomClassesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v1p1beta1.ListCustomClassesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listCustomClasses.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listCustomClassesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.speech.v1p1beta1.ICustomClass[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listCustomClasses.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listCustomClasses.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + + describe('customClass', async () => { + const fakePath = "/rendered/path/customClass"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + custom_class: "customClassValue", + }; + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.customClassPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.customClassPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('customClassPath', () => { + const result = client.customClassPath("projectValue", "locationValue", "customClassValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.customClassPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromCustomClassName', () => { + const result = client.matchProjectFromCustomClassName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.customClassPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromCustomClassName', () => { + const result = client.matchLocationFromCustomClassName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.customClassPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCustomClassFromCustomClassName', () => { + const result = client.matchCustomClassFromCustomClassName(fakePath); + assert.strictEqual(result, "customClassValue"); + assert((client.pathTemplates.customClassPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', async () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('phraseSet', async () => { + const fakePath = "/rendered/path/phraseSet"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + phrase_set: "phraseSetValue", + }; + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.phraseSetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.phraseSetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('phraseSetPath', () => { + const result = client.phraseSetPath("projectValue", "locationValue", "phraseSetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.phraseSetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromPhraseSetName', () => { + const result = client.matchProjectFromPhraseSetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.phraseSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromPhraseSetName', () => { + const result = client.matchLocationFromPhraseSetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.phraseSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPhraseSetFromPhraseSetName', () => { + const result = client.matchPhraseSetFromPhraseSetName(fakePath); + assert.strictEqual(result, "phraseSetValue"); + assert((client.pathTemplates.phraseSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('project', async () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new adaptationModule.v1p1beta1.AdaptationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/test/gapic_speech_v1.ts b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/test/gapic_speech_v1.ts new file mode 100644 index 00000000000..5cf13b4a47f --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/test/gapic_speech_v1.ts @@ -0,0 +1,864 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as speechModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubBidiStreamingCall(response?: ResponseType, error?: Error) { + const transformStub = error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + return sinon.stub().returns(mockStream); +} + +function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.SpeechClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new speechModule.v1.SpeechClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'speech.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new speechModule.v1.SpeechClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = speechModule.v1.SpeechClient.servicePath; + assert.strictEqual(servicePath, 'speech.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = speechModule.v1.SpeechClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'speech.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new speechModule.v1.SpeechClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'speech.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new speechModule.v1.SpeechClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'speech.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new speechModule.v1.SpeechClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'speech.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new speechModule.v1.SpeechClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'speech.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new speechModule.v1.SpeechClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = speechModule.v1.SpeechClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new speechModule.v1.SpeechClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new speechModule.v1.SpeechClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.speechStub, undefined); + await client.initialize(); + assert(client.speechStub); + }); + + it('has close method for the initialized client', done => { + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.speechStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.speechStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('recognize', () => { + it('invokes recognize without error', async () => { + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.RecognizeRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1.RecognizeResponse() + ); + client.innerApiCalls.recognize = stubSimpleCall(expectedResponse); + const [response] = await client.recognize(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes recognize without error using callback', async () => { + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.RecognizeRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1.RecognizeResponse() + ); + client.innerApiCalls.recognize = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.recognize( + request, + (err?: Error|null, result?: protos.google.cloud.speech.v1.IRecognizeResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes recognize with error', async () => { + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.RecognizeRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.recognize = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.recognize(request), expectedError); + }); + + it('invokes recognize with closed client', async () => { + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.RecognizeRequest() + ); + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.recognize(request), expectedError); + }); + }); + + describe('longRunningRecognize', () => { + it('invokes longRunningRecognize without error', async () => { + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.LongRunningRecognizeRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.longRunningRecognize = stubLongRunningCall(expectedResponse); + const [operation] = await client.longRunningRecognize(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes longRunningRecognize without error using callback', async () => { + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.LongRunningRecognizeRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.longRunningRecognize = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.longRunningRecognize( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes longRunningRecognize with call error', async () => { + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.LongRunningRecognizeRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.longRunningRecognize = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.longRunningRecognize(request), expectedError); + }); + + it('invokes longRunningRecognize with LRO error', async () => { + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.LongRunningRecognizeRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.longRunningRecognize = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.longRunningRecognize(request); + await assert.rejects(operation.promise(), expectedError); + }); + + it('invokes checkLongRunningRecognizeProgress without error', async () => { + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkLongRunningRecognizeProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkLongRunningRecognizeProgress with error', async () => { + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkLongRunningRecognizeProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('streamingRecognize', () => { + it('invokes streamingRecognize without error', async () => { + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.StreamingRecognizeRequest() + ); + + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1.StreamingRecognizeResponse() + ); + client.innerApiCalls.streamingRecognize = stubBidiStreamingCall(expectedResponse); + const stream = client.streamingRecognize(); + const promise = new Promise((resolve, reject) => { + stream.on('data', (response: protos.google.cloud.speech.v1.StreamingRecognizeResponse) => { + resolve(response); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + stream.write(request); + stream.end(); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.streamingRecognize as SinonStub) + .getCall(0).calledWith(null)); + assert.deepStrictEqual(((stream as unknown as PassThrough) + ._transform as SinonStub).getCall(0).args[0], request); + }); + + it('invokes streamingRecognize with error', async () => { + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1.StreamingRecognizeRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.streamingRecognize = stubBidiStreamingCall(undefined, expectedError); + const stream = client.streamingRecognize(); + const promise = new Promise((resolve, reject) => { + stream.on('data', (response: protos.google.cloud.speech.v1.StreamingRecognizeResponse) => { + resolve(response); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + stream.write(request); + stream.end(); + }); + await assert.rejects(promise, expectedError); + assert((client.innerApiCalls.streamingRecognize as SinonStub) + .getCall(0).calledWith(null)); + assert.deepStrictEqual(((stream as unknown as PassThrough) + ._transform as SinonStub).getCall(0).args[0], request); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.IOperation[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.IOperation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + describe('Path templates', () => { + + describe('customClass', async () => { + const fakePath = "/rendered/path/customClass"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + custom_class: "customClassValue", + }; + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.customClassPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.customClassPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('customClassPath', () => { + const result = client.customClassPath("projectValue", "locationValue", "customClassValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.customClassPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromCustomClassName', () => { + const result = client.matchProjectFromCustomClassName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.customClassPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromCustomClassName', () => { + const result = client.matchLocationFromCustomClassName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.customClassPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCustomClassFromCustomClassName', () => { + const result = client.matchCustomClassFromCustomClassName(fakePath); + assert.strictEqual(result, "customClassValue"); + assert((client.pathTemplates.customClassPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('phraseSet', async () => { + const fakePath = "/rendered/path/phraseSet"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + phrase_set: "phraseSetValue", + }; + const client = new speechModule.v1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.phraseSetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.phraseSetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('phraseSetPath', () => { + const result = client.phraseSetPath("projectValue", "locationValue", "phraseSetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.phraseSetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromPhraseSetName', () => { + const result = client.matchProjectFromPhraseSetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.phraseSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromPhraseSetName', () => { + const result = client.matchLocationFromPhraseSetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.phraseSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPhraseSetFromPhraseSetName', () => { + const result = client.matchPhraseSetFromPhraseSetName(fakePath); + assert.strictEqual(result, "phraseSetValue"); + assert((client.pathTemplates.phraseSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/test/gapic_speech_v1p1beta1.ts b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/test/gapic_speech_v1p1beta1.ts new file mode 100644 index 00000000000..2f06d475be1 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/test/gapic_speech_v1p1beta1.ts @@ -0,0 +1,864 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as speechModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubBidiStreamingCall(response?: ResponseType, error?: Error) { + const transformStub = error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + return sinon.stub().returns(mockStream); +} + +function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1p1beta1.SpeechClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new speechModule.v1p1beta1.SpeechClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'speech.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new speechModule.v1p1beta1.SpeechClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = speechModule.v1p1beta1.SpeechClient.servicePath; + assert.strictEqual(servicePath, 'speech.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = speechModule.v1p1beta1.SpeechClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'speech.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new speechModule.v1p1beta1.SpeechClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'speech.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new speechModule.v1p1beta1.SpeechClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'speech.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new speechModule.v1p1beta1.SpeechClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'speech.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new speechModule.v1p1beta1.SpeechClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'speech.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new speechModule.v1p1beta1.SpeechClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = speechModule.v1p1beta1.SpeechClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new speechModule.v1p1beta1.SpeechClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new speechModule.v1p1beta1.SpeechClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.speechStub, undefined); + await client.initialize(); + assert(client.speechStub); + }); + + it('has close method for the initialized client', done => { + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.speechStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.speechStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('recognize', () => { + it('invokes recognize without error', async () => { + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.RecognizeRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.RecognizeResponse() + ); + client.innerApiCalls.recognize = stubSimpleCall(expectedResponse); + const [response] = await client.recognize(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes recognize without error using callback', async () => { + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.RecognizeRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.RecognizeResponse() + ); + client.innerApiCalls.recognize = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.recognize( + request, + (err?: Error|null, result?: protos.google.cloud.speech.v1p1beta1.IRecognizeResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes recognize with error', async () => { + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.RecognizeRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.recognize = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.recognize(request), expectedError); + }); + + it('invokes recognize with closed client', async () => { + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.RecognizeRequest() + ); + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.recognize(request), expectedError); + }); + }); + + describe('longRunningRecognize', () => { + it('invokes longRunningRecognize without error', async () => { + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.longRunningRecognize = stubLongRunningCall(expectedResponse); + const [operation] = await client.longRunningRecognize(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes longRunningRecognize without error using callback', async () => { + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.longRunningRecognize = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.longRunningRecognize( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes longRunningRecognize with call error', async () => { + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.longRunningRecognize = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.longRunningRecognize(request), expectedError); + }); + + it('invokes longRunningRecognize with LRO error', async () => { + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.longRunningRecognize = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.longRunningRecognize(request); + await assert.rejects(operation.promise(), expectedError); + }); + + it('invokes checkLongRunningRecognizeProgress without error', async () => { + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkLongRunningRecognizeProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkLongRunningRecognizeProgress with error', async () => { + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkLongRunningRecognizeProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('streamingRecognize', () => { + it('invokes streamingRecognize without error', async () => { + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest() + ); + + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse() + ); + client.innerApiCalls.streamingRecognize = stubBidiStreamingCall(expectedResponse); + const stream = client.streamingRecognize(); + const promise = new Promise((resolve, reject) => { + stream.on('data', (response: protos.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse) => { + resolve(response); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + stream.write(request); + stream.end(); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.streamingRecognize as SinonStub) + .getCall(0).calledWith(null)); + assert.deepStrictEqual(((stream as unknown as PassThrough) + ._transform as SinonStub).getCall(0).args[0], request); + }); + + it('invokes streamingRecognize with error', async () => { + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.streamingRecognize = stubBidiStreamingCall(undefined, expectedError); + const stream = client.streamingRecognize(); + const promise = new Promise((resolve, reject) => { + stream.on('data', (response: protos.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse) => { + resolve(response); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + stream.write(request); + stream.end(); + }); + await assert.rejects(promise, expectedError); + assert((client.innerApiCalls.streamingRecognize as SinonStub) + .getCall(0).calledWith(null)); + assert.deepStrictEqual(((stream as unknown as PassThrough) + ._transform as SinonStub).getCall(0).args[0], request); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.IOperation[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.IOperation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + describe('Path templates', () => { + + describe('customClass', async () => { + const fakePath = "/rendered/path/customClass"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + custom_class: "customClassValue", + }; + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.customClassPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.customClassPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('customClassPath', () => { + const result = client.customClassPath("projectValue", "locationValue", "customClassValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.customClassPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromCustomClassName', () => { + const result = client.matchProjectFromCustomClassName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.customClassPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromCustomClassName', () => { + const result = client.matchLocationFromCustomClassName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.customClassPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCustomClassFromCustomClassName', () => { + const result = client.matchCustomClassFromCustomClassName(fakePath); + assert.strictEqual(result, "customClassValue"); + assert((client.pathTemplates.customClassPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('phraseSet', async () => { + const fakePath = "/rendered/path/phraseSet"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + phrase_set: "phraseSetValue", + }; + const client = new speechModule.v1p1beta1.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.phraseSetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.phraseSetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('phraseSetPath', () => { + const result = client.phraseSetPath("projectValue", "locationValue", "phraseSetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.phraseSetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromPhraseSetName', () => { + const result = client.matchProjectFromPhraseSetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.phraseSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromPhraseSetName', () => { + const result = client.matchLocationFromPhraseSetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.phraseSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPhraseSetFromPhraseSetName', () => { + const result = client.matchPhraseSetFromPhraseSetName(fakePath); + assert.strictEqual(result, "phraseSetValue"); + assert((client.pathTemplates.phraseSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/test/gapic_speech_v2.ts b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/test/gapic_speech_v2.ts new file mode 100644 index 00000000000..23703309b49 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/test/gapic_speech_v2.ts @@ -0,0 +1,4535 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as speechModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos, LocationProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubBidiStreamingCall(response?: ResponseType, error?: Error) { + const transformStub = error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + return sinon.stub().returns(mockStream); +} + +function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v2.SpeechClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new speechModule.v2.SpeechClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'speech.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new speechModule.v2.SpeechClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = speechModule.v2.SpeechClient.servicePath; + assert.strictEqual(servicePath, 'speech.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = speechModule.v2.SpeechClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'speech.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new speechModule.v2.SpeechClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'speech.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new speechModule.v2.SpeechClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'speech.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new speechModule.v2.SpeechClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'speech.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new speechModule.v2.SpeechClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'speech.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new speechModule.v2.SpeechClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = speechModule.v2.SpeechClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new speechModule.v2.SpeechClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new speechModule.v2.SpeechClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.speechStub, undefined); + await client.initialize(); + assert(client.speechStub); + }); + + it('has close method for the initialized client', done => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.speechStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.speechStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('getRecognizer', () => { + it('invokes getRecognizer without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.GetRecognizerRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.GetRecognizerRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v2.Recognizer() + ); + client.innerApiCalls.getRecognizer = stubSimpleCall(expectedResponse); + const [response] = await client.getRecognizer(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getRecognizer as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getRecognizer as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRecognizer without error using callback', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.GetRecognizerRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.GetRecognizerRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v2.Recognizer() + ); + client.innerApiCalls.getRecognizer = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getRecognizer( + request, + (err?: Error|null, result?: protos.google.cloud.speech.v2.IRecognizer|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getRecognizer as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getRecognizer as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRecognizer with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.GetRecognizerRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.GetRecognizerRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getRecognizer = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getRecognizer(request), expectedError); + const actualRequest = (client.innerApiCalls.getRecognizer as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getRecognizer as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRecognizer with closed client', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.GetRecognizerRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.GetRecognizerRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getRecognizer(request), expectedError); + }); + }); + + describe('recognize', () => { + it('invokes recognize without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.RecognizeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.RecognizeRequest', ['recognizer']); + request.recognizer = defaultValue1; + const expectedHeaderRequestParams = `recognizer=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v2.RecognizeResponse() + ); + client.innerApiCalls.recognize = stubSimpleCall(expectedResponse); + const [response] = await client.recognize(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.recognize as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.recognize as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes recognize without error using callback', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.RecognizeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.RecognizeRequest', ['recognizer']); + request.recognizer = defaultValue1; + const expectedHeaderRequestParams = `recognizer=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v2.RecognizeResponse() + ); + client.innerApiCalls.recognize = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.recognize( + request, + (err?: Error|null, result?: protos.google.cloud.speech.v2.IRecognizeResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.recognize as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.recognize as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes recognize with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.RecognizeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.RecognizeRequest', ['recognizer']); + request.recognizer = defaultValue1; + const expectedHeaderRequestParams = `recognizer=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.recognize = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.recognize(request), expectedError); + const actualRequest = (client.innerApiCalls.recognize as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.recognize as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes recognize with closed client', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.RecognizeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.RecognizeRequest', ['recognizer']); + request.recognizer = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.recognize(request), expectedError); + }); + }); + + describe('getConfig', () => { + it('invokes getConfig without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.GetConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.GetConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v2.Config() + ); + client.innerApiCalls.getConfig = stubSimpleCall(expectedResponse); + const [response] = await client.getConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConfig without error using callback', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.GetConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.GetConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v2.Config() + ); + client.innerApiCalls.getConfig = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getConfig( + request, + (err?: Error|null, result?: protos.google.cloud.speech.v2.IConfig|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConfig with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.GetConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.GetConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getConfig = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getConfig(request), expectedError); + const actualRequest = (client.innerApiCalls.getConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConfig with closed client', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.GetConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.GetConfigRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getConfig(request), expectedError); + }); + }); + + describe('updateConfig', () => { + it('invokes updateConfig without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.UpdateConfigRequest() + ); + request.config ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.UpdateConfigRequest', ['config', 'name']); + request.config.name = defaultValue1; + const expectedHeaderRequestParams = `config.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v2.Config() + ); + client.innerApiCalls.updateConfig = stubSimpleCall(expectedResponse); + const [response] = await client.updateConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateConfig without error using callback', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.UpdateConfigRequest() + ); + request.config ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.UpdateConfigRequest', ['config', 'name']); + request.config.name = defaultValue1; + const expectedHeaderRequestParams = `config.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v2.Config() + ); + client.innerApiCalls.updateConfig = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateConfig( + request, + (err?: Error|null, result?: protos.google.cloud.speech.v2.IConfig|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateConfig with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.UpdateConfigRequest() + ); + request.config ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.UpdateConfigRequest', ['config', 'name']); + request.config.name = defaultValue1; + const expectedHeaderRequestParams = `config.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateConfig = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateConfig(request), expectedError); + const actualRequest = (client.innerApiCalls.updateConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateConfig with closed client', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.UpdateConfigRequest() + ); + request.config ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.UpdateConfigRequest', ['config', 'name']); + request.config.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateConfig(request), expectedError); + }); + }); + + describe('getCustomClass', () => { + it('invokes getCustomClass without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.GetCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.GetCustomClassRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v2.CustomClass() + ); + client.innerApiCalls.getCustomClass = stubSimpleCall(expectedResponse); + const [response] = await client.getCustomClass(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCustomClass without error using callback', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.GetCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.GetCustomClassRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v2.CustomClass() + ); + client.innerApiCalls.getCustomClass = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getCustomClass( + request, + (err?: Error|null, result?: protos.google.cloud.speech.v2.ICustomClass|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCustomClass with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.GetCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.GetCustomClassRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getCustomClass = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getCustomClass(request), expectedError); + const actualRequest = (client.innerApiCalls.getCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCustomClass with closed client', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.GetCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.GetCustomClassRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getCustomClass(request), expectedError); + }); + }); + + describe('getPhraseSet', () => { + it('invokes getPhraseSet without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.GetPhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.GetPhraseSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v2.PhraseSet() + ); + client.innerApiCalls.getPhraseSet = stubSimpleCall(expectedResponse); + const [response] = await client.getPhraseSet(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getPhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getPhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPhraseSet without error using callback', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.GetPhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.GetPhraseSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v2.PhraseSet() + ); + client.innerApiCalls.getPhraseSet = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getPhraseSet( + request, + (err?: Error|null, result?: protos.google.cloud.speech.v2.IPhraseSet|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getPhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getPhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPhraseSet with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.GetPhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.GetPhraseSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getPhraseSet = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getPhraseSet(request), expectedError); + const actualRequest = (client.innerApiCalls.getPhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getPhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPhraseSet with closed client', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.GetPhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.GetPhraseSetRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getPhraseSet(request), expectedError); + }); + }); + + describe('createRecognizer', () => { + it('invokes createRecognizer without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.CreateRecognizerRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.CreateRecognizerRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createRecognizer = stubLongRunningCall(expectedResponse); + const [operation] = await client.createRecognizer(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createRecognizer as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createRecognizer as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createRecognizer without error using callback', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.CreateRecognizerRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.CreateRecognizerRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createRecognizer = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createRecognizer( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createRecognizer as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createRecognizer as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createRecognizer with call error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.CreateRecognizerRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.CreateRecognizerRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createRecognizer = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createRecognizer(request), expectedError); + const actualRequest = (client.innerApiCalls.createRecognizer as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createRecognizer as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createRecognizer with LRO error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.CreateRecognizerRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.CreateRecognizerRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createRecognizer = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createRecognizer(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createRecognizer as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createRecognizer as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateRecognizerProgress without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateRecognizerProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateRecognizerProgress with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateRecognizerProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateRecognizer', () => { + it('invokes updateRecognizer without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.UpdateRecognizerRequest() + ); + request.recognizer ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.UpdateRecognizerRequest', ['recognizer', 'name']); + request.recognizer.name = defaultValue1; + const expectedHeaderRequestParams = `recognizer.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateRecognizer = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateRecognizer(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateRecognizer as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateRecognizer as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateRecognizer without error using callback', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.UpdateRecognizerRequest() + ); + request.recognizer ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.UpdateRecognizerRequest', ['recognizer', 'name']); + request.recognizer.name = defaultValue1; + const expectedHeaderRequestParams = `recognizer.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateRecognizer = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateRecognizer( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateRecognizer as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateRecognizer as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateRecognizer with call error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.UpdateRecognizerRequest() + ); + request.recognizer ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.UpdateRecognizerRequest', ['recognizer', 'name']); + request.recognizer.name = defaultValue1; + const expectedHeaderRequestParams = `recognizer.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateRecognizer = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateRecognizer(request), expectedError); + const actualRequest = (client.innerApiCalls.updateRecognizer as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateRecognizer as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateRecognizer with LRO error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.UpdateRecognizerRequest() + ); + request.recognizer ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.UpdateRecognizerRequest', ['recognizer', 'name']); + request.recognizer.name = defaultValue1; + const expectedHeaderRequestParams = `recognizer.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateRecognizer = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateRecognizer(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateRecognizer as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateRecognizer as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateRecognizerProgress without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateRecognizerProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateRecognizerProgress with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpdateRecognizerProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteRecognizer', () => { + it('invokes deleteRecognizer without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.DeleteRecognizerRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.DeleteRecognizerRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteRecognizer = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteRecognizer(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteRecognizer as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteRecognizer as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteRecognizer without error using callback', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.DeleteRecognizerRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.DeleteRecognizerRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteRecognizer = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteRecognizer( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteRecognizer as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteRecognizer as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteRecognizer with call error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.DeleteRecognizerRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.DeleteRecognizerRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteRecognizer = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteRecognizer(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteRecognizer as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteRecognizer as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteRecognizer with LRO error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.DeleteRecognizerRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.DeleteRecognizerRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteRecognizer = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteRecognizer(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteRecognizer as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteRecognizer as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteRecognizerProgress without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteRecognizerProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteRecognizerProgress with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteRecognizerProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('undeleteRecognizer', () => { + it('invokes undeleteRecognizer without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.UndeleteRecognizerRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.UndeleteRecognizerRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.undeleteRecognizer = stubLongRunningCall(expectedResponse); + const [operation] = await client.undeleteRecognizer(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.undeleteRecognizer as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.undeleteRecognizer as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeleteRecognizer without error using callback', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.UndeleteRecognizerRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.UndeleteRecognizerRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.undeleteRecognizer = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.undeleteRecognizer( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.undeleteRecognizer as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.undeleteRecognizer as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeleteRecognizer with call error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.UndeleteRecognizerRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.UndeleteRecognizerRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.undeleteRecognizer = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.undeleteRecognizer(request), expectedError); + const actualRequest = (client.innerApiCalls.undeleteRecognizer as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.undeleteRecognizer as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeleteRecognizer with LRO error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.UndeleteRecognizerRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.UndeleteRecognizerRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.undeleteRecognizer = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.undeleteRecognizer(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.undeleteRecognizer as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.undeleteRecognizer as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUndeleteRecognizerProgress without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUndeleteRecognizerProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUndeleteRecognizerProgress with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUndeleteRecognizerProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('batchRecognize', () => { + it('invokes batchRecognize without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.BatchRecognizeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.BatchRecognizeRequest', ['recognizer']); + request.recognizer = defaultValue1; + const expectedHeaderRequestParams = `recognizer=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.batchRecognize = stubLongRunningCall(expectedResponse); + const [operation] = await client.batchRecognize(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.batchRecognize as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchRecognize as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchRecognize without error using callback', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.BatchRecognizeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.BatchRecognizeRequest', ['recognizer']); + request.recognizer = defaultValue1; + const expectedHeaderRequestParams = `recognizer=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.batchRecognize = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchRecognize( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.batchRecognize as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchRecognize as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchRecognize with call error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.BatchRecognizeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.BatchRecognizeRequest', ['recognizer']); + request.recognizer = defaultValue1; + const expectedHeaderRequestParams = `recognizer=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchRecognize = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.batchRecognize(request), expectedError); + const actualRequest = (client.innerApiCalls.batchRecognize as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchRecognize as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchRecognize with LRO error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.BatchRecognizeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.BatchRecognizeRequest', ['recognizer']); + request.recognizer = defaultValue1; + const expectedHeaderRequestParams = `recognizer=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchRecognize = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.batchRecognize(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.batchRecognize as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchRecognize as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkBatchRecognizeProgress without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkBatchRecognizeProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkBatchRecognizeProgress with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkBatchRecognizeProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('createCustomClass', () => { + it('invokes createCustomClass without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.CreateCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.CreateCustomClassRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createCustomClass = stubLongRunningCall(expectedResponse); + const [operation] = await client.createCustomClass(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCustomClass without error using callback', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.CreateCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.CreateCustomClassRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createCustomClass = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createCustomClass( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCustomClass with call error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.CreateCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.CreateCustomClassRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCustomClass = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createCustomClass(request), expectedError); + const actualRequest = (client.innerApiCalls.createCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCustomClass with LRO error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.CreateCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.CreateCustomClassRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCustomClass = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createCustomClass(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateCustomClassProgress without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateCustomClassProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateCustomClassProgress with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateCustomClassProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateCustomClass', () => { + it('invokes updateCustomClass without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.UpdateCustomClassRequest() + ); + request.customClass ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.UpdateCustomClassRequest', ['customClass', 'name']); + request.customClass.name = defaultValue1; + const expectedHeaderRequestParams = `custom_class.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateCustomClass = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateCustomClass(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCustomClass without error using callback', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.UpdateCustomClassRequest() + ); + request.customClass ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.UpdateCustomClassRequest', ['customClass', 'name']); + request.customClass.name = defaultValue1; + const expectedHeaderRequestParams = `custom_class.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateCustomClass = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateCustomClass( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCustomClass with call error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.UpdateCustomClassRequest() + ); + request.customClass ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.UpdateCustomClassRequest', ['customClass', 'name']); + request.customClass.name = defaultValue1; + const expectedHeaderRequestParams = `custom_class.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCustomClass = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateCustomClass(request), expectedError); + const actualRequest = (client.innerApiCalls.updateCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCustomClass with LRO error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.UpdateCustomClassRequest() + ); + request.customClass ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.UpdateCustomClassRequest', ['customClass', 'name']); + request.customClass.name = defaultValue1; + const expectedHeaderRequestParams = `custom_class.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCustomClass = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateCustomClass(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateCustomClassProgress without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateCustomClassProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateCustomClassProgress with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpdateCustomClassProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteCustomClass', () => { + it('invokes deleteCustomClass without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.DeleteCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.DeleteCustomClassRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteCustomClass = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteCustomClass(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCustomClass without error using callback', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.DeleteCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.DeleteCustomClassRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteCustomClass = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteCustomClass( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCustomClass with call error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.DeleteCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.DeleteCustomClassRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCustomClass = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteCustomClass(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCustomClass with LRO error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.DeleteCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.DeleteCustomClassRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCustomClass = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteCustomClass(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteCustomClassProgress without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteCustomClassProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteCustomClassProgress with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteCustomClassProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('undeleteCustomClass', () => { + it('invokes undeleteCustomClass without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.UndeleteCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.UndeleteCustomClassRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.undeleteCustomClass = stubLongRunningCall(expectedResponse); + const [operation] = await client.undeleteCustomClass(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.undeleteCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.undeleteCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeleteCustomClass without error using callback', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.UndeleteCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.UndeleteCustomClassRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.undeleteCustomClass = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.undeleteCustomClass( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.undeleteCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.undeleteCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeleteCustomClass with call error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.UndeleteCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.UndeleteCustomClassRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.undeleteCustomClass = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.undeleteCustomClass(request), expectedError); + const actualRequest = (client.innerApiCalls.undeleteCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.undeleteCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeleteCustomClass with LRO error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.UndeleteCustomClassRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.UndeleteCustomClassRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.undeleteCustomClass = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.undeleteCustomClass(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.undeleteCustomClass as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.undeleteCustomClass as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUndeleteCustomClassProgress without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUndeleteCustomClassProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUndeleteCustomClassProgress with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUndeleteCustomClassProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('createPhraseSet', () => { + it('invokes createPhraseSet without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.CreatePhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.CreatePhraseSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createPhraseSet = stubLongRunningCall(expectedResponse); + const [operation] = await client.createPhraseSet(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createPhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createPhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPhraseSet without error using callback', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.CreatePhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.CreatePhraseSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createPhraseSet = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createPhraseSet( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createPhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createPhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPhraseSet with call error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.CreatePhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.CreatePhraseSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createPhraseSet = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createPhraseSet(request), expectedError); + const actualRequest = (client.innerApiCalls.createPhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createPhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPhraseSet with LRO error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.CreatePhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.CreatePhraseSetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createPhraseSet = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createPhraseSet(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createPhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createPhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreatePhraseSetProgress without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreatePhraseSetProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreatePhraseSetProgress with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreatePhraseSetProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updatePhraseSet', () => { + it('invokes updatePhraseSet without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.UpdatePhraseSetRequest() + ); + request.phraseSet ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.UpdatePhraseSetRequest', ['phraseSet', 'name']); + request.phraseSet.name = defaultValue1; + const expectedHeaderRequestParams = `phrase_set.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updatePhraseSet = stubLongRunningCall(expectedResponse); + const [operation] = await client.updatePhraseSet(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updatePhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updatePhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updatePhraseSet without error using callback', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.UpdatePhraseSetRequest() + ); + request.phraseSet ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.UpdatePhraseSetRequest', ['phraseSet', 'name']); + request.phraseSet.name = defaultValue1; + const expectedHeaderRequestParams = `phrase_set.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updatePhraseSet = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updatePhraseSet( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updatePhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updatePhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updatePhraseSet with call error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.UpdatePhraseSetRequest() + ); + request.phraseSet ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.UpdatePhraseSetRequest', ['phraseSet', 'name']); + request.phraseSet.name = defaultValue1; + const expectedHeaderRequestParams = `phrase_set.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updatePhraseSet = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updatePhraseSet(request), expectedError); + const actualRequest = (client.innerApiCalls.updatePhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updatePhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updatePhraseSet with LRO error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.UpdatePhraseSetRequest() + ); + request.phraseSet ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.UpdatePhraseSetRequest', ['phraseSet', 'name']); + request.phraseSet.name = defaultValue1; + const expectedHeaderRequestParams = `phrase_set.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updatePhraseSet = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updatePhraseSet(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updatePhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updatePhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdatePhraseSetProgress without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdatePhraseSetProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdatePhraseSetProgress with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpdatePhraseSetProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deletePhraseSet', () => { + it('invokes deletePhraseSet without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.DeletePhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.DeletePhraseSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deletePhraseSet = stubLongRunningCall(expectedResponse); + const [operation] = await client.deletePhraseSet(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deletePhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deletePhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePhraseSet without error using callback', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.DeletePhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.DeletePhraseSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deletePhraseSet = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deletePhraseSet( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deletePhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deletePhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePhraseSet with call error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.DeletePhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.DeletePhraseSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deletePhraseSet = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deletePhraseSet(request), expectedError); + const actualRequest = (client.innerApiCalls.deletePhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deletePhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePhraseSet with LRO error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.DeletePhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.DeletePhraseSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deletePhraseSet = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deletePhraseSet(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deletePhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deletePhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeletePhraseSetProgress without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeletePhraseSetProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeletePhraseSetProgress with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeletePhraseSetProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('undeletePhraseSet', () => { + it('invokes undeletePhraseSet without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.UndeletePhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.UndeletePhraseSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.undeletePhraseSet = stubLongRunningCall(expectedResponse); + const [operation] = await client.undeletePhraseSet(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.undeletePhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.undeletePhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeletePhraseSet without error using callback', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.UndeletePhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.UndeletePhraseSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.undeletePhraseSet = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.undeletePhraseSet( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.undeletePhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.undeletePhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeletePhraseSet with call error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.UndeletePhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.UndeletePhraseSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.undeletePhraseSet = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.undeletePhraseSet(request), expectedError); + const actualRequest = (client.innerApiCalls.undeletePhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.undeletePhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeletePhraseSet with LRO error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.UndeletePhraseSetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.UndeletePhraseSetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.undeletePhraseSet = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.undeletePhraseSet(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.undeletePhraseSet as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.undeletePhraseSet as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUndeletePhraseSetProgress without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUndeletePhraseSetProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUndeletePhraseSetProgress with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUndeletePhraseSetProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('streamingRecognize', () => { + it('invokes streamingRecognize without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.StreamingRecognizeRequest() + ); + + const expectedResponse = generateSampleMessage( + new protos.google.cloud.speech.v2.StreamingRecognizeResponse() + ); + client.innerApiCalls.streamingRecognize = stubBidiStreamingCall(expectedResponse); + const stream = client.streamingRecognize(); + const promise = new Promise((resolve, reject) => { + stream.on('data', (response: protos.google.cloud.speech.v2.StreamingRecognizeResponse) => { + resolve(response); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + stream.write(request); + stream.end(); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.streamingRecognize as SinonStub) + .getCall(0).calledWith(null)); + assert.deepStrictEqual(((stream as unknown as PassThrough) + ._transform as SinonStub).getCall(0).args[0], request); + }); + + it('invokes streamingRecognize with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.StreamingRecognizeRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.streamingRecognize = stubBidiStreamingCall(undefined, expectedError); + const stream = client.streamingRecognize(); + const promise = new Promise((resolve, reject) => { + stream.on('data', (response: protos.google.cloud.speech.v2.StreamingRecognizeResponse) => { + resolve(response); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + stream.write(request); + stream.end(); + }); + await assert.rejects(promise, expectedError); + assert((client.innerApiCalls.streamingRecognize as SinonStub) + .getCall(0).calledWith(null)); + assert.deepStrictEqual(((stream as unknown as PassThrough) + ._transform as SinonStub).getCall(0).args[0], request); + }); + }); + + describe('listRecognizers', () => { + it('invokes listRecognizers without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.ListRecognizersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.ListRecognizersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.speech.v2.Recognizer()), + generateSampleMessage(new protos.google.cloud.speech.v2.Recognizer()), + generateSampleMessage(new protos.google.cloud.speech.v2.Recognizer()), + ]; + client.innerApiCalls.listRecognizers = stubSimpleCall(expectedResponse); + const [response] = await client.listRecognizers(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listRecognizers as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listRecognizers as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRecognizers without error using callback', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.ListRecognizersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.ListRecognizersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.speech.v2.Recognizer()), + generateSampleMessage(new protos.google.cloud.speech.v2.Recognizer()), + generateSampleMessage(new protos.google.cloud.speech.v2.Recognizer()), + ]; + client.innerApiCalls.listRecognizers = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listRecognizers( + request, + (err?: Error|null, result?: protos.google.cloud.speech.v2.IRecognizer[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listRecognizers as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listRecognizers as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRecognizers with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.ListRecognizersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.ListRecognizersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listRecognizers = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listRecognizers(request), expectedError); + const actualRequest = (client.innerApiCalls.listRecognizers as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listRecognizers as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRecognizersStream without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.ListRecognizersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.ListRecognizersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.speech.v2.Recognizer()), + generateSampleMessage(new protos.google.cloud.speech.v2.Recognizer()), + generateSampleMessage(new protos.google.cloud.speech.v2.Recognizer()), + ]; + client.descriptors.page.listRecognizers.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listRecognizersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.speech.v2.Recognizer[] = []; + stream.on('data', (response: protos.google.cloud.speech.v2.Recognizer) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listRecognizers.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listRecognizers, request)); + assert( + (client.descriptors.page.listRecognizers.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listRecognizersStream with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.ListRecognizersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.ListRecognizersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listRecognizers.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listRecognizersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.speech.v2.Recognizer[] = []; + stream.on('data', (response: protos.google.cloud.speech.v2.Recognizer) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listRecognizers.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listRecognizers, request)); + assert( + (client.descriptors.page.listRecognizers.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listRecognizers without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.ListRecognizersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.ListRecognizersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.speech.v2.Recognizer()), + generateSampleMessage(new protos.google.cloud.speech.v2.Recognizer()), + generateSampleMessage(new protos.google.cloud.speech.v2.Recognizer()), + ]; + client.descriptors.page.listRecognizers.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.speech.v2.IRecognizer[] = []; + const iterable = client.listRecognizersAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listRecognizers.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listRecognizers.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listRecognizers with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.ListRecognizersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.ListRecognizersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listRecognizers.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listRecognizersAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.speech.v2.IRecognizer[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listRecognizers.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listRecognizers.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listCustomClasses', () => { + it('invokes listCustomClasses without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.ListCustomClassesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.ListCustomClassesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.speech.v2.CustomClass()), + generateSampleMessage(new protos.google.cloud.speech.v2.CustomClass()), + generateSampleMessage(new protos.google.cloud.speech.v2.CustomClass()), + ]; + client.innerApiCalls.listCustomClasses = stubSimpleCall(expectedResponse); + const [response] = await client.listCustomClasses(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listCustomClasses as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listCustomClasses as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCustomClasses without error using callback', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.ListCustomClassesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.ListCustomClassesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.speech.v2.CustomClass()), + generateSampleMessage(new protos.google.cloud.speech.v2.CustomClass()), + generateSampleMessage(new protos.google.cloud.speech.v2.CustomClass()), + ]; + client.innerApiCalls.listCustomClasses = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listCustomClasses( + request, + (err?: Error|null, result?: protos.google.cloud.speech.v2.ICustomClass[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listCustomClasses as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listCustomClasses as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCustomClasses with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.ListCustomClassesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.ListCustomClassesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listCustomClasses = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listCustomClasses(request), expectedError); + const actualRequest = (client.innerApiCalls.listCustomClasses as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listCustomClasses as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCustomClassesStream without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.ListCustomClassesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.ListCustomClassesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.speech.v2.CustomClass()), + generateSampleMessage(new protos.google.cloud.speech.v2.CustomClass()), + generateSampleMessage(new protos.google.cloud.speech.v2.CustomClass()), + ]; + client.descriptors.page.listCustomClasses.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listCustomClassesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.speech.v2.CustomClass[] = []; + stream.on('data', (response: protos.google.cloud.speech.v2.CustomClass) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listCustomClasses.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listCustomClasses, request)); + assert( + (client.descriptors.page.listCustomClasses.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listCustomClassesStream with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.ListCustomClassesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.ListCustomClassesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listCustomClasses.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listCustomClassesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.speech.v2.CustomClass[] = []; + stream.on('data', (response: protos.google.cloud.speech.v2.CustomClass) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listCustomClasses.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listCustomClasses, request)); + assert( + (client.descriptors.page.listCustomClasses.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listCustomClasses without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.ListCustomClassesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.ListCustomClassesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.speech.v2.CustomClass()), + generateSampleMessage(new protos.google.cloud.speech.v2.CustomClass()), + generateSampleMessage(new protos.google.cloud.speech.v2.CustomClass()), + ]; + client.descriptors.page.listCustomClasses.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.speech.v2.ICustomClass[] = []; + const iterable = client.listCustomClassesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listCustomClasses.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listCustomClasses.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listCustomClasses with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.ListCustomClassesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.ListCustomClassesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listCustomClasses.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listCustomClassesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.speech.v2.ICustomClass[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listCustomClasses.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listCustomClasses.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listPhraseSets', () => { + it('invokes listPhraseSets without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.ListPhraseSetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.ListPhraseSetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.speech.v2.PhraseSet()), + generateSampleMessage(new protos.google.cloud.speech.v2.PhraseSet()), + generateSampleMessage(new protos.google.cloud.speech.v2.PhraseSet()), + ]; + client.innerApiCalls.listPhraseSets = stubSimpleCall(expectedResponse); + const [response] = await client.listPhraseSets(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listPhraseSets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listPhraseSets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPhraseSets without error using callback', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.ListPhraseSetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.ListPhraseSetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.speech.v2.PhraseSet()), + generateSampleMessage(new protos.google.cloud.speech.v2.PhraseSet()), + generateSampleMessage(new protos.google.cloud.speech.v2.PhraseSet()), + ]; + client.innerApiCalls.listPhraseSets = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listPhraseSets( + request, + (err?: Error|null, result?: protos.google.cloud.speech.v2.IPhraseSet[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listPhraseSets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listPhraseSets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPhraseSets with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.ListPhraseSetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.ListPhraseSetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listPhraseSets = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listPhraseSets(request), expectedError); + const actualRequest = (client.innerApiCalls.listPhraseSets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listPhraseSets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPhraseSetsStream without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.ListPhraseSetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.ListPhraseSetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.speech.v2.PhraseSet()), + generateSampleMessage(new protos.google.cloud.speech.v2.PhraseSet()), + generateSampleMessage(new protos.google.cloud.speech.v2.PhraseSet()), + ]; + client.descriptors.page.listPhraseSets.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listPhraseSetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.speech.v2.PhraseSet[] = []; + stream.on('data', (response: protos.google.cloud.speech.v2.PhraseSet) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listPhraseSets.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listPhraseSets, request)); + assert( + (client.descriptors.page.listPhraseSets.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listPhraseSetsStream with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.ListPhraseSetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.ListPhraseSetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listPhraseSets.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listPhraseSetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.speech.v2.PhraseSet[] = []; + stream.on('data', (response: protos.google.cloud.speech.v2.PhraseSet) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listPhraseSets.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listPhraseSets, request)); + assert( + (client.descriptors.page.listPhraseSets.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listPhraseSets without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.ListPhraseSetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.ListPhraseSetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.speech.v2.PhraseSet()), + generateSampleMessage(new protos.google.cloud.speech.v2.PhraseSet()), + generateSampleMessage(new protos.google.cloud.speech.v2.PhraseSet()), + ]; + client.descriptors.page.listPhraseSets.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.speech.v2.IPhraseSet[] = []; + const iterable = client.listPhraseSetsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listPhraseSets.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listPhraseSets.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listPhraseSets with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.speech.v2.ListPhraseSetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.speech.v2.ListPhraseSetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listPhraseSets.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listPhraseSetsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.speech.v2.IPhraseSet[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listPhraseSets.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listPhraseSets.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation without error using callback', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.IOperation[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.IOperation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + describe('Path templates', () => { + + describe('config', async () => { + const fakePath = "/rendered/path/config"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.configPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.configPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('configPath', () => { + const result = client.configPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.configPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromConfigName', () => { + const result = client.matchProjectFromConfigName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.configPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromConfigName', () => { + const result = client.matchLocationFromConfigName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.configPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('cryptoKey', async () => { + const fakePath = "/rendered/path/cryptoKey"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + key_ring: "keyRingValue", + crypto_key: "cryptoKeyValue", + }; + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.cryptoKeyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.cryptoKeyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('cryptoKeyPath', () => { + const result = client.cryptoKeyPath("projectValue", "locationValue", "keyRingValue", "cryptoKeyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.cryptoKeyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromCryptoKeyName', () => { + const result = client.matchProjectFromCryptoKeyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromCryptoKeyName', () => { + const result = client.matchLocationFromCryptoKeyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchKeyRingFromCryptoKeyName', () => { + const result = client.matchKeyRingFromCryptoKeyName(fakePath); + assert.strictEqual(result, "keyRingValue"); + assert((client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCryptoKeyFromCryptoKeyName', () => { + const result = client.matchCryptoKeyFromCryptoKeyName(fakePath); + assert.strictEqual(result, "cryptoKeyValue"); + assert((client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('cryptoKeyVersion', async () => { + const fakePath = "/rendered/path/cryptoKeyVersion"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + key_ring: "keyRingValue", + crypto_key: "cryptoKeyValue", + crypto_key_version: "cryptoKeyVersionValue", + }; + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.cryptoKeyVersionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.cryptoKeyVersionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('cryptoKeyVersionPath', () => { + const result = client.cryptoKeyVersionPath("projectValue", "locationValue", "keyRingValue", "cryptoKeyValue", "cryptoKeyVersionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.cryptoKeyVersionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromCryptoKeyVersionName', () => { + const result = client.matchProjectFromCryptoKeyVersionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.cryptoKeyVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromCryptoKeyVersionName', () => { + const result = client.matchLocationFromCryptoKeyVersionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.cryptoKeyVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchKeyRingFromCryptoKeyVersionName', () => { + const result = client.matchKeyRingFromCryptoKeyVersionName(fakePath); + assert.strictEqual(result, "keyRingValue"); + assert((client.pathTemplates.cryptoKeyVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCryptoKeyFromCryptoKeyVersionName', () => { + const result = client.matchCryptoKeyFromCryptoKeyVersionName(fakePath); + assert.strictEqual(result, "cryptoKeyValue"); + assert((client.pathTemplates.cryptoKeyVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCryptoKeyVersionFromCryptoKeyVersionName', () => { + const result = client.matchCryptoKeyVersionFromCryptoKeyVersionName(fakePath); + assert.strictEqual(result, "cryptoKeyVersionValue"); + assert((client.pathTemplates.cryptoKeyVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('customClass', async () => { + const fakePath = "/rendered/path/customClass"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + custom_class: "customClassValue", + }; + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.customClassPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.customClassPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('customClassPath', () => { + const result = client.customClassPath("projectValue", "locationValue", "customClassValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.customClassPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromCustomClassName', () => { + const result = client.matchProjectFromCustomClassName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.customClassPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromCustomClassName', () => { + const result = client.matchLocationFromCustomClassName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.customClassPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCustomClassFromCustomClassName', () => { + const result = client.matchCustomClassFromCustomClassName(fakePath); + assert.strictEqual(result, "customClassValue"); + assert((client.pathTemplates.customClassPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', async () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('phraseSet', async () => { + const fakePath = "/rendered/path/phraseSet"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + phrase_set: "phraseSetValue", + }; + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.phraseSetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.phraseSetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('phraseSetPath', () => { + const result = client.phraseSetPath("projectValue", "locationValue", "phraseSetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.phraseSetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromPhraseSetName', () => { + const result = client.matchProjectFromPhraseSetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.phraseSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromPhraseSetName', () => { + const result = client.matchLocationFromPhraseSetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.phraseSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPhraseSetFromPhraseSetName', () => { + const result = client.matchPhraseSetFromPhraseSetName(fakePath); + assert.strictEqual(result, "phraseSetValue"); + assert((client.pathTemplates.phraseSetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('project', async () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('recognizer', async () => { + const fakePath = "/rendered/path/recognizer"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + recognizer: "recognizerValue", + }; + const client = new speechModule.v2.SpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.recognizerPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.recognizerPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('recognizerPath', () => { + const result = client.recognizerPath("projectValue", "locationValue", "recognizerValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.recognizerPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromRecognizerName', () => { + const result = client.matchProjectFromRecognizerName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.recognizerPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromRecognizerName', () => { + const result = client.matchLocationFromRecognizerName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.recognizerPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRecognizerFromRecognizerName', () => { + const result = client.matchRecognizerFromRecognizerName(fakePath); + assert.strictEqual(result, "recognizerValue"); + assert((client.pathTemplates.recognizerPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/tsconfig.json b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/tsconfig.json new file mode 100644 index 00000000000..ca73e7bfc82 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/tsconfig.json @@ -0,0 +1,22 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2023", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts", + "src/**/*.json", + "samples/**/*.json", + "protos/protos.json" + ] +} diff --git a/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/webpack.config.js b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/webpack.config.js new file mode 100644 index 00000000000..50273cca41c --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/webpack.config.js @@ -0,0 +1,64 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: 'Adaptation', + filename: './adaptation.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/ + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader' + }, + ], + }, + mode: 'production', +}; diff --git a/packages/gapic-node-templating/test/fixtures/serviceConfig.yaml b/packages/gapic-node-processing/test/fixtures/serviceConfig.yaml similarity index 100% rename from packages/gapic-node-templating/test/fixtures/serviceConfig.yaml rename to packages/gapic-node-processing/test/fixtures/serviceConfig.yaml diff --git a/packages/gapic-node-processing/test/fixtures/test-input-readme/README.md b/packages/gapic-node-processing/test/fixtures/test-input-readme/README.md new file mode 100644 index 00000000000..170f33fea95 --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/test-input-readme/README.md @@ -0,0 +1,3 @@ +hello! + +[//]: # "GOODBYE" \ No newline at end of file diff --git a/packages/gapic-node-processing/test/fixtures/untemplated-README.md b/packages/gapic-node-processing/test/fixtures/untemplated-README.md new file mode 100644 index 00000000000..061c4f74c8d --- /dev/null +++ b/packages/gapic-node-processing/test/fixtures/untemplated-README.md @@ -0,0 +1,107 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "The comments you see below are used to generate those parts of the template in later states." +Google Cloud Platform logo + +[homepage]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-speech + +# [Speech: Nodejs Client][homepage] + +[//]: # "releaseLevel" + +[![npm version](https://img.shields.io/npm/v/@google-cloud/speech.svg)](https://www.npmjs.org/package/@google-cloud/speech) + +Speech client for Node.js + +[//]: # "partials.introduction" + +A comprehensive list of changes in each version may be found in +[the CHANGELOG]([homepage]/CHANGELOG.md). + +* [Speech Nodejs Client API Reference](https://cloud.google.com/nodejs/docs/reference/speech/latest) + + +Read more about the client libraries for Cloud APIs, including the older +Google APIs Client Libraries, in [Client Libraries Explained][explained]. + +[explained]: https://cloud.google.com/apis/docs/client-libraries-explained + +**Table of contents:** + +* [Quickstart](#quickstart) + * [Before you begin](#before-you-begin) + * [Installing the client library](#installing-the-client-library) + +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) + +## Quickstart +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Speech API][enable_api]. +1. [Set up authentication][auth] so you can access the + API from your local workstation. +### Installing the client library + +```bash +npm install @google-cloud/speech +``` + +[//]: # "partials.body" + +## Samples + +Samples are in the [`samples/`]([homepage]/samples) directory. Each sample's `README.md` has instructions for running its sample. + +[//]: # "samples" + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://github.com/nodejs/release#release-schedule). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. +If you are using an end-of-life version of Node.js, we recommend that you update +as soon as possible to an actively supported LTS version. + +Google's client libraries support legacy versions of Node.js runtimes on a +best-efforts basis with the following warnings: + +* Legacy versions are not tested in continuous integration. +* Some security patches and features cannot be backported. +* Dependencies cannot be kept up-to-date. + +Client libraries targeting some end-of-life versions of Node.js are available, and +can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. +For example, `npm install @google-cloud/speech@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide]([homepage]/CONTRIBUTING.md). + +Please note that this `README.md` +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. + +## License + +Apache Version 2.0 + +See [LICENSE]([homepage]/LICENSE) + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=speech.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local \ No newline at end of file diff --git a/packages/gapic-node-processing/test/generate-combined-library-command.test.ts b/packages/gapic-node-processing/test/generate-combined-library-command.test.ts new file mode 100644 index 00000000000..18fb9f778e1 --- /dev/null +++ b/packages/gapic-node-processing/test/generate-combined-library-command.test.ts @@ -0,0 +1,205 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import * as assert from 'assert'; +import {generateCombinedLibraries} from '../src/commands/generate-combined-library'; +import {describe, it} from 'mocha'; +import * as sinon from 'sinon'; +import * as combineLibraries from '../src/combine-libraries'; +import * as generateIndexTs from '../src/generate-index'; +import * as templates from '../src/templating'; +import path from 'path'; +import {TEST_FIXTURES_PATH} from './combine-libraries.test'; + +describe('tests running build trigger', () => { + let combineLibrariesStub: sinon.SinonStub; + let generateIndexTsStub: sinon.SinonStub; + beforeEach(() => { + combineLibrariesStub = sinon.stub(combineLibraries, 'combineLibraries'); + generateIndexTsStub = sinon.stub(generateIndexTs, 'generateIndexTs'); + }); + + afterEach(() => { + combineLibrariesStub.restore(); + generateIndexTsStub.restore(); + }); + + it('should generate a full library with only a single library argument', async () => { + await generateCombinedLibraries.handler({ + 'source-path': path.join( + TEST_FIXTURES_PATH, + 'google-cloud-speech-nodejs', + ), + sourcePath: path.join(TEST_FIXTURES_PATH, 'google-cloud-speech-nodejs'), + _: [], + $0: 'foo', + }); + + assert.ok( + combineLibrariesStub.calledOnceWithExactly( + path.join(TEST_FIXTURES_PATH, 'google-cloud-speech-nodejs'), + path.join(TEST_FIXTURES_PATH, 'google-cloud-speech-nodejs'), + ), + ); + assert.ok( + generateIndexTsStub.calledOnceWithExactly( + path.join(TEST_FIXTURES_PATH, 'google-cloud-speech-nodejs'), + undefined, + undefined, + ), + ); + }); + + it('should generate a full library at a different destination path if provided', async () => { + await generateCombinedLibraries.handler({ + 'source-path': path.join( + TEST_FIXTURES_PATH, + 'google-cloud-speech-nodejs', + ), + sourcePath: path.join(TEST_FIXTURES_PATH, 'google-cloud-speech-nodejs'), + 'destination-path': 'different-path', + destinationPath: 'different-path', + _: [], + $0: 'foo', + }); + + assert.ok( + combineLibrariesStub.calledOnceWithExactly( + path.join(TEST_FIXTURES_PATH, 'google-cloud-speech-nodejs'), + 'different-path', + ), + ); + assert.ok( + generateIndexTsStub.calledOnceWithExactly( + 'different-path', + undefined, + undefined, + ), + ); + }); + + it('it should generate a full library with a default version', async () => { + await generateCombinedLibraries.handler({ + 'source-path': path.join( + TEST_FIXTURES_PATH, + 'google-cloud-speech-nodejs', + ), + sourcePath: path.join(TEST_FIXTURES_PATH, 'google-cloud-speech-nodejs'), + 'default-version': 'v1', + defaultVersion: 'v1', + _: [], + $0: 'foo', + }); + + assert.ok( + combineLibrariesStub.calledOnceWithExactly( + path.join(TEST_FIXTURES_PATH, 'google-cloud-speech-nodejs'), + path.join(TEST_FIXTURES_PATH, 'google-cloud-speech-nodejs'), + ), + ); + assert.ok( + generateIndexTsStub.calledOnceWithExactly( + path.join(TEST_FIXTURES_PATH, 'google-cloud-speech-nodejs'), + 'v1', + undefined, + ), + ); + }); + + it('it should not bubble up an error if the library is in an expected format', async () => { + // Stub the function to reject with the specific error message. + combineLibrariesStub.rejects(new Error('Unexpected library format')); + + // We expect the handler to NOT reject, as the error is handled internally. + await assert.doesNotReject(async () => + generateCombinedLibraries.handler({ + 'source-path': path.join( + TEST_FIXTURES_PATH, + 'google-cloud-speech-nodejs', + ), + sourcePath: path.join(TEST_FIXTURES_PATH, 'google-cloud-speech-nodejs'), + _: [], + $0: 'foo', + }), + ); + // Assertions to prove the code continued executing after the handled error. + assert.ok( + combineLibrariesStub.calledOnceWithExactly( + path.join(TEST_FIXTURES_PATH, 'google-cloud-speech-nodejs'), + path.join(TEST_FIXTURES_PATH, 'google-cloud-speech-nodejs'), + ), + ); + assert.ok(generateIndexTsStub.calledOnce); + }); + + // Add a new test for when a different error occurs. + it('it should bubble up an error if a different error occurs', async () => { + // Stub the function to reject with a DIFFERENT error message. + combineLibrariesStub.rejects(new Error('A different kind of error')); + + // We expect the handler to REJECT, as the if condition in the catch block will pass. + await assert.rejects( + async () => + generateCombinedLibraries.handler({ + 'source-path': path.join( + TEST_FIXTURES_PATH, + 'google-cloud-speech-nodejs', + ), + sourcePath: path.join( + TEST_FIXTURES_PATH, + 'google-cloud-speech-nodejs', + ), + _: [], + $0: 'foo', + }), + /A different kind of error/, // Use a regex to match the error message. + ); + // Assertions to prove the code stopped executing. + assert.ok( + combineLibrariesStub.calledOnceWithExactly( + path.join(TEST_FIXTURES_PATH, 'google-cloud-speech-nodejs'), + path.join(TEST_FIXTURES_PATH, 'google-cloud-speech-nodejs'), + ), + ); + assert.ok(generateIndexTsStub.notCalled); + }); + + it('it should generate a full library with isEsm', async () => { + await generateCombinedLibraries.handler({ + 'source-path': path.join( + TEST_FIXTURES_PATH, + 'google-cloud-speech-nodejs' + ), + sourcePath: path.join(TEST_FIXTURES_PATH, 'google-cloud-speech-nodejs'), + 'is-esm': true, + isEsm: true, + _: [], + $0: 'foo', + }); + + assert.ok( + combineLibrariesStub.calledOnceWithExactly( + path.join(TEST_FIXTURES_PATH, 'google-cloud-speech-nodejs'), + path.join(TEST_FIXTURES_PATH, 'google-cloud-speech-nodejs') + ) + ); + assert.ok( + generateIndexTsStub.calledOnceWithExactly( + path.join(TEST_FIXTURES_PATH, 'google-cloud-speech-nodejs'), + undefined, + true + ) + ); + }); +}); diff --git a/packages/gapic-node-processing/test/generate-index.test.ts b/packages/gapic-node-processing/test/generate-index.test.ts new file mode 100644 index 00000000000..455d512a081 --- /dev/null +++ b/packages/gapic-node-processing/test/generate-index.test.ts @@ -0,0 +1,220 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// eslint-disable-next-line n/no-unpublished-import +import {describe, it} from 'mocha'; +import * as assert from 'assert'; +import * as path from 'path'; +import * as fs from 'fs/promises'; +import { + extractClients, + extractVersions, + generateIndexTs, + getHighestVersionWithPrecedence, +} from '../src/generate-index'; +import { + LIB_POST_COMBINATION, + LIB_PRE_COMBINATION, +} from './combine-libraries.test'; +import {combineLibraries} from '../src/combine-libraries'; +const TEST_FIXTURES_PATH = path.resolve('test/fixtures/combined-library'); +describe('generate index.ts', () => { + beforeEach(async () => { + await combineLibraries( + path.resolve(TEST_FIXTURES_PATH, LIB_PRE_COMBINATION), + path.resolve(TEST_FIXTURES_PATH, LIB_POST_COMBINATION), + ); + }); + + afterEach(async () => { + // Even though the library combination should delete the current library, + // this allows us to ensure that our output is expected. + try { + await fs.rm(path.join(TEST_FIXTURES_PATH, LIB_POST_COMBINATION)); + } catch (err) { + console.log(`Could not delete ${LIB_POST_COMBINATION}`); + } + }); + it('should extract versions', async () => { + const versions = await extractVersions( + path.join(TEST_FIXTURES_PATH, LIB_POST_COMBINATION), + ); + assert.ok(versions.includes('v1')); + assert.ok(versions.includes('v1p1beta1')); + assert.ok(versions.includes('v2')); + }); + + it('should throw an error if not in an expected format', async () => { + // In case the library hasn't been formed yet + await assert.rejects( + () => extractVersions(path.join(TEST_FIXTURES_PATH, LIB_PRE_COMBINATION)), + /Unexpected library format/, + ); + }); + + it('should extract all clients and tie them to each version', async () => { + const versionsAndClients = await extractClients( + path.join(TEST_FIXTURES_PATH, LIB_POST_COMBINATION), + ); + const expectedVersionsAndClients = [ + {version: 'v1', clients: ['AdaptationClient', 'SpeechClient']}, + { + version: 'v1p1beta1', + clients: ['AdaptationClient', 'SpeechClient'], + }, + {version: 'v2', clients: ['SpeechClient']}, + ]; + assert.deepStrictEqual(versionsAndClients, expectedVersionsAndClients); + }); + + it('should generate index file with a default version provided', async () => { + // Even though the library combination should delete the current library, + // this allows us to ensure that our output is expected. + try { + await fs.rm( + path.join(TEST_FIXTURES_PATH, LIB_POST_COMBINATION, 'src', 'index.ts'), + ); + } catch (err) { + console.log(`Could not delete ${LIB_POST_COMBINATION}/src/index.ts file`); + } + await generateIndexTs( + path.resolve(TEST_FIXTURES_PATH, LIB_POST_COMBINATION), + 'v1', + ); + + // Confirm index.ts was generated + assert.ok( + await fs.stat( + path.join(TEST_FIXTURES_PATH, LIB_POST_COMBINATION, 'src', 'index.ts'), + ), + ); + const contents = await fs.readFile( + path.join(TEST_FIXTURES_PATH, LIB_POST_COMBINATION, 'src', 'index.ts'), + 'utf8', + ); + // Confirm all versions were generated + assert.match( + contents, + /export default {v1, v1p1beta1, v2, AdaptationClient, SpeechClient};/, + ); + // Confirm default version is exported + assert.match(contents, /const AdaptationClient = v1.AdaptationClient;/); + + // Confirm another version is NOT exported + assert.doesNotMatch( + contents, + /const AdaptationClient = v2.AdaptationClient;/, + ); + }); + + it('should generate an index file as ESM if true', async () => { + // Even though the library combination should delete the current library, + // this allows us to ensure that our output is expected. + try { + await fs.rm( + path.join(TEST_FIXTURES_PATH, LIB_POST_COMBINATION, 'src', 'index.ts'), + ); + } catch (err) { + console.log(`Could not delete ${LIB_POST_COMBINATION}/src/index.ts file`); + } + await generateIndexTs( + path.resolve(TEST_FIXTURES_PATH, LIB_POST_COMBINATION), + 'v1', + true, + ); + + // Confirm index.ts was generated + assert.ok( + await fs.stat( + path.join(TEST_FIXTURES_PATH, LIB_POST_COMBINATION, 'src', 'index.ts'), + ), + ); + const contents = await fs.readFile( + path.join(TEST_FIXTURES_PATH, LIB_POST_COMBINATION, 'src', 'index.ts'), + 'utf8', + ); + // Confirm all versions were generated + assert.match(contents, /index.js/); + // Confirm default version is exported + assert.match(contents, /..\/..\/protos\/protos.js/); + }); + + it('should guess the default version if not provided', async () => { + // Even though the library combination should delete the current library, + // this allows us to ensure that our output is expected. + try { + await fs.rm( + path.join(TEST_FIXTURES_PATH, LIB_POST_COMBINATION, 'src', 'index.ts'), + ); + } catch (err) { + console.log(`Could not delete ${LIB_POST_COMBINATION}/src/index.ts file`); + } + await generateIndexTs( + path.resolve(TEST_FIXTURES_PATH, LIB_POST_COMBINATION), + ); + // Confirm index.ts was generated + assert.ok( + await fs.stat( + path.join(TEST_FIXTURES_PATH, LIB_POST_COMBINATION, 'src', 'index.ts'), + ), + ); + const contents = await fs.readFile( + path.join(TEST_FIXTURES_PATH, LIB_POST_COMBINATION, 'src', 'index.ts'), + 'utf8', + ); + // Confirm all versions were generated + // Note that v2 doesn't have Adaptation client, so it shouldn't be exported + // if v2 is assumed to be the default + assert.match(contents, /export default {v1, v1p1beta1, v2, SpeechClient};/); + + // Confirm default version is exported + assert.match(contents, /const SpeechClient = v2.SpeechClient;/); + + // Confirm another version is NOT exported + assert.doesNotMatch( + contents, + /const AdaptationClient = v1.AdaptationClient;/, + ); + }); + + it('should get highest version with precedence', async () => { + const highestVersion1 = getHighestVersionWithPrecedence([ + 'v1', + 'v1beta1', + 'v2', + 'v2beta1', + ]); + const highestVersion2 = getHighestVersionWithPrecedence([ + 'v1', + 'v1beta1', + 'v2beta1', + ]); + const highestVersion3 = getHighestVersionWithPrecedence(['v1alpha']); + const highestVersion4 = getHighestVersionWithPrecedence([ + 'v1alpha', + 'v1beta1', + 'v2beta1', + ]); + const highestVersion5 = getHighestVersionWithPrecedence([ + 'v1alpha', + 'v2alpha', + ]); + + assert.deepStrictEqual(highestVersion1, 'v2'); + assert.deepStrictEqual(highestVersion2, 'v1'); + assert.deepStrictEqual(highestVersion3, 'v1alpha'); + assert.deepStrictEqual(highestVersion4, 'v2beta1'); + assert.deepStrictEqual(highestVersion5, 'v2alpha'); + }); +}); diff --git a/packages/gapic-node-processing/test/generate-readme-command.test.ts b/packages/gapic-node-processing/test/generate-readme-command.test.ts new file mode 100644 index 00000000000..1ade35f065e --- /dev/null +++ b/packages/gapic-node-processing/test/generate-readme-command.test.ts @@ -0,0 +1,205 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import * as assert from 'assert'; +import {generateReadme} from '../src/commands/generate-readme'; +import {describe, it} from 'mocha'; +import * as sinon from 'sinon'; +import * as generateReadMe from '../src/generate-readme'; +import path from 'path'; + +const TEST_FIXTURES_PATH = path.join(__dirname, 'fixtures', 'combined-library'); + +describe('tests running generate-readme command', () => { + let initialGenerateReadMeStub: sinon.SinonStub; + let readAndWriteToReadmeStub: sinon.SinonStub; + + beforeEach(() => { + initialGenerateReadMeStub = sinon.stub( + generateReadMe, + 'initialGenerateReadMe', + ); + readAndWriteToReadmeStub = sinon.stub( + generateReadMe, + 'readAndWriteToReadme', + ); + }); + + afterEach(() => { + initialGenerateReadMeStub.restore(); + readAndWriteToReadmeStub.restore(); + }); + + it('it should run initial generation if initial-generation flag is true', async () => { + await generateReadme.handler({ + 'source-path': 'path', + sourcePath: 'path', + 'initial-generation': true, + initialGeneration: true, + 'replacement-string-samples': '//samples', + replacementStringSamples: '//samples', + 'replacement-string-release-level': '//releaseLevel', + replacementStringReleaseLevel: '//releaseLevel', + 'release-level': 'stable', + releaseLevel: 'stable', + 'destination-path': 'destination-path', + destinationPath: 'destination-path', + _: [], + $0: 'foo', + }); + + assert.ok( + initialGenerateReadMeStub.calledOnceWithExactly({ + currentLibrary: 'path', + stringToReplaceForSampleTable: '//samples', + stringToReplaceForReleaseLevel: '//releaseLevel', + releaseLevel: 'stable', + writeLibrary: 'destination-path', + }), + ); + assert.ok(readAndWriteToReadmeStub.notCalled); + }); + + it('it should run post-initial generation if initial-generation flag is not provided', async () => { + await generateReadme.handler({ + 'source-path': 'path', + sourcePath: 'path', + 'string-to-replace': 'old', + stringToReplace: 'old', + 'replacement-string': 'new', + replacementString: 'new', + _: [], + $0: 'foo', + }); + + assert.ok( + readAndWriteToReadmeStub.calledOnceWithExactly( + 'path', + 'old', + 'new', + 'path', + ), + ); + assert.ok(initialGenerateReadMeStub.notCalled); + }); + + it('it should use default values for replacement strings if they are not provided during initial generation', async () => { + const consoleStub = sinon.stub(console, 'log'); + + await generateReadme.handler({ + 'source-path': 'path', + sourcePath: 'path', + 'initial-generation': true, + initialGeneration: true, + _: [], + $0: 'foo', + }); + + // Assert that the console log message is displayed for the missing replacement strings + assert.ok( + consoleStub.calledWith( + `Initial readme generation was selected, but no string to replace the samples table was given. `+ + `Will use '[//]: # "samples"'` + ), + ); + assert.ok( + consoleStub.calledWith( + `Initial readme generation was selected, but no string to replace the release level was given. ` + + `Will use '[//]: # "releaseLevel"'`, + ), + ); + + // Assert that initialGenerateReadMeStub was called once with the default values + assert.ok( + initialGenerateReadMeStub.calledOnceWithExactly({ + currentLibrary: 'path', + stringToReplaceForSampleTable: '[//]: # "samples"', + stringToReplaceForReleaseLevel: '[//]: # "releaseLevel"', + releaseLevel: undefined, + writeLibrary: 'path', + }), + ); + assert.ok(readAndWriteToReadmeStub.notCalled); + + consoleStub.restore(); + }); + + it('it should bubble up an error if post-initial generation is selected without replacement strings', async () => { + await assert.rejects( + async () => + generateReadme.handler({ + 'source-path': 'path', + sourcePath: 'path', + _: [], + $0: 'foo', + }), + { + message: + 'Post-initial generate readme was selected, but no string to replace/replacement was given', + }, + ); + assert.ok(initialGenerateReadMeStub.notCalled); + assert.ok(readAndWriteToReadmeStub.notCalled); + }); + + it('it should set writeDestination to sourcePath if destinationPath is not provided', async () => { + await generateReadme.handler({ + 'source-path': 'path', + sourcePath: 'path', + 'string-to-replace': 'old', + stringToReplace: 'old', + 'replacement-string': 'new', + replacementString: 'new', + _: [], + $0: 'foo', + }); + + assert.ok( + readAndWriteToReadmeStub.calledOnceWithExactly( + 'path', + 'old', + 'new', + 'path', // Asserting that the writeDestination is the same as the sourcePath + ), + ); + }); + + it('it should continue generation and log a message if no release level is given during initial generation', async () => { + const consoleStub = sinon.stub(console, 'log'); + + await generateReadme.handler({ + 'source-path': 'path', + sourcePath: 'path', + 'initial-generation': true, + initialGeneration: true, + 'replacement-string-samples': 'samples', + replacementStringSamples: 'samples', + 'replacement-string-release-level': 'beta', + replacementStringReleaseLevel: 'beta', + _: [], + $0: 'foo', + }); + + assert.ok( + consoleStub.calledWith( + 'No release level was selected for initial generation; will generate with preview', + ), + ); + + // Make sure the main function was still called after the log + assert.ok(initialGenerateReadMeStub.calledOnce); + + consoleStub.restore(); // Clean up the stub + }); +}); diff --git a/packages/gapic-node-processing/test/generate-readme.test.ts b/packages/gapic-node-processing/test/generate-readme.test.ts new file mode 100644 index 00000000000..4da2af5576b --- /dev/null +++ b/packages/gapic-node-processing/test/generate-readme.test.ts @@ -0,0 +1,204 @@ +import {describe, it} from 'mocha'; +import * as assert from 'assert'; +import * as path from 'path'; +import * as fs from 'fs/promises'; +import {POST_PROCESSING_TEMPLATES_PATH} from '../src/generate-index'; +import {LIB_POST_COMBINATION} from './combine-libraries.test'; +import { + getSampleName, + getSamplesMetadata, + initialGenerateReadMe, + SAMPLES_TEMPLATE_PATH, + readAndWriteToReadme, +} from '../src/generate-readme'; +import * as nj from 'nunjucks'; + +const TEST_FIXTURES_PATH = path.resolve('test/fixtures'); +const COMBINED_LIBRARY_PATH = path.resolve( + TEST_FIXTURES_PATH, + 'combined-library', +); + +async function copyAndRename(sourcePath: string, newName: string) { + const temporaryPath = `${newName}.temp`; // Use a temporary name to avoid issues + + try { + // Step 1: Copy the file to a temporary name + await fs.copyFile(sourcePath, temporaryPath); + console.log(`File copied from ${sourcePath} to ${temporaryPath}`); + + // Step 2: Rename the temporary file to the final name + await fs.rename(temporaryPath, newName); + console.log(`File renamed from ${temporaryPath} to ${newName}`); + } catch (error) { + console.error('Error:', error); + } +} + +describe('generate readme.ts', () => { + it('get all the samples metadata', async () => { + const samples = await getSamplesMetadata( + path.join(COMBINED_LIBRARY_PATH, LIB_POST_COMBINATION), + ); + assert.deepStrictEqual(samples.length, 52); + + // Randomly check that some samples exist + assert.ok( + samples + .map(x => x.filePath) + .includes( + '/google-cloud-speech/samples/generated/v1/adaptation.update_custom_class.js', + ), + ); + assert.ok(samples.map(x => x.title).includes('update custom class')); + assert.ok( + samples + .map(x => x.filePath) + .includes( + '/google-cloud-speech/samples/generated/v2/speech.get_phrase_set.js', + ), + ); + assert.ok(samples.map(x => x.title).includes('get phrase set')); + assert.ok( + samples + .map(x => x.filePath) + .includes( + '/google-cloud-speech/samples/generated/v2/speech.undelete_recognizer.js', + ), + ); + assert.ok(samples.map(x => x.title).includes('undelete recognizer')); + + // Assert content exists + assert.ok(samples.map(x => x.content).length); + }); + + it('should NOT throw if the sample name is not in the correct format; just return the name', async () => { + const sampleName = getSampleName({ + filePath: 'not-in-the-correct-format', + }); + assert.deepStrictEqual(sampleName, 'not-in-the-correct-format'); + }); + + it('should generate a README with initial values with a release level if provided', async () => { + // A little helper to ensure that the README has the 'untemplated' + // values before rendering + await copyAndRename( + path.join(TEST_FIXTURES_PATH, 'untemplated-README.md'), + path.join(COMBINED_LIBRARY_PATH, LIB_POST_COMBINATION, 'README.md'), + ); + const samples = await getSamplesMetadata( + path.join(COMBINED_LIBRARY_PATH, LIB_POST_COMBINATION), + ); + const currentLibrary = path.join( + COMBINED_LIBRARY_PATH, + LIB_POST_COMBINATION, + ); + const stringToReplaceForSampleTable = '[//]: # "samples"'; + const stringToReplaceForReleaseLevel = '[//]: # "releaseLevel"'; + const releaseLevel = 'stable'; + const writeLibrary = path.join(COMBINED_LIBRARY_PATH, LIB_POST_COMBINATION); + await initialGenerateReadMe({ + currentLibrary, + stringToReplaceForReleaseLevel, + stringToReplaceForSampleTable, + releaseLevel, + writeLibrary, + }); + const readMeContents = await fs.readFile( + path.join(COMBINED_LIBRARY_PATH, LIB_POST_COMBINATION, 'README.md'), + 'utf8', + ); + const env = new nj.Environment( + new nj.FileSystemLoader(POST_PROCESSING_TEMPLATES_PATH), + {autoescape: false}, // Disable autoescaping for code generation + ); + + // Now, render using the template's filename, and Nunjucks will find it + // within the configured templateDirectory. + const compiledTemplate = env.render(SAMPLES_TEMPLATE_PATH, { + samplesMetadata: samples, + }); + assert.match(readMeContents, new RegExp(compiledTemplate)); + assert.match(readMeContents, /stable/); + }); + + it('should generate a README with initial values with a default release level if none is provided', async () => { + // A little helper to ensure that the README has the 'untemplated' + // values before rendering + await copyAndRename( + path.join(TEST_FIXTURES_PATH, 'untemplated-README.md'), + path.join(COMBINED_LIBRARY_PATH, LIB_POST_COMBINATION, 'README.md'), + ); + const samples = await getSamplesMetadata( + path.join(COMBINED_LIBRARY_PATH, LIB_POST_COMBINATION), + ); + const currentLibrary = path.join( + COMBINED_LIBRARY_PATH, + LIB_POST_COMBINATION, + ); + const stringToReplaceForSampleTable = '[//]: # "samples"'; + const stringToReplaceForReleaseLevel = '[//]: # "releaseLevel"'; + const writeLibrary = path.join(COMBINED_LIBRARY_PATH, LIB_POST_COMBINATION); + await initialGenerateReadMe({ + currentLibrary, + stringToReplaceForReleaseLevel, + stringToReplaceForSampleTable, + writeLibrary, + }); + const readMeContents = await fs.readFile( + path.join(COMBINED_LIBRARY_PATH, LIB_POST_COMBINATION, 'README.md'), + 'utf8', + ); + const env = new nj.Environment( + new nj.FileSystemLoader(POST_PROCESSING_TEMPLATES_PATH), + {autoescape: false}, // Disable autoescaping for code generation + ); + + // Now, render using the template's filename, and Nunjucks will find it + // within the configured templateDirectory. + const compiledTemplate = env.render(SAMPLES_TEMPLATE_PATH, { + samplesMetadata: samples, + }); + assert.match(readMeContents, new RegExp(compiledTemplate)); + assert.match(readMeContents, /preview/); + }); + + it('should write to any README file with any regex that you give it', async () => { + const testDirRead = path.join(TEST_FIXTURES_PATH, 'test-input-readme'); + const testDirWrite = path.join(TEST_FIXTURES_PATH, 'test-output-readme'); + await readAndWriteToReadme( + testDirRead, + '[//]: # "GOODBYE"', + 'We generated correctly! Hooray!', + testDirWrite, + ); + const readMeContents = await fs.readFile( + path.join(testDirWrite, 'README.md'), + 'utf8', + ); + assert.match(readMeContents, /We generated correctly! Hooray!/); + }); + + it('if a README does not exist, it should throw a helfpul error', async () => { + try { + await fs.rm( + path.join(TEST_FIXTURES_PATH, 'test-output-readme', 'README.md'), + ); + } catch (err) { + console.log( + `No readme in ${path.join(TEST_FIXTURES_PATH, 'test-output-readme', 'README.md')} to delete`, + ); + } + const testDirRead = path.join(TEST_FIXTURES_PATH, 'test-output-readme'); + await assert.rejects( + () => + readAndWriteToReadme( + testDirRead, + '[//]: # "GOODBYE"', + 'We generated correctly! Hooray!', + testDirRead, + ), + /does not exist; cannot write to/, + ); + }); +}); diff --git a/packages/gapic-node-templating/test/get-bootstrap-template-vars.test.ts b/packages/gapic-node-processing/test/get-bootstrap-template-vars.test.ts similarity index 98% rename from packages/gapic-node-templating/test/get-bootstrap-template-vars.test.ts rename to packages/gapic-node-processing/test/get-bootstrap-template-vars.test.ts index 2ac0e2d9b7c..ce1b6b5de50 100644 --- a/packages/gapic-node-templating/test/get-bootstrap-template-vars.test.ts +++ b/packages/gapic-node-processing/test/get-bootstrap-template-vars.test.ts @@ -28,7 +28,7 @@ import { API_ID, DESTINATION_FOLDER, MONO_REPO_NAME, -} from './bootstrap-library.test'; +} from './bootstrap-library-command.test'; // eslint-disable-next-line node/no-unpublished-import import * as sinon from 'sinon'; // eslint-disable-next-line node/no-unpublished-import diff --git a/packages/gapic-node-templating/test/templating.test.ts b/packages/gapic-node-processing/test/templating.test.ts similarity index 100% rename from packages/gapic-node-templating/test/templating.test.ts rename to packages/gapic-node-processing/test/templating.test.ts diff --git a/packages/gapic-node-templating/tsconfig.json b/packages/gapic-node-processing/tsconfig.json similarity index 90% rename from packages/gapic-node-templating/tsconfig.json rename to packages/gapic-node-processing/tsconfig.json index a0cccbf16c8..cb236311afd 100644 --- a/packages/gapic-node-templating/tsconfig.json +++ b/packages/gapic-node-processing/tsconfig.json @@ -18,5 +18,8 @@ "system-test/*.ts", "src/**/*.json", "protos/protos.json" + ], + "exclude": [ + "test/fixtures" ] } \ No newline at end of file diff --git a/packages/google-ads-admanager/protos/protos.d.ts b/packages/google-ads-admanager/protos/protos.d.ts index 264dc90fbb5..dcc69cfa53e 100644 --- a/packages/google-ads-admanager/protos/protos.d.ts +++ b/packages/google-ads-admanager/protos/protos.d.ts @@ -24217,6 +24217,9 @@ export namespace google { /** CommonLanguageSettings destinations */ destinations?: (google.api.ClientLibraryDestination[]|null); + + /** CommonLanguageSettings selectiveGapicGeneration */ + selectiveGapicGeneration?: (google.api.ISelectiveGapicGeneration|null); } /** Represents a CommonLanguageSettings. */ @@ -24234,6 +24237,9 @@ export namespace google { /** CommonLanguageSettings destinations. */ public destinations: google.api.ClientLibraryDestination[]; + /** CommonLanguageSettings selectiveGapicGeneration. */ + public selectiveGapicGeneration?: (google.api.ISelectiveGapicGeneration|null); + /** * Creates a new CommonLanguageSettings instance using the specified properties. * @param [properties] Properties to set @@ -24934,6 +24940,9 @@ export namespace google { /** PythonSettings common */ common?: (google.api.ICommonLanguageSettings|null); + + /** PythonSettings experimentalFeatures */ + experimentalFeatures?: (google.api.PythonSettings.IExperimentalFeatures|null); } /** Represents a PythonSettings. */ @@ -24948,6 +24957,9 @@ export namespace google { /** PythonSettings common. */ public common?: (google.api.ICommonLanguageSettings|null); + /** PythonSettings experimentalFeatures. */ + public experimentalFeatures?: (google.api.PythonSettings.IExperimentalFeatures|null); + /** * Creates a new PythonSettings instance using the specified properties. * @param [properties] Properties to set @@ -25026,6 +25038,118 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + namespace PythonSettings { + + /** Properties of an ExperimentalFeatures. */ + interface IExperimentalFeatures { + + /** ExperimentalFeatures restAsyncIoEnabled */ + restAsyncIoEnabled?: (boolean|null); + + /** ExperimentalFeatures protobufPythonicTypesEnabled */ + protobufPythonicTypesEnabled?: (boolean|null); + + /** ExperimentalFeatures unversionedPackageDisabled */ + unversionedPackageDisabled?: (boolean|null); + } + + /** Represents an ExperimentalFeatures. */ + class ExperimentalFeatures implements IExperimentalFeatures { + + /** + * Constructs a new ExperimentalFeatures. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.PythonSettings.IExperimentalFeatures); + + /** ExperimentalFeatures restAsyncIoEnabled. */ + public restAsyncIoEnabled: boolean; + + /** ExperimentalFeatures protobufPythonicTypesEnabled. */ + public protobufPythonicTypesEnabled: boolean; + + /** ExperimentalFeatures unversionedPackageDisabled. */ + public unversionedPackageDisabled: boolean; + + /** + * Creates a new ExperimentalFeatures instance using the specified properties. + * @param [properties] Properties to set + * @returns ExperimentalFeatures instance + */ + public static create(properties?: google.api.PythonSettings.IExperimentalFeatures): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Encodes the specified ExperimentalFeatures message. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @param message ExperimentalFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.PythonSettings.IExperimentalFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExperimentalFeatures message, length delimited. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @param message ExperimentalFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.PythonSettings.IExperimentalFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Verifies an ExperimentalFeatures message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExperimentalFeatures message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExperimentalFeatures + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Creates a plain object from an ExperimentalFeatures message. Also converts values to other types if specified. + * @param message ExperimentalFeatures + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings.ExperimentalFeatures, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExperimentalFeatures to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExperimentalFeatures + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + /** Properties of a NodeSettings. */ interface INodeSettings { @@ -25352,6 +25476,9 @@ export namespace google { /** GoSettings common */ common?: (google.api.ICommonLanguageSettings|null); + + /** GoSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|null); } /** Represents a GoSettings. */ @@ -25366,6 +25493,9 @@ export namespace google { /** GoSettings common. */ public common?: (google.api.ICommonLanguageSettings|null); + /** GoSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + /** * Creates a new GoSettings instance using the specified properties. * @param [properties] Properties to set @@ -25690,6 +25820,109 @@ export namespace google { PACKAGE_MANAGER = 20 } + /** Properties of a SelectiveGapicGeneration. */ + interface ISelectiveGapicGeneration { + + /** SelectiveGapicGeneration methods */ + methods?: (string[]|null); + + /** SelectiveGapicGeneration generateOmittedAsInternal */ + generateOmittedAsInternal?: (boolean|null); + } + + /** Represents a SelectiveGapicGeneration. */ + class SelectiveGapicGeneration implements ISelectiveGapicGeneration { + + /** + * Constructs a new SelectiveGapicGeneration. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ISelectiveGapicGeneration); + + /** SelectiveGapicGeneration methods. */ + public methods: string[]; + + /** SelectiveGapicGeneration generateOmittedAsInternal. */ + public generateOmittedAsInternal: boolean; + + /** + * Creates a new SelectiveGapicGeneration instance using the specified properties. + * @param [properties] Properties to set + * @returns SelectiveGapicGeneration instance + */ + public static create(properties?: google.api.ISelectiveGapicGeneration): google.api.SelectiveGapicGeneration; + + /** + * Encodes the specified SelectiveGapicGeneration message. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @param message SelectiveGapicGeneration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ISelectiveGapicGeneration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SelectiveGapicGeneration message, length delimited. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @param message SelectiveGapicGeneration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ISelectiveGapicGeneration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.SelectiveGapicGeneration; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.SelectiveGapicGeneration; + + /** + * Verifies a SelectiveGapicGeneration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SelectiveGapicGeneration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SelectiveGapicGeneration + */ + public static fromObject(object: { [k: string]: any }): google.api.SelectiveGapicGeneration; + + /** + * Creates a plain object from a SelectiveGapicGeneration message. Also converts values to other types if specified. + * @param message SelectiveGapicGeneration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.SelectiveGapicGeneration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SelectiveGapicGeneration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SelectiveGapicGeneration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** LaunchStage enum. */ enum LaunchStage { LAUNCH_STAGE_UNSPECIFIED = 0, @@ -25806,6 +26039,7 @@ export namespace google { /** Edition enum. */ enum Edition { EDITION_UNKNOWN = 0, + EDITION_LEGACY = 900, EDITION_PROTO2 = 998, EDITION_PROTO3 = 999, EDITION_2023 = 1000, @@ -25836,6 +26070,9 @@ export namespace google { /** FileDescriptorProto weakDependency */ weakDependency?: (number[]|null); + /** FileDescriptorProto optionDependency */ + optionDependency?: (string[]|null); + /** FileDescriptorProto messageType */ messageType?: (google.protobuf.IDescriptorProto[]|null); @@ -25885,6 +26122,9 @@ export namespace google { /** FileDescriptorProto weakDependency. */ public weakDependency: number[]; + /** FileDescriptorProto optionDependency. */ + public optionDependency: string[]; + /** FileDescriptorProto messageType. */ public messageType: google.protobuf.IDescriptorProto[]; @@ -26019,6 +26259,9 @@ export namespace google { /** DescriptorProto reservedName */ reservedName?: (string[]|null); + + /** DescriptorProto visibility */ + visibility?: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility|null); } /** Represents a DescriptorProto. */ @@ -26060,6 +26303,9 @@ export namespace google { /** DescriptorProto reservedName. */ public reservedName: string[]; + /** DescriptorProto visibility. */ + public visibility: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility); + /** * Creates a new DescriptorProto instance using the specified properties. * @param [properties] Properties to set @@ -26907,6 +27153,9 @@ export namespace google { /** EnumDescriptorProto reservedName */ reservedName?: (string[]|null); + + /** EnumDescriptorProto visibility */ + visibility?: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility|null); } /** Represents an EnumDescriptorProto. */ @@ -26933,6 +27182,9 @@ export namespace google { /** EnumDescriptorProto reservedName. */ public reservedName: string[]; + /** EnumDescriptorProto visibility. */ + public visibility: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility); + /** * Creates a new EnumDescriptorProto instance using the specified properties. * @param [properties] Properties to set @@ -27867,6 +28119,9 @@ export namespace google { /** FieldOptions features */ features?: (google.protobuf.IFeatureSet|null); + /** FieldOptions featureSupport */ + featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** FieldOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); @@ -27922,6 +28177,9 @@ export namespace google { /** FieldOptions features. */ public features?: (google.protobuf.IFeatureSet|null); + /** FieldOptions featureSupport. */ + public featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** FieldOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; @@ -28142,6 +28400,121 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** Properties of a FeatureSupport. */ + interface IFeatureSupport { + + /** FeatureSupport editionIntroduced */ + editionIntroduced?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSupport editionDeprecated */ + editionDeprecated?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSupport deprecationWarning */ + deprecationWarning?: (string|null); + + /** FeatureSupport editionRemoved */ + editionRemoved?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSupport. */ + class FeatureSupport implements IFeatureSupport { + + /** + * Constructs a new FeatureSupport. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IFeatureSupport); + + /** FeatureSupport editionIntroduced. */ + public editionIntroduced: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSupport editionDeprecated. */ + public editionDeprecated: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSupport deprecationWarning. */ + public deprecationWarning: string; + + /** FeatureSupport editionRemoved. */ + public editionRemoved: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSupport instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSupport instance + */ + public static create(properties?: google.protobuf.FieldOptions.IFeatureSupport): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Encodes the specified FeatureSupport message. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @param message FeatureSupport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IFeatureSupport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSupport message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @param message FeatureSupport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IFeatureSupport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Verifies a FeatureSupport message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSupport message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSupport + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Creates a plain object from a FeatureSupport message. Also converts values to other types if specified. + * @param message FeatureSupport + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.FeatureSupport, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSupport to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSupport + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } /** Properties of an OneofOptions. */ @@ -28380,6 +28753,9 @@ export namespace google { /** EnumValueOptions debugRedact */ debugRedact?: (boolean|null); + /** EnumValueOptions featureSupport */ + featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** EnumValueOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); } @@ -28402,6 +28778,9 @@ export namespace google { /** EnumValueOptions debugRedact. */ public debugRedact: boolean; + /** EnumValueOptions featureSupport. */ + public featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** EnumValueOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; @@ -28994,6 +29373,12 @@ export namespace google { /** FeatureSet jsonFormat */ jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); + + /** FeatureSet enforceNamingStyle */ + enforceNamingStyle?: (google.protobuf.FeatureSet.EnforceNamingStyle|keyof typeof google.protobuf.FeatureSet.EnforceNamingStyle|null); + + /** FeatureSet defaultSymbolVisibility */ + defaultSymbolVisibility?: (google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|keyof typeof google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|null); } /** Represents a FeatureSet. */ @@ -29023,6 +29408,12 @@ export namespace google { /** FeatureSet jsonFormat. */ public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); + /** FeatureSet enforceNamingStyle. */ + public enforceNamingStyle: (google.protobuf.FeatureSet.EnforceNamingStyle|keyof typeof google.protobuf.FeatureSet.EnforceNamingStyle); + + /** FeatureSet defaultSymbolVisibility. */ + public defaultSymbolVisibility: (google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|keyof typeof google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility); + /** * Creates a new FeatureSet instance using the specified properties. * @param [properties] Properties to set @@ -29145,6 +29536,116 @@ export namespace google { ALLOW = 1, LEGACY_BEST_EFFORT = 2 } + + /** EnforceNamingStyle enum. */ + enum EnforceNamingStyle { + ENFORCE_NAMING_STYLE_UNKNOWN = 0, + STYLE2024 = 1, + STYLE_LEGACY = 2 + } + + /** Properties of a VisibilityFeature. */ + interface IVisibilityFeature { + } + + /** Represents a VisibilityFeature. */ + class VisibilityFeature implements IVisibilityFeature { + + /** + * Constructs a new VisibilityFeature. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSet.IVisibilityFeature); + + /** + * Creates a new VisibilityFeature instance using the specified properties. + * @param [properties] Properties to set + * @returns VisibilityFeature instance + */ + public static create(properties?: google.protobuf.FeatureSet.IVisibilityFeature): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Encodes the specified VisibilityFeature message. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @param message VisibilityFeature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSet.IVisibilityFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VisibilityFeature message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @param message VisibilityFeature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSet.IVisibilityFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Verifies a VisibilityFeature message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VisibilityFeature message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VisibilityFeature + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Creates a plain object from a VisibilityFeature message. Also converts values to other types if specified. + * @param message VisibilityFeature + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet.VisibilityFeature, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VisibilityFeature to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VisibilityFeature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace VisibilityFeature { + + /** DefaultSymbolVisibility enum. */ + enum DefaultSymbolVisibility { + DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0, + EXPORT_ALL = 1, + EXPORT_TOP_LEVEL = 2, + LOCAL_ALL = 3, + STRICT = 4 + } + } } /** Properties of a FeatureSetDefaults. */ @@ -29264,8 +29765,11 @@ export namespace google { /** FeatureSetEditionDefault edition */ edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - /** FeatureSetEditionDefault features */ - features?: (google.protobuf.IFeatureSet|null); + /** FeatureSetEditionDefault overridableFeatures */ + overridableFeatures?: (google.protobuf.IFeatureSet|null); + + /** FeatureSetEditionDefault fixedFeatures */ + fixedFeatures?: (google.protobuf.IFeatureSet|null); } /** Represents a FeatureSetEditionDefault. */ @@ -29280,8 +29784,11 @@ export namespace google { /** FeatureSetEditionDefault edition. */ public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - /** FeatureSetEditionDefault features. */ - public features?: (google.protobuf.IFeatureSet|null); + /** FeatureSetEditionDefault overridableFeatures. */ + public overridableFeatures?: (google.protobuf.IFeatureSet|null); + + /** FeatureSetEditionDefault fixedFeatures. */ + public fixedFeatures?: (google.protobuf.IFeatureSet|null); /** * Creates a new FeatureSetEditionDefault instance using the specified properties. @@ -29814,6 +30321,13 @@ export namespace google { } } + /** SymbolVisibility enum. */ + enum SymbolVisibility { + VISIBILITY_UNSET = 0, + VISIBILITY_LOCAL = 1, + VISIBILITY_EXPORT = 2 + } + /** Properties of a Duration. */ interface IDuration { diff --git a/packages/google-ads-admanager/protos/protos.js b/packages/google-ads-admanager/protos/protos.js index 028625c7dbc..02afdad10d8 100644 --- a/packages/google-ads-admanager/protos/protos.js +++ b/packages/google-ads-admanager/protos/protos.js @@ -70684,6 +70684,7 @@ * @interface ICommonLanguageSettings * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri * @property {Array.|null} [destinations] CommonLanguageSettings destinations + * @property {google.api.ISelectiveGapicGeneration|null} [selectiveGapicGeneration] CommonLanguageSettings selectiveGapicGeneration */ /** @@ -70718,6 +70719,14 @@ */ CommonLanguageSettings.prototype.destinations = $util.emptyArray; + /** + * CommonLanguageSettings selectiveGapicGeneration. + * @member {google.api.ISelectiveGapicGeneration|null|undefined} selectiveGapicGeneration + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.selectiveGapicGeneration = null; + /** * Creates a new CommonLanguageSettings instance using the specified properties. * @function create @@ -70750,6 +70759,8 @@ writer.int32(message.destinations[i]); writer.ldelim(); } + if (message.selectiveGapicGeneration != null && Object.hasOwnProperty.call(message, "selectiveGapicGeneration")) + $root.google.api.SelectiveGapicGeneration.encode(message.selectiveGapicGeneration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -70801,6 +70812,10 @@ message.destinations.push(reader.int32()); break; } + case 3: { + message.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -70852,6 +70867,11 @@ break; } } + if (message.selectiveGapicGeneration != null && message.hasOwnProperty("selectiveGapicGeneration")) { + var error = $root.google.api.SelectiveGapicGeneration.verify(message.selectiveGapicGeneration); + if (error) + return "selectiveGapicGeneration." + error; + } return null; }; @@ -70894,6 +70914,11 @@ break; } } + if (object.selectiveGapicGeneration != null) { + if (typeof object.selectiveGapicGeneration !== "object") + throw TypeError(".google.api.CommonLanguageSettings.selectiveGapicGeneration: object expected"); + message.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.fromObject(object.selectiveGapicGeneration); + } return message; }; @@ -70912,8 +70937,10 @@ var object = {}; if (options.arrays || options.defaults) object.destinations = []; - if (options.defaults) + if (options.defaults) { object.referenceDocsUri = ""; + object.selectiveGapicGeneration = null; + } if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) object.referenceDocsUri = message.referenceDocsUri; if (message.destinations && message.destinations.length) { @@ -70921,6 +70948,8 @@ for (var j = 0; j < message.destinations.length; ++j) object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; } + if (message.selectiveGapicGeneration != null && message.hasOwnProperty("selectiveGapicGeneration")) + object.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.toObject(message.selectiveGapicGeneration, options); return object; }; @@ -72743,6 +72772,7 @@ * @memberof google.api * @interface IPythonSettings * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common + * @property {google.api.PythonSettings.IExperimentalFeatures|null} [experimentalFeatures] PythonSettings experimentalFeatures */ /** @@ -72768,6 +72798,14 @@ */ PythonSettings.prototype.common = null; + /** + * PythonSettings experimentalFeatures. + * @member {google.api.PythonSettings.IExperimentalFeatures|null|undefined} experimentalFeatures + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.experimentalFeatures = null; + /** * Creates a new PythonSettings instance using the specified properties. * @function create @@ -72794,6 +72832,8 @@ writer = $Writer.create(); if (message.common != null && Object.hasOwnProperty.call(message, "common")) $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.experimentalFeatures != null && Object.hasOwnProperty.call(message, "experimentalFeatures")) + $root.google.api.PythonSettings.ExperimentalFeatures.encode(message.experimentalFeatures, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -72834,6 +72874,10 @@ message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); break; } + case 2: { + message.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -72874,6 +72918,11 @@ if (error) return "common." + error; } + if (message.experimentalFeatures != null && message.hasOwnProperty("experimentalFeatures")) { + var error = $root.google.api.PythonSettings.ExperimentalFeatures.verify(message.experimentalFeatures); + if (error) + return "experimentalFeatures." + error; + } return null; }; @@ -72894,6 +72943,11 @@ throw TypeError(".google.api.PythonSettings.common: object expected"); message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); } + if (object.experimentalFeatures != null) { + if (typeof object.experimentalFeatures !== "object") + throw TypeError(".google.api.PythonSettings.experimentalFeatures: object expected"); + message.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.fromObject(object.experimentalFeatures); + } return message; }; @@ -72910,10 +72964,14 @@ if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.common = null; + object.experimentalFeatures = null; + } if (message.common != null && message.hasOwnProperty("common")) object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + if (message.experimentalFeatures != null && message.hasOwnProperty("experimentalFeatures")) + object.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.toObject(message.experimentalFeatures, options); return object; }; @@ -72943,6 +73001,258 @@ return typeUrlPrefix + "/google.api.PythonSettings"; }; + PythonSettings.ExperimentalFeatures = (function() { + + /** + * Properties of an ExperimentalFeatures. + * @memberof google.api.PythonSettings + * @interface IExperimentalFeatures + * @property {boolean|null} [restAsyncIoEnabled] ExperimentalFeatures restAsyncIoEnabled + * @property {boolean|null} [protobufPythonicTypesEnabled] ExperimentalFeatures protobufPythonicTypesEnabled + * @property {boolean|null} [unversionedPackageDisabled] ExperimentalFeatures unversionedPackageDisabled + */ + + /** + * Constructs a new ExperimentalFeatures. + * @memberof google.api.PythonSettings + * @classdesc Represents an ExperimentalFeatures. + * @implements IExperimentalFeatures + * @constructor + * @param {google.api.PythonSettings.IExperimentalFeatures=} [properties] Properties to set + */ + function ExperimentalFeatures(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExperimentalFeatures restAsyncIoEnabled. + * @member {boolean} restAsyncIoEnabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.restAsyncIoEnabled = false; + + /** + * ExperimentalFeatures protobufPythonicTypesEnabled. + * @member {boolean} protobufPythonicTypesEnabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.protobufPythonicTypesEnabled = false; + + /** + * ExperimentalFeatures unversionedPackageDisabled. + * @member {boolean} unversionedPackageDisabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.unversionedPackageDisabled = false; + + /** + * Creates a new ExperimentalFeatures instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures=} [properties] Properties to set + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures instance + */ + ExperimentalFeatures.create = function create(properties) { + return new ExperimentalFeatures(properties); + }; + + /** + * Encodes the specified ExperimentalFeatures message. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures} message ExperimentalFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExperimentalFeatures.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.restAsyncIoEnabled != null && Object.hasOwnProperty.call(message, "restAsyncIoEnabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.restAsyncIoEnabled); + if (message.protobufPythonicTypesEnabled != null && Object.hasOwnProperty.call(message, "protobufPythonicTypesEnabled")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.protobufPythonicTypesEnabled); + if (message.unversionedPackageDisabled != null && Object.hasOwnProperty.call(message, "unversionedPackageDisabled")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.unversionedPackageDisabled); + return writer; + }; + + /** + * Encodes the specified ExperimentalFeatures message, length delimited. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures} message ExperimentalFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExperimentalFeatures.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExperimentalFeatures.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings.ExperimentalFeatures(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.restAsyncIoEnabled = reader.bool(); + break; + } + case 2: { + message.protobufPythonicTypesEnabled = reader.bool(); + break; + } + case 3: { + message.unversionedPackageDisabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExperimentalFeatures.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExperimentalFeatures message. + * @function verify + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExperimentalFeatures.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.restAsyncIoEnabled != null && message.hasOwnProperty("restAsyncIoEnabled")) + if (typeof message.restAsyncIoEnabled !== "boolean") + return "restAsyncIoEnabled: boolean expected"; + if (message.protobufPythonicTypesEnabled != null && message.hasOwnProperty("protobufPythonicTypesEnabled")) + if (typeof message.protobufPythonicTypesEnabled !== "boolean") + return "protobufPythonicTypesEnabled: boolean expected"; + if (message.unversionedPackageDisabled != null && message.hasOwnProperty("unversionedPackageDisabled")) + if (typeof message.unversionedPackageDisabled !== "boolean") + return "unversionedPackageDisabled: boolean expected"; + return null; + }; + + /** + * Creates an ExperimentalFeatures message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + */ + ExperimentalFeatures.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PythonSettings.ExperimentalFeatures) + return object; + var message = new $root.google.api.PythonSettings.ExperimentalFeatures(); + if (object.restAsyncIoEnabled != null) + message.restAsyncIoEnabled = Boolean(object.restAsyncIoEnabled); + if (object.protobufPythonicTypesEnabled != null) + message.protobufPythonicTypesEnabled = Boolean(object.protobufPythonicTypesEnabled); + if (object.unversionedPackageDisabled != null) + message.unversionedPackageDisabled = Boolean(object.unversionedPackageDisabled); + return message; + }; + + /** + * Creates a plain object from an ExperimentalFeatures message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.ExperimentalFeatures} message ExperimentalFeatures + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExperimentalFeatures.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.restAsyncIoEnabled = false; + object.protobufPythonicTypesEnabled = false; + object.unversionedPackageDisabled = false; + } + if (message.restAsyncIoEnabled != null && message.hasOwnProperty("restAsyncIoEnabled")) + object.restAsyncIoEnabled = message.restAsyncIoEnabled; + if (message.protobufPythonicTypesEnabled != null && message.hasOwnProperty("protobufPythonicTypesEnabled")) + object.protobufPythonicTypesEnabled = message.protobufPythonicTypesEnabled; + if (message.unversionedPackageDisabled != null && message.hasOwnProperty("unversionedPackageDisabled")) + object.unversionedPackageDisabled = message.unversionedPackageDisabled; + return object; + }; + + /** + * Converts this ExperimentalFeatures to JSON. + * @function toJSON + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + * @returns {Object.} JSON object + */ + ExperimentalFeatures.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExperimentalFeatures + * @function getTypeUrl + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExperimentalFeatures.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings.ExperimentalFeatures"; + }; + + return ExperimentalFeatures; + })(); + return PythonSettings; })(); @@ -73819,6 +74129,7 @@ * @memberof google.api * @interface IGoSettings * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common + * @property {Object.|null} [renamedServices] GoSettings renamedServices */ /** @@ -73830,6 +74141,7 @@ * @param {google.api.IGoSettings=} [properties] Properties to set */ function GoSettings(properties) { + this.renamedServices = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -73844,6 +74156,14 @@ */ GoSettings.prototype.common = null; + /** + * GoSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.renamedServices = $util.emptyObject; + /** * Creates a new GoSettings instance using the specified properties. * @function create @@ -73870,6 +74190,9 @@ writer = $Writer.create(); if (message.common != null && Object.hasOwnProperty.call(message, "common")) $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); return writer; }; @@ -73900,7 +74223,7 @@ GoSettings.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(), key, value; while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) @@ -73910,6 +74233,29 @@ message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); break; } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedServices[key] = value; + break; + } default: reader.skipType(tag & 7); break; @@ -73950,6 +74296,14 @@ if (error) return "common." + error; } + if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } return null; }; @@ -73970,6 +74324,13 @@ throw TypeError(".google.api.GoSettings.common: object expected"); message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); } + if (object.renamedServices) { + if (typeof object.renamedServices !== "object") + throw TypeError(".google.api.GoSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } return message; }; @@ -73986,10 +74347,18 @@ if (!options) options = {}; var object = {}; + if (options.objects || options.defaults) + object.renamedServices = {}; if (options.defaults) object.common = null; if (message.common != null && message.hasOwnProperty("common")) object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } return object; }; @@ -74628,29 +74997,274 @@ return values; })(); - /** - * LaunchStage enum. - * @name google.api.LaunchStage - * @enum {number} - * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value - * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value - * @property {number} PRELAUNCH=7 PRELAUNCH value - * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value - * @property {number} ALPHA=2 ALPHA value - * @property {number} BETA=3 BETA value - * @property {number} GA=4 GA value - * @property {number} DEPRECATED=5 DEPRECATED value - */ - api.LaunchStage = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; - values[valuesById[6] = "UNIMPLEMENTED"] = 6; - values[valuesById[7] = "PRELAUNCH"] = 7; - values[valuesById[1] = "EARLY_ACCESS"] = 1; - values[valuesById[2] = "ALPHA"] = 2; - values[valuesById[3] = "BETA"] = 3; - values[valuesById[4] = "GA"] = 4; - values[valuesById[5] = "DEPRECATED"] = 5; + api.SelectiveGapicGeneration = (function() { + + /** + * Properties of a SelectiveGapicGeneration. + * @memberof google.api + * @interface ISelectiveGapicGeneration + * @property {Array.|null} [methods] SelectiveGapicGeneration methods + * @property {boolean|null} [generateOmittedAsInternal] SelectiveGapicGeneration generateOmittedAsInternal + */ + + /** + * Constructs a new SelectiveGapicGeneration. + * @memberof google.api + * @classdesc Represents a SelectiveGapicGeneration. + * @implements ISelectiveGapicGeneration + * @constructor + * @param {google.api.ISelectiveGapicGeneration=} [properties] Properties to set + */ + function SelectiveGapicGeneration(properties) { + this.methods = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SelectiveGapicGeneration methods. + * @member {Array.} methods + * @memberof google.api.SelectiveGapicGeneration + * @instance + */ + SelectiveGapicGeneration.prototype.methods = $util.emptyArray; + + /** + * SelectiveGapicGeneration generateOmittedAsInternal. + * @member {boolean} generateOmittedAsInternal + * @memberof google.api.SelectiveGapicGeneration + * @instance + */ + SelectiveGapicGeneration.prototype.generateOmittedAsInternal = false; + + /** + * Creates a new SelectiveGapicGeneration instance using the specified properties. + * @function create + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration=} [properties] Properties to set + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration instance + */ + SelectiveGapicGeneration.create = function create(properties) { + return new SelectiveGapicGeneration(properties); + }; + + /** + * Encodes the specified SelectiveGapicGeneration message. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @function encode + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration} message SelectiveGapicGeneration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelectiveGapicGeneration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.methods != null && message.methods.length) + for (var i = 0; i < message.methods.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.methods[i]); + if (message.generateOmittedAsInternal != null && Object.hasOwnProperty.call(message, "generateOmittedAsInternal")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.generateOmittedAsInternal); + return writer; + }; + + /** + * Encodes the specified SelectiveGapicGeneration message, length delimited. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration} message SelectiveGapicGeneration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelectiveGapicGeneration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer. + * @function decode + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelectiveGapicGeneration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.SelectiveGapicGeneration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.methods && message.methods.length)) + message.methods = []; + message.methods.push(reader.string()); + break; + } + case 2: { + message.generateOmittedAsInternal = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelectiveGapicGeneration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SelectiveGapicGeneration message. + * @function verify + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SelectiveGapicGeneration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.methods != null && message.hasOwnProperty("methods")) { + if (!Array.isArray(message.methods)) + return "methods: array expected"; + for (var i = 0; i < message.methods.length; ++i) + if (!$util.isString(message.methods[i])) + return "methods: string[] expected"; + } + if (message.generateOmittedAsInternal != null && message.hasOwnProperty("generateOmittedAsInternal")) + if (typeof message.generateOmittedAsInternal !== "boolean") + return "generateOmittedAsInternal: boolean expected"; + return null; + }; + + /** + * Creates a SelectiveGapicGeneration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {Object.} object Plain object + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + */ + SelectiveGapicGeneration.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.SelectiveGapicGeneration) + return object; + var message = new $root.google.api.SelectiveGapicGeneration(); + if (object.methods) { + if (!Array.isArray(object.methods)) + throw TypeError(".google.api.SelectiveGapicGeneration.methods: array expected"); + message.methods = []; + for (var i = 0; i < object.methods.length; ++i) + message.methods[i] = String(object.methods[i]); + } + if (object.generateOmittedAsInternal != null) + message.generateOmittedAsInternal = Boolean(object.generateOmittedAsInternal); + return message; + }; + + /** + * Creates a plain object from a SelectiveGapicGeneration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.SelectiveGapicGeneration} message SelectiveGapicGeneration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SelectiveGapicGeneration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.methods = []; + if (options.defaults) + object.generateOmittedAsInternal = false; + if (message.methods && message.methods.length) { + object.methods = []; + for (var j = 0; j < message.methods.length; ++j) + object.methods[j] = message.methods[j]; + } + if (message.generateOmittedAsInternal != null && message.hasOwnProperty("generateOmittedAsInternal")) + object.generateOmittedAsInternal = message.generateOmittedAsInternal; + return object; + }; + + /** + * Converts this SelectiveGapicGeneration to JSON. + * @function toJSON + * @memberof google.api.SelectiveGapicGeneration + * @instance + * @returns {Object.} JSON object + */ + SelectiveGapicGeneration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SelectiveGapicGeneration + * @function getTypeUrl + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SelectiveGapicGeneration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.SelectiveGapicGeneration"; + }; + + return SelectiveGapicGeneration; + })(); + + /** + * LaunchStage enum. + * @name google.api.LaunchStage + * @enum {number} + * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value + * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value + * @property {number} PRELAUNCH=7 PRELAUNCH value + * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value + * @property {number} ALPHA=2 ALPHA value + * @property {number} BETA=3 BETA value + * @property {number} GA=4 GA value + * @property {number} DEPRECATED=5 DEPRECATED value + */ + api.LaunchStage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; + values[valuesById[6] = "UNIMPLEMENTED"] = 6; + values[valuesById[7] = "PRELAUNCH"] = 7; + values[valuesById[1] = "EARLY_ACCESS"] = 1; + values[valuesById[2] = "ALPHA"] = 2; + values[valuesById[3] = "BETA"] = 3; + values[valuesById[4] = "GA"] = 4; + values[valuesById[5] = "DEPRECATED"] = 5; return values; })(); @@ -74897,6 +75511,7 @@ * @name google.protobuf.Edition * @enum {number} * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value + * @property {number} EDITION_LEGACY=900 EDITION_LEGACY value * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value * @property {number} EDITION_2023=1000 EDITION_2023 value @@ -74911,6 +75526,7 @@ protobuf.Edition = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "EDITION_UNKNOWN"] = 0; + values[valuesById[900] = "EDITION_LEGACY"] = 900; values[valuesById[998] = "EDITION_PROTO2"] = 998; values[valuesById[999] = "EDITION_PROTO3"] = 999; values[valuesById[1000] = "EDITION_2023"] = 1000; @@ -74935,6 +75551,7 @@ * @property {Array.|null} [dependency] FileDescriptorProto dependency * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [optionDependency] FileDescriptorProto optionDependency * @property {Array.|null} [messageType] FileDescriptorProto messageType * @property {Array.|null} [enumType] FileDescriptorProto enumType * @property {Array.|null} [service] FileDescriptorProto service @@ -74957,6 +75574,7 @@ this.dependency = []; this.publicDependency = []; this.weakDependency = []; + this.optionDependency = []; this.messageType = []; this.enumType = []; this.service = []; @@ -75007,6 +75625,14 @@ */ FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + /** + * FileDescriptorProto optionDependency. + * @member {Array.} optionDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.optionDependency = $util.emptyArray; + /** * FileDescriptorProto messageType. * @member {Array.} messageType @@ -75128,6 +75754,9 @@ writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); + if (message.optionDependency != null && message.optionDependency.length) + for (var i = 0; i < message.optionDependency.length; ++i) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.optionDependency[i]); return writer; }; @@ -75200,6 +75829,12 @@ message.weakDependency.push(reader.int32()); break; } + case 15: { + if (!(message.optionDependency && message.optionDependency.length)) + message.optionDependency = []; + message.optionDependency.push(reader.string()); + break; + } case 4: { if (!(message.messageType && message.messageType.length)) message.messageType = []; @@ -75302,6 +75937,13 @@ if (!$util.isInteger(message.weakDependency[i])) return "weakDependency: integer[] expected"; } + if (message.optionDependency != null && message.hasOwnProperty("optionDependency")) { + if (!Array.isArray(message.optionDependency)) + return "optionDependency: array expected"; + for (var i = 0; i < message.optionDependency.length; ++i) + if (!$util.isString(message.optionDependency[i])) + return "optionDependency: string[] expected"; + } if (message.messageType != null && message.hasOwnProperty("messageType")) { if (!Array.isArray(message.messageType)) return "messageType: array expected"; @@ -75356,6 +75998,7 @@ default: return "edition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -75408,6 +76051,13 @@ for (var i = 0; i < object.weakDependency.length; ++i) message.weakDependency[i] = object.weakDependency[i] | 0; } + if (object.optionDependency) { + if (!Array.isArray(object.optionDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.optionDependency: array expected"); + message.optionDependency = []; + for (var i = 0; i < object.optionDependency.length; ++i) + message.optionDependency[i] = String(object.optionDependency[i]); + } if (object.messageType) { if (!Array.isArray(object.messageType)) throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); @@ -75471,6 +76121,10 @@ case 0: message.edition = 0; break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; case "EDITION_PROTO2": case 998: message.edition = 998; @@ -75536,6 +76190,7 @@ object.extension = []; object.publicDependency = []; object.weakDependency = []; + object.optionDependency = []; } if (options.defaults) { object.name = ""; @@ -75592,6 +76247,11 @@ object.syntax = message.syntax; if (message.edition != null && message.hasOwnProperty("edition")) object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + if (message.optionDependency && message.optionDependency.length) { + object.optionDependency = []; + for (var j = 0; j < message.optionDependency.length; ++j) + object.optionDependency[j] = message.optionDependency[j]; + } return object; }; @@ -75640,6 +76300,7 @@ * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options * @property {Array.|null} [reservedRange] DescriptorProto reservedRange * @property {Array.|null} [reservedName] DescriptorProto reservedName + * @property {google.protobuf.SymbolVisibility|null} [visibility] DescriptorProto visibility */ /** @@ -75745,6 +76406,14 @@ */ DescriptorProto.prototype.reservedName = $util.emptyArray; + /** + * DescriptorProto visibility. + * @member {google.protobuf.SymbolVisibility} visibility + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.visibility = 0; + /** * Creates a new DescriptorProto instance using the specified properties. * @function create @@ -75797,6 +76466,8 @@ if (message.reservedName != null && message.reservedName.length) for (var i = 0; i < message.reservedName.length; ++i) writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.visibility); return writer; }; @@ -75889,6 +76560,10 @@ message.reservedName.push(reader.string()); break; } + case 11: { + message.visibility = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -76002,6 +76677,15 @@ if (!$util.isString(message.reservedName[i])) return "reservedName: string[] expected"; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + switch (message.visibility) { + default: + return "visibility: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; @@ -76101,6 +76785,26 @@ for (var i = 0; i < object.reservedName.length; ++i) message.reservedName[i] = String(object.reservedName[i]); } + switch (object.visibility) { + default: + if (typeof object.visibility === "number") { + message.visibility = object.visibility; + break; + } + break; + case "VISIBILITY_UNSET": + case 0: + message.visibility = 0; + break; + case "VISIBILITY_LOCAL": + case 1: + message.visibility = 1; + break; + case "VISIBILITY_EXPORT": + case 2: + message.visibility = 2; + break; + } return message; }; @@ -76130,6 +76834,7 @@ if (options.defaults) { object.name = ""; object.options = null; + object.visibility = options.enums === String ? "VISIBILITY_UNSET" : 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -76175,6 +76880,8 @@ for (var j = 0; j < message.reservedName.length; ++j) object.reservedName[j] = message.reservedName[j]; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + object.visibility = options.enums === String ? $root.google.protobuf.SymbolVisibility[message.visibility] === undefined ? message.visibility : $root.google.protobuf.SymbolVisibility[message.visibility] : message.visibility; return object; }; @@ -78219,6 +78926,7 @@ * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + * @property {google.protobuf.SymbolVisibility|null} [visibility] EnumDescriptorProto visibility */ /** @@ -78279,6 +78987,14 @@ */ EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + /** + * EnumDescriptorProto visibility. + * @member {google.protobuf.SymbolVisibility} visibility + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.visibility = 0; + /** * Creates a new EnumDescriptorProto instance using the specified properties. * @function create @@ -78316,6 +79032,8 @@ if (message.reservedName != null && message.reservedName.length) for (var i = 0; i < message.reservedName.length; ++i) writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.visibility); return writer; }; @@ -78378,6 +79096,10 @@ message.reservedName.push(reader.string()); break; } + case 6: { + message.visibility = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -78446,6 +79168,15 @@ if (!$util.isString(message.reservedName[i])) return "reservedName: string[] expected"; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + switch (message.visibility) { + default: + return "visibility: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; @@ -78495,6 +79226,26 @@ for (var i = 0; i < object.reservedName.length; ++i) message.reservedName[i] = String(object.reservedName[i]); } + switch (object.visibility) { + default: + if (typeof object.visibility === "number") { + message.visibility = object.visibility; + break; + } + break; + case "VISIBILITY_UNSET": + case 0: + message.visibility = 0; + break; + case "VISIBILITY_LOCAL": + case 1: + message.visibility = 1; + break; + case "VISIBILITY_EXPORT": + case 2: + message.visibility = 2; + break; + } return message; }; @@ -78519,6 +79270,7 @@ if (options.defaults) { object.name = ""; object.options = null; + object.visibility = options.enums === String ? "VISIBILITY_UNSET" : 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -78539,6 +79291,8 @@ for (var j = 0; j < message.reservedName.length; ++j) object.reservedName[j] = message.reservedName[j]; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + object.visibility = options.enums === String ? $root.google.protobuf.SymbolVisibility[message.visibility] === undefined ? message.visibility : $root.google.protobuf.SymbolVisibility[message.visibility] : message.visibility; return object; }; @@ -80857,6 +81611,7 @@ * @property {Array.|null} [targets] FieldOptions targets * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features + * @property {google.protobuf.FieldOptions.IFeatureSupport|null} [featureSupport] FieldOptions featureSupport * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference @@ -80977,6 +81732,14 @@ */ FieldOptions.prototype.features = null; + /** + * FieldOptions featureSupport. + * @member {google.protobuf.FieldOptions.IFeatureSupport|null|undefined} featureSupport + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.featureSupport = null; + /** * FieldOptions uninterpretedOption. * @member {Array.} uninterpretedOption @@ -81051,6 +81814,8 @@ $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); if (message.features != null && Object.hasOwnProperty.call(message, "features")) $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) + $root.google.protobuf.FieldOptions.FeatureSupport.encode(message.featureSupport, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); @@ -81152,6 +81917,10 @@ message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); break; } + case 22: { + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.decode(reader, reader.uint32()); + break; + } case 999: { if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; @@ -81287,6 +82056,11 @@ if (error) return "features." + error; } + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) { + var error = $root.google.protobuf.FieldOptions.FeatureSupport.verify(message.featureSupport); + if (error) + return "featureSupport." + error; + } if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; @@ -81475,6 +82249,11 @@ throw TypeError(".google.protobuf.FieldOptions.features: object expected"); message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); } + if (object.featureSupport != null) { + if (typeof object.featureSupport !== "object") + throw TypeError(".google.protobuf.FieldOptions.featureSupport: object expected"); + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.fromObject(object.featureSupport); + } if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); @@ -81572,6 +82351,7 @@ object.debugRedact = false; object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; object.features = null; + object.featureSupport = null; object[".google.api.resourceReference"] = null; } if (message.ctype != null && message.hasOwnProperty("ctype")) @@ -81604,6 +82384,8 @@ } if (message.features != null && message.hasOwnProperty("features")) object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) + object.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.toObject(message.featureSupport, options); if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) @@ -81876,6 +82658,7 @@ default: return "edition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -81917,103 +82700,589 @@ case 0: message.edition = 0; break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this EditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + * @returns {Object.} JSON object + */ + EditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; + }; + + return EditionDefault; + })(); + + FieldOptions.FeatureSupport = (function() { + + /** + * Properties of a FeatureSupport. + * @memberof google.protobuf.FieldOptions + * @interface IFeatureSupport + * @property {google.protobuf.Edition|null} [editionIntroduced] FeatureSupport editionIntroduced + * @property {google.protobuf.Edition|null} [editionDeprecated] FeatureSupport editionDeprecated + * @property {string|null} [deprecationWarning] FeatureSupport deprecationWarning + * @property {google.protobuf.Edition|null} [editionRemoved] FeatureSupport editionRemoved + */ + + /** + * Constructs a new FeatureSupport. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents a FeatureSupport. + * @implements IFeatureSupport + * @constructor + * @param {google.protobuf.FieldOptions.IFeatureSupport=} [properties] Properties to set + */ + function FeatureSupport(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSupport editionIntroduced. + * @member {google.protobuf.Edition} editionIntroduced + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionIntroduced = 0; + + /** + * FeatureSupport editionDeprecated. + * @member {google.protobuf.Edition} editionDeprecated + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionDeprecated = 0; + + /** + * FeatureSupport deprecationWarning. + * @member {string} deprecationWarning + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.deprecationWarning = ""; + + /** + * FeatureSupport editionRemoved. + * @member {google.protobuf.Edition} editionRemoved + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionRemoved = 0; + + /** + * Creates a new FeatureSupport instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport instance + */ + FeatureSupport.create = function create(properties) { + return new FeatureSupport(properties); + }; + + /** + * Encodes the specified FeatureSupport message. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport} message FeatureSupport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSupport.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.editionIntroduced != null && Object.hasOwnProperty.call(message, "editionIntroduced")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.editionIntroduced); + if (message.editionDeprecated != null && Object.hasOwnProperty.call(message, "editionDeprecated")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.editionDeprecated); + if (message.deprecationWarning != null && Object.hasOwnProperty.call(message, "deprecationWarning")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.deprecationWarning); + if (message.editionRemoved != null && Object.hasOwnProperty.call(message, "editionRemoved")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.editionRemoved); + return writer; + }; + + /** + * Encodes the specified FeatureSupport message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport} message FeatureSupport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSupport.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSupport.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.FeatureSupport(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.editionIntroduced = reader.int32(); + break; + } + case 2: { + message.editionDeprecated = reader.int32(); + break; + } + case 3: { + message.deprecationWarning = reader.string(); + break; + } + case 4: { + message.editionRemoved = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSupport.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSupport message. + * @function verify + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSupport.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.editionIntroduced != null && message.hasOwnProperty("editionIntroduced")) + switch (message.editionIntroduced) { + default: + return "editionIntroduced: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.editionDeprecated != null && message.hasOwnProperty("editionDeprecated")) + switch (message.editionDeprecated) { + default: + return "editionDeprecated: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.deprecationWarning != null && message.hasOwnProperty("deprecationWarning")) + if (!$util.isString(message.deprecationWarning)) + return "deprecationWarning: string expected"; + if (message.editionRemoved != null && message.hasOwnProperty("editionRemoved")) + switch (message.editionRemoved) { + default: + return "editionRemoved: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FeatureSupport message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + */ + FeatureSupport.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions.FeatureSupport) + return object; + var message = new $root.google.protobuf.FieldOptions.FeatureSupport(); + switch (object.editionIntroduced) { + default: + if (typeof object.editionIntroduced === "number") { + message.editionIntroduced = object.editionIntroduced; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionIntroduced = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionIntroduced = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionIntroduced = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionIntroduced = 999; + break; + case "EDITION_2023": + case 1000: + message.editionIntroduced = 1000; + break; + case "EDITION_2024": + case 1001: + message.editionIntroduced = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.editionIntroduced = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.editionIntroduced = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.editionIntroduced = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.editionIntroduced = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.editionIntroduced = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.editionIntroduced = 2147483647; + break; + } + switch (object.editionDeprecated) { + default: + if (typeof object.editionDeprecated === "number") { + message.editionDeprecated = object.editionDeprecated; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionDeprecated = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionDeprecated = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionDeprecated = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionDeprecated = 999; + break; + case "EDITION_2023": + case 1000: + message.editionDeprecated = 1000; + break; + case "EDITION_2024": + case 1001: + message.editionDeprecated = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.editionDeprecated = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.editionDeprecated = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.editionDeprecated = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.editionDeprecated = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.editionDeprecated = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.editionDeprecated = 2147483647; + break; + } + if (object.deprecationWarning != null) + message.deprecationWarning = String(object.deprecationWarning); + switch (object.editionRemoved) { + default: + if (typeof object.editionRemoved === "number") { + message.editionRemoved = object.editionRemoved; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionRemoved = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionRemoved = 900; + break; case "EDITION_PROTO2": case 998: - message.edition = 998; + message.editionRemoved = 998; break; case "EDITION_PROTO3": case 999: - message.edition = 999; + message.editionRemoved = 999; break; case "EDITION_2023": case 1000: - message.edition = 1000; + message.editionRemoved = 1000; break; case "EDITION_2024": case 1001: - message.edition = 1001; + message.editionRemoved = 1001; break; case "EDITION_1_TEST_ONLY": case 1: - message.edition = 1; + message.editionRemoved = 1; break; case "EDITION_2_TEST_ONLY": case 2: - message.edition = 2; + message.editionRemoved = 2; break; case "EDITION_99997_TEST_ONLY": case 99997: - message.edition = 99997; + message.editionRemoved = 99997; break; case "EDITION_99998_TEST_ONLY": case 99998: - message.edition = 99998; + message.editionRemoved = 99998; break; case "EDITION_99999_TEST_ONLY": case 99999: - message.edition = 99999; + message.editionRemoved = 99999; break; case "EDITION_MAX": case 2147483647: - message.edition = 2147483647; + message.editionRemoved = 2147483647; break; } - if (object.value != null) - message.value = String(object.value); return message; }; /** - * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * Creates a plain object from a FeatureSupport message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.FieldOptions.EditionDefault + * @memberof google.protobuf.FieldOptions.FeatureSupport * @static - * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault + * @param {google.protobuf.FieldOptions.FeatureSupport} message FeatureSupport * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EditionDefault.toObject = function toObject(message, options) { + FeatureSupport.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.value = ""; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.editionIntroduced = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.editionDeprecated = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.deprecationWarning = ""; + object.editionRemoved = options.enums === String ? "EDITION_UNKNOWN" : 0; } - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + if (message.editionIntroduced != null && message.hasOwnProperty("editionIntroduced")) + object.editionIntroduced = options.enums === String ? $root.google.protobuf.Edition[message.editionIntroduced] === undefined ? message.editionIntroduced : $root.google.protobuf.Edition[message.editionIntroduced] : message.editionIntroduced; + if (message.editionDeprecated != null && message.hasOwnProperty("editionDeprecated")) + object.editionDeprecated = options.enums === String ? $root.google.protobuf.Edition[message.editionDeprecated] === undefined ? message.editionDeprecated : $root.google.protobuf.Edition[message.editionDeprecated] : message.editionDeprecated; + if (message.deprecationWarning != null && message.hasOwnProperty("deprecationWarning")) + object.deprecationWarning = message.deprecationWarning; + if (message.editionRemoved != null && message.hasOwnProperty("editionRemoved")) + object.editionRemoved = options.enums === String ? $root.google.protobuf.Edition[message.editionRemoved] === undefined ? message.editionRemoved : $root.google.protobuf.Edition[message.editionRemoved] : message.editionRemoved; return object; }; /** - * Converts this EditionDefault to JSON. + * Converts this FeatureSupport to JSON. * @function toJSON - * @memberof google.protobuf.FieldOptions.EditionDefault + * @memberof google.protobuf.FieldOptions.FeatureSupport * @instance * @returns {Object.} JSON object */ - EditionDefault.prototype.toJSON = function toJSON() { + FeatureSupport.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for EditionDefault + * Gets the default type url for FeatureSupport * @function getTypeUrl - * @memberof google.protobuf.FieldOptions.EditionDefault + * @memberof google.protobuf.FieldOptions.FeatureSupport * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + FeatureSupport.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; + return typeUrlPrefix + "/google.protobuf.FieldOptions.FeatureSupport"; }; - return EditionDefault; + return FeatureSupport; })(); return FieldOptions; @@ -82608,6 +83877,7 @@ * @property {boolean|null} [deprecated] EnumValueOptions deprecated * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact + * @property {google.protobuf.FieldOptions.IFeatureSupport|null} [featureSupport] EnumValueOptions featureSupport * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption */ @@ -82651,6 +83921,14 @@ */ EnumValueOptions.prototype.debugRedact = false; + /** + * EnumValueOptions featureSupport. + * @member {google.protobuf.FieldOptions.IFeatureSupport|null|undefined} featureSupport + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.featureSupport = null; + /** * EnumValueOptions uninterpretedOption. * @member {Array.} uninterpretedOption @@ -82689,6 +83967,8 @@ $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); + if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) + $root.google.protobuf.FieldOptions.FeatureSupport.encode(message.featureSupport, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); @@ -82740,6 +84020,10 @@ message.debugRedact = reader.bool(); break; } + case 4: { + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.decode(reader, reader.uint32()); + break; + } case 999: { if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; @@ -82792,6 +84076,11 @@ if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) if (typeof message.debugRedact !== "boolean") return "debugRedact: boolean expected"; + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) { + var error = $root.google.protobuf.FieldOptions.FeatureSupport.verify(message.featureSupport); + if (error) + return "featureSupport." + error; + } if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; @@ -82825,6 +84114,11 @@ } if (object.debugRedact != null) message.debugRedact = Boolean(object.debugRedact); + if (object.featureSupport != null) { + if (typeof object.featureSupport !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.featureSupport: object expected"); + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.fromObject(object.featureSupport); + } if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); @@ -82857,6 +84151,7 @@ object.deprecated = false; object.features = null; object.debugRedact = false; + object.featureSupport = null; } if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; @@ -82864,6 +84159,8 @@ object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) object.debugRedact = message.debugRedact; + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) + object.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.toObject(message.featureSupport, options); if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) @@ -84331,6 +85628,8 @@ * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat + * @property {google.protobuf.FeatureSet.EnforceNamingStyle|null} [enforceNamingStyle] FeatureSet enforceNamingStyle + * @property {google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|null} [defaultSymbolVisibility] FeatureSet defaultSymbolVisibility */ /** @@ -84396,6 +85695,22 @@ */ FeatureSet.prototype.jsonFormat = 0; + /** + * FeatureSet enforceNamingStyle. + * @member {google.protobuf.FeatureSet.EnforceNamingStyle} enforceNamingStyle + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enforceNamingStyle = 0; + + /** + * FeatureSet defaultSymbolVisibility. + * @member {google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility} defaultSymbolVisibility + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.defaultSymbolVisibility = 0; + /** * Creates a new FeatureSet instance using the specified properties. * @function create @@ -84432,6 +85747,10 @@ writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); + if (message.enforceNamingStyle != null && Object.hasOwnProperty.call(message, "enforceNamingStyle")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.enforceNamingStyle); + if (message.defaultSymbolVisibility != null && Object.hasOwnProperty.call(message, "defaultSymbolVisibility")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.defaultSymbolVisibility); return writer; }; @@ -84492,6 +85811,14 @@ message.jsonFormat = reader.int32(); break; } + case 7: { + message.enforceNamingStyle = reader.int32(); + break; + } + case 8: { + message.defaultSymbolVisibility = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -84582,6 +85909,26 @@ case 2: break; } + if (message.enforceNamingStyle != null && message.hasOwnProperty("enforceNamingStyle")) + switch (message.enforceNamingStyle) { + default: + return "enforceNamingStyle: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.defaultSymbolVisibility != null && message.hasOwnProperty("defaultSymbolVisibility")) + switch (message.defaultSymbolVisibility) { + default: + return "defaultSymbolVisibility: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } return null; }; @@ -84721,6 +86068,54 @@ message.jsonFormat = 2; break; } + switch (object.enforceNamingStyle) { + default: + if (typeof object.enforceNamingStyle === "number") { + message.enforceNamingStyle = object.enforceNamingStyle; + break; + } + break; + case "ENFORCE_NAMING_STYLE_UNKNOWN": + case 0: + message.enforceNamingStyle = 0; + break; + case "STYLE2024": + case 1: + message.enforceNamingStyle = 1; + break; + case "STYLE_LEGACY": + case 2: + message.enforceNamingStyle = 2; + break; + } + switch (object.defaultSymbolVisibility) { + default: + if (typeof object.defaultSymbolVisibility === "number") { + message.defaultSymbolVisibility = object.defaultSymbolVisibility; + break; + } + break; + case "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN": + case 0: + message.defaultSymbolVisibility = 0; + break; + case "EXPORT_ALL": + case 1: + message.defaultSymbolVisibility = 1; + break; + case "EXPORT_TOP_LEVEL": + case 2: + message.defaultSymbolVisibility = 2; + break; + case "LOCAL_ALL": + case 3: + message.defaultSymbolVisibility = 3; + break; + case "STRICT": + case 4: + message.defaultSymbolVisibility = 4; + break; + } return message; }; @@ -84744,6 +86139,8 @@ object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; + object.enforceNamingStyle = options.enums === String ? "ENFORCE_NAMING_STYLE_UNKNOWN" : 0; + object.defaultSymbolVisibility = options.enums === String ? "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN" : 0; } if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; @@ -84757,6 +86154,10 @@ object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; + if (message.enforceNamingStyle != null && message.hasOwnProperty("enforceNamingStyle")) + object.enforceNamingStyle = options.enums === String ? $root.google.protobuf.FeatureSet.EnforceNamingStyle[message.enforceNamingStyle] === undefined ? message.enforceNamingStyle : $root.google.protobuf.FeatureSet.EnforceNamingStyle[message.enforceNamingStyle] : message.enforceNamingStyle; + if (message.defaultSymbolVisibility != null && message.hasOwnProperty("defaultSymbolVisibility")) + object.defaultSymbolVisibility = options.enums === String ? $root.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility[message.defaultSymbolVisibility] === undefined ? message.defaultSymbolVisibility : $root.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility[message.defaultSymbolVisibility] : message.defaultSymbolVisibility; return object; }; @@ -84884,6 +86285,219 @@ return values; })(); + /** + * EnforceNamingStyle enum. + * @name google.protobuf.FeatureSet.EnforceNamingStyle + * @enum {number} + * @property {number} ENFORCE_NAMING_STYLE_UNKNOWN=0 ENFORCE_NAMING_STYLE_UNKNOWN value + * @property {number} STYLE2024=1 STYLE2024 value + * @property {number} STYLE_LEGACY=2 STYLE_LEGACY value + */ + FeatureSet.EnforceNamingStyle = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENFORCE_NAMING_STYLE_UNKNOWN"] = 0; + values[valuesById[1] = "STYLE2024"] = 1; + values[valuesById[2] = "STYLE_LEGACY"] = 2; + return values; + })(); + + FeatureSet.VisibilityFeature = (function() { + + /** + * Properties of a VisibilityFeature. + * @memberof google.protobuf.FeatureSet + * @interface IVisibilityFeature + */ + + /** + * Constructs a new VisibilityFeature. + * @memberof google.protobuf.FeatureSet + * @classdesc Represents a VisibilityFeature. + * @implements IVisibilityFeature + * @constructor + * @param {google.protobuf.FeatureSet.IVisibilityFeature=} [properties] Properties to set + */ + function VisibilityFeature(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new VisibilityFeature instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature instance + */ + VisibilityFeature.create = function create(properties) { + return new VisibilityFeature(properties); + }; + + /** + * Encodes the specified VisibilityFeature message. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature} message VisibilityFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VisibilityFeature.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified VisibilityFeature message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature} message VisibilityFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VisibilityFeature.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VisibilityFeature.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet.VisibilityFeature(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VisibilityFeature.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VisibilityFeature message. + * @function verify + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VisibilityFeature.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a VisibilityFeature message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + */ + VisibilityFeature.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSet.VisibilityFeature) + return object; + return new $root.google.protobuf.FeatureSet.VisibilityFeature(); + }; + + /** + * Creates a plain object from a VisibilityFeature message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.VisibilityFeature} message VisibilityFeature + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VisibilityFeature.toObject = function toObject() { + return {}; + }; + + /** + * Converts this VisibilityFeature to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @instance + * @returns {Object.} JSON object + */ + VisibilityFeature.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VisibilityFeature + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VisibilityFeature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet.VisibilityFeature"; + }; + + /** + * DefaultSymbolVisibility enum. + * @name google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility + * @enum {number} + * @property {number} DEFAULT_SYMBOL_VISIBILITY_UNKNOWN=0 DEFAULT_SYMBOL_VISIBILITY_UNKNOWN value + * @property {number} EXPORT_ALL=1 EXPORT_ALL value + * @property {number} EXPORT_TOP_LEVEL=2 EXPORT_TOP_LEVEL value + * @property {number} LOCAL_ALL=3 LOCAL_ALL value + * @property {number} STRICT=4 STRICT value + */ + VisibilityFeature.DefaultSymbolVisibility = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN"] = 0; + values[valuesById[1] = "EXPORT_ALL"] = 1; + values[valuesById[2] = "EXPORT_TOP_LEVEL"] = 2; + values[valuesById[3] = "LOCAL_ALL"] = 3; + values[valuesById[4] = "STRICT"] = 4; + return values; + })(); + + return VisibilityFeature; + })(); + return FeatureSet; })(); @@ -85068,6 +86682,7 @@ default: return "minimumEdition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -85085,6 +86700,7 @@ default: return "maximumEdition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -85133,6 +86749,10 @@ case 0: message.minimumEdition = 0; break; + case "EDITION_LEGACY": + case 900: + message.minimumEdition = 900; + break; case "EDITION_PROTO2": case 998: message.minimumEdition = 998; @@ -85185,6 +86805,10 @@ case 0: message.maximumEdition = 0; break; + case "EDITION_LEGACY": + case 900: + message.maximumEdition = 900; + break; case "EDITION_PROTO2": case 998: message.maximumEdition = 998; @@ -85293,7 +86917,8 @@ * @memberof google.protobuf.FeatureSetDefaults * @interface IFeatureSetEditionDefault * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition - * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features + * @property {google.protobuf.IFeatureSet|null} [overridableFeatures] FeatureSetEditionDefault overridableFeatures + * @property {google.protobuf.IFeatureSet|null} [fixedFeatures] FeatureSetEditionDefault fixedFeatures */ /** @@ -85320,12 +86945,20 @@ FeatureSetEditionDefault.prototype.edition = 0; /** - * FeatureSetEditionDefault features. - * @member {google.protobuf.IFeatureSet|null|undefined} features + * FeatureSetEditionDefault overridableFeatures. + * @member {google.protobuf.IFeatureSet|null|undefined} overridableFeatures + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.overridableFeatures = null; + + /** + * FeatureSetEditionDefault fixedFeatures. + * @member {google.protobuf.IFeatureSet|null|undefined} fixedFeatures * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault * @instance */ - FeatureSetEditionDefault.prototype.features = null; + FeatureSetEditionDefault.prototype.fixedFeatures = null; /** * Creates a new FeatureSetEditionDefault instance using the specified properties. @@ -85351,10 +86984,12 @@ FeatureSetEditionDefault.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + if (message.overridableFeatures != null && Object.hasOwnProperty.call(message, "overridableFeatures")) + $root.google.protobuf.FeatureSet.encode(message.overridableFeatures, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.fixedFeatures != null && Object.hasOwnProperty.call(message, "fixedFeatures")) + $root.google.protobuf.FeatureSet.encode(message.fixedFeatures, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -85395,8 +87030,12 @@ message.edition = reader.int32(); break; } - case 2: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + case 4: { + message.overridableFeatures = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 5: { + message.fixedFeatures = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); break; } default: @@ -85439,6 +87078,7 @@ default: return "edition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -85451,10 +87091,15 @@ case 2147483647: break; } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (message.overridableFeatures != null && message.hasOwnProperty("overridableFeatures")) { + var error = $root.google.protobuf.FeatureSet.verify(message.overridableFeatures); + if (error) + return "overridableFeatures." + error; + } + if (message.fixedFeatures != null && message.hasOwnProperty("fixedFeatures")) { + var error = $root.google.protobuf.FeatureSet.verify(message.fixedFeatures); if (error) - return "features." + error; + return "fixedFeatures." + error; } return null; }; @@ -85482,6 +87127,10 @@ case 0: message.edition = 0; break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; case "EDITION_PROTO2": case 998: message.edition = 998; @@ -85523,10 +87172,15 @@ message.edition = 2147483647; break; } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + if (object.overridableFeatures != null) { + if (typeof object.overridableFeatures !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.overridableFeatures: object expected"); + message.overridableFeatures = $root.google.protobuf.FeatureSet.fromObject(object.overridableFeatures); + } + if (object.fixedFeatures != null) { + if (typeof object.fixedFeatures !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fixedFeatures: object expected"); + message.fixedFeatures = $root.google.protobuf.FeatureSet.fromObject(object.fixedFeatures); } return message; }; @@ -85545,13 +87199,16 @@ options = {}; var object = {}; if (options.defaults) { - object.features = null; object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.overridableFeatures = null; + object.fixedFeatures = null; } - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); if (message.edition != null && message.hasOwnProperty("edition")) object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + if (message.overridableFeatures != null && message.hasOwnProperty("overridableFeatures")) + object.overridableFeatures = $root.google.protobuf.FeatureSet.toObject(message.overridableFeatures, options); + if (message.fixedFeatures != null && message.hasOwnProperty("fixedFeatures")) + object.fixedFeatures = $root.google.protobuf.FeatureSet.toObject(message.fixedFeatures, options); return object; }; @@ -86766,6 +88423,22 @@ return GeneratedCodeInfo; })(); + /** + * SymbolVisibility enum. + * @name google.protobuf.SymbolVisibility + * @enum {number} + * @property {number} VISIBILITY_UNSET=0 VISIBILITY_UNSET value + * @property {number} VISIBILITY_LOCAL=1 VISIBILITY_LOCAL value + * @property {number} VISIBILITY_EXPORT=2 VISIBILITY_EXPORT value + */ + protobuf.SymbolVisibility = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VISIBILITY_UNSET"] = 0; + values[valuesById[1] = "VISIBILITY_LOCAL"] = 1; + values[valuesById[2] = "VISIBILITY_EXPORT"] = 2; + return values; + })(); + protobuf.Duration = (function() { /** diff --git a/packages/google-ads-admanager/protos/protos.json b/packages/google-ads-admanager/protos/protos.json index 1c5f84623d5..0526f0415b7 100644 --- a/packages/google-ads-admanager/protos/protos.json +++ b/packages/google-ads-admanager/protos/protos.json @@ -8370,8 +8370,7 @@ "java_multiple_files": true, "java_outer_classname": "LaunchStageProto", "java_package": "com.google.api", - "objc_class_prefix": "GAPI", - "cc_enable_arenas": true + "objc_class_prefix": "GAPI" }, "nested": { "fieldBehavior": { @@ -8594,6 +8593,10 @@ "rule": "repeated", "type": "ClientLibraryDestination", "id": 2 + }, + "selectiveGapicGeneration": { + "type": "SelectiveGapicGeneration", + "id": 3 } } }, @@ -8734,6 +8737,28 @@ "common": { "type": "CommonLanguageSettings", "id": 1 + }, + "experimentalFeatures": { + "type": "ExperimentalFeatures", + "id": 2 + } + }, + "nested": { + "ExperimentalFeatures": { + "fields": { + "restAsyncIoEnabled": { + "type": "bool", + "id": 1 + }, + "protobufPythonicTypesEnabled": { + "type": "bool", + "id": 2 + }, + "unversionedPackageDisabled": { + "type": "bool", + "id": 3 + } + } } } }, @@ -8791,6 +8816,11 @@ "common": { "type": "CommonLanguageSettings", "id": 1 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 } } }, @@ -8852,6 +8882,19 @@ "PACKAGE_MANAGER": 20 } }, + "SelectiveGapicGeneration": { + "fields": { + "methods": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "generateOmittedAsInternal": { + "type": "bool", + "id": 2 + } + } + }, "LaunchStage": { "values": { "LAUNCH_STAGE_UNSPECIFIED": 0, @@ -8885,12 +8928,19 @@ "type": "FileDescriptorProto", "id": 1 } - } + }, + "extensions": [ + [ + 536000000, + 536000000 + ] + ] }, "Edition": { "edition": "proto2", "values": { "EDITION_UNKNOWN": 0, + "EDITION_LEGACY": 900, "EDITION_PROTO2": 998, "EDITION_PROTO3": 999, "EDITION_2023": 1000, @@ -8929,6 +8979,11 @@ "type": "int32", "id": 11 }, + "optionDependency": { + "rule": "repeated", + "type": "string", + "id": 15 + }, "messageType": { "rule": "repeated", "type": "DescriptorProto", @@ -9017,6 +9072,10 @@ "rule": "repeated", "type": "string", "id": 10 + }, + "visibility": { + "type": "SymbolVisibility", + "id": 11 } }, "nested": { @@ -9242,6 +9301,10 @@ "rule": "repeated", "type": "string", "id": 5 + }, + "visibility": { + "type": "SymbolVisibility", + "id": 6 } }, "nested": { @@ -9456,6 +9519,7 @@ 42, 42 ], + "php_generic_services", [ 38, 38 @@ -9591,7 +9655,8 @@ "type": "bool", "id": 10, "options": { - "default": false + "default": false, + "deprecated": true } }, "debugRedact": { @@ -9619,6 +9684,10 @@ "type": "FeatureSet", "id": 21 }, + "featureSupport": { + "type": "FeatureSupport", + "id": 22 + }, "uninterpretedOption": { "rule": "repeated", "type": "UninterpretedOption", @@ -9688,6 +9757,26 @@ "id": 2 } } + }, + "FeatureSupport": { + "fields": { + "editionIntroduced": { + "type": "Edition", + "id": 1 + }, + "editionDeprecated": { + "type": "Edition", + "id": 2 + }, + "deprecationWarning": { + "type": "string", + "id": 3 + }, + "editionRemoved": { + "type": "Edition", + "id": 4 + } + } } } }, @@ -9776,6 +9865,10 @@ "default": false } }, + "featureSupport": { + "type": "FieldOptions.FeatureSupport", + "id": 4 + }, "uninterpretedOption": { "rule": "repeated", "type": "UninterpretedOption", @@ -9918,6 +10011,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_2023", "edition_defaults.value": "EXPLICIT" } @@ -9928,6 +10022,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "OPEN" } @@ -9938,6 +10033,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "PACKED" } @@ -9948,6 +10044,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "VERIFY" } @@ -9958,7 +10055,8 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO2", + "feature_support.edition_introduced": "EDITION_2023", + "edition_defaults.edition": "EDITION_LEGACY", "edition_defaults.value": "LENGTH_PREFIXED" } }, @@ -9968,27 +10066,38 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "ALLOW" } + }, + "enforceNamingStyle": { + "type": "EnforceNamingStyle", + "id": 7, + "options": { + "retention": "RETENTION_SOURCE", + "targets": "TARGET_TYPE_METHOD", + "feature_support.edition_introduced": "EDITION_2024", + "edition_defaults.edition": "EDITION_2024", + "edition_defaults.value": "STYLE2024" + } + }, + "defaultSymbolVisibility": { + "type": "VisibilityFeature.DefaultSymbolVisibility", + "id": 8, + "options": { + "retention": "RETENTION_SOURCE", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2024", + "edition_defaults.edition": "EDITION_2024", + "edition_defaults.value": "EXPORT_TOP_LEVEL" + } } }, "extensions": [ [ 1000, - 1000 - ], - [ - 1001, - 1001 - ], - [ - 1002, - 1002 - ], - [ - 9990, - 9990 + 9994 ], [ 9995, @@ -10033,7 +10142,13 @@ "UTF8_VALIDATION_UNKNOWN": 0, "VERIFY": 2, "NONE": 3 - } + }, + "reserved": [ + [ + 1, + 1 + ] + ] }, "MessageEncoding": { "values": { @@ -10048,6 +10163,33 @@ "ALLOW": 1, "LEGACY_BEST_EFFORT": 2 } + }, + "EnforceNamingStyle": { + "values": { + "ENFORCE_NAMING_STYLE_UNKNOWN": 0, + "STYLE2024": 1, + "STYLE_LEGACY": 2 + } + }, + "VisibilityFeature": { + "fields": {}, + "reserved": [ + [ + 1, + 536870911 + ] + ], + "nested": { + "DefaultSymbolVisibility": { + "values": { + "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN": 0, + "EXPORT_ALL": 1, + "EXPORT_TOP_LEVEL": 2, + "LOCAL_ALL": 3, + "STRICT": 4 + } + } + } } } }, @@ -10075,11 +10217,26 @@ "type": "Edition", "id": 3 }, - "features": { + "overridableFeatures": { "type": "FeatureSet", - "id": 2 + "id": 4 + }, + "fixedFeatures": { + "type": "FeatureSet", + "id": 5 } - } + }, + "reserved": [ + [ + 1, + 1 + ], + [ + 2, + 2 + ], + "features" + ] } } }, @@ -10092,6 +10249,12 @@ "id": 1 } }, + "extensions": [ + [ + 536000000, + 536000000 + ] + ], "nested": { "Location": { "fields": { @@ -10177,6 +10340,14 @@ } } }, + "SymbolVisibility": { + "edition": "proto2", + "values": { + "VISIBILITY_UNSET": 0, + "VISIBILITY_LOCAL": 1, + "VISIBILITY_EXPORT": 2 + } + }, "Duration": { "fields": { "seconds": { @@ -10311,6 +10482,7 @@ "java_multiple_files": true, "java_outer_classname": "OperationsProto", "java_package": "com.google.longrunning", + "objc_class_prefix": "GLRUN", "php_namespace": "Google\\LongRunning" }, "nested": { diff --git a/packages/google-ai-generativelanguage/CHANGELOG.md b/packages/google-ai-generativelanguage/CHANGELOG.md index 93233287b24..c6fb5c15d9d 100644 --- a/packages/google-ai-generativelanguage/CHANGELOG.md +++ b/packages/google-ai-generativelanguage/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [3.4.0](https://github.com/googleapis/google-cloud-node/compare/generativelanguage-v3.3.0...generativelanguage-v3.4.0) (2025-08-27) + + +### Features + +* [generativelanguage] add support for thought_signature ([#6616](https://github.com/googleapis/google-cloud-node/issues/6616)) ([20de60f](https://github.com/googleapis/google-cloud-node/commit/20de60f347970414459bcd168425903f11851993)) + ## [3.3.0](https://github.com/googleapis/google-cloud-node/compare/generativelanguage-v3.2.0...generativelanguage-v3.3.0) (2025-07-09) diff --git a/packages/google-ai-generativelanguage/package.json b/packages/google-ai-generativelanguage/package.json index 5b56de7ef15..c11dcbd5bbc 100644 --- a/packages/google-ai-generativelanguage/package.json +++ b/packages/google-ai-generativelanguage/package.json @@ -1,6 +1,6 @@ { "name": "@google-ai/generativelanguage", - "version": "3.3.0", + "version": "3.4.0", "description": "Generative Language API client for Node.js", "repository": { "type": "git", diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1/content.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1/content.proto index d6661c5706e..48abc6c4a52 100644 --- a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1/content.proto +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1/content.proto @@ -17,6 +17,7 @@ syntax = "proto3"; package google.ai.generativelanguage.v1; import "google/api/field_behavior.proto"; +import "google/protobuf/duration.proto"; option go_package = "cloud.google.com/go/ai/generativelanguage/apiv1/generativelanguagepb;generativelanguagepb"; option java_multiple_files = true; @@ -76,6 +77,13 @@ message Part { // Inline media bytes. Blob inline_data = 3; } + + // Controls extra preprocessing of data. + oneof metadata { + // Optional. Video metadata. The metadata should only be specified while the + // video data is presented in inline_data or file_data. + VideoMetadata video_metadata = 14 [(google.api.field_behavior) = OPTIONAL]; + } } // Raw media bytes. @@ -95,6 +103,21 @@ message Blob { bytes data = 2; } +// Metadata describes the input video content. +message VideoMetadata { + // Optional. The start offset of the video. + google.protobuf.Duration start_offset = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The end offset of the video. + google.protobuf.Duration end_offset = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The frame rate of the video sent to the model. If not specified, + // the default value will be 1.0. The fps range is (0.0, 24.0]. + double fps = 3 [(google.api.field_behavior) = OPTIONAL]; +} + // Represents token counting info for a single modality. message ModalityTokenCount { // The modality associated with this token count. diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1/generative_service.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1/generative_service.proto index 9715445399b..f3058679ca7 100644 --- a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1/generative_service.proto +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1/generative_service.proto @@ -394,6 +394,9 @@ message GenerateContentResponse { // Output only. The model version used to generate the response. string model_version = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. response_id is used to identify each response. + string response_id = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; } // A response candidate generated from the model. @@ -438,6 +441,9 @@ message Candidate { // Token generation stopped because generated images contain safety // violations. IMAGE_SAFETY = 11; + + // Model generated a tool call but no tools were enabled in the request. + UNEXPECTED_TOOL_CALL = 12; } // Output only. Index of the candidate in the list of response candidates. @@ -482,6 +488,37 @@ message Candidate { // Output only. Log-likelihood scores for the response tokens and top tokens LogprobsResult logprobs_result = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Metadata related to url context retrieval tool. + UrlContextMetadata url_context_metadata = 13 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Metadata related to url context retrieval tool. +message UrlContextMetadata { + // List of url context. + repeated UrlMetadata url_metadata = 1; +} + +// Context of the a single url retrieval. +message UrlMetadata { + // Status of the url retrieval. + enum UrlRetrievalStatus { + // Default value. This value is unused. + URL_RETRIEVAL_STATUS_UNSPECIFIED = 0; + + // Url retrieval is successful. + URL_RETRIEVAL_STATUS_SUCCESS = 1; + + // Url retrieval is failed due to error. + URL_RETRIEVAL_STATUS_ERROR = 2; + } + + // Retrieved url by the tool. + string retrieved_url = 1; + + // Status of the url retrieval. + UrlRetrievalStatus url_retrieval_status = 2; } // Logprobs Result diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1/model.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1/model.proto index 9a8d7a65985..8bc1e404f8e 100644 --- a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1/model.proto +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1/model.proto @@ -106,4 +106,7 @@ message Model { // If empty, indicates the model doesn't use top-k sampling, and `top_k` isn't // allowed as a generation parameter. optional int32 top_k = 11; + + // Whether the model supports thinking. + bool thinking = 15; } diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/cached_content.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/cached_content.proto index 0e4df0e8087..d5ddaa48357 100644 --- a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/cached_content.proto +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/cached_content.proto @@ -57,11 +57,11 @@ message CachedContent { [(google.api.field_behavior) = INPUT_ONLY]; } - // Optional. Identifier. The resource name referring to the cached content. + // Output only. Identifier. The resource name referring to the cached content. // Format: `cachedContents/{id}` optional string name = 1 [ (google.api.field_behavior) = IDENTIFIER, - (google.api.field_behavior) = OPTIONAL + (google.api.field_behavior) = OUTPUT_ONLY ]; // Optional. Immutable. The user-generated meaningful display name of the diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/content.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/content.proto index a0d223537cd..f030a76fa78 100644 --- a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/content.proto +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/content.proto @@ -17,7 +17,9 @@ syntax = "proto3"; package google.ai.generativelanguage.v1beta; import "google/api/field_behavior.proto"; +import "google/protobuf/duration.proto"; import "google/protobuf/struct.proto"; +import "google/type/interval.proto"; option go_package = "cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb;generativelanguagepb"; option java_multiple_files = true; @@ -49,8 +51,6 @@ enum Type { OBJECT = 6; // Null type. - // HACK: We use this to handle optional parameters, which users are specifying - // optional things by using a OneOf with a second type of NULL. NULL = 7; } @@ -128,8 +128,19 @@ message Part { CodeExecutionResult code_execution_result = 10; } + // Controls extra preprocessing of data. + oneof metadata { + // Optional. Video metadata. The metadata should only be specified while the + // video data is presented in inline_data or file_data. + VideoMetadata video_metadata = 14 [(google.api.field_behavior) = OPTIONAL]; + } + // Optional. Indicates if the part is thought from the model. bool thought = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An opaque signature for the thought so it can be reused in + // subsequent requests. + bytes thought_signature = 13 [(google.api.field_behavior) = OPTIONAL]; } // Raw media bytes. @@ -158,6 +169,21 @@ message FileData { string file_uri = 2 [(google.api.field_behavior) = REQUIRED]; } +// Metadata describes the input video content. +message VideoMetadata { + // Optional. The start offset of the video. + google.protobuf.Duration start_offset = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The end offset of the video. + google.protobuf.Duration end_offset = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The frame rate of the video sent to the model. If not specified, + // the default value will be 1.0. The fps range is (0.0, 24.0]. + double fps = 3 [(google.api.field_behavior) = OPTIONAL]; +} + // Code generated by the model that is meant to be executed, and the result // returned to the model. // @@ -219,7 +245,13 @@ message CodeExecutionResult { message Tool { // GoogleSearch tool type. // Tool to support Google Search in Model. Powered by Google. - message GoogleSearch {} + message GoogleSearch { + // Optional. Filter search results to a specific time range. + // If customers set a start time, they must set an end time (and vice + // versa). + google.type.Interval time_range_filter = 2 + [(google.api.field_behavior) = OPTIONAL]; + } // Optional. A list of `FunctionDeclarations` available to the model that can // be used for function calling. @@ -247,8 +279,14 @@ message Tool { // Optional. GoogleSearch tool type. // Tool to support Google Search in Model. Powered by Google. GoogleSearch google_search = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Tool to support URL context retrieval. + UrlContext url_context = 8 [(google.api.field_behavior) = OPTIONAL]; } +// Tool to support URL context retrieval. +message UrlContext {} + // Tool to retrieve public web data for grounding, powered by Google. message GoogleSearchRetrieval { // Specifies the dynamic retrieval configuration for the given source. @@ -337,6 +375,22 @@ message FunctionCallingConfig { // FunctionDeclaration is a representation of a block of code that can be used // as a `Tool` by the model and executed by the client. message FunctionDeclaration { + // Defines the function behavior. Defaults to `BLOCKING`. + enum Behavior { + // This value is unused. + UNSPECIFIED = 0; + + // If set, the system will wait to receive the function response before + // continuing the conversation. + BLOCKING = 1; + + // If set, the system will not wait to receive the function response. + // Instead, it will attempt to handle function responses as they become + // available while maintaining the conversation between the user and the + // model. + NON_BLOCKING = 2; + } + // 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. @@ -351,10 +405,42 @@ message FunctionDeclaration { // for the parameter. optional Schema parameters = 3 [(google.api.field_behavior) = OPTIONAL]; + // Optional. Describes the parameters to the function in JSON Schema format. + // The schema must describe an object where the properties are the parameters + // to the function. For example: + // + // ``` + // { + // "type": "object", + // "properties": { + // "name": { "type": "string" }, + // "age": { "type": "integer" } + // }, + // "additionalProperties": false, + // "required": ["name", "age"], + // "propertyOrdering": ["name", "age"] + // } + // ``` + // + // This field is mutually exclusive with `parameters`. + optional google.protobuf.Value parameters_json_schema = 6 + [(google.api.field_behavior) = OPTIONAL]; + // Optional. Describes the output from this function in JSON Schema format. // Reflects the Open API 3.03 Response Object. The Schema defines the type // used for the response value of the function. optional Schema response = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Describes the output from this function in JSON Schema format. + // The value specified by the schema is the response value of the function. + // + // This field is mutually exclusive with `response`. + optional google.protobuf.Value response_json_schema = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the function Behavior. + // Currently only supported by the BidiGenerateContent method. + Behavior behavior = 5 [(google.api.field_behavior) = OPTIONAL]; } // A predicted `FunctionCall` returned from the model that contains @@ -381,6 +467,24 @@ message FunctionCall { // the model. This should contain the result of a`FunctionCall` made // based on model prediction. message FunctionResponse { + // Specifies how the response should be scheduled in the conversation. + enum Scheduling { + // This value is unused. + SCHEDULING_UNSPECIFIED = 0; + + // Only add the result to the conversation context, do not interrupt or + // trigger generation. + SILENT = 1; + + // Add the result to the conversation context, and prompt to generate output + // without interrupting ongoing generation. + WHEN_IDLE = 2; + + // Add the result to the conversation context, interrupt ongoing generation + // and prompt to generate output. + INTERRUPT = 3; + } + // Optional. The id of the function call this response is for. Populated by // the client to match the corresponding function call `id`. string id = 3 [(google.api.field_behavior) = OPTIONAL]; @@ -392,6 +496,21 @@ message FunctionResponse { // Required. The function response in JSON object format. google.protobuf.Struct response = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Signals that function call continues, and more responses will be + // returned, turning the function call into a generator. + // Is only applicable to NON_BLOCKING function calls, is ignored otherwise. + // If set to false, future responses will not be considered. + // It is allowed to return empty `response` with `will_continue=False` to + // signal that the function call is finished. This may still trigger the model + // generation. To avoid triggering the generation and finish the function + // call, additionally set `scheduling` to `SILENT`. + bool will_continue = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies how the response should be scheduled in the + // conversation. Only applicable to NON_BLOCKING function calls, is ignored + // otherwise. Defaults to WHEN_IDLE. + optional Scheduling scheduling = 5 [(google.api.field_behavior) = OPTIONAL]; } // The `Schema` object allows the definition of input and output data types. @@ -439,6 +558,12 @@ message Schema { // Optional. Required properties of Type.OBJECT. repeated string required = 8 [(google.api.field_behavior) = OPTIONAL]; + // Optional. Minimum number of the properties for Type.OBJECT. + int64 min_properties = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Maximum number of the properties for Type.OBJECT. + int64 max_properties = 10 [(google.api.field_behavior) = OPTIONAL]; + // Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER // Minimum value of the Type.INTEGER and Type.NUMBER optional double minimum = 11 [(google.api.field_behavior) = OPTIONAL]; @@ -446,6 +571,21 @@ message Schema { // Optional. Maximum value of the Type.INTEGER and Type.NUMBER optional double maximum = 12 [(google.api.field_behavior) = OPTIONAL]; + // Optional. SCHEMA FIELDS FOR TYPE STRING + // Minimum length of the Type.STRING + int64 min_length = 13 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Maximum length of the Type.STRING + int64 max_length = 14 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Pattern of the Type.STRING to restrict a string to a regular + // expression. + string pattern = 15 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Example of the object. Will only populated when the object is the + // root. + google.protobuf.Value example = 16 [(google.api.field_behavior) = OPTIONAL]; + // Optional. The value should be validated against any (one or more) of the // subschemas in the list. repeated Schema any_of = 18 [(google.api.field_behavior) = OPTIONAL]; diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/file.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/file.proto index 68c343d719f..86adf2c4d5f 100644 --- a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/file.proto +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/file.proto @@ -66,7 +66,7 @@ message File { // Metadata for the File. oneof metadata { // Output only. Metadata for a video. - VideoMetadata video_metadata = 12 + VideoFileMetadata video_metadata = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; } @@ -124,7 +124,7 @@ message File { } // Metadata for a video `File`. -message VideoMetadata { +message VideoFileMetadata { // Duration of the video. google.protobuf.Duration video_duration = 1; } diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/generative_service.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/generative_service.proto index 564ecee999b..c38d5e4bf16 100644 --- a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/generative_service.proto +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/generative_service.proto @@ -25,6 +25,7 @@ import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/protobuf/duration.proto"; +import "google/protobuf/struct.proto"; option go_package = "cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb;generativelanguagepb"; option java_multiple_files = true; @@ -255,11 +256,33 @@ message VoiceConfig { } } +// The configuration for a single speaker in a multi speaker setup. +message SpeakerVoiceConfig { + // Required. The name of the speaker to use. Should be the same as in the + // prompt. + string speaker = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The configuration for the voice to use. + VoiceConfig voice_config = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The configuration for the multi-speaker setup. +message MultiSpeakerVoiceConfig { + // Required. All the enabled speaker voices. + repeated SpeakerVoiceConfig speaker_voice_configs = 2 + [(google.api.field_behavior) = REQUIRED]; +} + // The speech generation config. message SpeechConfig { // The configuration in case of single-voice output. VoiceConfig voice_config = 1; + // Optional. The configuration for the multi-speaker setup. + // It is mutually exclusive with the voice_config field. + MultiSpeakerVoiceConfig multi_speaker_voice_config = 3 + [(google.api.field_behavior) = OPTIONAL]; + // Optional. Language code (in BCP 47 format, e.g. "en-US") for speech // synthesis. // @@ -391,6 +414,45 @@ message GenerationConfig { // guide](https://ai.google.dev/gemini-api/docs/json-mode) for more details. Schema response_schema = 14 [(google.api.field_behavior) = OPTIONAL]; + // Optional. Output schema of the generated response. This is an alternative + // to `response_schema` that accepts [JSON Schema](https://json-schema.org/). + // + // If set, `response_schema` must be omitted, but `response_mime_type` is + // required. + // + // While the full JSON Schema may be sent, not all features are supported. + // Specifically, only the following properties are supported: + // + // - `$id` + // - `$defs` + // - `$ref` + // - `$anchor` + // - `type` + // - `format` + // - `title` + // - `description` + // - `enum` (for strings and numbers) + // - `items` + // - `prefixItems` + // - `minItems` + // - `maxItems` + // - `minimum` + // - `maximum` + // - `anyOf` + // - `oneOf` (interpreted the same as `anyOf`) + // - `properties` + // - `additionalProperties` + // - `required` + // + // The non-standard `propertyOrdering` property may also be set. + // + // Cyclic references are unrolled to a limited degree and, as such, may only + // be used within non-required properties. (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. + google.protobuf.Value response_json_schema = 24 + [(google.api.field_behavior) = OPTIONAL]; + // Optional. Presence penalty applied to the next token's logprobs if the // token has already been seen in the response. // @@ -590,6 +652,9 @@ message GenerateContentResponse { // Output only. The model version used to generate the response. string model_version = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. response_id is used to identify each response. + string response_id = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; } // A response candidate generated from the model. @@ -634,6 +699,9 @@ message Candidate { // Token generation stopped because generated images contain safety // violations. IMAGE_SAFETY = 11; + + // Model generated a tool call but no tools were enabled in the request. + UNEXPECTED_TOOL_CALL = 12; } // Output only. Index of the candidate in the list of response candidates. @@ -685,6 +753,37 @@ message Candidate { // Output only. Log-likelihood scores for the response tokens and top tokens LogprobsResult logprobs_result = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Metadata related to url context retrieval tool. + UrlContextMetadata url_context_metadata = 13 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Metadata related to url context retrieval tool. +message UrlContextMetadata { + // List of url context. + repeated UrlMetadata url_metadata = 1; +} + +// Context of the a single url retrieval. +message UrlMetadata { + // Status of the url retrieval. + enum UrlRetrievalStatus { + // Default value. This value is unused. + URL_RETRIEVAL_STATUS_UNSPECIFIED = 0; + + // Url retrieval is successful. + URL_RETRIEVAL_STATUS_SUCCESS = 1; + + // Url retrieval is failed due to error. + URL_RETRIEVAL_STATUS_ERROR = 2; + } + + // Retrieved url by the tool. + string retrieved_url = 1; + + // Status of the url retrieval. + UrlRetrievalStatus url_retrieval_status = 2; } // Logprobs Result @@ -859,7 +958,7 @@ message GenerateAnswerRequest { // Unspecified answer style. ANSWER_STYLE_UNSPECIFIED = 0; - // Succint but abstract style. + // Succinct but abstract style. ABSTRACTIVE = 1; // Very brief and extractive style. @@ -1306,6 +1405,7 @@ message BidiGenerateContentSetup { // - `response_mime_type` // - `logprobs` // - `response_schema` + // - `response_json_schema` // - `stop_sequence` // - `routing_config` // - `audio_timestamp` @@ -1343,6 +1443,11 @@ message BidiGenerateContentSetup { ContextWindowCompressionConfig context_window_compression = 8 [(google.api.field_behavior) = OPTIONAL]; + // Optional. If set, enables transcription of voice input. The transcription + // aligns with the input audio language, if configured. + AudioTranscriptionConfig input_audio_transcription = 10 + [(google.api.field_behavior) = OPTIONAL]; + // Optional. If set, enables transcription of the model's audio output. The // transcription aligns with the language code specified for the output // audio, if configured. @@ -1503,12 +1608,23 @@ message BidiGenerateContentServerContent { GroundingMetadata grounding_metadata = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. Output audio transcription. The transcription is sent + // Output only. Input audio transcription. The transcription is sent // independently of the other server messages and there is no guaranteed - // ordering, in particular not between `server_content` and this - // `output_transcription`. + // ordering. + BidiGenerateContentTranscription input_transcription = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Output audio transcription. These transcriptions are part of + // the Generation output of the server. The last output transcription of this + // turn is sent before either `generation_complete` or `interrupted`, which in + // turn are followed by `turn_complete`. There is no guaranteed exact ordering + // between transcriptions and other `model_turn` output but the server tries + // to send the transcripts close to the corresponding audio output. BidiGenerateContentTranscription output_transcription = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + UrlContextMetadata url_context_metadata = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; } // Request for the client to execute the `function_calls` and return the diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/model.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/model.proto index 8c3f496be3b..087061763eb 100644 --- a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/model.proto +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/model.proto @@ -106,4 +106,7 @@ message Model { // If empty, indicates the model doesn't use top-k sampling, and `top_k` isn't // allowed as a generation parameter. optional int32 top_k = 11; + + // Whether the model supports thinking. + bool thinking = 15; } diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/retriever_service.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/retriever_service.proto index c019967a4a5..e435612c838 100644 --- a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/retriever_service.proto +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/retriever_service.proto @@ -349,6 +349,9 @@ message RelevantChunk { // `Chunk` associated with the query. Chunk chunk = 2; + + // `Document` associated with the chunk. + Document document = 3; } // Request to create a `Document`. diff --git a/packages/google-ai-generativelanguage/protos/protos.d.ts b/packages/google-ai-generativelanguage/protos/protos.d.ts index 4e53a36f9ec..21775bc995b 100644 --- a/packages/google-ai-generativelanguage/protos/protos.d.ts +++ b/packages/google-ai-generativelanguage/protos/protos.d.ts @@ -359,6 +359,9 @@ export namespace google { /** Part inlineData */ inlineData?: (google.ai.generativelanguage.v1.IBlob|null); + + /** Part videoMetadata */ + videoMetadata?: (google.ai.generativelanguage.v1.IVideoMetadata|null); } /** Represents a Part. */ @@ -376,9 +379,15 @@ export namespace google { /** Part inlineData. */ public inlineData?: (google.ai.generativelanguage.v1.IBlob|null); + /** Part videoMetadata. */ + public videoMetadata?: (google.ai.generativelanguage.v1.IVideoMetadata|null); + /** Part data. */ public data?: ("text"|"inlineData"); + /** Part metadata. */ + public metadata?: "videoMetadata"; + /** * Creates a new Part instance using the specified properties. * @param [properties] Properties to set @@ -560,6 +569,115 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a VideoMetadata. */ + interface IVideoMetadata { + + /** VideoMetadata startOffset */ + startOffset?: (google.protobuf.IDuration|null); + + /** VideoMetadata endOffset */ + endOffset?: (google.protobuf.IDuration|null); + + /** VideoMetadata fps */ + fps?: (number|null); + } + + /** Represents a VideoMetadata. */ + class VideoMetadata implements IVideoMetadata { + + /** + * Constructs a new VideoMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1.IVideoMetadata); + + /** VideoMetadata startOffset. */ + public startOffset?: (google.protobuf.IDuration|null); + + /** VideoMetadata endOffset. */ + public endOffset?: (google.protobuf.IDuration|null); + + /** VideoMetadata fps. */ + public fps: number; + + /** + * Creates a new VideoMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns VideoMetadata instance + */ + public static create(properties?: google.ai.generativelanguage.v1.IVideoMetadata): google.ai.generativelanguage.v1.VideoMetadata; + + /** + * Encodes the specified VideoMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1.VideoMetadata.verify|verify} messages. + * @param message VideoMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1.IVideoMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VideoMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1.VideoMetadata.verify|verify} messages. + * @param message VideoMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1.IVideoMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VideoMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VideoMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1.VideoMetadata; + + /** + * Decodes a VideoMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VideoMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1.VideoMetadata; + + /** + * Verifies a VideoMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VideoMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VideoMetadata + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1.VideoMetadata; + + /** + * Creates a plain object from a VideoMetadata message. Also converts values to other types if specified. + * @param message VideoMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1.VideoMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VideoMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VideoMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a ModalityTokenCount. */ interface IModalityTokenCount { @@ -1097,6 +1215,9 @@ export namespace google { /** GenerateContentResponse modelVersion */ modelVersion?: (string|null); + + /** GenerateContentResponse responseId */ + responseId?: (string|null); } /** Represents a GenerateContentResponse. */ @@ -1120,6 +1241,9 @@ export namespace google { /** GenerateContentResponse modelVersion. */ public modelVersion: string; + /** GenerateContentResponse responseId. */ + public responseId: string; + /** * Creates a new GenerateContentResponse instance using the specified properties. * @param [properties] Properties to set @@ -1491,6 +1615,9 @@ export namespace google { /** Candidate logprobsResult */ logprobsResult?: (google.ai.generativelanguage.v1.ILogprobsResult|null); + + /** Candidate urlContextMetadata */ + urlContextMetadata?: (google.ai.generativelanguage.v1.IUrlContextMetadata|null); } /** Represents a Candidate. */ @@ -1529,6 +1656,9 @@ export namespace google { /** Candidate logprobsResult. */ public logprobsResult?: (google.ai.generativelanguage.v1.ILogprobsResult|null); + /** Candidate urlContextMetadata. */ + public urlContextMetadata?: (google.ai.generativelanguage.v1.IUrlContextMetadata|null); + /** * Creates a new Candidate instance using the specified properties. * @param [properties] Properties to set @@ -1622,7 +1752,218 @@ export namespace google { PROHIBITED_CONTENT = 8, SPII = 9, MALFORMED_FUNCTION_CALL = 10, - IMAGE_SAFETY = 11 + IMAGE_SAFETY = 11, + UNEXPECTED_TOOL_CALL = 12 + } + } + + /** Properties of an UrlContextMetadata. */ + interface IUrlContextMetadata { + + /** UrlContextMetadata urlMetadata */ + urlMetadata?: (google.ai.generativelanguage.v1.IUrlMetadata[]|null); + } + + /** Represents an UrlContextMetadata. */ + class UrlContextMetadata implements IUrlContextMetadata { + + /** + * Constructs a new UrlContextMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1.IUrlContextMetadata); + + /** UrlContextMetadata urlMetadata. */ + public urlMetadata: google.ai.generativelanguage.v1.IUrlMetadata[]; + + /** + * Creates a new UrlContextMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UrlContextMetadata instance + */ + public static create(properties?: google.ai.generativelanguage.v1.IUrlContextMetadata): google.ai.generativelanguage.v1.UrlContextMetadata; + + /** + * Encodes the specified UrlContextMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1.UrlContextMetadata.verify|verify} messages. + * @param message UrlContextMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1.IUrlContextMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UrlContextMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1.UrlContextMetadata.verify|verify} messages. + * @param message UrlContextMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1.IUrlContextMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UrlContextMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UrlContextMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1.UrlContextMetadata; + + /** + * Decodes an UrlContextMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UrlContextMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1.UrlContextMetadata; + + /** + * Verifies an UrlContextMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UrlContextMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UrlContextMetadata + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1.UrlContextMetadata; + + /** + * Creates a plain object from an UrlContextMetadata message. Also converts values to other types if specified. + * @param message UrlContextMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1.UrlContextMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UrlContextMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UrlContextMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UrlMetadata. */ + interface IUrlMetadata { + + /** UrlMetadata retrievedUrl */ + retrievedUrl?: (string|null); + + /** UrlMetadata urlRetrievalStatus */ + urlRetrievalStatus?: (google.ai.generativelanguage.v1.UrlMetadata.UrlRetrievalStatus|keyof typeof google.ai.generativelanguage.v1.UrlMetadata.UrlRetrievalStatus|null); + } + + /** Represents an UrlMetadata. */ + class UrlMetadata implements IUrlMetadata { + + /** + * Constructs a new UrlMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1.IUrlMetadata); + + /** UrlMetadata retrievedUrl. */ + public retrievedUrl: string; + + /** UrlMetadata urlRetrievalStatus. */ + public urlRetrievalStatus: (google.ai.generativelanguage.v1.UrlMetadata.UrlRetrievalStatus|keyof typeof google.ai.generativelanguage.v1.UrlMetadata.UrlRetrievalStatus); + + /** + * Creates a new UrlMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UrlMetadata instance + */ + public static create(properties?: google.ai.generativelanguage.v1.IUrlMetadata): google.ai.generativelanguage.v1.UrlMetadata; + + /** + * Encodes the specified UrlMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1.UrlMetadata.verify|verify} messages. + * @param message UrlMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1.IUrlMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UrlMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1.UrlMetadata.verify|verify} messages. + * @param message UrlMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1.IUrlMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UrlMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UrlMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1.UrlMetadata; + + /** + * Decodes an UrlMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UrlMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1.UrlMetadata; + + /** + * Verifies an UrlMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UrlMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UrlMetadata + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1.UrlMetadata; + + /** + * Creates a plain object from an UrlMetadata message. Also converts values to other types if specified. + * @param message UrlMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1.UrlMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UrlMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UrlMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UrlMetadata { + + /** UrlRetrievalStatus enum. */ + enum UrlRetrievalStatus { + URL_RETRIEVAL_STATUS_UNSPECIFIED = 0, + URL_RETRIEVAL_STATUS_SUCCESS = 1, + URL_RETRIEVAL_STATUS_ERROR = 2 } } @@ -3713,6 +4054,9 @@ export namespace google { /** Model topK */ topK?: (number|null); + + /** Model thinking */ + thinking?: (boolean|null); } /** Represents a Model. */ @@ -3760,6 +4104,9 @@ export namespace google { /** Model topK. */ public topK?: (number|null); + /** Model thinking. */ + public thinking: boolean; + /** * Creates a new Model instance using the specified properties. * @param [properties] Properties to set @@ -25463,8 +25810,14 @@ export namespace google { /** Part codeExecutionResult */ codeExecutionResult?: (google.ai.generativelanguage.v1beta.ICodeExecutionResult|null); + /** Part videoMetadata */ + videoMetadata?: (google.ai.generativelanguage.v1beta.IVideoMetadata|null); + /** Part thought */ thought?: (boolean|null); + + /** Part thoughtSignature */ + thoughtSignature?: (Uint8Array|Buffer|string|null); } /** Represents a Part. */ @@ -25497,12 +25850,21 @@ export namespace google { /** Part codeExecutionResult. */ public codeExecutionResult?: (google.ai.generativelanguage.v1beta.ICodeExecutionResult|null); + /** Part videoMetadata. */ + public videoMetadata?: (google.ai.generativelanguage.v1beta.IVideoMetadata|null); + /** Part thought. */ public thought: boolean; + /** Part thoughtSignature. */ + public thoughtSignature: (Uint8Array|Buffer|string); + /** Part data. */ public data?: ("text"|"inlineData"|"functionCall"|"functionResponse"|"fileData"|"executableCode"|"codeExecutionResult"); + /** Part metadata. */ + public metadata?: "videoMetadata"; + /** * Creates a new Part instance using the specified properties. * @param [properties] Properties to set @@ -25787,6 +26149,115 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a VideoMetadata. */ + interface IVideoMetadata { + + /** VideoMetadata startOffset */ + startOffset?: (google.protobuf.IDuration|null); + + /** VideoMetadata endOffset */ + endOffset?: (google.protobuf.IDuration|null); + + /** VideoMetadata fps */ + fps?: (number|null); + } + + /** Represents a VideoMetadata. */ + class VideoMetadata implements IVideoMetadata { + + /** + * Constructs a new VideoMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta.IVideoMetadata); + + /** VideoMetadata startOffset. */ + public startOffset?: (google.protobuf.IDuration|null); + + /** VideoMetadata endOffset. */ + public endOffset?: (google.protobuf.IDuration|null); + + /** VideoMetadata fps. */ + public fps: number; + + /** + * Creates a new VideoMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns VideoMetadata instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta.IVideoMetadata): google.ai.generativelanguage.v1beta.VideoMetadata; + + /** + * Encodes the specified VideoMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1beta.VideoMetadata.verify|verify} messages. + * @param message VideoMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta.IVideoMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VideoMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.VideoMetadata.verify|verify} messages. + * @param message VideoMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta.IVideoMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VideoMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VideoMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1beta.VideoMetadata; + + /** + * Decodes a VideoMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VideoMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1beta.VideoMetadata; + + /** + * Verifies a VideoMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VideoMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VideoMetadata + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta.VideoMetadata; + + /** + * Creates a plain object from a VideoMetadata message. Also converts values to other types if specified. + * @param message VideoMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta.VideoMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VideoMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VideoMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of an ExecutableCode. */ interface IExecutableCode { @@ -26027,6 +26498,9 @@ export namespace google { /** Tool googleSearch */ googleSearch?: (google.ai.generativelanguage.v1beta.Tool.IGoogleSearch|null); + + /** Tool urlContext */ + urlContext?: (google.ai.generativelanguage.v1beta.IUrlContext|null); } /** Represents a Tool. */ @@ -26050,6 +26524,9 @@ export namespace google { /** Tool googleSearch. */ public googleSearch?: (google.ai.generativelanguage.v1beta.Tool.IGoogleSearch|null); + /** Tool urlContext. */ + public urlContext?: (google.ai.generativelanguage.v1beta.IUrlContext|null); + /** * Creates a new Tool instance using the specified properties. * @param [properties] Properties to set @@ -26132,6 +26609,9 @@ export namespace google { /** Properties of a GoogleSearch. */ interface IGoogleSearch { + + /** GoogleSearch timeRangeFilter */ + timeRangeFilter?: (google.type.IInterval|null); } /** Represents a GoogleSearch. */ @@ -26143,6 +26623,9 @@ export namespace google { */ constructor(properties?: google.ai.generativelanguage.v1beta.Tool.IGoogleSearch); + /** GoogleSearch timeRangeFilter. */ + public timeRangeFilter?: (google.type.IInterval|null); + /** * Creates a new GoogleSearch instance using the specified properties. * @param [properties] Properties to set @@ -26222,6 +26705,97 @@ export namespace google { } } + /** Properties of an UrlContext. */ + interface IUrlContext { + } + + /** Represents an UrlContext. */ + class UrlContext implements IUrlContext { + + /** + * Constructs a new UrlContext. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta.IUrlContext); + + /** + * Creates a new UrlContext instance using the specified properties. + * @param [properties] Properties to set + * @returns UrlContext instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta.IUrlContext): google.ai.generativelanguage.v1beta.UrlContext; + + /** + * Encodes the specified UrlContext message. Does not implicitly {@link google.ai.generativelanguage.v1beta.UrlContext.verify|verify} messages. + * @param message UrlContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta.IUrlContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UrlContext message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.UrlContext.verify|verify} messages. + * @param message UrlContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta.IUrlContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UrlContext message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UrlContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1beta.UrlContext; + + /** + * Decodes an UrlContext message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UrlContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1beta.UrlContext; + + /** + * Verifies an UrlContext message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UrlContext message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UrlContext + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta.UrlContext; + + /** + * Creates a plain object from an UrlContext message. Also converts values to other types if specified. + * @param message UrlContext + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta.UrlContext, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UrlContext to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UrlContext + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a GoogleSearchRetrieval. */ interface IGoogleSearchRetrieval { @@ -26746,8 +27320,17 @@ export namespace google { /** FunctionDeclaration parameters */ parameters?: (google.ai.generativelanguage.v1beta.ISchema|null); + /** FunctionDeclaration parametersJsonSchema */ + parametersJsonSchema?: (google.protobuf.IValue|null); + /** FunctionDeclaration response */ response?: (google.ai.generativelanguage.v1beta.ISchema|null); + + /** FunctionDeclaration responseJsonSchema */ + responseJsonSchema?: (google.protobuf.IValue|null); + + /** FunctionDeclaration behavior */ + behavior?: (google.ai.generativelanguage.v1beta.FunctionDeclaration.Behavior|keyof typeof google.ai.generativelanguage.v1beta.FunctionDeclaration.Behavior|null); } /** Represents a FunctionDeclaration. */ @@ -26768,9 +27351,18 @@ export namespace google { /** FunctionDeclaration parameters. */ public parameters?: (google.ai.generativelanguage.v1beta.ISchema|null); + /** FunctionDeclaration parametersJsonSchema. */ + public parametersJsonSchema?: (google.protobuf.IValue|null); + /** FunctionDeclaration response. */ public response?: (google.ai.generativelanguage.v1beta.ISchema|null); + /** FunctionDeclaration responseJsonSchema. */ + public responseJsonSchema?: (google.protobuf.IValue|null); + + /** FunctionDeclaration behavior. */ + public behavior: (google.ai.generativelanguage.v1beta.FunctionDeclaration.Behavior|keyof typeof google.ai.generativelanguage.v1beta.FunctionDeclaration.Behavior); + /** * Creates a new FunctionDeclaration instance using the specified properties. * @param [properties] Properties to set @@ -26849,6 +27441,16 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + namespace FunctionDeclaration { + + /** Behavior enum. */ + enum Behavior { + UNSPECIFIED = 0, + BLOCKING = 1, + NON_BLOCKING = 2 + } + } + /** Properties of a FunctionCall. */ interface IFunctionCall { @@ -26969,6 +27571,12 @@ export namespace google { /** FunctionResponse response */ response?: (google.protobuf.IStruct|null); + + /** FunctionResponse willContinue */ + willContinue?: (boolean|null); + + /** FunctionResponse scheduling */ + scheduling?: (google.ai.generativelanguage.v1beta.FunctionResponse.Scheduling|keyof typeof google.ai.generativelanguage.v1beta.FunctionResponse.Scheduling|null); } /** Represents a FunctionResponse. */ @@ -26989,6 +27597,12 @@ export namespace google { /** FunctionResponse response. */ public response?: (google.protobuf.IStruct|null); + /** FunctionResponse willContinue. */ + public willContinue: boolean; + + /** FunctionResponse scheduling. */ + public scheduling?: (google.ai.generativelanguage.v1beta.FunctionResponse.Scheduling|keyof typeof google.ai.generativelanguage.v1beta.FunctionResponse.Scheduling|null); + /** * Creates a new FunctionResponse instance using the specified properties. * @param [properties] Properties to set @@ -27067,6 +27681,17 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + namespace FunctionResponse { + + /** Scheduling enum. */ + enum Scheduling { + SCHEDULING_UNSPECIFIED = 0, + SILENT = 1, + WHEN_IDLE = 2, + INTERRUPT = 3 + } + } + /** Properties of a Schema. */ interface ISchema { @@ -27103,12 +27728,30 @@ export namespace google { /** Schema required */ required?: (string[]|null); + /** Schema minProperties */ + minProperties?: (number|Long|string|null); + + /** Schema maxProperties */ + maxProperties?: (number|Long|string|null); + /** Schema minimum */ minimum?: (number|null); /** Schema maximum */ maximum?: (number|null); + /** Schema minLength */ + minLength?: (number|Long|string|null); + + /** Schema maxLength */ + maxLength?: (number|Long|string|null); + + /** Schema pattern */ + pattern?: (string|null); + + /** Schema example */ + example?: (google.protobuf.IValue|null); + /** Schema anyOf */ anyOf?: (google.ai.generativelanguage.v1beta.ISchema[]|null); @@ -27161,12 +27804,30 @@ export namespace google { /** Schema required. */ public required: string[]; + /** Schema minProperties. */ + public minProperties: (number|Long|string); + + /** Schema maxProperties. */ + public maxProperties: (number|Long|string); + /** Schema minimum. */ public minimum?: (number|null); /** Schema maximum. */ public maximum?: (number|null); + /** Schema minLength. */ + public minLength: (number|Long|string); + + /** Schema maxLength. */ + public maxLength: (number|Long|string); + + /** Schema pattern. */ + public pattern: string; + + /** Schema example. */ + public example?: (google.protobuf.IValue|null); + /** Schema anyOf. */ public anyOf: google.ai.generativelanguage.v1beta.ISchema[]; @@ -29065,7 +29726,7 @@ export namespace google { interface IFile { /** File videoMetadata */ - videoMetadata?: (google.ai.generativelanguage.v1beta.IVideoMetadata|null); + videoMetadata?: (google.ai.generativelanguage.v1beta.IVideoFileMetadata|null); /** File name */ name?: (string|null); @@ -29117,7 +29778,7 @@ export namespace google { constructor(properties?: google.ai.generativelanguage.v1beta.IFile); /** File videoMetadata. */ - public videoMetadata?: (google.ai.generativelanguage.v1beta.IVideoMetadata|null); + public videoMetadata?: (google.ai.generativelanguage.v1beta.IVideoFileMetadata|null); /** File name. */ public name: string; @@ -29257,97 +29918,97 @@ export namespace google { } } - /** Properties of a VideoMetadata. */ - interface IVideoMetadata { + /** Properties of a VideoFileMetadata. */ + interface IVideoFileMetadata { - /** VideoMetadata videoDuration */ + /** VideoFileMetadata videoDuration */ videoDuration?: (google.protobuf.IDuration|null); } - /** Represents a VideoMetadata. */ - class VideoMetadata implements IVideoMetadata { + /** Represents a VideoFileMetadata. */ + class VideoFileMetadata implements IVideoFileMetadata { /** - * Constructs a new VideoMetadata. + * Constructs a new VideoFileMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.ai.generativelanguage.v1beta.IVideoMetadata); + constructor(properties?: google.ai.generativelanguage.v1beta.IVideoFileMetadata); - /** VideoMetadata videoDuration. */ + /** VideoFileMetadata videoDuration. */ public videoDuration?: (google.protobuf.IDuration|null); /** - * Creates a new VideoMetadata instance using the specified properties. + * Creates a new VideoFileMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns VideoMetadata instance + * @returns VideoFileMetadata instance */ - public static create(properties?: google.ai.generativelanguage.v1beta.IVideoMetadata): google.ai.generativelanguage.v1beta.VideoMetadata; + public static create(properties?: google.ai.generativelanguage.v1beta.IVideoFileMetadata): google.ai.generativelanguage.v1beta.VideoFileMetadata; /** - * Encodes the specified VideoMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1beta.VideoMetadata.verify|verify} messages. - * @param message VideoMetadata message or plain object to encode + * Encodes the specified VideoFileMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1beta.VideoFileMetadata.verify|verify} messages. + * @param message VideoFileMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.ai.generativelanguage.v1beta.IVideoMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.ai.generativelanguage.v1beta.IVideoFileMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified VideoMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.VideoMetadata.verify|verify} messages. - * @param message VideoMetadata message or plain object to encode + * Encodes the specified VideoFileMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.VideoFileMetadata.verify|verify} messages. + * @param message VideoFileMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.ai.generativelanguage.v1beta.IVideoMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.ai.generativelanguage.v1beta.IVideoFileMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a VideoMetadata message from the specified reader or buffer. + * Decodes a VideoFileMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns VideoMetadata + * @returns VideoFileMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1beta.VideoMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1beta.VideoFileMetadata; /** - * Decodes a VideoMetadata message from the specified reader or buffer, length delimited. + * Decodes a VideoFileMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns VideoMetadata + * @returns VideoFileMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1beta.VideoMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1beta.VideoFileMetadata; /** - * Verifies a VideoMetadata message. + * Verifies a VideoFileMetadata message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a VideoMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a VideoFileMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns VideoMetadata + * @returns VideoFileMetadata */ - public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta.VideoMetadata; + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta.VideoFileMetadata; /** - * Creates a plain object from a VideoMetadata message. Also converts values to other types if specified. - * @param message VideoMetadata + * Creates a plain object from a VideoFileMetadata message. Also converts values to other types if specified. + * @param message VideoFileMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.ai.generativelanguage.v1beta.VideoMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.ai.generativelanguage.v1beta.VideoFileMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this VideoMetadata to JSON. + * Converts this VideoFileMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for VideoMetadata + * Gets the default type url for VideoFileMetadata * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ @@ -30785,12 +31446,215 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a SpeakerVoiceConfig. */ + interface ISpeakerVoiceConfig { + + /** SpeakerVoiceConfig speaker */ + speaker?: (string|null); + + /** SpeakerVoiceConfig voiceConfig */ + voiceConfig?: (google.ai.generativelanguage.v1beta.IVoiceConfig|null); + } + + /** Represents a SpeakerVoiceConfig. */ + class SpeakerVoiceConfig implements ISpeakerVoiceConfig { + + /** + * Constructs a new SpeakerVoiceConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta.ISpeakerVoiceConfig); + + /** SpeakerVoiceConfig speaker. */ + public speaker: string; + + /** SpeakerVoiceConfig voiceConfig. */ + public voiceConfig?: (google.ai.generativelanguage.v1beta.IVoiceConfig|null); + + /** + * Creates a new SpeakerVoiceConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SpeakerVoiceConfig instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta.ISpeakerVoiceConfig): google.ai.generativelanguage.v1beta.SpeakerVoiceConfig; + + /** + * Encodes the specified SpeakerVoiceConfig message. Does not implicitly {@link google.ai.generativelanguage.v1beta.SpeakerVoiceConfig.verify|verify} messages. + * @param message SpeakerVoiceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta.ISpeakerVoiceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpeakerVoiceConfig message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.SpeakerVoiceConfig.verify|verify} messages. + * @param message SpeakerVoiceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta.ISpeakerVoiceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpeakerVoiceConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpeakerVoiceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1beta.SpeakerVoiceConfig; + + /** + * Decodes a SpeakerVoiceConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpeakerVoiceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1beta.SpeakerVoiceConfig; + + /** + * Verifies a SpeakerVoiceConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpeakerVoiceConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpeakerVoiceConfig + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta.SpeakerVoiceConfig; + + /** + * Creates a plain object from a SpeakerVoiceConfig message. Also converts values to other types if specified. + * @param message SpeakerVoiceConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta.SpeakerVoiceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpeakerVoiceConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpeakerVoiceConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MultiSpeakerVoiceConfig. */ + interface IMultiSpeakerVoiceConfig { + + /** MultiSpeakerVoiceConfig speakerVoiceConfigs */ + speakerVoiceConfigs?: (google.ai.generativelanguage.v1beta.ISpeakerVoiceConfig[]|null); + } + + /** Represents a MultiSpeakerVoiceConfig. */ + class MultiSpeakerVoiceConfig implements IMultiSpeakerVoiceConfig { + + /** + * Constructs a new MultiSpeakerVoiceConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta.IMultiSpeakerVoiceConfig); + + /** MultiSpeakerVoiceConfig speakerVoiceConfigs. */ + public speakerVoiceConfigs: google.ai.generativelanguage.v1beta.ISpeakerVoiceConfig[]; + + /** + * Creates a new MultiSpeakerVoiceConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns MultiSpeakerVoiceConfig instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta.IMultiSpeakerVoiceConfig): google.ai.generativelanguage.v1beta.MultiSpeakerVoiceConfig; + + /** + * Encodes the specified MultiSpeakerVoiceConfig message. Does not implicitly {@link google.ai.generativelanguage.v1beta.MultiSpeakerVoiceConfig.verify|verify} messages. + * @param message MultiSpeakerVoiceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta.IMultiSpeakerVoiceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MultiSpeakerVoiceConfig message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.MultiSpeakerVoiceConfig.verify|verify} messages. + * @param message MultiSpeakerVoiceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta.IMultiSpeakerVoiceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MultiSpeakerVoiceConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MultiSpeakerVoiceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1beta.MultiSpeakerVoiceConfig; + + /** + * Decodes a MultiSpeakerVoiceConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MultiSpeakerVoiceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1beta.MultiSpeakerVoiceConfig; + + /** + * Verifies a MultiSpeakerVoiceConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MultiSpeakerVoiceConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MultiSpeakerVoiceConfig + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta.MultiSpeakerVoiceConfig; + + /** + * Creates a plain object from a MultiSpeakerVoiceConfig message. Also converts values to other types if specified. + * @param message MultiSpeakerVoiceConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta.MultiSpeakerVoiceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MultiSpeakerVoiceConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MultiSpeakerVoiceConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a SpeechConfig. */ interface ISpeechConfig { /** SpeechConfig voiceConfig */ voiceConfig?: (google.ai.generativelanguage.v1beta.IVoiceConfig|null); + /** SpeechConfig multiSpeakerVoiceConfig */ + multiSpeakerVoiceConfig?: (google.ai.generativelanguage.v1beta.IMultiSpeakerVoiceConfig|null); + /** SpeechConfig languageCode */ languageCode?: (string|null); } @@ -30807,6 +31671,9 @@ export namespace google { /** SpeechConfig voiceConfig. */ public voiceConfig?: (google.ai.generativelanguage.v1beta.IVoiceConfig|null); + /** SpeechConfig multiSpeakerVoiceConfig. */ + public multiSpeakerVoiceConfig?: (google.ai.generativelanguage.v1beta.IMultiSpeakerVoiceConfig|null); + /** SpeechConfig languageCode. */ public languageCode: string; @@ -31021,6 +31888,9 @@ export namespace google { /** GenerationConfig responseSchema */ responseSchema?: (google.ai.generativelanguage.v1beta.ISchema|null); + /** GenerationConfig responseJsonSchema */ + responseJsonSchema?: (google.protobuf.IValue|null); + /** GenerationConfig presencePenalty */ presencePenalty?: (number|null); @@ -31085,6 +31955,9 @@ export namespace google { /** GenerationConfig responseSchema. */ public responseSchema?: (google.ai.generativelanguage.v1beta.ISchema|null); + /** GenerationConfig responseJsonSchema. */ + public responseJsonSchema?: (google.protobuf.IValue|null); + /** GenerationConfig presencePenalty. */ public presencePenalty?: (number|null); @@ -31344,6 +32217,9 @@ export namespace google { /** GenerateContentResponse modelVersion */ modelVersion?: (string|null); + + /** GenerateContentResponse responseId */ + responseId?: (string|null); } /** Represents a GenerateContentResponse. */ @@ -31367,6 +32243,9 @@ export namespace google { /** GenerateContentResponse modelVersion. */ public modelVersion: string; + /** GenerateContentResponse responseId. */ + public responseId: string; + /** * Creates a new GenerateContentResponse instance using the specified properties. * @param [properties] Properties to set @@ -31747,6 +32626,9 @@ export namespace google { /** Candidate logprobsResult */ logprobsResult?: (google.ai.generativelanguage.v1beta.ILogprobsResult|null); + + /** Candidate urlContextMetadata */ + urlContextMetadata?: (google.ai.generativelanguage.v1beta.IUrlContextMetadata|null); } /** Represents a Candidate. */ @@ -31788,6 +32670,9 @@ export namespace google { /** Candidate logprobsResult. */ public logprobsResult?: (google.ai.generativelanguage.v1beta.ILogprobsResult|null); + /** Candidate urlContextMetadata. */ + public urlContextMetadata?: (google.ai.generativelanguage.v1beta.IUrlContextMetadata|null); + /** * Creates a new Candidate instance using the specified properties. * @param [properties] Properties to set @@ -31881,7 +32766,218 @@ export namespace google { PROHIBITED_CONTENT = 8, SPII = 9, MALFORMED_FUNCTION_CALL = 10, - IMAGE_SAFETY = 11 + IMAGE_SAFETY = 11, + UNEXPECTED_TOOL_CALL = 12 + } + } + + /** Properties of an UrlContextMetadata. */ + interface IUrlContextMetadata { + + /** UrlContextMetadata urlMetadata */ + urlMetadata?: (google.ai.generativelanguage.v1beta.IUrlMetadata[]|null); + } + + /** Represents an UrlContextMetadata. */ + class UrlContextMetadata implements IUrlContextMetadata { + + /** + * Constructs a new UrlContextMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta.IUrlContextMetadata); + + /** UrlContextMetadata urlMetadata. */ + public urlMetadata: google.ai.generativelanguage.v1beta.IUrlMetadata[]; + + /** + * Creates a new UrlContextMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UrlContextMetadata instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta.IUrlContextMetadata): google.ai.generativelanguage.v1beta.UrlContextMetadata; + + /** + * Encodes the specified UrlContextMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1beta.UrlContextMetadata.verify|verify} messages. + * @param message UrlContextMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta.IUrlContextMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UrlContextMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.UrlContextMetadata.verify|verify} messages. + * @param message UrlContextMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta.IUrlContextMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UrlContextMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UrlContextMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1beta.UrlContextMetadata; + + /** + * Decodes an UrlContextMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UrlContextMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1beta.UrlContextMetadata; + + /** + * Verifies an UrlContextMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UrlContextMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UrlContextMetadata + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta.UrlContextMetadata; + + /** + * Creates a plain object from an UrlContextMetadata message. Also converts values to other types if specified. + * @param message UrlContextMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta.UrlContextMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UrlContextMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UrlContextMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UrlMetadata. */ + interface IUrlMetadata { + + /** UrlMetadata retrievedUrl */ + retrievedUrl?: (string|null); + + /** UrlMetadata urlRetrievalStatus */ + urlRetrievalStatus?: (google.ai.generativelanguage.v1beta.UrlMetadata.UrlRetrievalStatus|keyof typeof google.ai.generativelanguage.v1beta.UrlMetadata.UrlRetrievalStatus|null); + } + + /** Represents an UrlMetadata. */ + class UrlMetadata implements IUrlMetadata { + + /** + * Constructs a new UrlMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta.IUrlMetadata); + + /** UrlMetadata retrievedUrl. */ + public retrievedUrl: string; + + /** UrlMetadata urlRetrievalStatus. */ + public urlRetrievalStatus: (google.ai.generativelanguage.v1beta.UrlMetadata.UrlRetrievalStatus|keyof typeof google.ai.generativelanguage.v1beta.UrlMetadata.UrlRetrievalStatus); + + /** + * Creates a new UrlMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UrlMetadata instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta.IUrlMetadata): google.ai.generativelanguage.v1beta.UrlMetadata; + + /** + * Encodes the specified UrlMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1beta.UrlMetadata.verify|verify} messages. + * @param message UrlMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta.IUrlMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UrlMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.UrlMetadata.verify|verify} messages. + * @param message UrlMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta.IUrlMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UrlMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UrlMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1beta.UrlMetadata; + + /** + * Decodes an UrlMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UrlMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1beta.UrlMetadata; + + /** + * Verifies an UrlMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UrlMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UrlMetadata + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta.UrlMetadata; + + /** + * Creates a plain object from an UrlMetadata message. Also converts values to other types if specified. + * @param message UrlMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta.UrlMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UrlMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UrlMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UrlMetadata { + + /** UrlRetrievalStatus enum. */ + enum UrlRetrievalStatus { + URL_RETRIEVAL_STATUS_UNSPECIFIED = 0, + URL_RETRIEVAL_STATUS_SUCCESS = 1, + URL_RETRIEVAL_STATUS_ERROR = 2 } } @@ -35159,6 +36255,9 @@ export namespace google { /** BidiGenerateContentSetup contextWindowCompression */ contextWindowCompression?: (google.ai.generativelanguage.v1beta.IContextWindowCompressionConfig|null); + /** BidiGenerateContentSetup inputAudioTranscription */ + inputAudioTranscription?: (google.ai.generativelanguage.v1beta.IAudioTranscriptionConfig|null); + /** BidiGenerateContentSetup outputAudioTranscription */ outputAudioTranscription?: (google.ai.generativelanguage.v1beta.IAudioTranscriptionConfig|null); } @@ -35193,6 +36292,9 @@ export namespace google { /** BidiGenerateContentSetup contextWindowCompression. */ public contextWindowCompression?: (google.ai.generativelanguage.v1beta.IContextWindowCompressionConfig|null); + /** BidiGenerateContentSetup inputAudioTranscription. */ + public inputAudioTranscription?: (google.ai.generativelanguage.v1beta.IAudioTranscriptionConfig|null); + /** BidiGenerateContentSetup outputAudioTranscription. */ public outputAudioTranscription?: (google.ai.generativelanguage.v1beta.IAudioTranscriptionConfig|null); @@ -36019,8 +37121,14 @@ export namespace google { /** BidiGenerateContentServerContent groundingMetadata */ groundingMetadata?: (google.ai.generativelanguage.v1beta.IGroundingMetadata|null); + /** BidiGenerateContentServerContent inputTranscription */ + inputTranscription?: (google.ai.generativelanguage.v1beta.IBidiGenerateContentTranscription|null); + /** BidiGenerateContentServerContent outputTranscription */ outputTranscription?: (google.ai.generativelanguage.v1beta.IBidiGenerateContentTranscription|null); + + /** BidiGenerateContentServerContent urlContextMetadata */ + urlContextMetadata?: (google.ai.generativelanguage.v1beta.IUrlContextMetadata|null); } /** Represents a BidiGenerateContentServerContent. */ @@ -36047,9 +37155,15 @@ export namespace google { /** BidiGenerateContentServerContent groundingMetadata. */ public groundingMetadata?: (google.ai.generativelanguage.v1beta.IGroundingMetadata|null); + /** BidiGenerateContentServerContent inputTranscription. */ + public inputTranscription?: (google.ai.generativelanguage.v1beta.IBidiGenerateContentTranscription|null); + /** BidiGenerateContentServerContent outputTranscription. */ public outputTranscription?: (google.ai.generativelanguage.v1beta.IBidiGenerateContentTranscription|null); + /** BidiGenerateContentServerContent urlContextMetadata. */ + public urlContextMetadata?: (google.ai.generativelanguage.v1beta.IUrlContextMetadata|null); + /** * Creates a new BidiGenerateContentServerContent instance using the specified properties. * @param [properties] Properties to set @@ -37864,6 +38978,9 @@ export namespace google { /** Model topK */ topK?: (number|null); + + /** Model thinking */ + thinking?: (boolean|null); } /** Represents a Model. */ @@ -37911,6 +39028,9 @@ export namespace google { /** Model topK. */ public topK?: (number|null); + /** Model thinking. */ + public thinking: boolean; + /** * Creates a new Model instance using the specified properties. * @param [properties] Properties to set @@ -43386,6 +44506,9 @@ export namespace google { /** RelevantChunk chunk */ chunk?: (google.ai.generativelanguage.v1beta.IChunk|null); + + /** RelevantChunk document */ + document?: (google.ai.generativelanguage.v1beta.IDocument|null); } /** Represents a RelevantChunk. */ @@ -43403,6 +44526,9 @@ export namespace google { /** RelevantChunk chunk. */ public chunk?: (google.ai.generativelanguage.v1beta.IChunk|null); + /** RelevantChunk document. */ + public document?: (google.ai.generativelanguage.v1beta.IDocument|null); + /** * Creates a new RelevantChunk instance using the specified properties. * @param [properties] Properties to set @@ -56065,6 +57191,9 @@ export namespace google { /** CommonLanguageSettings destinations */ destinations?: (google.api.ClientLibraryDestination[]|null); + + /** CommonLanguageSettings selectiveGapicGeneration */ + selectiveGapicGeneration?: (google.api.ISelectiveGapicGeneration|null); } /** Represents a CommonLanguageSettings. */ @@ -56082,6 +57211,9 @@ export namespace google { /** CommonLanguageSettings destinations. */ public destinations: google.api.ClientLibraryDestination[]; + /** CommonLanguageSettings selectiveGapicGeneration. */ + public selectiveGapicGeneration?: (google.api.ISelectiveGapicGeneration|null); + /** * Creates a new CommonLanguageSettings instance using the specified properties. * @param [properties] Properties to set @@ -56782,6 +57914,9 @@ export namespace google { /** PythonSettings common */ common?: (google.api.ICommonLanguageSettings|null); + + /** PythonSettings experimentalFeatures */ + experimentalFeatures?: (google.api.PythonSettings.IExperimentalFeatures|null); } /** Represents a PythonSettings. */ @@ -56796,6 +57931,9 @@ export namespace google { /** PythonSettings common. */ public common?: (google.api.ICommonLanguageSettings|null); + /** PythonSettings experimentalFeatures. */ + public experimentalFeatures?: (google.api.PythonSettings.IExperimentalFeatures|null); + /** * Creates a new PythonSettings instance using the specified properties. * @param [properties] Properties to set @@ -56874,6 +58012,118 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + namespace PythonSettings { + + /** Properties of an ExperimentalFeatures. */ + interface IExperimentalFeatures { + + /** ExperimentalFeatures restAsyncIoEnabled */ + restAsyncIoEnabled?: (boolean|null); + + /** ExperimentalFeatures protobufPythonicTypesEnabled */ + protobufPythonicTypesEnabled?: (boolean|null); + + /** ExperimentalFeatures unversionedPackageDisabled */ + unversionedPackageDisabled?: (boolean|null); + } + + /** Represents an ExperimentalFeatures. */ + class ExperimentalFeatures implements IExperimentalFeatures { + + /** + * Constructs a new ExperimentalFeatures. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.PythonSettings.IExperimentalFeatures); + + /** ExperimentalFeatures restAsyncIoEnabled. */ + public restAsyncIoEnabled: boolean; + + /** ExperimentalFeatures protobufPythonicTypesEnabled. */ + public protobufPythonicTypesEnabled: boolean; + + /** ExperimentalFeatures unversionedPackageDisabled. */ + public unversionedPackageDisabled: boolean; + + /** + * Creates a new ExperimentalFeatures instance using the specified properties. + * @param [properties] Properties to set + * @returns ExperimentalFeatures instance + */ + public static create(properties?: google.api.PythonSettings.IExperimentalFeatures): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Encodes the specified ExperimentalFeatures message. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @param message ExperimentalFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.PythonSettings.IExperimentalFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExperimentalFeatures message, length delimited. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @param message ExperimentalFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.PythonSettings.IExperimentalFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Verifies an ExperimentalFeatures message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExperimentalFeatures message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExperimentalFeatures + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Creates a plain object from an ExperimentalFeatures message. Also converts values to other types if specified. + * @param message ExperimentalFeatures + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings.ExperimentalFeatures, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExperimentalFeatures to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExperimentalFeatures + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + /** Properties of a NodeSettings. */ interface INodeSettings { @@ -57200,6 +58450,9 @@ export namespace google { /** GoSettings common */ common?: (google.api.ICommonLanguageSettings|null); + + /** GoSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|null); } /** Represents a GoSettings. */ @@ -57214,6 +58467,9 @@ export namespace google { /** GoSettings common. */ public common?: (google.api.ICommonLanguageSettings|null); + /** GoSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + /** * Creates a new GoSettings instance using the specified properties. * @param [properties] Properties to set @@ -57538,6 +58794,109 @@ export namespace google { PACKAGE_MANAGER = 20 } + /** Properties of a SelectiveGapicGeneration. */ + interface ISelectiveGapicGeneration { + + /** SelectiveGapicGeneration methods */ + methods?: (string[]|null); + + /** SelectiveGapicGeneration generateOmittedAsInternal */ + generateOmittedAsInternal?: (boolean|null); + } + + /** Represents a SelectiveGapicGeneration. */ + class SelectiveGapicGeneration implements ISelectiveGapicGeneration { + + /** + * Constructs a new SelectiveGapicGeneration. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ISelectiveGapicGeneration); + + /** SelectiveGapicGeneration methods. */ + public methods: string[]; + + /** SelectiveGapicGeneration generateOmittedAsInternal. */ + public generateOmittedAsInternal: boolean; + + /** + * Creates a new SelectiveGapicGeneration instance using the specified properties. + * @param [properties] Properties to set + * @returns SelectiveGapicGeneration instance + */ + public static create(properties?: google.api.ISelectiveGapicGeneration): google.api.SelectiveGapicGeneration; + + /** + * Encodes the specified SelectiveGapicGeneration message. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @param message SelectiveGapicGeneration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ISelectiveGapicGeneration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SelectiveGapicGeneration message, length delimited. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @param message SelectiveGapicGeneration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ISelectiveGapicGeneration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.SelectiveGapicGeneration; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.SelectiveGapicGeneration; + + /** + * Verifies a SelectiveGapicGeneration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SelectiveGapicGeneration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SelectiveGapicGeneration + */ + public static fromObject(object: { [k: string]: any }): google.api.SelectiveGapicGeneration; + + /** + * Creates a plain object from a SelectiveGapicGeneration message. Also converts values to other types if specified. + * @param message SelectiveGapicGeneration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.SelectiveGapicGeneration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SelectiveGapicGeneration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SelectiveGapicGeneration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** LaunchStage enum. */ enum LaunchStage { LAUNCH_STAGE_UNSPECIFIED = 0, @@ -57906,6 +59265,7 @@ export namespace google { /** Edition enum. */ enum Edition { EDITION_UNKNOWN = 0, + EDITION_LEGACY = 900, EDITION_PROTO2 = 998, EDITION_PROTO3 = 999, EDITION_2023 = 1000, @@ -57936,6 +59296,9 @@ export namespace google { /** FileDescriptorProto weakDependency */ weakDependency?: (number[]|null); + /** FileDescriptorProto optionDependency */ + optionDependency?: (string[]|null); + /** FileDescriptorProto messageType */ messageType?: (google.protobuf.IDescriptorProto[]|null); @@ -57985,6 +59348,9 @@ export namespace google { /** FileDescriptorProto weakDependency. */ public weakDependency: number[]; + /** FileDescriptorProto optionDependency. */ + public optionDependency: string[]; + /** FileDescriptorProto messageType. */ public messageType: google.protobuf.IDescriptorProto[]; @@ -58119,6 +59485,9 @@ export namespace google { /** DescriptorProto reservedName */ reservedName?: (string[]|null); + + /** DescriptorProto visibility */ + visibility?: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility|null); } /** Represents a DescriptorProto. */ @@ -58160,6 +59529,9 @@ export namespace google { /** DescriptorProto reservedName. */ public reservedName: string[]; + /** DescriptorProto visibility. */ + public visibility: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility); + /** * Creates a new DescriptorProto instance using the specified properties. * @param [properties] Properties to set @@ -59007,6 +60379,9 @@ export namespace google { /** EnumDescriptorProto reservedName */ reservedName?: (string[]|null); + + /** EnumDescriptorProto visibility */ + visibility?: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility|null); } /** Represents an EnumDescriptorProto. */ @@ -59033,6 +60408,9 @@ export namespace google { /** EnumDescriptorProto reservedName. */ public reservedName: string[]; + /** EnumDescriptorProto visibility. */ + public visibility: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility); + /** * Creates a new EnumDescriptorProto instance using the specified properties. * @param [properties] Properties to set @@ -59967,6 +61345,9 @@ export namespace google { /** FieldOptions features */ features?: (google.protobuf.IFeatureSet|null); + /** FieldOptions featureSupport */ + featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** FieldOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); @@ -60022,6 +61403,9 @@ export namespace google { /** FieldOptions features. */ public features?: (google.protobuf.IFeatureSet|null); + /** FieldOptions featureSupport. */ + public featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** FieldOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; @@ -60242,6 +61626,121 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** Properties of a FeatureSupport. */ + interface IFeatureSupport { + + /** FeatureSupport editionIntroduced */ + editionIntroduced?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSupport editionDeprecated */ + editionDeprecated?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSupport deprecationWarning */ + deprecationWarning?: (string|null); + + /** FeatureSupport editionRemoved */ + editionRemoved?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSupport. */ + class FeatureSupport implements IFeatureSupport { + + /** + * Constructs a new FeatureSupport. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IFeatureSupport); + + /** FeatureSupport editionIntroduced. */ + public editionIntroduced: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSupport editionDeprecated. */ + public editionDeprecated: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSupport deprecationWarning. */ + public deprecationWarning: string; + + /** FeatureSupport editionRemoved. */ + public editionRemoved: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSupport instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSupport instance + */ + public static create(properties?: google.protobuf.FieldOptions.IFeatureSupport): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Encodes the specified FeatureSupport message. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @param message FeatureSupport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IFeatureSupport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSupport message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @param message FeatureSupport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IFeatureSupport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Verifies a FeatureSupport message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSupport message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSupport + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Creates a plain object from a FeatureSupport message. Also converts values to other types if specified. + * @param message FeatureSupport + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.FeatureSupport, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSupport to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSupport + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } /** Properties of an OneofOptions. */ @@ -60480,6 +61979,9 @@ export namespace google { /** EnumValueOptions debugRedact */ debugRedact?: (boolean|null); + /** EnumValueOptions featureSupport */ + featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** EnumValueOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); } @@ -60502,6 +62004,9 @@ export namespace google { /** EnumValueOptions debugRedact. */ public debugRedact: boolean; + /** EnumValueOptions featureSupport. */ + public featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** EnumValueOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; @@ -61094,6 +62599,12 @@ export namespace google { /** FeatureSet jsonFormat */ jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); + + /** FeatureSet enforceNamingStyle */ + enforceNamingStyle?: (google.protobuf.FeatureSet.EnforceNamingStyle|keyof typeof google.protobuf.FeatureSet.EnforceNamingStyle|null); + + /** FeatureSet defaultSymbolVisibility */ + defaultSymbolVisibility?: (google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|keyof typeof google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|null); } /** Represents a FeatureSet. */ @@ -61123,6 +62634,12 @@ export namespace google { /** FeatureSet jsonFormat. */ public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); + /** FeatureSet enforceNamingStyle. */ + public enforceNamingStyle: (google.protobuf.FeatureSet.EnforceNamingStyle|keyof typeof google.protobuf.FeatureSet.EnforceNamingStyle); + + /** FeatureSet defaultSymbolVisibility. */ + public defaultSymbolVisibility: (google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|keyof typeof google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility); + /** * Creates a new FeatureSet instance using the specified properties. * @param [properties] Properties to set @@ -61245,6 +62762,116 @@ export namespace google { ALLOW = 1, LEGACY_BEST_EFFORT = 2 } + + /** EnforceNamingStyle enum. */ + enum EnforceNamingStyle { + ENFORCE_NAMING_STYLE_UNKNOWN = 0, + STYLE2024 = 1, + STYLE_LEGACY = 2 + } + + /** Properties of a VisibilityFeature. */ + interface IVisibilityFeature { + } + + /** Represents a VisibilityFeature. */ + class VisibilityFeature implements IVisibilityFeature { + + /** + * Constructs a new VisibilityFeature. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSet.IVisibilityFeature); + + /** + * Creates a new VisibilityFeature instance using the specified properties. + * @param [properties] Properties to set + * @returns VisibilityFeature instance + */ + public static create(properties?: google.protobuf.FeatureSet.IVisibilityFeature): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Encodes the specified VisibilityFeature message. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @param message VisibilityFeature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSet.IVisibilityFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VisibilityFeature message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @param message VisibilityFeature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSet.IVisibilityFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Verifies a VisibilityFeature message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VisibilityFeature message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VisibilityFeature + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Creates a plain object from a VisibilityFeature message. Also converts values to other types if specified. + * @param message VisibilityFeature + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet.VisibilityFeature, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VisibilityFeature to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VisibilityFeature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace VisibilityFeature { + + /** DefaultSymbolVisibility enum. */ + enum DefaultSymbolVisibility { + DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0, + EXPORT_ALL = 1, + EXPORT_TOP_LEVEL = 2, + LOCAL_ALL = 3, + STRICT = 4 + } + } } /** Properties of a FeatureSetDefaults. */ @@ -61364,8 +62991,11 @@ export namespace google { /** FeatureSetEditionDefault edition */ edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - /** FeatureSetEditionDefault features */ - features?: (google.protobuf.IFeatureSet|null); + /** FeatureSetEditionDefault overridableFeatures */ + overridableFeatures?: (google.protobuf.IFeatureSet|null); + + /** FeatureSetEditionDefault fixedFeatures */ + fixedFeatures?: (google.protobuf.IFeatureSet|null); } /** Represents a FeatureSetEditionDefault. */ @@ -61380,8 +63010,11 @@ export namespace google { /** FeatureSetEditionDefault edition. */ public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - /** FeatureSetEditionDefault features. */ - public features?: (google.protobuf.IFeatureSet|null); + /** FeatureSetEditionDefault overridableFeatures. */ + public overridableFeatures?: (google.protobuf.IFeatureSet|null); + + /** FeatureSetEditionDefault fixedFeatures. */ + public fixedFeatures?: (google.protobuf.IFeatureSet|null); /** * Creates a new FeatureSetEditionDefault instance using the specified properties. @@ -61914,6 +63547,13 @@ export namespace google { } } + /** SymbolVisibility enum. */ + enum SymbolVisibility { + VISIBILITY_UNSET = 0, + VISIBILITY_LOCAL = 1, + VISIBILITY_EXPORT = 2 + } + /** Properties of a Duration. */ interface IDuration { @@ -63825,4 +65465,111 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } } + + /** Namespace type. */ + namespace type { + + /** Properties of an Interval. */ + interface IInterval { + + /** Interval startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** Interval endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an Interval. */ + class Interval implements IInterval { + + /** + * Constructs a new Interval. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IInterval); + + /** Interval startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** Interval endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new Interval instance using the specified properties. + * @param [properties] Properties to set + * @returns Interval instance + */ + public static create(properties?: google.type.IInterval): google.type.Interval; + + /** + * Encodes the specified Interval message. Does not implicitly {@link google.type.Interval.verify|verify} messages. + * @param message Interval message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IInterval, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Interval message, length delimited. Does not implicitly {@link google.type.Interval.verify|verify} messages. + * @param message Interval message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IInterval, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Interval message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Interval + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.Interval; + + /** + * Decodes an Interval message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Interval + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.Interval; + + /** + * Verifies an Interval message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Interval message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Interval + */ + public static fromObject(object: { [k: string]: any }): google.type.Interval; + + /** + * Creates a plain object from an Interval message. Also converts values to other types if specified. + * @param message Interval + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.Interval, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Interval to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Interval + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } } diff --git a/packages/google-ai-generativelanguage/protos/protos.js b/packages/google-ai-generativelanguage/protos/protos.js index 4e2ecb1724d..058d6207451 100644 --- a/packages/google-ai-generativelanguage/protos/protos.js +++ b/packages/google-ai-generativelanguage/protos/protos.js @@ -889,6 +889,7 @@ * @interface IPart * @property {string|null} [text] Part text * @property {google.ai.generativelanguage.v1.IBlob|null} [inlineData] Part inlineData + * @property {google.ai.generativelanguage.v1.IVideoMetadata|null} [videoMetadata] Part videoMetadata */ /** @@ -922,6 +923,14 @@ */ Part.prototype.inlineData = null; + /** + * Part videoMetadata. + * @member {google.ai.generativelanguage.v1.IVideoMetadata|null|undefined} videoMetadata + * @memberof google.ai.generativelanguage.v1.Part + * @instance + */ + Part.prototype.videoMetadata = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -936,6 +945,17 @@ set: $util.oneOfSetter($oneOfFields) }); + /** + * Part metadata. + * @member {"videoMetadata"|undefined} metadata + * @memberof google.ai.generativelanguage.v1.Part + * @instance + */ + Object.defineProperty(Part.prototype, "metadata", { + get: $util.oneOfGetter($oneOfFields = ["videoMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * Creates a new Part instance using the specified properties. * @function create @@ -964,6 +984,8 @@ writer.uint32(/* id 2, wireType 2 =*/18).string(message.text); if (message.inlineData != null && Object.hasOwnProperty.call(message, "inlineData")) $root.google.ai.generativelanguage.v1.Blob.encode(message.inlineData, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.videoMetadata != null && Object.hasOwnProperty.call(message, "videoMetadata")) + $root.google.ai.generativelanguage.v1.VideoMetadata.encode(message.videoMetadata, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); return writer; }; @@ -1008,6 +1030,10 @@ message.inlineData = $root.google.ai.generativelanguage.v1.Blob.decode(reader, reader.uint32()); break; } + case 14: { + message.videoMetadata = $root.google.ai.generativelanguage.v1.VideoMetadata.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -1059,6 +1085,14 @@ return "inlineData." + error; } } + if (message.videoMetadata != null && message.hasOwnProperty("videoMetadata")) { + properties.metadata = 1; + { + var error = $root.google.ai.generativelanguage.v1.VideoMetadata.verify(message.videoMetadata); + if (error) + return "videoMetadata." + error; + } + } return null; }; @@ -1081,6 +1115,11 @@ throw TypeError(".google.ai.generativelanguage.v1.Part.inlineData: object expected"); message.inlineData = $root.google.ai.generativelanguage.v1.Blob.fromObject(object.inlineData); } + if (object.videoMetadata != null) { + if (typeof object.videoMetadata !== "object") + throw TypeError(".google.ai.generativelanguage.v1.Part.videoMetadata: object expected"); + message.videoMetadata = $root.google.ai.generativelanguage.v1.VideoMetadata.fromObject(object.videoMetadata); + } return message; }; @@ -1107,6 +1146,11 @@ if (options.oneofs) object.data = "inlineData"; } + if (message.videoMetadata != null && message.hasOwnProperty("videoMetadata")) { + object.videoMetadata = $root.google.ai.generativelanguage.v1.VideoMetadata.toObject(message.videoMetadata, options); + if (options.oneofs) + object.metadata = "videoMetadata"; + } return object; }; @@ -1377,6 +1421,268 @@ return Blob; })(); + v1.VideoMetadata = (function() { + + /** + * Properties of a VideoMetadata. + * @memberof google.ai.generativelanguage.v1 + * @interface IVideoMetadata + * @property {google.protobuf.IDuration|null} [startOffset] VideoMetadata startOffset + * @property {google.protobuf.IDuration|null} [endOffset] VideoMetadata endOffset + * @property {number|null} [fps] VideoMetadata fps + */ + + /** + * Constructs a new VideoMetadata. + * @memberof google.ai.generativelanguage.v1 + * @classdesc Represents a VideoMetadata. + * @implements IVideoMetadata + * @constructor + * @param {google.ai.generativelanguage.v1.IVideoMetadata=} [properties] Properties to set + */ + function VideoMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VideoMetadata startOffset. + * @member {google.protobuf.IDuration|null|undefined} startOffset + * @memberof google.ai.generativelanguage.v1.VideoMetadata + * @instance + */ + VideoMetadata.prototype.startOffset = null; + + /** + * VideoMetadata endOffset. + * @member {google.protobuf.IDuration|null|undefined} endOffset + * @memberof google.ai.generativelanguage.v1.VideoMetadata + * @instance + */ + VideoMetadata.prototype.endOffset = null; + + /** + * VideoMetadata fps. + * @member {number} fps + * @memberof google.ai.generativelanguage.v1.VideoMetadata + * @instance + */ + VideoMetadata.prototype.fps = 0; + + /** + * Creates a new VideoMetadata instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1.VideoMetadata + * @static + * @param {google.ai.generativelanguage.v1.IVideoMetadata=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1.VideoMetadata} VideoMetadata instance + */ + VideoMetadata.create = function create(properties) { + return new VideoMetadata(properties); + }; + + /** + * Encodes the specified VideoMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1.VideoMetadata.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1.VideoMetadata + * @static + * @param {google.ai.generativelanguage.v1.IVideoMetadata} message VideoMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startOffset != null && Object.hasOwnProperty.call(message, "startOffset")) + $root.google.protobuf.Duration.encode(message.startOffset, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endOffset != null && Object.hasOwnProperty.call(message, "endOffset")) + $root.google.protobuf.Duration.encode(message.endOffset, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.fps != null && Object.hasOwnProperty.call(message, "fps")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.fps); + return writer; + }; + + /** + * Encodes the specified VideoMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1.VideoMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1.VideoMetadata + * @static + * @param {google.ai.generativelanguage.v1.IVideoMetadata} message VideoMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VideoMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1.VideoMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1.VideoMetadata} VideoMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1.VideoMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.startOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 3: { + message.fps = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VideoMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1.VideoMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1.VideoMetadata} VideoMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VideoMetadata message. + * @function verify + * @memberof google.ai.generativelanguage.v1.VideoMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VideoMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startOffset != null && message.hasOwnProperty("startOffset")) { + var error = $root.google.protobuf.Duration.verify(message.startOffset); + if (error) + return "startOffset." + error; + } + if (message.endOffset != null && message.hasOwnProperty("endOffset")) { + var error = $root.google.protobuf.Duration.verify(message.endOffset); + if (error) + return "endOffset." + error; + } + if (message.fps != null && message.hasOwnProperty("fps")) + if (typeof message.fps !== "number") + return "fps: number expected"; + return null; + }; + + /** + * Creates a VideoMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1.VideoMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1.VideoMetadata} VideoMetadata + */ + VideoMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1.VideoMetadata) + return object; + var message = new $root.google.ai.generativelanguage.v1.VideoMetadata(); + if (object.startOffset != null) { + if (typeof object.startOffset !== "object") + throw TypeError(".google.ai.generativelanguage.v1.VideoMetadata.startOffset: object expected"); + message.startOffset = $root.google.protobuf.Duration.fromObject(object.startOffset); + } + if (object.endOffset != null) { + if (typeof object.endOffset !== "object") + throw TypeError(".google.ai.generativelanguage.v1.VideoMetadata.endOffset: object expected"); + message.endOffset = $root.google.protobuf.Duration.fromObject(object.endOffset); + } + if (object.fps != null) + message.fps = Number(object.fps); + return message; + }; + + /** + * Creates a plain object from a VideoMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1.VideoMetadata + * @static + * @param {google.ai.generativelanguage.v1.VideoMetadata} message VideoMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VideoMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startOffset = null; + object.endOffset = null; + object.fps = 0; + } + if (message.startOffset != null && message.hasOwnProperty("startOffset")) + object.startOffset = $root.google.protobuf.Duration.toObject(message.startOffset, options); + if (message.endOffset != null && message.hasOwnProperty("endOffset")) + object.endOffset = $root.google.protobuf.Duration.toObject(message.endOffset, options); + if (message.fps != null && message.hasOwnProperty("fps")) + object.fps = options.json && !isFinite(message.fps) ? String(message.fps) : message.fps; + return object; + }; + + /** + * Converts this VideoMetadata to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1.VideoMetadata + * @instance + * @returns {Object.} JSON object + */ + VideoMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VideoMetadata + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1.VideoMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VideoMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1.VideoMetadata"; + }; + + return VideoMetadata; + })(); + v1.ModalityTokenCount = (function() { /** @@ -2809,6 +3115,7 @@ * @property {google.ai.generativelanguage.v1.GenerateContentResponse.IPromptFeedback|null} [promptFeedback] GenerateContentResponse promptFeedback * @property {google.ai.generativelanguage.v1.GenerateContentResponse.IUsageMetadata|null} [usageMetadata] GenerateContentResponse usageMetadata * @property {string|null} [modelVersion] GenerateContentResponse modelVersion + * @property {string|null} [responseId] GenerateContentResponse responseId */ /** @@ -2859,6 +3166,14 @@ */ GenerateContentResponse.prototype.modelVersion = ""; + /** + * GenerateContentResponse responseId. + * @member {string} responseId + * @memberof google.ai.generativelanguage.v1.GenerateContentResponse + * @instance + */ + GenerateContentResponse.prototype.responseId = ""; + /** * Creates a new GenerateContentResponse instance using the specified properties. * @function create @@ -2892,6 +3207,8 @@ $root.google.ai.generativelanguage.v1.GenerateContentResponse.UsageMetadata.encode(message.usageMetadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.modelVersion != null && Object.hasOwnProperty.call(message, "modelVersion")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.modelVersion); + if (message.responseId != null && Object.hasOwnProperty.call(message, "responseId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.responseId); return writer; }; @@ -2946,6 +3263,10 @@ message.modelVersion = reader.string(); break; } + case 5: { + message.responseId = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -3003,6 +3324,9 @@ if (message.modelVersion != null && message.hasOwnProperty("modelVersion")) if (!$util.isString(message.modelVersion)) return "modelVersion: string expected"; + if (message.responseId != null && message.hasOwnProperty("responseId")) + if (!$util.isString(message.responseId)) + return "responseId: string expected"; return null; }; @@ -3040,6 +3364,8 @@ } if (object.modelVersion != null) message.modelVersion = String(object.modelVersion); + if (object.responseId != null) + message.responseId = String(object.responseId); return message; }; @@ -3062,6 +3388,7 @@ object.promptFeedback = null; object.usageMetadata = null; object.modelVersion = ""; + object.responseId = ""; } if (message.candidates && message.candidates.length) { object.candidates = []; @@ -3074,6 +3401,8 @@ object.usageMetadata = $root.google.ai.generativelanguage.v1.GenerateContentResponse.UsageMetadata.toObject(message.usageMetadata, options); if (message.modelVersion != null && message.hasOwnProperty("modelVersion")) object.modelVersion = message.modelVersion; + if (message.responseId != null && message.hasOwnProperty("responseId")) + object.responseId = message.responseId; return object; }; @@ -3908,6 +4237,7 @@ * @property {google.ai.generativelanguage.v1.IGroundingMetadata|null} [groundingMetadata] Candidate groundingMetadata * @property {number|null} [avgLogprobs] Candidate avgLogprobs * @property {google.ai.generativelanguage.v1.ILogprobsResult|null} [logprobsResult] Candidate logprobsResult + * @property {google.ai.generativelanguage.v1.IUrlContextMetadata|null} [urlContextMetadata] Candidate urlContextMetadata */ /** @@ -3998,6 +4328,14 @@ */ Candidate.prototype.logprobsResult = null; + /** + * Candidate urlContextMetadata. + * @member {google.ai.generativelanguage.v1.IUrlContextMetadata|null|undefined} urlContextMetadata + * @memberof google.ai.generativelanguage.v1.Candidate + * @instance + */ + Candidate.prototype.urlContextMetadata = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -4050,6 +4388,8 @@ writer.uint32(/* id 10, wireType 1 =*/81).double(message.avgLogprobs); if (message.logprobsResult != null && Object.hasOwnProperty.call(message, "logprobsResult")) $root.google.ai.generativelanguage.v1.LogprobsResult.encode(message.logprobsResult, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.urlContextMetadata != null && Object.hasOwnProperty.call(message, "urlContextMetadata")) + $root.google.ai.generativelanguage.v1.UrlContextMetadata.encode(message.urlContextMetadata, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); return writer; }; @@ -4124,6 +4464,10 @@ message.logprobsResult = $root.google.ai.generativelanguage.v1.LogprobsResult.decode(reader, reader.uint32()); break; } + case 13: { + message.urlContextMetadata = $root.google.ai.generativelanguage.v1.UrlContextMetadata.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -4186,6 +4530,7 @@ case 9: case 10: case 11: + case 12: break; } if (message.safetyRatings != null && message.hasOwnProperty("safetyRatings")) { @@ -4218,6 +4563,11 @@ if (error) return "logprobsResult." + error; } + if (message.urlContextMetadata != null && message.hasOwnProperty("urlContextMetadata")) { + var error = $root.google.ai.generativelanguage.v1.UrlContextMetadata.verify(message.urlContextMetadata); + if (error) + return "urlContextMetadata." + error; + } return null; }; @@ -4295,6 +4645,10 @@ case 11: message.finishReason = 11; break; + case "UNEXPECTED_TOOL_CALL": + case 12: + message.finishReason = 12; + break; } if (object.safetyRatings) { if (!Array.isArray(object.safetyRatings)) @@ -4325,6 +4679,11 @@ throw TypeError(".google.ai.generativelanguage.v1.Candidate.logprobsResult: object expected"); message.logprobsResult = $root.google.ai.generativelanguage.v1.LogprobsResult.fromObject(object.logprobsResult); } + if (object.urlContextMetadata != null) { + if (typeof object.urlContextMetadata !== "object") + throw TypeError(".google.ai.generativelanguage.v1.Candidate.urlContextMetadata: object expected"); + message.urlContextMetadata = $root.google.ai.generativelanguage.v1.UrlContextMetadata.fromObject(object.urlContextMetadata); + } return message; }; @@ -4351,6 +4710,7 @@ object.groundingMetadata = null; object.avgLogprobs = 0; object.logprobsResult = null; + object.urlContextMetadata = null; } if (message.content != null && message.hasOwnProperty("content")) object.content = $root.google.ai.generativelanguage.v1.Content.toObject(message.content, options); @@ -4376,6 +4736,8 @@ object.avgLogprobs = options.json && !isFinite(message.avgLogprobs) ? String(message.avgLogprobs) : message.avgLogprobs; if (message.logprobsResult != null && message.hasOwnProperty("logprobsResult")) object.logprobsResult = $root.google.ai.generativelanguage.v1.LogprobsResult.toObject(message.logprobsResult, options); + if (message.urlContextMetadata != null && message.hasOwnProperty("urlContextMetadata")) + object.urlContextMetadata = $root.google.ai.generativelanguage.v1.UrlContextMetadata.toObject(message.urlContextMetadata, options); return object; }; @@ -4421,6 +4783,7 @@ * @property {number} SPII=9 SPII value * @property {number} MALFORMED_FUNCTION_CALL=10 MALFORMED_FUNCTION_CALL value * @property {number} IMAGE_SAFETY=11 IMAGE_SAFETY value + * @property {number} UNEXPECTED_TOOL_CALL=12 UNEXPECTED_TOOL_CALL value */ Candidate.FinishReason = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -4436,12 +4799,508 @@ values[valuesById[9] = "SPII"] = 9; values[valuesById[10] = "MALFORMED_FUNCTION_CALL"] = 10; values[valuesById[11] = "IMAGE_SAFETY"] = 11; + values[valuesById[12] = "UNEXPECTED_TOOL_CALL"] = 12; return values; })(); return Candidate; })(); + v1.UrlContextMetadata = (function() { + + /** + * Properties of an UrlContextMetadata. + * @memberof google.ai.generativelanguage.v1 + * @interface IUrlContextMetadata + * @property {Array.|null} [urlMetadata] UrlContextMetadata urlMetadata + */ + + /** + * Constructs a new UrlContextMetadata. + * @memberof google.ai.generativelanguage.v1 + * @classdesc Represents an UrlContextMetadata. + * @implements IUrlContextMetadata + * @constructor + * @param {google.ai.generativelanguage.v1.IUrlContextMetadata=} [properties] Properties to set + */ + function UrlContextMetadata(properties) { + this.urlMetadata = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UrlContextMetadata urlMetadata. + * @member {Array.} urlMetadata + * @memberof google.ai.generativelanguage.v1.UrlContextMetadata + * @instance + */ + UrlContextMetadata.prototype.urlMetadata = $util.emptyArray; + + /** + * Creates a new UrlContextMetadata instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1.UrlContextMetadata + * @static + * @param {google.ai.generativelanguage.v1.IUrlContextMetadata=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1.UrlContextMetadata} UrlContextMetadata instance + */ + UrlContextMetadata.create = function create(properties) { + return new UrlContextMetadata(properties); + }; + + /** + * Encodes the specified UrlContextMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1.UrlContextMetadata.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1.UrlContextMetadata + * @static + * @param {google.ai.generativelanguage.v1.IUrlContextMetadata} message UrlContextMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UrlContextMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.urlMetadata != null && message.urlMetadata.length) + for (var i = 0; i < message.urlMetadata.length; ++i) + $root.google.ai.generativelanguage.v1.UrlMetadata.encode(message.urlMetadata[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UrlContextMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1.UrlContextMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1.UrlContextMetadata + * @static + * @param {google.ai.generativelanguage.v1.IUrlContextMetadata} message UrlContextMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UrlContextMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UrlContextMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1.UrlContextMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1.UrlContextMetadata} UrlContextMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UrlContextMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1.UrlContextMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.urlMetadata && message.urlMetadata.length)) + message.urlMetadata = []; + message.urlMetadata.push($root.google.ai.generativelanguage.v1.UrlMetadata.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UrlContextMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1.UrlContextMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1.UrlContextMetadata} UrlContextMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UrlContextMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UrlContextMetadata message. + * @function verify + * @memberof google.ai.generativelanguage.v1.UrlContextMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UrlContextMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.urlMetadata != null && message.hasOwnProperty("urlMetadata")) { + if (!Array.isArray(message.urlMetadata)) + return "urlMetadata: array expected"; + for (var i = 0; i < message.urlMetadata.length; ++i) { + var error = $root.google.ai.generativelanguage.v1.UrlMetadata.verify(message.urlMetadata[i]); + if (error) + return "urlMetadata." + error; + } + } + return null; + }; + + /** + * Creates an UrlContextMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1.UrlContextMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1.UrlContextMetadata} UrlContextMetadata + */ + UrlContextMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1.UrlContextMetadata) + return object; + var message = new $root.google.ai.generativelanguage.v1.UrlContextMetadata(); + if (object.urlMetadata) { + if (!Array.isArray(object.urlMetadata)) + throw TypeError(".google.ai.generativelanguage.v1.UrlContextMetadata.urlMetadata: array expected"); + message.urlMetadata = []; + for (var i = 0; i < object.urlMetadata.length; ++i) { + if (typeof object.urlMetadata[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1.UrlContextMetadata.urlMetadata: object expected"); + message.urlMetadata[i] = $root.google.ai.generativelanguage.v1.UrlMetadata.fromObject(object.urlMetadata[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an UrlContextMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1.UrlContextMetadata + * @static + * @param {google.ai.generativelanguage.v1.UrlContextMetadata} message UrlContextMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UrlContextMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.urlMetadata = []; + if (message.urlMetadata && message.urlMetadata.length) { + object.urlMetadata = []; + for (var j = 0; j < message.urlMetadata.length; ++j) + object.urlMetadata[j] = $root.google.ai.generativelanguage.v1.UrlMetadata.toObject(message.urlMetadata[j], options); + } + return object; + }; + + /** + * Converts this UrlContextMetadata to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1.UrlContextMetadata + * @instance + * @returns {Object.} JSON object + */ + UrlContextMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UrlContextMetadata + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1.UrlContextMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UrlContextMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1.UrlContextMetadata"; + }; + + return UrlContextMetadata; + })(); + + v1.UrlMetadata = (function() { + + /** + * Properties of an UrlMetadata. + * @memberof google.ai.generativelanguage.v1 + * @interface IUrlMetadata + * @property {string|null} [retrievedUrl] UrlMetadata retrievedUrl + * @property {google.ai.generativelanguage.v1.UrlMetadata.UrlRetrievalStatus|null} [urlRetrievalStatus] UrlMetadata urlRetrievalStatus + */ + + /** + * Constructs a new UrlMetadata. + * @memberof google.ai.generativelanguage.v1 + * @classdesc Represents an UrlMetadata. + * @implements IUrlMetadata + * @constructor + * @param {google.ai.generativelanguage.v1.IUrlMetadata=} [properties] Properties to set + */ + function UrlMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UrlMetadata retrievedUrl. + * @member {string} retrievedUrl + * @memberof google.ai.generativelanguage.v1.UrlMetadata + * @instance + */ + UrlMetadata.prototype.retrievedUrl = ""; + + /** + * UrlMetadata urlRetrievalStatus. + * @member {google.ai.generativelanguage.v1.UrlMetadata.UrlRetrievalStatus} urlRetrievalStatus + * @memberof google.ai.generativelanguage.v1.UrlMetadata + * @instance + */ + UrlMetadata.prototype.urlRetrievalStatus = 0; + + /** + * Creates a new UrlMetadata instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1.UrlMetadata + * @static + * @param {google.ai.generativelanguage.v1.IUrlMetadata=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1.UrlMetadata} UrlMetadata instance + */ + UrlMetadata.create = function create(properties) { + return new UrlMetadata(properties); + }; + + /** + * Encodes the specified UrlMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1.UrlMetadata.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1.UrlMetadata + * @static + * @param {google.ai.generativelanguage.v1.IUrlMetadata} message UrlMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UrlMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.retrievedUrl != null && Object.hasOwnProperty.call(message, "retrievedUrl")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.retrievedUrl); + if (message.urlRetrievalStatus != null && Object.hasOwnProperty.call(message, "urlRetrievalStatus")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.urlRetrievalStatus); + return writer; + }; + + /** + * Encodes the specified UrlMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1.UrlMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1.UrlMetadata + * @static + * @param {google.ai.generativelanguage.v1.IUrlMetadata} message UrlMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UrlMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UrlMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1.UrlMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1.UrlMetadata} UrlMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UrlMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1.UrlMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.retrievedUrl = reader.string(); + break; + } + case 2: { + message.urlRetrievalStatus = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UrlMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1.UrlMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1.UrlMetadata} UrlMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UrlMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UrlMetadata message. + * @function verify + * @memberof google.ai.generativelanguage.v1.UrlMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UrlMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.retrievedUrl != null && message.hasOwnProperty("retrievedUrl")) + if (!$util.isString(message.retrievedUrl)) + return "retrievedUrl: string expected"; + if (message.urlRetrievalStatus != null && message.hasOwnProperty("urlRetrievalStatus")) + switch (message.urlRetrievalStatus) { + default: + return "urlRetrievalStatus: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an UrlMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1.UrlMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1.UrlMetadata} UrlMetadata + */ + UrlMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1.UrlMetadata) + return object; + var message = new $root.google.ai.generativelanguage.v1.UrlMetadata(); + if (object.retrievedUrl != null) + message.retrievedUrl = String(object.retrievedUrl); + switch (object.urlRetrievalStatus) { + default: + if (typeof object.urlRetrievalStatus === "number") { + message.urlRetrievalStatus = object.urlRetrievalStatus; + break; + } + break; + case "URL_RETRIEVAL_STATUS_UNSPECIFIED": + case 0: + message.urlRetrievalStatus = 0; + break; + case "URL_RETRIEVAL_STATUS_SUCCESS": + case 1: + message.urlRetrievalStatus = 1; + break; + case "URL_RETRIEVAL_STATUS_ERROR": + case 2: + message.urlRetrievalStatus = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an UrlMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1.UrlMetadata + * @static + * @param {google.ai.generativelanguage.v1.UrlMetadata} message UrlMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UrlMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.retrievedUrl = ""; + object.urlRetrievalStatus = options.enums === String ? "URL_RETRIEVAL_STATUS_UNSPECIFIED" : 0; + } + if (message.retrievedUrl != null && message.hasOwnProperty("retrievedUrl")) + object.retrievedUrl = message.retrievedUrl; + if (message.urlRetrievalStatus != null && message.hasOwnProperty("urlRetrievalStatus")) + object.urlRetrievalStatus = options.enums === String ? $root.google.ai.generativelanguage.v1.UrlMetadata.UrlRetrievalStatus[message.urlRetrievalStatus] === undefined ? message.urlRetrievalStatus : $root.google.ai.generativelanguage.v1.UrlMetadata.UrlRetrievalStatus[message.urlRetrievalStatus] : message.urlRetrievalStatus; + return object; + }; + + /** + * Converts this UrlMetadata to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1.UrlMetadata + * @instance + * @returns {Object.} JSON object + */ + UrlMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UrlMetadata + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1.UrlMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UrlMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1.UrlMetadata"; + }; + + /** + * UrlRetrievalStatus enum. + * @name google.ai.generativelanguage.v1.UrlMetadata.UrlRetrievalStatus + * @enum {number} + * @property {number} URL_RETRIEVAL_STATUS_UNSPECIFIED=0 URL_RETRIEVAL_STATUS_UNSPECIFIED value + * @property {number} URL_RETRIEVAL_STATUS_SUCCESS=1 URL_RETRIEVAL_STATUS_SUCCESS value + * @property {number} URL_RETRIEVAL_STATUS_ERROR=2 URL_RETRIEVAL_STATUS_ERROR value + */ + UrlMetadata.UrlRetrievalStatus = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "URL_RETRIEVAL_STATUS_UNSPECIFIED"] = 0; + values[valuesById[1] = "URL_RETRIEVAL_STATUS_SUCCESS"] = 1; + values[valuesById[2] = "URL_RETRIEVAL_STATUS_ERROR"] = 2; + return values; + })(); + + return UrlMetadata; + })(); + v1.LogprobsResult = (function() { /** @@ -9799,6 +10658,7 @@ * @property {number|null} [maxTemperature] Model maxTemperature * @property {number|null} [topP] Model topP * @property {number|null} [topK] Model topK + * @property {boolean|null} [thinking] Model thinking */ /** @@ -9913,6 +10773,14 @@ */ Model.prototype.topK = null; + /** + * Model thinking. + * @member {boolean} thinking + * @memberof google.ai.generativelanguage.v1.Model + * @instance + */ + Model.prototype.thinking = false; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -9989,6 +10857,8 @@ writer.uint32(/* id 11, wireType 0 =*/88).int32(message.topK); if (message.maxTemperature != null && Object.hasOwnProperty.call(message, "maxTemperature")) writer.uint32(/* id 13, wireType 5 =*/109).float(message.maxTemperature); + if (message.thinking != null && Object.hasOwnProperty.call(message, "thinking")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.thinking); return writer; }; @@ -10075,6 +10945,10 @@ message.topK = reader.int32(); break; } + case 15: { + message.thinking = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -10159,6 +11033,9 @@ if (!$util.isInteger(message.topK)) return "topK: integer expected"; } + if (message.thinking != null && message.hasOwnProperty("thinking")) + if (typeof message.thinking !== "boolean") + return "thinking: boolean expected"; return null; }; @@ -10203,6 +11080,8 @@ message.topP = Number(object.topP); if (object.topK != null) message.topK = object.topK | 0; + if (object.thinking != null) + message.thinking = Boolean(object.thinking); return message; }; @@ -10229,6 +11108,7 @@ object.description = ""; object.inputTokenLimit = 0; object.outputTokenLimit = 0; + object.thinking = false; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -10269,6 +11149,8 @@ if (options.oneofs) object._maxTemperature = "maxTemperature"; } + if (message.thinking != null && message.hasOwnProperty("thinking")) + object.thinking = message.thinking; return object; }; @@ -62958,7 +63840,9 @@ * @property {google.ai.generativelanguage.v1beta.IFileData|null} [fileData] Part fileData * @property {google.ai.generativelanguage.v1beta.IExecutableCode|null} [executableCode] Part executableCode * @property {google.ai.generativelanguage.v1beta.ICodeExecutionResult|null} [codeExecutionResult] Part codeExecutionResult + * @property {google.ai.generativelanguage.v1beta.IVideoMetadata|null} [videoMetadata] Part videoMetadata * @property {boolean|null} [thought] Part thought + * @property {Uint8Array|null} [thoughtSignature] Part thoughtSignature */ /** @@ -63032,6 +63916,14 @@ */ Part.prototype.codeExecutionResult = null; + /** + * Part videoMetadata. + * @member {google.ai.generativelanguage.v1beta.IVideoMetadata|null|undefined} videoMetadata + * @memberof google.ai.generativelanguage.v1beta.Part + * @instance + */ + Part.prototype.videoMetadata = null; + /** * Part thought. * @member {boolean} thought @@ -63040,6 +63932,14 @@ */ Part.prototype.thought = false; + /** + * Part thoughtSignature. + * @member {Uint8Array} thoughtSignature + * @memberof google.ai.generativelanguage.v1beta.Part + * @instance + */ + Part.prototype.thoughtSignature = $util.newBuffer([]); + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -63054,6 +63954,17 @@ set: $util.oneOfSetter($oneOfFields) }); + /** + * Part metadata. + * @member {"videoMetadata"|undefined} metadata + * @memberof google.ai.generativelanguage.v1beta.Part + * @instance + */ + Object.defineProperty(Part.prototype, "metadata", { + get: $util.oneOfGetter($oneOfFields = ["videoMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * Creates a new Part instance using the specified properties. * @function create @@ -63094,6 +64005,10 @@ $root.google.ai.generativelanguage.v1beta.CodeExecutionResult.encode(message.codeExecutionResult, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); if (message.thought != null && Object.hasOwnProperty.call(message, "thought")) writer.uint32(/* id 11, wireType 0 =*/88).bool(message.thought); + if (message.thoughtSignature != null && Object.hasOwnProperty.call(message, "thoughtSignature")) + writer.uint32(/* id 13, wireType 2 =*/106).bytes(message.thoughtSignature); + if (message.videoMetadata != null && Object.hasOwnProperty.call(message, "videoMetadata")) + $root.google.ai.generativelanguage.v1beta.VideoMetadata.encode(message.videoMetadata, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); return writer; }; @@ -63158,10 +64073,18 @@ message.codeExecutionResult = $root.google.ai.generativelanguage.v1beta.CodeExecutionResult.decode(reader, reader.uint32()); break; } + case 14: { + message.videoMetadata = $root.google.ai.generativelanguage.v1beta.VideoMetadata.decode(reader, reader.uint32()); + break; + } case 11: { message.thought = reader.bool(); break; } + case 13: { + message.thoughtSignature = reader.bytes(); + break; + } default: reader.skipType(tag & 7); break; @@ -63263,9 +64186,20 @@ return "codeExecutionResult." + error; } } + if (message.videoMetadata != null && message.hasOwnProperty("videoMetadata")) { + properties.metadata = 1; + { + var error = $root.google.ai.generativelanguage.v1beta.VideoMetadata.verify(message.videoMetadata); + if (error) + return "videoMetadata." + error; + } + } if (message.thought != null && message.hasOwnProperty("thought")) if (typeof message.thought !== "boolean") return "thought: boolean expected"; + if (message.thoughtSignature != null && message.hasOwnProperty("thoughtSignature")) + if (!(message.thoughtSignature && typeof message.thoughtSignature.length === "number" || $util.isString(message.thoughtSignature))) + return "thoughtSignature: buffer expected"; return null; }; @@ -63313,8 +64247,18 @@ throw TypeError(".google.ai.generativelanguage.v1beta.Part.codeExecutionResult: object expected"); message.codeExecutionResult = $root.google.ai.generativelanguage.v1beta.CodeExecutionResult.fromObject(object.codeExecutionResult); } + if (object.videoMetadata != null) { + if (typeof object.videoMetadata !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.Part.videoMetadata: object expected"); + message.videoMetadata = $root.google.ai.generativelanguage.v1beta.VideoMetadata.fromObject(object.videoMetadata); + } if (object.thought != null) message.thought = Boolean(object.thought); + if (object.thoughtSignature != null) + if (typeof object.thoughtSignature === "string") + $util.base64.decode(object.thoughtSignature, message.thoughtSignature = $util.newBuffer($util.base64.length(object.thoughtSignature)), 0); + else if (object.thoughtSignature.length >= 0) + message.thoughtSignature = object.thoughtSignature; return message; }; @@ -63331,8 +64275,16 @@ if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.thought = false; + if (options.bytes === String) + object.thoughtSignature = ""; + else { + object.thoughtSignature = []; + if (options.bytes !== Array) + object.thoughtSignature = $util.newBuffer(object.thoughtSignature); + } + } if (message.text != null && message.hasOwnProperty("text")) { object.text = message.text; if (options.oneofs) @@ -63370,6 +64322,13 @@ } if (message.thought != null && message.hasOwnProperty("thought")) object.thought = message.thought; + if (message.thoughtSignature != null && message.hasOwnProperty("thoughtSignature")) + object.thoughtSignature = options.bytes === String ? $util.base64.encode(message.thoughtSignature, 0, message.thoughtSignature.length) : options.bytes === Array ? Array.prototype.slice.call(message.thoughtSignature) : message.thoughtSignature; + if (message.videoMetadata != null && message.hasOwnProperty("videoMetadata")) { + object.videoMetadata = $root.google.ai.generativelanguage.v1beta.VideoMetadata.toObject(message.videoMetadata, options); + if (options.oneofs) + object.metadata = "videoMetadata"; + } return object; }; @@ -63869,6 +64828,268 @@ return FileData; })(); + v1beta.VideoMetadata = (function() { + + /** + * Properties of a VideoMetadata. + * @memberof google.ai.generativelanguage.v1beta + * @interface IVideoMetadata + * @property {google.protobuf.IDuration|null} [startOffset] VideoMetadata startOffset + * @property {google.protobuf.IDuration|null} [endOffset] VideoMetadata endOffset + * @property {number|null} [fps] VideoMetadata fps + */ + + /** + * Constructs a new VideoMetadata. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents a VideoMetadata. + * @implements IVideoMetadata + * @constructor + * @param {google.ai.generativelanguage.v1beta.IVideoMetadata=} [properties] Properties to set + */ + function VideoMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VideoMetadata startOffset. + * @member {google.protobuf.IDuration|null|undefined} startOffset + * @memberof google.ai.generativelanguage.v1beta.VideoMetadata + * @instance + */ + VideoMetadata.prototype.startOffset = null; + + /** + * VideoMetadata endOffset. + * @member {google.protobuf.IDuration|null|undefined} endOffset + * @memberof google.ai.generativelanguage.v1beta.VideoMetadata + * @instance + */ + VideoMetadata.prototype.endOffset = null; + + /** + * VideoMetadata fps. + * @member {number} fps + * @memberof google.ai.generativelanguage.v1beta.VideoMetadata + * @instance + */ + VideoMetadata.prototype.fps = 0; + + /** + * Creates a new VideoMetadata instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta.VideoMetadata + * @static + * @param {google.ai.generativelanguage.v1beta.IVideoMetadata=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.VideoMetadata} VideoMetadata instance + */ + VideoMetadata.create = function create(properties) { + return new VideoMetadata(properties); + }; + + /** + * Encodes the specified VideoMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1beta.VideoMetadata.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.VideoMetadata + * @static + * @param {google.ai.generativelanguage.v1beta.IVideoMetadata} message VideoMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startOffset != null && Object.hasOwnProperty.call(message, "startOffset")) + $root.google.protobuf.Duration.encode(message.startOffset, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endOffset != null && Object.hasOwnProperty.call(message, "endOffset")) + $root.google.protobuf.Duration.encode(message.endOffset, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.fps != null && Object.hasOwnProperty.call(message, "fps")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.fps); + return writer; + }; + + /** + * Encodes the specified VideoMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.VideoMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta.VideoMetadata + * @static + * @param {google.ai.generativelanguage.v1beta.IVideoMetadata} message VideoMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VideoMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta.VideoMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta.VideoMetadata} VideoMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.VideoMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.startOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 3: { + message.fps = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VideoMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.VideoMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta.VideoMetadata} VideoMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VideoMetadata message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta.VideoMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VideoMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startOffset != null && message.hasOwnProperty("startOffset")) { + var error = $root.google.protobuf.Duration.verify(message.startOffset); + if (error) + return "startOffset." + error; + } + if (message.endOffset != null && message.hasOwnProperty("endOffset")) { + var error = $root.google.protobuf.Duration.verify(message.endOffset); + if (error) + return "endOffset." + error; + } + if (message.fps != null && message.hasOwnProperty("fps")) + if (typeof message.fps !== "number") + return "fps: number expected"; + return null; + }; + + /** + * Creates a VideoMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.VideoMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.VideoMetadata} VideoMetadata + */ + VideoMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.VideoMetadata) + return object; + var message = new $root.google.ai.generativelanguage.v1beta.VideoMetadata(); + if (object.startOffset != null) { + if (typeof object.startOffset !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.VideoMetadata.startOffset: object expected"); + message.startOffset = $root.google.protobuf.Duration.fromObject(object.startOffset); + } + if (object.endOffset != null) { + if (typeof object.endOffset !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.VideoMetadata.endOffset: object expected"); + message.endOffset = $root.google.protobuf.Duration.fromObject(object.endOffset); + } + if (object.fps != null) + message.fps = Number(object.fps); + return message; + }; + + /** + * Creates a plain object from a VideoMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.VideoMetadata + * @static + * @param {google.ai.generativelanguage.v1beta.VideoMetadata} message VideoMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VideoMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startOffset = null; + object.endOffset = null; + object.fps = 0; + } + if (message.startOffset != null && message.hasOwnProperty("startOffset")) + object.startOffset = $root.google.protobuf.Duration.toObject(message.startOffset, options); + if (message.endOffset != null && message.hasOwnProperty("endOffset")) + object.endOffset = $root.google.protobuf.Duration.toObject(message.endOffset, options); + if (message.fps != null && message.hasOwnProperty("fps")) + object.fps = options.json && !isFinite(message.fps) ? String(message.fps) : message.fps; + return object; + }; + + /** + * Converts this VideoMetadata to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta.VideoMetadata + * @instance + * @returns {Object.} JSON object + */ + VideoMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VideoMetadata + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta.VideoMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VideoMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.VideoMetadata"; + }; + + return VideoMetadata; + })(); + v1beta.ExecutableCode = (function() { /** @@ -64417,6 +65638,7 @@ * @property {google.ai.generativelanguage.v1beta.IGoogleSearchRetrieval|null} [googleSearchRetrieval] Tool googleSearchRetrieval * @property {google.ai.generativelanguage.v1beta.ICodeExecution|null} [codeExecution] Tool codeExecution * @property {google.ai.generativelanguage.v1beta.Tool.IGoogleSearch|null} [googleSearch] Tool googleSearch + * @property {google.ai.generativelanguage.v1beta.IUrlContext|null} [urlContext] Tool urlContext */ /** @@ -64467,6 +65689,14 @@ */ Tool.prototype.googleSearch = null; + /** + * Tool urlContext. + * @member {google.ai.generativelanguage.v1beta.IUrlContext|null|undefined} urlContext + * @memberof google.ai.generativelanguage.v1beta.Tool + * @instance + */ + Tool.prototype.urlContext = null; + /** * Creates a new Tool instance using the specified properties. * @function create @@ -64500,6 +65730,8 @@ $root.google.ai.generativelanguage.v1beta.CodeExecution.encode(message.codeExecution, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.googleSearch != null && Object.hasOwnProperty.call(message, "googleSearch")) $root.google.ai.generativelanguage.v1beta.Tool.GoogleSearch.encode(message.googleSearch, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.urlContext != null && Object.hasOwnProperty.call(message, "urlContext")) + $root.google.ai.generativelanguage.v1beta.UrlContext.encode(message.urlContext, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); return writer; }; @@ -64554,6 +65786,10 @@ message.googleSearch = $root.google.ai.generativelanguage.v1beta.Tool.GoogleSearch.decode(reader, reader.uint32()); break; } + case 8: { + message.urlContext = $root.google.ai.generativelanguage.v1beta.UrlContext.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -64613,6 +65849,11 @@ if (error) return "googleSearch." + error; } + if (message.urlContext != null && message.hasOwnProperty("urlContext")) { + var error = $root.google.ai.generativelanguage.v1beta.UrlContext.verify(message.urlContext); + if (error) + return "urlContext." + error; + } return null; }; @@ -64653,6 +65894,11 @@ throw TypeError(".google.ai.generativelanguage.v1beta.Tool.googleSearch: object expected"); message.googleSearch = $root.google.ai.generativelanguage.v1beta.Tool.GoogleSearch.fromObject(object.googleSearch); } + if (object.urlContext != null) { + if (typeof object.urlContext !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.Tool.urlContext: object expected"); + message.urlContext = $root.google.ai.generativelanguage.v1beta.UrlContext.fromObject(object.urlContext); + } return message; }; @@ -64675,6 +65921,7 @@ object.googleSearchRetrieval = null; object.codeExecution = null; object.googleSearch = null; + object.urlContext = null; } if (message.functionDeclarations && message.functionDeclarations.length) { object.functionDeclarations = []; @@ -64687,6 +65934,8 @@ object.codeExecution = $root.google.ai.generativelanguage.v1beta.CodeExecution.toObject(message.codeExecution, options); if (message.googleSearch != null && message.hasOwnProperty("googleSearch")) object.googleSearch = $root.google.ai.generativelanguage.v1beta.Tool.GoogleSearch.toObject(message.googleSearch, options); + if (message.urlContext != null && message.hasOwnProperty("urlContext")) + object.urlContext = $root.google.ai.generativelanguage.v1beta.UrlContext.toObject(message.urlContext, options); return object; }; @@ -64722,6 +65971,7 @@ * Properties of a GoogleSearch. * @memberof google.ai.generativelanguage.v1beta.Tool * @interface IGoogleSearch + * @property {google.type.IInterval|null} [timeRangeFilter] GoogleSearch timeRangeFilter */ /** @@ -64739,6 +65989,14 @@ this[keys[i]] = properties[keys[i]]; } + /** + * GoogleSearch timeRangeFilter. + * @member {google.type.IInterval|null|undefined} timeRangeFilter + * @memberof google.ai.generativelanguage.v1beta.Tool.GoogleSearch + * @instance + */ + GoogleSearch.prototype.timeRangeFilter = null; + /** * Creates a new GoogleSearch instance using the specified properties. * @function create @@ -64763,6 +66021,8 @@ GoogleSearch.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.timeRangeFilter != null && Object.hasOwnProperty.call(message, "timeRangeFilter")) + $root.google.type.Interval.encode(message.timeRangeFilter, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -64799,6 +66059,10 @@ if (tag === error) break; switch (tag >>> 3) { + case 2: { + message.timeRangeFilter = $root.google.type.Interval.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -64834,6 +66098,11 @@ GoogleSearch.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + if (message.timeRangeFilter != null && message.hasOwnProperty("timeRangeFilter")) { + var error = $root.google.type.Interval.verify(message.timeRangeFilter); + if (error) + return "timeRangeFilter." + error; + } return null; }; @@ -64848,7 +66117,13 @@ GoogleSearch.fromObject = function fromObject(object) { if (object instanceof $root.google.ai.generativelanguage.v1beta.Tool.GoogleSearch) return object; - return new $root.google.ai.generativelanguage.v1beta.Tool.GoogleSearch(); + var message = new $root.google.ai.generativelanguage.v1beta.Tool.GoogleSearch(); + if (object.timeRangeFilter != null) { + if (typeof object.timeRangeFilter !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.Tool.GoogleSearch.timeRangeFilter: object expected"); + message.timeRangeFilter = $root.google.type.Interval.fromObject(object.timeRangeFilter); + } + return message; }; /** @@ -64860,8 +66135,15 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GoogleSearch.toObject = function toObject() { - return {}; + GoogleSearch.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.timeRangeFilter = null; + if (message.timeRangeFilter != null && message.hasOwnProperty("timeRangeFilter")) + object.timeRangeFilter = $root.google.type.Interval.toObject(message.timeRangeFilter, options); + return object; }; /** @@ -64896,6 +66178,183 @@ return Tool; })(); + v1beta.UrlContext = (function() { + + /** + * Properties of an UrlContext. + * @memberof google.ai.generativelanguage.v1beta + * @interface IUrlContext + */ + + /** + * Constructs a new UrlContext. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents an UrlContext. + * @implements IUrlContext + * @constructor + * @param {google.ai.generativelanguage.v1beta.IUrlContext=} [properties] Properties to set + */ + function UrlContext(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new UrlContext instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta.UrlContext + * @static + * @param {google.ai.generativelanguage.v1beta.IUrlContext=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.UrlContext} UrlContext instance + */ + UrlContext.create = function create(properties) { + return new UrlContext(properties); + }; + + /** + * Encodes the specified UrlContext message. Does not implicitly {@link google.ai.generativelanguage.v1beta.UrlContext.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.UrlContext + * @static + * @param {google.ai.generativelanguage.v1beta.IUrlContext} message UrlContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UrlContext.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified UrlContext message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.UrlContext.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta.UrlContext + * @static + * @param {google.ai.generativelanguage.v1beta.IUrlContext} message UrlContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UrlContext.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UrlContext message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta.UrlContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta.UrlContext} UrlContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UrlContext.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.UrlContext(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UrlContext message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.UrlContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta.UrlContext} UrlContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UrlContext.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UrlContext message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta.UrlContext + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UrlContext.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an UrlContext message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.UrlContext + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.UrlContext} UrlContext + */ + UrlContext.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.UrlContext) + return object; + return new $root.google.ai.generativelanguage.v1beta.UrlContext(); + }; + + /** + * Creates a plain object from an UrlContext message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.UrlContext + * @static + * @param {google.ai.generativelanguage.v1beta.UrlContext} message UrlContext + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UrlContext.toObject = function toObject() { + return {}; + }; + + /** + * Converts this UrlContext to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta.UrlContext + * @instance + * @returns {Object.} JSON object + */ + UrlContext.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UrlContext + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta.UrlContext + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UrlContext.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.UrlContext"; + }; + + return UrlContext; + })(); + v1beta.GoogleSearchRetrieval = (function() { /** @@ -66076,7 +67535,10 @@ * @property {string|null} [name] FunctionDeclaration name * @property {string|null} [description] FunctionDeclaration description * @property {google.ai.generativelanguage.v1beta.ISchema|null} [parameters] FunctionDeclaration parameters + * @property {google.protobuf.IValue|null} [parametersJsonSchema] FunctionDeclaration parametersJsonSchema * @property {google.ai.generativelanguage.v1beta.ISchema|null} [response] FunctionDeclaration response + * @property {google.protobuf.IValue|null} [responseJsonSchema] FunctionDeclaration responseJsonSchema + * @property {google.ai.generativelanguage.v1beta.FunctionDeclaration.Behavior|null} [behavior] FunctionDeclaration behavior */ /** @@ -66118,6 +67580,14 @@ */ FunctionDeclaration.prototype.parameters = null; + /** + * FunctionDeclaration parametersJsonSchema. + * @member {google.protobuf.IValue|null|undefined} parametersJsonSchema + * @memberof google.ai.generativelanguage.v1beta.FunctionDeclaration + * @instance + */ + FunctionDeclaration.prototype.parametersJsonSchema = null; + /** * FunctionDeclaration response. * @member {google.ai.generativelanguage.v1beta.ISchema|null|undefined} response @@ -66126,6 +67596,22 @@ */ FunctionDeclaration.prototype.response = null; + /** + * FunctionDeclaration responseJsonSchema. + * @member {google.protobuf.IValue|null|undefined} responseJsonSchema + * @memberof google.ai.generativelanguage.v1beta.FunctionDeclaration + * @instance + */ + FunctionDeclaration.prototype.responseJsonSchema = null; + + /** + * FunctionDeclaration behavior. + * @member {google.ai.generativelanguage.v1beta.FunctionDeclaration.Behavior} behavior + * @memberof google.ai.generativelanguage.v1beta.FunctionDeclaration + * @instance + */ + FunctionDeclaration.prototype.behavior = 0; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -66135,12 +67621,24 @@ set: $util.oneOfSetter($oneOfFields) }); + // Virtual OneOf for proto3 optional field + Object.defineProperty(FunctionDeclaration.prototype, "_parametersJsonSchema", { + get: $util.oneOfGetter($oneOfFields = ["parametersJsonSchema"]), + set: $util.oneOfSetter($oneOfFields) + }); + // Virtual OneOf for proto3 optional field Object.defineProperty(FunctionDeclaration.prototype, "_response", { get: $util.oneOfGetter($oneOfFields = ["response"]), set: $util.oneOfSetter($oneOfFields) }); + // Virtual OneOf for proto3 optional field + Object.defineProperty(FunctionDeclaration.prototype, "_responseJsonSchema", { + get: $util.oneOfGetter($oneOfFields = ["responseJsonSchema"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * Creates a new FunctionDeclaration instance using the specified properties. * @function create @@ -66173,6 +67671,12 @@ $root.google.ai.generativelanguage.v1beta.Schema.encode(message.parameters, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.response != null && Object.hasOwnProperty.call(message, "response")) $root.google.ai.generativelanguage.v1beta.Schema.encode(message.response, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.behavior != null && Object.hasOwnProperty.call(message, "behavior")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.behavior); + if (message.parametersJsonSchema != null && Object.hasOwnProperty.call(message, "parametersJsonSchema")) + $root.google.protobuf.Value.encode(message.parametersJsonSchema, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.responseJsonSchema != null && Object.hasOwnProperty.call(message, "responseJsonSchema")) + $root.google.protobuf.Value.encode(message.responseJsonSchema, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); return writer; }; @@ -66221,10 +67725,22 @@ message.parameters = $root.google.ai.generativelanguage.v1beta.Schema.decode(reader, reader.uint32()); break; } + case 6: { + message.parametersJsonSchema = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + } case 4: { message.response = $root.google.ai.generativelanguage.v1beta.Schema.decode(reader, reader.uint32()); break; } + case 7: { + message.responseJsonSchema = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + } + case 5: { + message.behavior = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -66275,6 +67791,14 @@ return "parameters." + error; } } + if (message.parametersJsonSchema != null && message.hasOwnProperty("parametersJsonSchema")) { + properties._parametersJsonSchema = 1; + { + var error = $root.google.protobuf.Value.verify(message.parametersJsonSchema); + if (error) + return "parametersJsonSchema." + error; + } + } if (message.response != null && message.hasOwnProperty("response")) { properties._response = 1; { @@ -66283,6 +67807,23 @@ return "response." + error; } } + if (message.responseJsonSchema != null && message.hasOwnProperty("responseJsonSchema")) { + properties._responseJsonSchema = 1; + { + var error = $root.google.protobuf.Value.verify(message.responseJsonSchema); + if (error) + return "responseJsonSchema." + error; + } + } + if (message.behavior != null && message.hasOwnProperty("behavior")) + switch (message.behavior) { + default: + return "behavior: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; @@ -66307,11 +67848,41 @@ throw TypeError(".google.ai.generativelanguage.v1beta.FunctionDeclaration.parameters: object expected"); message.parameters = $root.google.ai.generativelanguage.v1beta.Schema.fromObject(object.parameters); } + if (object.parametersJsonSchema != null) { + if (typeof object.parametersJsonSchema !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.FunctionDeclaration.parametersJsonSchema: object expected"); + message.parametersJsonSchema = $root.google.protobuf.Value.fromObject(object.parametersJsonSchema); + } if (object.response != null) { if (typeof object.response !== "object") throw TypeError(".google.ai.generativelanguage.v1beta.FunctionDeclaration.response: object expected"); message.response = $root.google.ai.generativelanguage.v1beta.Schema.fromObject(object.response); } + if (object.responseJsonSchema != null) { + if (typeof object.responseJsonSchema !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.FunctionDeclaration.responseJsonSchema: object expected"); + message.responseJsonSchema = $root.google.protobuf.Value.fromObject(object.responseJsonSchema); + } + switch (object.behavior) { + default: + if (typeof object.behavior === "number") { + message.behavior = object.behavior; + break; + } + break; + case "UNSPECIFIED": + case 0: + message.behavior = 0; + break; + case "BLOCKING": + case 1: + message.behavior = 1; + break; + case "NON_BLOCKING": + case 2: + message.behavior = 2; + break; + } return message; }; @@ -66331,6 +67902,7 @@ if (options.defaults) { object.name = ""; object.description = ""; + object.behavior = options.enums === String ? "UNSPECIFIED" : 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -66346,6 +67918,18 @@ if (options.oneofs) object._response = "response"; } + if (message.behavior != null && message.hasOwnProperty("behavior")) + object.behavior = options.enums === String ? $root.google.ai.generativelanguage.v1beta.FunctionDeclaration.Behavior[message.behavior] === undefined ? message.behavior : $root.google.ai.generativelanguage.v1beta.FunctionDeclaration.Behavior[message.behavior] : message.behavior; + if (message.parametersJsonSchema != null && message.hasOwnProperty("parametersJsonSchema")) { + object.parametersJsonSchema = $root.google.protobuf.Value.toObject(message.parametersJsonSchema, options); + if (options.oneofs) + object._parametersJsonSchema = "parametersJsonSchema"; + } + if (message.responseJsonSchema != null && message.hasOwnProperty("responseJsonSchema")) { + object.responseJsonSchema = $root.google.protobuf.Value.toObject(message.responseJsonSchema, options); + if (options.oneofs) + object._responseJsonSchema = "responseJsonSchema"; + } return object; }; @@ -66375,6 +67959,22 @@ return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.FunctionDeclaration"; }; + /** + * Behavior enum. + * @name google.ai.generativelanguage.v1beta.FunctionDeclaration.Behavior + * @enum {number} + * @property {number} UNSPECIFIED=0 UNSPECIFIED value + * @property {number} BLOCKING=1 BLOCKING value + * @property {number} NON_BLOCKING=2 NON_BLOCKING value + */ + FunctionDeclaration.Behavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNSPECIFIED"] = 0; + values[valuesById[1] = "BLOCKING"] = 1; + values[valuesById[2] = "NON_BLOCKING"] = 2; + return values; + })(); + return FunctionDeclaration; })(); @@ -66659,6 +68259,8 @@ * @property {string|null} [id] FunctionResponse id * @property {string|null} [name] FunctionResponse name * @property {google.protobuf.IStruct|null} [response] FunctionResponse response + * @property {boolean|null} [willContinue] FunctionResponse willContinue + * @property {google.ai.generativelanguage.v1beta.FunctionResponse.Scheduling|null} [scheduling] FunctionResponse scheduling */ /** @@ -66700,6 +68302,31 @@ */ FunctionResponse.prototype.response = null; + /** + * FunctionResponse willContinue. + * @member {boolean} willContinue + * @memberof google.ai.generativelanguage.v1beta.FunctionResponse + * @instance + */ + FunctionResponse.prototype.willContinue = false; + + /** + * FunctionResponse scheduling. + * @member {google.ai.generativelanguage.v1beta.FunctionResponse.Scheduling|null|undefined} scheduling + * @memberof google.ai.generativelanguage.v1beta.FunctionResponse + * @instance + */ + FunctionResponse.prototype.scheduling = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(FunctionResponse.prototype, "_scheduling", { + get: $util.oneOfGetter($oneOfFields = ["scheduling"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * Creates a new FunctionResponse instance using the specified properties. * @function create @@ -66730,6 +68357,10 @@ $root.google.protobuf.Struct.encode(message.response, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.id != null && Object.hasOwnProperty.call(message, "id")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.id); + if (message.willContinue != null && Object.hasOwnProperty.call(message, "willContinue")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.willContinue); + if (message.scheduling != null && Object.hasOwnProperty.call(message, "scheduling")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.scheduling); return writer; }; @@ -66778,6 +68409,14 @@ message.response = $root.google.protobuf.Struct.decode(reader, reader.uint32()); break; } + case 4: { + message.willContinue = reader.bool(); + break; + } + case 5: { + message.scheduling = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -66813,6 +68452,7 @@ FunctionResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + var properties = {}; if (message.id != null && message.hasOwnProperty("id")) if (!$util.isString(message.id)) return "id: string expected"; @@ -66824,6 +68464,21 @@ if (error) return "response." + error; } + if (message.willContinue != null && message.hasOwnProperty("willContinue")) + if (typeof message.willContinue !== "boolean") + return "willContinue: boolean expected"; + if (message.scheduling != null && message.hasOwnProperty("scheduling")) { + properties._scheduling = 1; + switch (message.scheduling) { + default: + return "scheduling: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } return null; }; @@ -66848,6 +68503,32 @@ throw TypeError(".google.ai.generativelanguage.v1beta.FunctionResponse.response: object expected"); message.response = $root.google.protobuf.Struct.fromObject(object.response); } + if (object.willContinue != null) + message.willContinue = Boolean(object.willContinue); + switch (object.scheduling) { + default: + if (typeof object.scheduling === "number") { + message.scheduling = object.scheduling; + break; + } + break; + case "SCHEDULING_UNSPECIFIED": + case 0: + message.scheduling = 0; + break; + case "SILENT": + case 1: + message.scheduling = 1; + break; + case "WHEN_IDLE": + case 2: + message.scheduling = 2; + break; + case "INTERRUPT": + case 3: + message.scheduling = 3; + break; + } return message; }; @@ -66868,6 +68549,7 @@ object.name = ""; object.response = null; object.id = ""; + object.willContinue = false; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -66875,6 +68557,13 @@ object.response = $root.google.protobuf.Struct.toObject(message.response, options); if (message.id != null && message.hasOwnProperty("id")) object.id = message.id; + if (message.willContinue != null && message.hasOwnProperty("willContinue")) + object.willContinue = message.willContinue; + if (message.scheduling != null && message.hasOwnProperty("scheduling")) { + object.scheduling = options.enums === String ? $root.google.ai.generativelanguage.v1beta.FunctionResponse.Scheduling[message.scheduling] === undefined ? message.scheduling : $root.google.ai.generativelanguage.v1beta.FunctionResponse.Scheduling[message.scheduling] : message.scheduling; + if (options.oneofs) + object._scheduling = "scheduling"; + } return object; }; @@ -66904,6 +68593,24 @@ return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.FunctionResponse"; }; + /** + * Scheduling enum. + * @name google.ai.generativelanguage.v1beta.FunctionResponse.Scheduling + * @enum {number} + * @property {number} SCHEDULING_UNSPECIFIED=0 SCHEDULING_UNSPECIFIED value + * @property {number} SILENT=1 SILENT value + * @property {number} WHEN_IDLE=2 WHEN_IDLE value + * @property {number} INTERRUPT=3 INTERRUPT value + */ + FunctionResponse.Scheduling = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SCHEDULING_UNSPECIFIED"] = 0; + values[valuesById[1] = "SILENT"] = 1; + values[valuesById[2] = "WHEN_IDLE"] = 2; + values[valuesById[3] = "INTERRUPT"] = 3; + return values; + })(); + return FunctionResponse; })(); @@ -66924,8 +68631,14 @@ * @property {number|Long|null} [minItems] Schema minItems * @property {Object.|null} [properties] Schema properties * @property {Array.|null} [required] Schema required + * @property {number|Long|null} [minProperties] Schema minProperties + * @property {number|Long|null} [maxProperties] Schema maxProperties * @property {number|null} [minimum] Schema minimum * @property {number|null} [maximum] Schema maximum + * @property {number|Long|null} [minLength] Schema minLength + * @property {number|Long|null} [maxLength] Schema maxLength + * @property {string|null} [pattern] Schema pattern + * @property {google.protobuf.IValue|null} [example] Schema example * @property {Array.|null} [anyOf] Schema anyOf * @property {Array.|null} [propertyOrdering] Schema propertyOrdering * @property {google.protobuf.IValue|null} ["default"] Schema default @@ -67039,6 +68752,22 @@ */ Schema.prototype.required = $util.emptyArray; + /** + * Schema minProperties. + * @member {number|Long} minProperties + * @memberof google.ai.generativelanguage.v1beta.Schema + * @instance + */ + Schema.prototype.minProperties = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Schema maxProperties. + * @member {number|Long} maxProperties + * @memberof google.ai.generativelanguage.v1beta.Schema + * @instance + */ + Schema.prototype.maxProperties = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + /** * Schema minimum. * @member {number|null|undefined} minimum @@ -67055,6 +68784,38 @@ */ Schema.prototype.maximum = null; + /** + * Schema minLength. + * @member {number|Long} minLength + * @memberof google.ai.generativelanguage.v1beta.Schema + * @instance + */ + Schema.prototype.minLength = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Schema maxLength. + * @member {number|Long} maxLength + * @memberof google.ai.generativelanguage.v1beta.Schema + * @instance + */ + Schema.prototype.maxLength = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Schema pattern. + * @member {string} pattern + * @memberof google.ai.generativelanguage.v1beta.Schema + * @instance + */ + Schema.prototype.pattern = ""; + + /** + * Schema example. + * @member {google.protobuf.IValue|null|undefined} example + * @memberof google.ai.generativelanguage.v1beta.Schema + * @instance + */ + Schema.prototype.example = null; + /** * Schema anyOf. * @member {Array.} anyOf @@ -67145,10 +68906,22 @@ if (message.required != null && message.required.length) for (var i = 0; i < message.required.length; ++i) writer.uint32(/* id 8, wireType 2 =*/66).string(message.required[i]); + if (message.minProperties != null && Object.hasOwnProperty.call(message, "minProperties")) + writer.uint32(/* id 9, wireType 0 =*/72).int64(message.minProperties); + if (message.maxProperties != null && Object.hasOwnProperty.call(message, "maxProperties")) + writer.uint32(/* id 10, wireType 0 =*/80).int64(message.maxProperties); if (message.minimum != null && Object.hasOwnProperty.call(message, "minimum")) writer.uint32(/* id 11, wireType 1 =*/89).double(message.minimum); if (message.maximum != null && Object.hasOwnProperty.call(message, "maximum")) writer.uint32(/* id 12, wireType 1 =*/97).double(message.maximum); + if (message.minLength != null && Object.hasOwnProperty.call(message, "minLength")) + writer.uint32(/* id 13, wireType 0 =*/104).int64(message.minLength); + if (message.maxLength != null && Object.hasOwnProperty.call(message, "maxLength")) + writer.uint32(/* id 14, wireType 0 =*/112).int64(message.maxLength); + if (message.pattern != null && Object.hasOwnProperty.call(message, "pattern")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.pattern); + if (message.example != null && Object.hasOwnProperty.call(message, "example")) + $root.google.protobuf.Value.encode(message.example, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); if (message.anyOf != null && message.anyOf.length) for (var i = 0; i < message.anyOf.length; ++i) $root.google.ai.generativelanguage.v1beta.Schema.encode(message.anyOf[i], writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); @@ -67266,6 +69039,14 @@ message.required.push(reader.string()); break; } + case 9: { + message.minProperties = reader.int64(); + break; + } + case 10: { + message.maxProperties = reader.int64(); + break; + } case 11: { message.minimum = reader.double(); break; @@ -67274,6 +69055,22 @@ message.maximum = reader.double(); break; } + case 13: { + message.minLength = reader.int64(); + break; + } + case 14: { + message.maxLength = reader.int64(); + break; + } + case 15: { + message.pattern = reader.string(); + break; + } + case 16: { + message.example = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + } case 18: { if (!(message.anyOf && message.anyOf.length)) message.anyOf = []; @@ -67390,6 +69187,12 @@ if (!$util.isString(message.required[i])) return "required: string[] expected"; } + if (message.minProperties != null && message.hasOwnProperty("minProperties")) + if (!$util.isInteger(message.minProperties) && !(message.minProperties && $util.isInteger(message.minProperties.low) && $util.isInteger(message.minProperties.high))) + return "minProperties: integer|Long expected"; + if (message.maxProperties != null && message.hasOwnProperty("maxProperties")) + if (!$util.isInteger(message.maxProperties) && !(message.maxProperties && $util.isInteger(message.maxProperties.low) && $util.isInteger(message.maxProperties.high))) + return "maxProperties: integer|Long expected"; if (message.minimum != null && message.hasOwnProperty("minimum")) { properties._minimum = 1; if (typeof message.minimum !== "number") @@ -67400,6 +69203,20 @@ if (typeof message.maximum !== "number") return "maximum: number expected"; } + if (message.minLength != null && message.hasOwnProperty("minLength")) + if (!$util.isInteger(message.minLength) && !(message.minLength && $util.isInteger(message.minLength.low) && $util.isInteger(message.minLength.high))) + return "minLength: integer|Long expected"; + if (message.maxLength != null && message.hasOwnProperty("maxLength")) + if (!$util.isInteger(message.maxLength) && !(message.maxLength && $util.isInteger(message.maxLength.low) && $util.isInteger(message.maxLength.high))) + return "maxLength: integer|Long expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) + if (!$util.isString(message.pattern)) + return "pattern: string expected"; + if (message.example != null && message.hasOwnProperty("example")) { + var error = $root.google.protobuf.Value.verify(message.example); + if (error) + return "example." + error; + } if (message.anyOf != null && message.hasOwnProperty("anyOf")) { if (!Array.isArray(message.anyOf)) return "anyOf: array expected"; @@ -67531,10 +69348,53 @@ for (var i = 0; i < object.required.length; ++i) message.required[i] = String(object.required[i]); } + if (object.minProperties != null) + if ($util.Long) + (message.minProperties = $util.Long.fromValue(object.minProperties)).unsigned = false; + else if (typeof object.minProperties === "string") + message.minProperties = parseInt(object.minProperties, 10); + else if (typeof object.minProperties === "number") + message.minProperties = object.minProperties; + else if (typeof object.minProperties === "object") + message.minProperties = new $util.LongBits(object.minProperties.low >>> 0, object.minProperties.high >>> 0).toNumber(); + if (object.maxProperties != null) + if ($util.Long) + (message.maxProperties = $util.Long.fromValue(object.maxProperties)).unsigned = false; + else if (typeof object.maxProperties === "string") + message.maxProperties = parseInt(object.maxProperties, 10); + else if (typeof object.maxProperties === "number") + message.maxProperties = object.maxProperties; + else if (typeof object.maxProperties === "object") + message.maxProperties = new $util.LongBits(object.maxProperties.low >>> 0, object.maxProperties.high >>> 0).toNumber(); if (object.minimum != null) message.minimum = Number(object.minimum); if (object.maximum != null) message.maximum = Number(object.maximum); + if (object.minLength != null) + if ($util.Long) + (message.minLength = $util.Long.fromValue(object.minLength)).unsigned = false; + else if (typeof object.minLength === "string") + message.minLength = parseInt(object.minLength, 10); + else if (typeof object.minLength === "number") + message.minLength = object.minLength; + else if (typeof object.minLength === "object") + message.minLength = new $util.LongBits(object.minLength.low >>> 0, object.minLength.high >>> 0).toNumber(); + if (object.maxLength != null) + if ($util.Long) + (message.maxLength = $util.Long.fromValue(object.maxLength)).unsigned = false; + else if (typeof object.maxLength === "string") + message.maxLength = parseInt(object.maxLength, 10); + else if (typeof object.maxLength === "number") + message.maxLength = object.maxLength; + else if (typeof object.maxLength === "object") + message.maxLength = new $util.LongBits(object.maxLength.low >>> 0, object.maxLength.high >>> 0).toNumber(); + if (object.pattern != null) + message.pattern = String(object.pattern); + if (object.example != null) { + if (typeof object.example !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.Schema.example: object expected"); + message.example = $root.google.protobuf.Value.fromObject(object.example); + } if (object.anyOf) { if (!Array.isArray(object.anyOf)) throw TypeError(".google.ai.generativelanguage.v1beta.Schema.anyOf: array expected"); @@ -67586,6 +69446,28 @@ object.format = ""; object.description = ""; object.nullable = false; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.minProperties = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.minProperties = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.maxProperties = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.maxProperties = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.minLength = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.minLength = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.maxLength = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.maxLength = options.longs === String ? "0" : 0; + object.pattern = ""; + object.example = null; if ($util.Long) { var long = new $util.Long(0, 0, false); object.maxItems = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; @@ -67628,6 +69510,16 @@ for (var j = 0; j < message.required.length; ++j) object.required[j] = message.required[j]; } + if (message.minProperties != null && message.hasOwnProperty("minProperties")) + if (typeof message.minProperties === "number") + object.minProperties = options.longs === String ? String(message.minProperties) : message.minProperties; + else + object.minProperties = options.longs === String ? $util.Long.prototype.toString.call(message.minProperties) : options.longs === Number ? new $util.LongBits(message.minProperties.low >>> 0, message.minProperties.high >>> 0).toNumber() : message.minProperties; + if (message.maxProperties != null && message.hasOwnProperty("maxProperties")) + if (typeof message.maxProperties === "number") + object.maxProperties = options.longs === String ? String(message.maxProperties) : message.maxProperties; + else + object.maxProperties = options.longs === String ? $util.Long.prototype.toString.call(message.maxProperties) : options.longs === Number ? new $util.LongBits(message.maxProperties.low >>> 0, message.maxProperties.high >>> 0).toNumber() : message.maxProperties; if (message.minimum != null && message.hasOwnProperty("minimum")) { object.minimum = options.json && !isFinite(message.minimum) ? String(message.minimum) : message.minimum; if (options.oneofs) @@ -67638,6 +69530,20 @@ if (options.oneofs) object._maximum = "maximum"; } + if (message.minLength != null && message.hasOwnProperty("minLength")) + if (typeof message.minLength === "number") + object.minLength = options.longs === String ? String(message.minLength) : message.minLength; + else + object.minLength = options.longs === String ? $util.Long.prototype.toString.call(message.minLength) : options.longs === Number ? new $util.LongBits(message.minLength.low >>> 0, message.minLength.high >>> 0).toNumber() : message.minLength; + if (message.maxLength != null && message.hasOwnProperty("maxLength")) + if (typeof message.maxLength === "number") + object.maxLength = options.longs === String ? String(message.maxLength) : message.maxLength; + else + object.maxLength = options.longs === String ? $util.Long.prototype.toString.call(message.maxLength) : options.longs === Number ? new $util.LongBits(message.maxLength.low >>> 0, message.maxLength.high >>> 0).toNumber() : message.maxLength; + if (message.pattern != null && message.hasOwnProperty("pattern")) + object.pattern = message.pattern; + if (message.example != null && message.hasOwnProperty("example")) + object.example = $root.google.protobuf.Value.toObject(message.example, options); if (message.anyOf && message.anyOf.length) { object.anyOf = []; for (var j = 0; j < message.anyOf.length; ++j) @@ -72291,7 +74197,7 @@ * Properties of a File. * @memberof google.ai.generativelanguage.v1beta * @interface IFile - * @property {google.ai.generativelanguage.v1beta.IVideoMetadata|null} [videoMetadata] File videoMetadata + * @property {google.ai.generativelanguage.v1beta.IVideoFileMetadata|null} [videoMetadata] File videoMetadata * @property {string|null} [name] File name * @property {string|null} [displayName] File displayName * @property {string|null} [mimeType] File mimeType @@ -72324,7 +74230,7 @@ /** * File videoMetadata. - * @member {google.ai.generativelanguage.v1beta.IVideoMetadata|null|undefined} videoMetadata + * @member {google.ai.generativelanguage.v1beta.IVideoFileMetadata|null|undefined} videoMetadata * @memberof google.ai.generativelanguage.v1beta.File * @instance */ @@ -72495,7 +74401,7 @@ if (message.error != null && Object.hasOwnProperty.call(message, "error")) $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); if (message.videoMetadata != null && Object.hasOwnProperty.call(message, "videoMetadata")) - $root.google.ai.generativelanguage.v1beta.VideoMetadata.encode(message.videoMetadata, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + $root.google.ai.generativelanguage.v1beta.VideoFileMetadata.encode(message.videoMetadata, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); if (message.source != null && Object.hasOwnProperty.call(message, "source")) writer.uint32(/* id 13, wireType 0 =*/104).int32(message.source); if (message.downloadUri != null && Object.hasOwnProperty.call(message, "downloadUri")) @@ -72537,7 +74443,7 @@ break; switch (tag >>> 3) { case 12: { - message.videoMetadata = $root.google.ai.generativelanguage.v1beta.VideoMetadata.decode(reader, reader.uint32()); + message.videoMetadata = $root.google.ai.generativelanguage.v1beta.VideoFileMetadata.decode(reader, reader.uint32()); break; } case 1: { @@ -72631,7 +74537,7 @@ if (message.videoMetadata != null && message.hasOwnProperty("videoMetadata")) { properties.metadata = 1; { - var error = $root.google.ai.generativelanguage.v1beta.VideoMetadata.verify(message.videoMetadata); + var error = $root.google.ai.generativelanguage.v1beta.VideoFileMetadata.verify(message.videoMetadata); if (error) return "videoMetadata." + error; } @@ -72714,7 +74620,7 @@ if (object.videoMetadata != null) { if (typeof object.videoMetadata !== "object") throw TypeError(".google.ai.generativelanguage.v1beta.File.videoMetadata: object expected"); - message.videoMetadata = $root.google.ai.generativelanguage.v1beta.VideoMetadata.fromObject(object.videoMetadata); + message.videoMetadata = $root.google.ai.generativelanguage.v1beta.VideoFileMetadata.fromObject(object.videoMetadata); } if (object.name != null) message.name = String(object.name); @@ -72871,7 +74777,7 @@ if (message.error != null && message.hasOwnProperty("error")) object.error = $root.google.rpc.Status.toObject(message.error, options); if (message.videoMetadata != null && message.hasOwnProperty("videoMetadata")) { - object.videoMetadata = $root.google.ai.generativelanguage.v1beta.VideoMetadata.toObject(message.videoMetadata, options); + object.videoMetadata = $root.google.ai.generativelanguage.v1beta.VideoFileMetadata.toObject(message.videoMetadata, options); if (options.oneofs) object.metadata = "videoMetadata"; } @@ -72945,24 +74851,24 @@ return File; })(); - v1beta.VideoMetadata = (function() { + v1beta.VideoFileMetadata = (function() { /** - * Properties of a VideoMetadata. + * Properties of a VideoFileMetadata. * @memberof google.ai.generativelanguage.v1beta - * @interface IVideoMetadata - * @property {google.protobuf.IDuration|null} [videoDuration] VideoMetadata videoDuration + * @interface IVideoFileMetadata + * @property {google.protobuf.IDuration|null} [videoDuration] VideoFileMetadata videoDuration */ /** - * Constructs a new VideoMetadata. + * Constructs a new VideoFileMetadata. * @memberof google.ai.generativelanguage.v1beta - * @classdesc Represents a VideoMetadata. - * @implements IVideoMetadata + * @classdesc Represents a VideoFileMetadata. + * @implements IVideoFileMetadata * @constructor - * @param {google.ai.generativelanguage.v1beta.IVideoMetadata=} [properties] Properties to set + * @param {google.ai.generativelanguage.v1beta.IVideoFileMetadata=} [properties] Properties to set */ - function VideoMetadata(properties) { + function VideoFileMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -72970,35 +74876,35 @@ } /** - * VideoMetadata videoDuration. + * VideoFileMetadata videoDuration. * @member {google.protobuf.IDuration|null|undefined} videoDuration - * @memberof google.ai.generativelanguage.v1beta.VideoMetadata + * @memberof google.ai.generativelanguage.v1beta.VideoFileMetadata * @instance */ - VideoMetadata.prototype.videoDuration = null; + VideoFileMetadata.prototype.videoDuration = null; /** - * Creates a new VideoMetadata instance using the specified properties. + * Creates a new VideoFileMetadata instance using the specified properties. * @function create - * @memberof google.ai.generativelanguage.v1beta.VideoMetadata + * @memberof google.ai.generativelanguage.v1beta.VideoFileMetadata * @static - * @param {google.ai.generativelanguage.v1beta.IVideoMetadata=} [properties] Properties to set - * @returns {google.ai.generativelanguage.v1beta.VideoMetadata} VideoMetadata instance + * @param {google.ai.generativelanguage.v1beta.IVideoFileMetadata=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.VideoFileMetadata} VideoFileMetadata instance */ - VideoMetadata.create = function create(properties) { - return new VideoMetadata(properties); + VideoFileMetadata.create = function create(properties) { + return new VideoFileMetadata(properties); }; /** - * Encodes the specified VideoMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1beta.VideoMetadata.verify|verify} messages. + * Encodes the specified VideoFileMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1beta.VideoFileMetadata.verify|verify} messages. * @function encode - * @memberof google.ai.generativelanguage.v1beta.VideoMetadata + * @memberof google.ai.generativelanguage.v1beta.VideoFileMetadata * @static - * @param {google.ai.generativelanguage.v1beta.IVideoMetadata} message VideoMetadata message or plain object to encode + * @param {google.ai.generativelanguage.v1beta.IVideoFileMetadata} message VideoFileMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - VideoMetadata.encode = function encode(message, writer) { + VideoFileMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.videoDuration != null && Object.hasOwnProperty.call(message, "videoDuration")) @@ -73007,33 +74913,33 @@ }; /** - * Encodes the specified VideoMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.VideoMetadata.verify|verify} messages. + * Encodes the specified VideoFileMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.VideoFileMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.ai.generativelanguage.v1beta.VideoMetadata + * @memberof google.ai.generativelanguage.v1beta.VideoFileMetadata * @static - * @param {google.ai.generativelanguage.v1beta.IVideoMetadata} message VideoMetadata message or plain object to encode + * @param {google.ai.generativelanguage.v1beta.IVideoFileMetadata} message VideoFileMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - VideoMetadata.encodeDelimited = function encodeDelimited(message, writer) { + VideoFileMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a VideoMetadata message from the specified reader or buffer. + * Decodes a VideoFileMetadata message from the specified reader or buffer. * @function decode - * @memberof google.ai.generativelanguage.v1beta.VideoMetadata + * @memberof google.ai.generativelanguage.v1beta.VideoFileMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.ai.generativelanguage.v1beta.VideoMetadata} VideoMetadata + * @returns {google.ai.generativelanguage.v1beta.VideoFileMetadata} VideoFileMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - VideoMetadata.decode = function decode(reader, length, error) { + VideoFileMetadata.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.VideoMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.VideoFileMetadata(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) @@ -73052,30 +74958,30 @@ }; /** - * Decodes a VideoMetadata message from the specified reader or buffer, length delimited. + * Decodes a VideoFileMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.ai.generativelanguage.v1beta.VideoMetadata + * @memberof google.ai.generativelanguage.v1beta.VideoFileMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ai.generativelanguage.v1beta.VideoMetadata} VideoMetadata + * @returns {google.ai.generativelanguage.v1beta.VideoFileMetadata} VideoFileMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - VideoMetadata.decodeDelimited = function decodeDelimited(reader) { + VideoFileMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a VideoMetadata message. + * Verifies a VideoFileMetadata message. * @function verify - * @memberof google.ai.generativelanguage.v1beta.VideoMetadata + * @memberof google.ai.generativelanguage.v1beta.VideoFileMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - VideoMetadata.verify = function verify(message) { + VideoFileMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.videoDuration != null && message.hasOwnProperty("videoDuration")) { @@ -73087,35 +74993,35 @@ }; /** - * Creates a VideoMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a VideoFileMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.ai.generativelanguage.v1beta.VideoMetadata + * @memberof google.ai.generativelanguage.v1beta.VideoFileMetadata * @static * @param {Object.} object Plain object - * @returns {google.ai.generativelanguage.v1beta.VideoMetadata} VideoMetadata + * @returns {google.ai.generativelanguage.v1beta.VideoFileMetadata} VideoFileMetadata */ - VideoMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.ai.generativelanguage.v1beta.VideoMetadata) + VideoFileMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.VideoFileMetadata) return object; - var message = new $root.google.ai.generativelanguage.v1beta.VideoMetadata(); + var message = new $root.google.ai.generativelanguage.v1beta.VideoFileMetadata(); if (object.videoDuration != null) { if (typeof object.videoDuration !== "object") - throw TypeError(".google.ai.generativelanguage.v1beta.VideoMetadata.videoDuration: object expected"); + throw TypeError(".google.ai.generativelanguage.v1beta.VideoFileMetadata.videoDuration: object expected"); message.videoDuration = $root.google.protobuf.Duration.fromObject(object.videoDuration); } return message; }; /** - * Creates a plain object from a VideoMetadata message. Also converts values to other types if specified. + * Creates a plain object from a VideoFileMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.ai.generativelanguage.v1beta.VideoMetadata + * @memberof google.ai.generativelanguage.v1beta.VideoFileMetadata * @static - * @param {google.ai.generativelanguage.v1beta.VideoMetadata} message VideoMetadata + * @param {google.ai.generativelanguage.v1beta.VideoFileMetadata} message VideoFileMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - VideoMetadata.toObject = function toObject(message, options) { + VideoFileMetadata.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -73127,32 +75033,32 @@ }; /** - * Converts this VideoMetadata to JSON. + * Converts this VideoFileMetadata to JSON. * @function toJSON - * @memberof google.ai.generativelanguage.v1beta.VideoMetadata + * @memberof google.ai.generativelanguage.v1beta.VideoFileMetadata * @instance * @returns {Object.} JSON object */ - VideoMetadata.prototype.toJSON = function toJSON() { + VideoFileMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for VideoMetadata + * Gets the default type url for VideoFileMetadata * @function getTypeUrl - * @memberof google.ai.generativelanguage.v1beta.VideoMetadata + * @memberof google.ai.generativelanguage.v1beta.VideoFileMetadata * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - VideoMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + VideoFileMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.VideoMetadata"; + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.VideoFileMetadata"; }; - return VideoMetadata; + return VideoFileMetadata; })(); v1beta.FileService = (function() { @@ -76270,6 +78176,466 @@ return VoiceConfig; })(); + v1beta.SpeakerVoiceConfig = (function() { + + /** + * Properties of a SpeakerVoiceConfig. + * @memberof google.ai.generativelanguage.v1beta + * @interface ISpeakerVoiceConfig + * @property {string|null} [speaker] SpeakerVoiceConfig speaker + * @property {google.ai.generativelanguage.v1beta.IVoiceConfig|null} [voiceConfig] SpeakerVoiceConfig voiceConfig + */ + + /** + * Constructs a new SpeakerVoiceConfig. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents a SpeakerVoiceConfig. + * @implements ISpeakerVoiceConfig + * @constructor + * @param {google.ai.generativelanguage.v1beta.ISpeakerVoiceConfig=} [properties] Properties to set + */ + function SpeakerVoiceConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpeakerVoiceConfig speaker. + * @member {string} speaker + * @memberof google.ai.generativelanguage.v1beta.SpeakerVoiceConfig + * @instance + */ + SpeakerVoiceConfig.prototype.speaker = ""; + + /** + * SpeakerVoiceConfig voiceConfig. + * @member {google.ai.generativelanguage.v1beta.IVoiceConfig|null|undefined} voiceConfig + * @memberof google.ai.generativelanguage.v1beta.SpeakerVoiceConfig + * @instance + */ + SpeakerVoiceConfig.prototype.voiceConfig = null; + + /** + * Creates a new SpeakerVoiceConfig instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta.SpeakerVoiceConfig + * @static + * @param {google.ai.generativelanguage.v1beta.ISpeakerVoiceConfig=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.SpeakerVoiceConfig} SpeakerVoiceConfig instance + */ + SpeakerVoiceConfig.create = function create(properties) { + return new SpeakerVoiceConfig(properties); + }; + + /** + * Encodes the specified SpeakerVoiceConfig message. Does not implicitly {@link google.ai.generativelanguage.v1beta.SpeakerVoiceConfig.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.SpeakerVoiceConfig + * @static + * @param {google.ai.generativelanguage.v1beta.ISpeakerVoiceConfig} message SpeakerVoiceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeakerVoiceConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.speaker != null && Object.hasOwnProperty.call(message, "speaker")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.speaker); + if (message.voiceConfig != null && Object.hasOwnProperty.call(message, "voiceConfig")) + $root.google.ai.generativelanguage.v1beta.VoiceConfig.encode(message.voiceConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SpeakerVoiceConfig message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.SpeakerVoiceConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta.SpeakerVoiceConfig + * @static + * @param {google.ai.generativelanguage.v1beta.ISpeakerVoiceConfig} message SpeakerVoiceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeakerVoiceConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpeakerVoiceConfig message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta.SpeakerVoiceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta.SpeakerVoiceConfig} SpeakerVoiceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeakerVoiceConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.SpeakerVoiceConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.speaker = reader.string(); + break; + } + case 2: { + message.voiceConfig = $root.google.ai.generativelanguage.v1beta.VoiceConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpeakerVoiceConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.SpeakerVoiceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta.SpeakerVoiceConfig} SpeakerVoiceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeakerVoiceConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpeakerVoiceConfig message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta.SpeakerVoiceConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpeakerVoiceConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.speaker != null && message.hasOwnProperty("speaker")) + if (!$util.isString(message.speaker)) + return "speaker: string expected"; + if (message.voiceConfig != null && message.hasOwnProperty("voiceConfig")) { + var error = $root.google.ai.generativelanguage.v1beta.VoiceConfig.verify(message.voiceConfig); + if (error) + return "voiceConfig." + error; + } + return null; + }; + + /** + * Creates a SpeakerVoiceConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.SpeakerVoiceConfig + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.SpeakerVoiceConfig} SpeakerVoiceConfig + */ + SpeakerVoiceConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.SpeakerVoiceConfig) + return object; + var message = new $root.google.ai.generativelanguage.v1beta.SpeakerVoiceConfig(); + if (object.speaker != null) + message.speaker = String(object.speaker); + if (object.voiceConfig != null) { + if (typeof object.voiceConfig !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.SpeakerVoiceConfig.voiceConfig: object expected"); + message.voiceConfig = $root.google.ai.generativelanguage.v1beta.VoiceConfig.fromObject(object.voiceConfig); + } + return message; + }; + + /** + * Creates a plain object from a SpeakerVoiceConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.SpeakerVoiceConfig + * @static + * @param {google.ai.generativelanguage.v1beta.SpeakerVoiceConfig} message SpeakerVoiceConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpeakerVoiceConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.speaker = ""; + object.voiceConfig = null; + } + if (message.speaker != null && message.hasOwnProperty("speaker")) + object.speaker = message.speaker; + if (message.voiceConfig != null && message.hasOwnProperty("voiceConfig")) + object.voiceConfig = $root.google.ai.generativelanguage.v1beta.VoiceConfig.toObject(message.voiceConfig, options); + return object; + }; + + /** + * Converts this SpeakerVoiceConfig to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta.SpeakerVoiceConfig + * @instance + * @returns {Object.} JSON object + */ + SpeakerVoiceConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpeakerVoiceConfig + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta.SpeakerVoiceConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpeakerVoiceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.SpeakerVoiceConfig"; + }; + + return SpeakerVoiceConfig; + })(); + + v1beta.MultiSpeakerVoiceConfig = (function() { + + /** + * Properties of a MultiSpeakerVoiceConfig. + * @memberof google.ai.generativelanguage.v1beta + * @interface IMultiSpeakerVoiceConfig + * @property {Array.|null} [speakerVoiceConfigs] MultiSpeakerVoiceConfig speakerVoiceConfigs + */ + + /** + * Constructs a new MultiSpeakerVoiceConfig. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents a MultiSpeakerVoiceConfig. + * @implements IMultiSpeakerVoiceConfig + * @constructor + * @param {google.ai.generativelanguage.v1beta.IMultiSpeakerVoiceConfig=} [properties] Properties to set + */ + function MultiSpeakerVoiceConfig(properties) { + this.speakerVoiceConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MultiSpeakerVoiceConfig speakerVoiceConfigs. + * @member {Array.} speakerVoiceConfigs + * @memberof google.ai.generativelanguage.v1beta.MultiSpeakerVoiceConfig + * @instance + */ + MultiSpeakerVoiceConfig.prototype.speakerVoiceConfigs = $util.emptyArray; + + /** + * Creates a new MultiSpeakerVoiceConfig instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta.MultiSpeakerVoiceConfig + * @static + * @param {google.ai.generativelanguage.v1beta.IMultiSpeakerVoiceConfig=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.MultiSpeakerVoiceConfig} MultiSpeakerVoiceConfig instance + */ + MultiSpeakerVoiceConfig.create = function create(properties) { + return new MultiSpeakerVoiceConfig(properties); + }; + + /** + * Encodes the specified MultiSpeakerVoiceConfig message. Does not implicitly {@link google.ai.generativelanguage.v1beta.MultiSpeakerVoiceConfig.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.MultiSpeakerVoiceConfig + * @static + * @param {google.ai.generativelanguage.v1beta.IMultiSpeakerVoiceConfig} message MultiSpeakerVoiceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MultiSpeakerVoiceConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.speakerVoiceConfigs != null && message.speakerVoiceConfigs.length) + for (var i = 0; i < message.speakerVoiceConfigs.length; ++i) + $root.google.ai.generativelanguage.v1beta.SpeakerVoiceConfig.encode(message.speakerVoiceConfigs[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MultiSpeakerVoiceConfig message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.MultiSpeakerVoiceConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta.MultiSpeakerVoiceConfig + * @static + * @param {google.ai.generativelanguage.v1beta.IMultiSpeakerVoiceConfig} message MultiSpeakerVoiceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MultiSpeakerVoiceConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MultiSpeakerVoiceConfig message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta.MultiSpeakerVoiceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta.MultiSpeakerVoiceConfig} MultiSpeakerVoiceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MultiSpeakerVoiceConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.MultiSpeakerVoiceConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.speakerVoiceConfigs && message.speakerVoiceConfigs.length)) + message.speakerVoiceConfigs = []; + message.speakerVoiceConfigs.push($root.google.ai.generativelanguage.v1beta.SpeakerVoiceConfig.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MultiSpeakerVoiceConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.MultiSpeakerVoiceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta.MultiSpeakerVoiceConfig} MultiSpeakerVoiceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MultiSpeakerVoiceConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MultiSpeakerVoiceConfig message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta.MultiSpeakerVoiceConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MultiSpeakerVoiceConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.speakerVoiceConfigs != null && message.hasOwnProperty("speakerVoiceConfigs")) { + if (!Array.isArray(message.speakerVoiceConfigs)) + return "speakerVoiceConfigs: array expected"; + for (var i = 0; i < message.speakerVoiceConfigs.length; ++i) { + var error = $root.google.ai.generativelanguage.v1beta.SpeakerVoiceConfig.verify(message.speakerVoiceConfigs[i]); + if (error) + return "speakerVoiceConfigs." + error; + } + } + return null; + }; + + /** + * Creates a MultiSpeakerVoiceConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.MultiSpeakerVoiceConfig + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.MultiSpeakerVoiceConfig} MultiSpeakerVoiceConfig + */ + MultiSpeakerVoiceConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.MultiSpeakerVoiceConfig) + return object; + var message = new $root.google.ai.generativelanguage.v1beta.MultiSpeakerVoiceConfig(); + if (object.speakerVoiceConfigs) { + if (!Array.isArray(object.speakerVoiceConfigs)) + throw TypeError(".google.ai.generativelanguage.v1beta.MultiSpeakerVoiceConfig.speakerVoiceConfigs: array expected"); + message.speakerVoiceConfigs = []; + for (var i = 0; i < object.speakerVoiceConfigs.length; ++i) { + if (typeof object.speakerVoiceConfigs[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.MultiSpeakerVoiceConfig.speakerVoiceConfigs: object expected"); + message.speakerVoiceConfigs[i] = $root.google.ai.generativelanguage.v1beta.SpeakerVoiceConfig.fromObject(object.speakerVoiceConfigs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MultiSpeakerVoiceConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.MultiSpeakerVoiceConfig + * @static + * @param {google.ai.generativelanguage.v1beta.MultiSpeakerVoiceConfig} message MultiSpeakerVoiceConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MultiSpeakerVoiceConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.speakerVoiceConfigs = []; + if (message.speakerVoiceConfigs && message.speakerVoiceConfigs.length) { + object.speakerVoiceConfigs = []; + for (var j = 0; j < message.speakerVoiceConfigs.length; ++j) + object.speakerVoiceConfigs[j] = $root.google.ai.generativelanguage.v1beta.SpeakerVoiceConfig.toObject(message.speakerVoiceConfigs[j], options); + } + return object; + }; + + /** + * Converts this MultiSpeakerVoiceConfig to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta.MultiSpeakerVoiceConfig + * @instance + * @returns {Object.} JSON object + */ + MultiSpeakerVoiceConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MultiSpeakerVoiceConfig + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta.MultiSpeakerVoiceConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MultiSpeakerVoiceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.MultiSpeakerVoiceConfig"; + }; + + return MultiSpeakerVoiceConfig; + })(); + v1beta.SpeechConfig = (function() { /** @@ -76277,6 +78643,7 @@ * @memberof google.ai.generativelanguage.v1beta * @interface ISpeechConfig * @property {google.ai.generativelanguage.v1beta.IVoiceConfig|null} [voiceConfig] SpeechConfig voiceConfig + * @property {google.ai.generativelanguage.v1beta.IMultiSpeakerVoiceConfig|null} [multiSpeakerVoiceConfig] SpeechConfig multiSpeakerVoiceConfig * @property {string|null} [languageCode] SpeechConfig languageCode */ @@ -76303,6 +78670,14 @@ */ SpeechConfig.prototype.voiceConfig = null; + /** + * SpeechConfig multiSpeakerVoiceConfig. + * @member {google.ai.generativelanguage.v1beta.IMultiSpeakerVoiceConfig|null|undefined} multiSpeakerVoiceConfig + * @memberof google.ai.generativelanguage.v1beta.SpeechConfig + * @instance + */ + SpeechConfig.prototype.multiSpeakerVoiceConfig = null; + /** * SpeechConfig languageCode. * @member {string} languageCode @@ -76339,6 +78714,8 @@ $root.google.ai.generativelanguage.v1beta.VoiceConfig.encode(message.voiceConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + if (message.multiSpeakerVoiceConfig != null && Object.hasOwnProperty.call(message, "multiSpeakerVoiceConfig")) + $root.google.ai.generativelanguage.v1beta.MultiSpeakerVoiceConfig.encode(message.multiSpeakerVoiceConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -76379,6 +78756,10 @@ message.voiceConfig = $root.google.ai.generativelanguage.v1beta.VoiceConfig.decode(reader, reader.uint32()); break; } + case 3: { + message.multiSpeakerVoiceConfig = $root.google.ai.generativelanguage.v1beta.MultiSpeakerVoiceConfig.decode(reader, reader.uint32()); + break; + } case 2: { message.languageCode = reader.string(); break; @@ -76423,6 +78804,11 @@ if (error) return "voiceConfig." + error; } + if (message.multiSpeakerVoiceConfig != null && message.hasOwnProperty("multiSpeakerVoiceConfig")) { + var error = $root.google.ai.generativelanguage.v1beta.MultiSpeakerVoiceConfig.verify(message.multiSpeakerVoiceConfig); + if (error) + return "multiSpeakerVoiceConfig." + error; + } if (message.languageCode != null && message.hasOwnProperty("languageCode")) if (!$util.isString(message.languageCode)) return "languageCode: string expected"; @@ -76446,6 +78832,11 @@ throw TypeError(".google.ai.generativelanguage.v1beta.SpeechConfig.voiceConfig: object expected"); message.voiceConfig = $root.google.ai.generativelanguage.v1beta.VoiceConfig.fromObject(object.voiceConfig); } + if (object.multiSpeakerVoiceConfig != null) { + if (typeof object.multiSpeakerVoiceConfig !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.SpeechConfig.multiSpeakerVoiceConfig: object expected"); + message.multiSpeakerVoiceConfig = $root.google.ai.generativelanguage.v1beta.MultiSpeakerVoiceConfig.fromObject(object.multiSpeakerVoiceConfig); + } if (object.languageCode != null) message.languageCode = String(object.languageCode); return message; @@ -76467,11 +78858,14 @@ if (options.defaults) { object.voiceConfig = null; object.languageCode = ""; + object.multiSpeakerVoiceConfig = null; } if (message.voiceConfig != null && message.hasOwnProperty("voiceConfig")) object.voiceConfig = $root.google.ai.generativelanguage.v1beta.VoiceConfig.toObject(message.voiceConfig, options); if (message.languageCode != null && message.hasOwnProperty("languageCode")) object.languageCode = message.languageCode; + if (message.multiSpeakerVoiceConfig != null && message.hasOwnProperty("multiSpeakerVoiceConfig")) + object.multiSpeakerVoiceConfig = $root.google.ai.generativelanguage.v1beta.MultiSpeakerVoiceConfig.toObject(message.multiSpeakerVoiceConfig, options); return object; }; @@ -76770,6 +79164,7 @@ * @property {number|null} [seed] GenerationConfig seed * @property {string|null} [responseMimeType] GenerationConfig responseMimeType * @property {google.ai.generativelanguage.v1beta.ISchema|null} [responseSchema] GenerationConfig responseSchema + * @property {google.protobuf.IValue|null} [responseJsonSchema] GenerationConfig responseJsonSchema * @property {number|null} [presencePenalty] GenerationConfig presencePenalty * @property {number|null} [frequencyPenalty] GenerationConfig frequencyPenalty * @property {boolean|null} [responseLogprobs] GenerationConfig responseLogprobs @@ -76870,6 +79265,14 @@ */ GenerationConfig.prototype.responseSchema = null; + /** + * GenerationConfig responseJsonSchema. + * @member {google.protobuf.IValue|null|undefined} responseJsonSchema + * @memberof google.ai.generativelanguage.v1beta.GenerationConfig + * @instance + */ + GenerationConfig.prototype.responseJsonSchema = null; + /** * GenerationConfig presencePenalty. * @member {number|null|undefined} presencePenalty @@ -77094,6 +79497,8 @@ $root.google.ai.generativelanguage.v1beta.ThinkingConfig.encode(message.thinkingConfig, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); if (message.mediaResolution != null && Object.hasOwnProperty.call(message, "mediaResolution")) writer.uint32(/* id 23, wireType 0 =*/184).int32(message.mediaResolution); + if (message.responseJsonSchema != null && Object.hasOwnProperty.call(message, "responseJsonSchema")) + $root.google.protobuf.Value.encode(message.responseJsonSchema, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); return writer; }; @@ -77168,6 +79573,10 @@ message.responseSchema = $root.google.ai.generativelanguage.v1beta.Schema.decode(reader, reader.uint32()); break; } + case 24: { + message.responseJsonSchema = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + } case 15: { message.presencePenalty = reader.float(); break; @@ -77292,6 +79701,11 @@ if (error) return "responseSchema." + error; } + if (message.responseJsonSchema != null && message.hasOwnProperty("responseJsonSchema")) { + var error = $root.google.protobuf.Value.verify(message.responseJsonSchema); + if (error) + return "responseJsonSchema." + error; + } if (message.presencePenalty != null && message.hasOwnProperty("presencePenalty")) { properties._presencePenalty = 1; if (typeof message.presencePenalty !== "number") @@ -77400,6 +79814,11 @@ throw TypeError(".google.ai.generativelanguage.v1beta.GenerationConfig.responseSchema: object expected"); message.responseSchema = $root.google.ai.generativelanguage.v1beta.Schema.fromObject(object.responseSchema); } + if (object.responseJsonSchema != null) { + if (typeof object.responseJsonSchema !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.GenerationConfig.responseJsonSchema: object expected"); + message.responseJsonSchema = $root.google.protobuf.Value.fromObject(object.responseJsonSchema); + } if (object.presencePenalty != null) message.presencePenalty = Number(object.presencePenalty); if (object.frequencyPenalty != null) @@ -77496,6 +79915,7 @@ if (options.defaults) { object.responseMimeType = ""; object.responseSchema = null; + object.responseJsonSchema = null; } if (message.candidateCount != null && message.hasOwnProperty("candidateCount")) { object.candidateCount = message.candidateCount; @@ -77581,6 +80001,8 @@ if (options.oneofs) object._mediaResolution = "mediaResolution"; } + if (message.responseJsonSchema != null && message.hasOwnProperty("responseJsonSchema")) + object.responseJsonSchema = $root.google.protobuf.Value.toObject(message.responseJsonSchema, options); return object; }; @@ -78008,6 +80430,7 @@ * @property {google.ai.generativelanguage.v1beta.GenerateContentResponse.IPromptFeedback|null} [promptFeedback] GenerateContentResponse promptFeedback * @property {google.ai.generativelanguage.v1beta.GenerateContentResponse.IUsageMetadata|null} [usageMetadata] GenerateContentResponse usageMetadata * @property {string|null} [modelVersion] GenerateContentResponse modelVersion + * @property {string|null} [responseId] GenerateContentResponse responseId */ /** @@ -78058,6 +80481,14 @@ */ GenerateContentResponse.prototype.modelVersion = ""; + /** + * GenerateContentResponse responseId. + * @member {string} responseId + * @memberof google.ai.generativelanguage.v1beta.GenerateContentResponse + * @instance + */ + GenerateContentResponse.prototype.responseId = ""; + /** * Creates a new GenerateContentResponse instance using the specified properties. * @function create @@ -78091,6 +80522,8 @@ $root.google.ai.generativelanguage.v1beta.GenerateContentResponse.UsageMetadata.encode(message.usageMetadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.modelVersion != null && Object.hasOwnProperty.call(message, "modelVersion")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.modelVersion); + if (message.responseId != null && Object.hasOwnProperty.call(message, "responseId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.responseId); return writer; }; @@ -78145,6 +80578,10 @@ message.modelVersion = reader.string(); break; } + case 5: { + message.responseId = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -78202,6 +80639,9 @@ if (message.modelVersion != null && message.hasOwnProperty("modelVersion")) if (!$util.isString(message.modelVersion)) return "modelVersion: string expected"; + if (message.responseId != null && message.hasOwnProperty("responseId")) + if (!$util.isString(message.responseId)) + return "responseId: string expected"; return null; }; @@ -78239,6 +80679,8 @@ } if (object.modelVersion != null) message.modelVersion = String(object.modelVersion); + if (object.responseId != null) + message.responseId = String(object.responseId); return message; }; @@ -78261,6 +80703,7 @@ object.promptFeedback = null; object.usageMetadata = null; object.modelVersion = ""; + object.responseId = ""; } if (message.candidates && message.candidates.length) { object.candidates = []; @@ -78273,6 +80716,8 @@ object.usageMetadata = $root.google.ai.generativelanguage.v1beta.GenerateContentResponse.UsageMetadata.toObject(message.usageMetadata, options); if (message.modelVersion != null && message.hasOwnProperty("modelVersion")) object.modelVersion = message.modelVersion; + if (message.responseId != null && message.hasOwnProperty("responseId")) + object.responseId = message.responseId; return object; }; @@ -79131,6 +81576,7 @@ * @property {google.ai.generativelanguage.v1beta.IGroundingMetadata|null} [groundingMetadata] Candidate groundingMetadata * @property {number|null} [avgLogprobs] Candidate avgLogprobs * @property {google.ai.generativelanguage.v1beta.ILogprobsResult|null} [logprobsResult] Candidate logprobsResult + * @property {google.ai.generativelanguage.v1beta.IUrlContextMetadata|null} [urlContextMetadata] Candidate urlContextMetadata */ /** @@ -79230,6 +81676,14 @@ */ Candidate.prototype.logprobsResult = null; + /** + * Candidate urlContextMetadata. + * @member {google.ai.generativelanguage.v1beta.IUrlContextMetadata|null|undefined} urlContextMetadata + * @memberof google.ai.generativelanguage.v1beta.Candidate + * @instance + */ + Candidate.prototype.urlContextMetadata = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -79285,6 +81739,8 @@ writer.uint32(/* id 10, wireType 1 =*/81).double(message.avgLogprobs); if (message.logprobsResult != null && Object.hasOwnProperty.call(message, "logprobsResult")) $root.google.ai.generativelanguage.v1beta.LogprobsResult.encode(message.logprobsResult, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.urlContextMetadata != null && Object.hasOwnProperty.call(message, "urlContextMetadata")) + $root.google.ai.generativelanguage.v1beta.UrlContextMetadata.encode(message.urlContextMetadata, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); return writer; }; @@ -79365,6 +81821,10 @@ message.logprobsResult = $root.google.ai.generativelanguage.v1beta.LogprobsResult.decode(reader, reader.uint32()); break; } + case 13: { + message.urlContextMetadata = $root.google.ai.generativelanguage.v1beta.UrlContextMetadata.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -79427,6 +81887,7 @@ case 9: case 10: case 11: + case 12: break; } if (message.safetyRatings != null && message.hasOwnProperty("safetyRatings")) { @@ -79468,6 +81929,11 @@ if (error) return "logprobsResult." + error; } + if (message.urlContextMetadata != null && message.hasOwnProperty("urlContextMetadata")) { + var error = $root.google.ai.generativelanguage.v1beta.UrlContextMetadata.verify(message.urlContextMetadata); + if (error) + return "urlContextMetadata." + error; + } return null; }; @@ -79545,6 +82011,10 @@ case 11: message.finishReason = 11; break; + case "UNEXPECTED_TOOL_CALL": + case 12: + message.finishReason = 12; + break; } if (object.safetyRatings) { if (!Array.isArray(object.safetyRatings)) @@ -79585,6 +82055,11 @@ throw TypeError(".google.ai.generativelanguage.v1beta.Candidate.logprobsResult: object expected"); message.logprobsResult = $root.google.ai.generativelanguage.v1beta.LogprobsResult.fromObject(object.logprobsResult); } + if (object.urlContextMetadata != null) { + if (typeof object.urlContextMetadata !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.Candidate.urlContextMetadata: object expected"); + message.urlContextMetadata = $root.google.ai.generativelanguage.v1beta.UrlContextMetadata.fromObject(object.urlContextMetadata); + } return message; }; @@ -79613,6 +82088,7 @@ object.groundingMetadata = null; object.avgLogprobs = 0; object.logprobsResult = null; + object.urlContextMetadata = null; } if (message.content != null && message.hasOwnProperty("content")) object.content = $root.google.ai.generativelanguage.v1beta.Content.toObject(message.content, options); @@ -79643,6 +82119,8 @@ object.avgLogprobs = options.json && !isFinite(message.avgLogprobs) ? String(message.avgLogprobs) : message.avgLogprobs; if (message.logprobsResult != null && message.hasOwnProperty("logprobsResult")) object.logprobsResult = $root.google.ai.generativelanguage.v1beta.LogprobsResult.toObject(message.logprobsResult, options); + if (message.urlContextMetadata != null && message.hasOwnProperty("urlContextMetadata")) + object.urlContextMetadata = $root.google.ai.generativelanguage.v1beta.UrlContextMetadata.toObject(message.urlContextMetadata, options); return object; }; @@ -79688,6 +82166,7 @@ * @property {number} SPII=9 SPII value * @property {number} MALFORMED_FUNCTION_CALL=10 MALFORMED_FUNCTION_CALL value * @property {number} IMAGE_SAFETY=11 IMAGE_SAFETY value + * @property {number} UNEXPECTED_TOOL_CALL=12 UNEXPECTED_TOOL_CALL value */ Candidate.FinishReason = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -79703,12 +82182,508 @@ values[valuesById[9] = "SPII"] = 9; values[valuesById[10] = "MALFORMED_FUNCTION_CALL"] = 10; values[valuesById[11] = "IMAGE_SAFETY"] = 11; + values[valuesById[12] = "UNEXPECTED_TOOL_CALL"] = 12; return values; })(); return Candidate; })(); + v1beta.UrlContextMetadata = (function() { + + /** + * Properties of an UrlContextMetadata. + * @memberof google.ai.generativelanguage.v1beta + * @interface IUrlContextMetadata + * @property {Array.|null} [urlMetadata] UrlContextMetadata urlMetadata + */ + + /** + * Constructs a new UrlContextMetadata. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents an UrlContextMetadata. + * @implements IUrlContextMetadata + * @constructor + * @param {google.ai.generativelanguage.v1beta.IUrlContextMetadata=} [properties] Properties to set + */ + function UrlContextMetadata(properties) { + this.urlMetadata = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UrlContextMetadata urlMetadata. + * @member {Array.} urlMetadata + * @memberof google.ai.generativelanguage.v1beta.UrlContextMetadata + * @instance + */ + UrlContextMetadata.prototype.urlMetadata = $util.emptyArray; + + /** + * Creates a new UrlContextMetadata instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta.UrlContextMetadata + * @static + * @param {google.ai.generativelanguage.v1beta.IUrlContextMetadata=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.UrlContextMetadata} UrlContextMetadata instance + */ + UrlContextMetadata.create = function create(properties) { + return new UrlContextMetadata(properties); + }; + + /** + * Encodes the specified UrlContextMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1beta.UrlContextMetadata.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.UrlContextMetadata + * @static + * @param {google.ai.generativelanguage.v1beta.IUrlContextMetadata} message UrlContextMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UrlContextMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.urlMetadata != null && message.urlMetadata.length) + for (var i = 0; i < message.urlMetadata.length; ++i) + $root.google.ai.generativelanguage.v1beta.UrlMetadata.encode(message.urlMetadata[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UrlContextMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.UrlContextMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta.UrlContextMetadata + * @static + * @param {google.ai.generativelanguage.v1beta.IUrlContextMetadata} message UrlContextMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UrlContextMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UrlContextMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta.UrlContextMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta.UrlContextMetadata} UrlContextMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UrlContextMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.UrlContextMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.urlMetadata && message.urlMetadata.length)) + message.urlMetadata = []; + message.urlMetadata.push($root.google.ai.generativelanguage.v1beta.UrlMetadata.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UrlContextMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.UrlContextMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta.UrlContextMetadata} UrlContextMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UrlContextMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UrlContextMetadata message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta.UrlContextMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UrlContextMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.urlMetadata != null && message.hasOwnProperty("urlMetadata")) { + if (!Array.isArray(message.urlMetadata)) + return "urlMetadata: array expected"; + for (var i = 0; i < message.urlMetadata.length; ++i) { + var error = $root.google.ai.generativelanguage.v1beta.UrlMetadata.verify(message.urlMetadata[i]); + if (error) + return "urlMetadata." + error; + } + } + return null; + }; + + /** + * Creates an UrlContextMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.UrlContextMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.UrlContextMetadata} UrlContextMetadata + */ + UrlContextMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.UrlContextMetadata) + return object; + var message = new $root.google.ai.generativelanguage.v1beta.UrlContextMetadata(); + if (object.urlMetadata) { + if (!Array.isArray(object.urlMetadata)) + throw TypeError(".google.ai.generativelanguage.v1beta.UrlContextMetadata.urlMetadata: array expected"); + message.urlMetadata = []; + for (var i = 0; i < object.urlMetadata.length; ++i) { + if (typeof object.urlMetadata[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.UrlContextMetadata.urlMetadata: object expected"); + message.urlMetadata[i] = $root.google.ai.generativelanguage.v1beta.UrlMetadata.fromObject(object.urlMetadata[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an UrlContextMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.UrlContextMetadata + * @static + * @param {google.ai.generativelanguage.v1beta.UrlContextMetadata} message UrlContextMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UrlContextMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.urlMetadata = []; + if (message.urlMetadata && message.urlMetadata.length) { + object.urlMetadata = []; + for (var j = 0; j < message.urlMetadata.length; ++j) + object.urlMetadata[j] = $root.google.ai.generativelanguage.v1beta.UrlMetadata.toObject(message.urlMetadata[j], options); + } + return object; + }; + + /** + * Converts this UrlContextMetadata to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta.UrlContextMetadata + * @instance + * @returns {Object.} JSON object + */ + UrlContextMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UrlContextMetadata + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta.UrlContextMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UrlContextMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.UrlContextMetadata"; + }; + + return UrlContextMetadata; + })(); + + v1beta.UrlMetadata = (function() { + + /** + * Properties of an UrlMetadata. + * @memberof google.ai.generativelanguage.v1beta + * @interface IUrlMetadata + * @property {string|null} [retrievedUrl] UrlMetadata retrievedUrl + * @property {google.ai.generativelanguage.v1beta.UrlMetadata.UrlRetrievalStatus|null} [urlRetrievalStatus] UrlMetadata urlRetrievalStatus + */ + + /** + * Constructs a new UrlMetadata. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents an UrlMetadata. + * @implements IUrlMetadata + * @constructor + * @param {google.ai.generativelanguage.v1beta.IUrlMetadata=} [properties] Properties to set + */ + function UrlMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UrlMetadata retrievedUrl. + * @member {string} retrievedUrl + * @memberof google.ai.generativelanguage.v1beta.UrlMetadata + * @instance + */ + UrlMetadata.prototype.retrievedUrl = ""; + + /** + * UrlMetadata urlRetrievalStatus. + * @member {google.ai.generativelanguage.v1beta.UrlMetadata.UrlRetrievalStatus} urlRetrievalStatus + * @memberof google.ai.generativelanguage.v1beta.UrlMetadata + * @instance + */ + UrlMetadata.prototype.urlRetrievalStatus = 0; + + /** + * Creates a new UrlMetadata instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta.UrlMetadata + * @static + * @param {google.ai.generativelanguage.v1beta.IUrlMetadata=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.UrlMetadata} UrlMetadata instance + */ + UrlMetadata.create = function create(properties) { + return new UrlMetadata(properties); + }; + + /** + * Encodes the specified UrlMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1beta.UrlMetadata.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.UrlMetadata + * @static + * @param {google.ai.generativelanguage.v1beta.IUrlMetadata} message UrlMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UrlMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.retrievedUrl != null && Object.hasOwnProperty.call(message, "retrievedUrl")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.retrievedUrl); + if (message.urlRetrievalStatus != null && Object.hasOwnProperty.call(message, "urlRetrievalStatus")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.urlRetrievalStatus); + return writer; + }; + + /** + * Encodes the specified UrlMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.UrlMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta.UrlMetadata + * @static + * @param {google.ai.generativelanguage.v1beta.IUrlMetadata} message UrlMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UrlMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UrlMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta.UrlMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta.UrlMetadata} UrlMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UrlMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.UrlMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.retrievedUrl = reader.string(); + break; + } + case 2: { + message.urlRetrievalStatus = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UrlMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.UrlMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta.UrlMetadata} UrlMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UrlMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UrlMetadata message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta.UrlMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UrlMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.retrievedUrl != null && message.hasOwnProperty("retrievedUrl")) + if (!$util.isString(message.retrievedUrl)) + return "retrievedUrl: string expected"; + if (message.urlRetrievalStatus != null && message.hasOwnProperty("urlRetrievalStatus")) + switch (message.urlRetrievalStatus) { + default: + return "urlRetrievalStatus: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an UrlMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.UrlMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.UrlMetadata} UrlMetadata + */ + UrlMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.UrlMetadata) + return object; + var message = new $root.google.ai.generativelanguage.v1beta.UrlMetadata(); + if (object.retrievedUrl != null) + message.retrievedUrl = String(object.retrievedUrl); + switch (object.urlRetrievalStatus) { + default: + if (typeof object.urlRetrievalStatus === "number") { + message.urlRetrievalStatus = object.urlRetrievalStatus; + break; + } + break; + case "URL_RETRIEVAL_STATUS_UNSPECIFIED": + case 0: + message.urlRetrievalStatus = 0; + break; + case "URL_RETRIEVAL_STATUS_SUCCESS": + case 1: + message.urlRetrievalStatus = 1; + break; + case "URL_RETRIEVAL_STATUS_ERROR": + case 2: + message.urlRetrievalStatus = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an UrlMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.UrlMetadata + * @static + * @param {google.ai.generativelanguage.v1beta.UrlMetadata} message UrlMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UrlMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.retrievedUrl = ""; + object.urlRetrievalStatus = options.enums === String ? "URL_RETRIEVAL_STATUS_UNSPECIFIED" : 0; + } + if (message.retrievedUrl != null && message.hasOwnProperty("retrievedUrl")) + object.retrievedUrl = message.retrievedUrl; + if (message.urlRetrievalStatus != null && message.hasOwnProperty("urlRetrievalStatus")) + object.urlRetrievalStatus = options.enums === String ? $root.google.ai.generativelanguage.v1beta.UrlMetadata.UrlRetrievalStatus[message.urlRetrievalStatus] === undefined ? message.urlRetrievalStatus : $root.google.ai.generativelanguage.v1beta.UrlMetadata.UrlRetrievalStatus[message.urlRetrievalStatus] : message.urlRetrievalStatus; + return object; + }; + + /** + * Converts this UrlMetadata to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta.UrlMetadata + * @instance + * @returns {Object.} JSON object + */ + UrlMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UrlMetadata + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta.UrlMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UrlMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.UrlMetadata"; + }; + + /** + * UrlRetrievalStatus enum. + * @name google.ai.generativelanguage.v1beta.UrlMetadata.UrlRetrievalStatus + * @enum {number} + * @property {number} URL_RETRIEVAL_STATUS_UNSPECIFIED=0 URL_RETRIEVAL_STATUS_UNSPECIFIED value + * @property {number} URL_RETRIEVAL_STATUS_SUCCESS=1 URL_RETRIEVAL_STATUS_SUCCESS value + * @property {number} URL_RETRIEVAL_STATUS_ERROR=2 URL_RETRIEVAL_STATUS_ERROR value + */ + UrlMetadata.UrlRetrievalStatus = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "URL_RETRIEVAL_STATUS_UNSPECIFIED"] = 0; + values[valuesById[1] = "URL_RETRIEVAL_STATUS_SUCCESS"] = 1; + values[valuesById[2] = "URL_RETRIEVAL_STATUS_ERROR"] = 2; + return values; + })(); + + return UrlMetadata; + })(); + v1beta.LogprobsResult = (function() { /** @@ -88034,6 +91009,7 @@ * @property {google.ai.generativelanguage.v1beta.IRealtimeInputConfig|null} [realtimeInputConfig] BidiGenerateContentSetup realtimeInputConfig * @property {google.ai.generativelanguage.v1beta.ISessionResumptionConfig|null} [sessionResumption] BidiGenerateContentSetup sessionResumption * @property {google.ai.generativelanguage.v1beta.IContextWindowCompressionConfig|null} [contextWindowCompression] BidiGenerateContentSetup contextWindowCompression + * @property {google.ai.generativelanguage.v1beta.IAudioTranscriptionConfig|null} [inputAudioTranscription] BidiGenerateContentSetup inputAudioTranscription * @property {google.ai.generativelanguage.v1beta.IAudioTranscriptionConfig|null} [outputAudioTranscription] BidiGenerateContentSetup outputAudioTranscription */ @@ -88109,6 +91085,14 @@ */ BidiGenerateContentSetup.prototype.contextWindowCompression = null; + /** + * BidiGenerateContentSetup inputAudioTranscription. + * @member {google.ai.generativelanguage.v1beta.IAudioTranscriptionConfig|null|undefined} inputAudioTranscription + * @memberof google.ai.generativelanguage.v1beta.BidiGenerateContentSetup + * @instance + */ + BidiGenerateContentSetup.prototype.inputAudioTranscription = null; + /** * BidiGenerateContentSetup outputAudioTranscription. * @member {google.ai.generativelanguage.v1beta.IAudioTranscriptionConfig|null|undefined} outputAudioTranscription @@ -88156,6 +91140,8 @@ $root.google.ai.generativelanguage.v1beta.SessionResumptionConfig.encode(message.sessionResumption, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); if (message.contextWindowCompression != null && Object.hasOwnProperty.call(message, "contextWindowCompression")) $root.google.ai.generativelanguage.v1beta.ContextWindowCompressionConfig.encode(message.contextWindowCompression, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.inputAudioTranscription != null && Object.hasOwnProperty.call(message, "inputAudioTranscription")) + $root.google.ai.generativelanguage.v1beta.AudioTranscriptionConfig.encode(message.inputAudioTranscription, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); if (message.outputAudioTranscription != null && Object.hasOwnProperty.call(message, "outputAudioTranscription")) $root.google.ai.generativelanguage.v1beta.AudioTranscriptionConfig.encode(message.outputAudioTranscription, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); return writer; @@ -88224,6 +91210,10 @@ message.contextWindowCompression = $root.google.ai.generativelanguage.v1beta.ContextWindowCompressionConfig.decode(reader, reader.uint32()); break; } + case 10: { + message.inputAudioTranscription = $root.google.ai.generativelanguage.v1beta.AudioTranscriptionConfig.decode(reader, reader.uint32()); + break; + } case 11: { message.outputAudioTranscription = $root.google.ai.generativelanguage.v1beta.AudioTranscriptionConfig.decode(reader, reader.uint32()); break; @@ -88300,6 +91290,11 @@ if (error) return "contextWindowCompression." + error; } + if (message.inputAudioTranscription != null && message.hasOwnProperty("inputAudioTranscription")) { + var error = $root.google.ai.generativelanguage.v1beta.AudioTranscriptionConfig.verify(message.inputAudioTranscription); + if (error) + return "inputAudioTranscription." + error; + } if (message.outputAudioTranscription != null && message.hasOwnProperty("outputAudioTranscription")) { var error = $root.google.ai.generativelanguage.v1beta.AudioTranscriptionConfig.verify(message.outputAudioTranscription); if (error) @@ -88357,6 +91352,11 @@ throw TypeError(".google.ai.generativelanguage.v1beta.BidiGenerateContentSetup.contextWindowCompression: object expected"); message.contextWindowCompression = $root.google.ai.generativelanguage.v1beta.ContextWindowCompressionConfig.fromObject(object.contextWindowCompression); } + if (object.inputAudioTranscription != null) { + if (typeof object.inputAudioTranscription !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.BidiGenerateContentSetup.inputAudioTranscription: object expected"); + message.inputAudioTranscription = $root.google.ai.generativelanguage.v1beta.AudioTranscriptionConfig.fromObject(object.inputAudioTranscription); + } if (object.outputAudioTranscription != null) { if (typeof object.outputAudioTranscription !== "object") throw TypeError(".google.ai.generativelanguage.v1beta.BidiGenerateContentSetup.outputAudioTranscription: object expected"); @@ -88387,6 +91387,7 @@ object.realtimeInputConfig = null; object.sessionResumption = null; object.contextWindowCompression = null; + object.inputAudioTranscription = null; object.outputAudioTranscription = null; } if (message.model != null && message.hasOwnProperty("model")) @@ -88406,6 +91407,8 @@ object.sessionResumption = $root.google.ai.generativelanguage.v1beta.SessionResumptionConfig.toObject(message.sessionResumption, options); if (message.contextWindowCompression != null && message.hasOwnProperty("contextWindowCompression")) object.contextWindowCompression = $root.google.ai.generativelanguage.v1beta.ContextWindowCompressionConfig.toObject(message.contextWindowCompression, options); + if (message.inputAudioTranscription != null && message.hasOwnProperty("inputAudioTranscription")) + object.inputAudioTranscription = $root.google.ai.generativelanguage.v1beta.AudioTranscriptionConfig.toObject(message.inputAudioTranscription, options); if (message.outputAudioTranscription != null && message.hasOwnProperty("outputAudioTranscription")) object.outputAudioTranscription = $root.google.ai.generativelanguage.v1beta.AudioTranscriptionConfig.toObject(message.outputAudioTranscription, options); return object; @@ -90202,7 +93205,9 @@ * @property {boolean|null} [turnComplete] BidiGenerateContentServerContent turnComplete * @property {boolean|null} [interrupted] BidiGenerateContentServerContent interrupted * @property {google.ai.generativelanguage.v1beta.IGroundingMetadata|null} [groundingMetadata] BidiGenerateContentServerContent groundingMetadata + * @property {google.ai.generativelanguage.v1beta.IBidiGenerateContentTranscription|null} [inputTranscription] BidiGenerateContentServerContent inputTranscription * @property {google.ai.generativelanguage.v1beta.IBidiGenerateContentTranscription|null} [outputTranscription] BidiGenerateContentServerContent outputTranscription + * @property {google.ai.generativelanguage.v1beta.IUrlContextMetadata|null} [urlContextMetadata] BidiGenerateContentServerContent urlContextMetadata */ /** @@ -90260,6 +93265,14 @@ */ BidiGenerateContentServerContent.prototype.groundingMetadata = null; + /** + * BidiGenerateContentServerContent inputTranscription. + * @member {google.ai.generativelanguage.v1beta.IBidiGenerateContentTranscription|null|undefined} inputTranscription + * @memberof google.ai.generativelanguage.v1beta.BidiGenerateContentServerContent + * @instance + */ + BidiGenerateContentServerContent.prototype.inputTranscription = null; + /** * BidiGenerateContentServerContent outputTranscription. * @member {google.ai.generativelanguage.v1beta.IBidiGenerateContentTranscription|null|undefined} outputTranscription @@ -90268,6 +93281,14 @@ */ BidiGenerateContentServerContent.prototype.outputTranscription = null; + /** + * BidiGenerateContentServerContent urlContextMetadata. + * @member {google.ai.generativelanguage.v1beta.IUrlContextMetadata|null|undefined} urlContextMetadata + * @memberof google.ai.generativelanguage.v1beta.BidiGenerateContentServerContent + * @instance + */ + BidiGenerateContentServerContent.prototype.urlContextMetadata = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -90311,8 +93332,12 @@ $root.google.ai.generativelanguage.v1beta.GroundingMetadata.encode(message.groundingMetadata, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.generationComplete != null && Object.hasOwnProperty.call(message, "generationComplete")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.generationComplete); + if (message.inputTranscription != null && Object.hasOwnProperty.call(message, "inputTranscription")) + $root.google.ai.generativelanguage.v1beta.BidiGenerateContentTranscription.encode(message.inputTranscription, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); if (message.outputTranscription != null && Object.hasOwnProperty.call(message, "outputTranscription")) $root.google.ai.generativelanguage.v1beta.BidiGenerateContentTranscription.encode(message.outputTranscription, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.urlContextMetadata != null && Object.hasOwnProperty.call(message, "urlContextMetadata")) + $root.google.ai.generativelanguage.v1beta.UrlContextMetadata.encode(message.urlContextMetadata, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); return writer; }; @@ -90369,10 +93394,18 @@ message.groundingMetadata = $root.google.ai.generativelanguage.v1beta.GroundingMetadata.decode(reader, reader.uint32()); break; } + case 6: { + message.inputTranscription = $root.google.ai.generativelanguage.v1beta.BidiGenerateContentTranscription.decode(reader, reader.uint32()); + break; + } case 7: { message.outputTranscription = $root.google.ai.generativelanguage.v1beta.BidiGenerateContentTranscription.decode(reader, reader.uint32()); break; } + case 9: { + message.urlContextMetadata = $root.google.ai.generativelanguage.v1beta.UrlContextMetadata.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -90431,11 +93464,21 @@ if (error) return "groundingMetadata." + error; } + if (message.inputTranscription != null && message.hasOwnProperty("inputTranscription")) { + var error = $root.google.ai.generativelanguage.v1beta.BidiGenerateContentTranscription.verify(message.inputTranscription); + if (error) + return "inputTranscription." + error; + } if (message.outputTranscription != null && message.hasOwnProperty("outputTranscription")) { var error = $root.google.ai.generativelanguage.v1beta.BidiGenerateContentTranscription.verify(message.outputTranscription); if (error) return "outputTranscription." + error; } + if (message.urlContextMetadata != null && message.hasOwnProperty("urlContextMetadata")) { + var error = $root.google.ai.generativelanguage.v1beta.UrlContextMetadata.verify(message.urlContextMetadata); + if (error) + return "urlContextMetadata." + error; + } return null; }; @@ -90467,11 +93510,21 @@ throw TypeError(".google.ai.generativelanguage.v1beta.BidiGenerateContentServerContent.groundingMetadata: object expected"); message.groundingMetadata = $root.google.ai.generativelanguage.v1beta.GroundingMetadata.fromObject(object.groundingMetadata); } + if (object.inputTranscription != null) { + if (typeof object.inputTranscription !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.BidiGenerateContentServerContent.inputTranscription: object expected"); + message.inputTranscription = $root.google.ai.generativelanguage.v1beta.BidiGenerateContentTranscription.fromObject(object.inputTranscription); + } if (object.outputTranscription != null) { if (typeof object.outputTranscription !== "object") throw TypeError(".google.ai.generativelanguage.v1beta.BidiGenerateContentServerContent.outputTranscription: object expected"); message.outputTranscription = $root.google.ai.generativelanguage.v1beta.BidiGenerateContentTranscription.fromObject(object.outputTranscription); } + if (object.urlContextMetadata != null) { + if (typeof object.urlContextMetadata !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.BidiGenerateContentServerContent.urlContextMetadata: object expected"); + message.urlContextMetadata = $root.google.ai.generativelanguage.v1beta.UrlContextMetadata.fromObject(object.urlContextMetadata); + } return message; }; @@ -90493,7 +93546,9 @@ object.interrupted = false; object.groundingMetadata = null; object.generationComplete = false; + object.inputTranscription = null; object.outputTranscription = null; + object.urlContextMetadata = null; } if (message.modelTurn != null && message.hasOwnProperty("modelTurn")) { object.modelTurn = $root.google.ai.generativelanguage.v1beta.Content.toObject(message.modelTurn, options); @@ -90508,8 +93563,12 @@ object.groundingMetadata = $root.google.ai.generativelanguage.v1beta.GroundingMetadata.toObject(message.groundingMetadata, options); if (message.generationComplete != null && message.hasOwnProperty("generationComplete")) object.generationComplete = message.generationComplete; + if (message.inputTranscription != null && message.hasOwnProperty("inputTranscription")) + object.inputTranscription = $root.google.ai.generativelanguage.v1beta.BidiGenerateContentTranscription.toObject(message.inputTranscription, options); if (message.outputTranscription != null && message.hasOwnProperty("outputTranscription")) object.outputTranscription = $root.google.ai.generativelanguage.v1beta.BidiGenerateContentTranscription.toObject(message.outputTranscription, options); + if (message.urlContextMetadata != null && message.hasOwnProperty("urlContextMetadata")) + object.urlContextMetadata = $root.google.ai.generativelanguage.v1beta.UrlContextMetadata.toObject(message.urlContextMetadata, options); return object; }; @@ -94966,6 +98025,7 @@ * @property {number|null} [maxTemperature] Model maxTemperature * @property {number|null} [topP] Model topP * @property {number|null} [topK] Model topK + * @property {boolean|null} [thinking] Model thinking */ /** @@ -95080,6 +98140,14 @@ */ Model.prototype.topK = null; + /** + * Model thinking. + * @member {boolean} thinking + * @memberof google.ai.generativelanguage.v1beta.Model + * @instance + */ + Model.prototype.thinking = false; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -95156,6 +98224,8 @@ writer.uint32(/* id 11, wireType 0 =*/88).int32(message.topK); if (message.maxTemperature != null && Object.hasOwnProperty.call(message, "maxTemperature")) writer.uint32(/* id 13, wireType 5 =*/109).float(message.maxTemperature); + if (message.thinking != null && Object.hasOwnProperty.call(message, "thinking")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.thinking); return writer; }; @@ -95242,6 +98312,10 @@ message.topK = reader.int32(); break; } + case 15: { + message.thinking = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -95326,6 +98400,9 @@ if (!$util.isInteger(message.topK)) return "topK: integer expected"; } + if (message.thinking != null && message.hasOwnProperty("thinking")) + if (typeof message.thinking !== "boolean") + return "thinking: boolean expected"; return null; }; @@ -95370,6 +98447,8 @@ message.topP = Number(object.topP); if (object.topK != null) message.topK = object.topK | 0; + if (object.thinking != null) + message.thinking = Boolean(object.thinking); return message; }; @@ -95396,6 +98475,7 @@ object.description = ""; object.inputTokenLimit = 0; object.outputTokenLimit = 0; + object.thinking = false; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -95436,6 +98516,8 @@ if (options.oneofs) object._maxTemperature = "maxTemperature"; } + if (message.thinking != null && message.hasOwnProperty("thinking")) + object.thinking = message.thinking; return object; }; @@ -107724,6 +110806,7 @@ * @interface IRelevantChunk * @property {number|null} [chunkRelevanceScore] RelevantChunk chunkRelevanceScore * @property {google.ai.generativelanguage.v1beta.IChunk|null} [chunk] RelevantChunk chunk + * @property {google.ai.generativelanguage.v1beta.IDocument|null} [document] RelevantChunk document */ /** @@ -107757,6 +110840,14 @@ */ RelevantChunk.prototype.chunk = null; + /** + * RelevantChunk document. + * @member {google.ai.generativelanguage.v1beta.IDocument|null|undefined} document + * @memberof google.ai.generativelanguage.v1beta.RelevantChunk + * @instance + */ + RelevantChunk.prototype.document = null; + /** * Creates a new RelevantChunk instance using the specified properties. * @function create @@ -107785,6 +110876,8 @@ writer.uint32(/* id 1, wireType 5 =*/13).float(message.chunkRelevanceScore); if (message.chunk != null && Object.hasOwnProperty.call(message, "chunk")) $root.google.ai.generativelanguage.v1beta.Chunk.encode(message.chunk, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.document != null && Object.hasOwnProperty.call(message, "document")) + $root.google.ai.generativelanguage.v1beta.Document.encode(message.document, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -107829,6 +110922,10 @@ message.chunk = $root.google.ai.generativelanguage.v1beta.Chunk.decode(reader, reader.uint32()); break; } + case 3: { + message.document = $root.google.ai.generativelanguage.v1beta.Document.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -107872,6 +110969,11 @@ if (error) return "chunk." + error; } + if (message.document != null && message.hasOwnProperty("document")) { + var error = $root.google.ai.generativelanguage.v1beta.Document.verify(message.document); + if (error) + return "document." + error; + } return null; }; @@ -107894,6 +110996,11 @@ throw TypeError(".google.ai.generativelanguage.v1beta.RelevantChunk.chunk: object expected"); message.chunk = $root.google.ai.generativelanguage.v1beta.Chunk.fromObject(object.chunk); } + if (object.document != null) { + if (typeof object.document !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.RelevantChunk.document: object expected"); + message.document = $root.google.ai.generativelanguage.v1beta.Document.fromObject(object.document); + } return message; }; @@ -107913,11 +111020,14 @@ if (options.defaults) { object.chunkRelevanceScore = 0; object.chunk = null; + object.document = null; } if (message.chunkRelevanceScore != null && message.hasOwnProperty("chunkRelevanceScore")) object.chunkRelevanceScore = options.json && !isFinite(message.chunkRelevanceScore) ? String(message.chunkRelevanceScore) : message.chunkRelevanceScore; if (message.chunk != null && message.hasOwnProperty("chunk")) object.chunk = $root.google.ai.generativelanguage.v1beta.Chunk.toObject(message.chunk, options); + if (message.document != null && message.hasOwnProperty("document")) + object.document = $root.google.ai.generativelanguage.v1beta.Document.toObject(message.document, options); return object; }; @@ -138551,6 +141661,7 @@ * @interface ICommonLanguageSettings * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri * @property {Array.|null} [destinations] CommonLanguageSettings destinations + * @property {google.api.ISelectiveGapicGeneration|null} [selectiveGapicGeneration] CommonLanguageSettings selectiveGapicGeneration */ /** @@ -138585,6 +141696,14 @@ */ CommonLanguageSettings.prototype.destinations = $util.emptyArray; + /** + * CommonLanguageSettings selectiveGapicGeneration. + * @member {google.api.ISelectiveGapicGeneration|null|undefined} selectiveGapicGeneration + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.selectiveGapicGeneration = null; + /** * Creates a new CommonLanguageSettings instance using the specified properties. * @function create @@ -138617,6 +141736,8 @@ writer.int32(message.destinations[i]); writer.ldelim(); } + if (message.selectiveGapicGeneration != null && Object.hasOwnProperty.call(message, "selectiveGapicGeneration")) + $root.google.api.SelectiveGapicGeneration.encode(message.selectiveGapicGeneration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -138668,6 +141789,10 @@ message.destinations.push(reader.int32()); break; } + case 3: { + message.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -138719,6 +141844,11 @@ break; } } + if (message.selectiveGapicGeneration != null && message.hasOwnProperty("selectiveGapicGeneration")) { + var error = $root.google.api.SelectiveGapicGeneration.verify(message.selectiveGapicGeneration); + if (error) + return "selectiveGapicGeneration." + error; + } return null; }; @@ -138761,6 +141891,11 @@ break; } } + if (object.selectiveGapicGeneration != null) { + if (typeof object.selectiveGapicGeneration !== "object") + throw TypeError(".google.api.CommonLanguageSettings.selectiveGapicGeneration: object expected"); + message.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.fromObject(object.selectiveGapicGeneration); + } return message; }; @@ -138779,8 +141914,10 @@ var object = {}; if (options.arrays || options.defaults) object.destinations = []; - if (options.defaults) + if (options.defaults) { object.referenceDocsUri = ""; + object.selectiveGapicGeneration = null; + } if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) object.referenceDocsUri = message.referenceDocsUri; if (message.destinations && message.destinations.length) { @@ -138788,6 +141925,8 @@ for (var j = 0; j < message.destinations.length; ++j) object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; } + if (message.selectiveGapicGeneration != null && message.hasOwnProperty("selectiveGapicGeneration")) + object.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.toObject(message.selectiveGapicGeneration, options); return object; }; @@ -140610,6 +143749,7 @@ * @memberof google.api * @interface IPythonSettings * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common + * @property {google.api.PythonSettings.IExperimentalFeatures|null} [experimentalFeatures] PythonSettings experimentalFeatures */ /** @@ -140635,6 +143775,14 @@ */ PythonSettings.prototype.common = null; + /** + * PythonSettings experimentalFeatures. + * @member {google.api.PythonSettings.IExperimentalFeatures|null|undefined} experimentalFeatures + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.experimentalFeatures = null; + /** * Creates a new PythonSettings instance using the specified properties. * @function create @@ -140661,6 +143809,8 @@ writer = $Writer.create(); if (message.common != null && Object.hasOwnProperty.call(message, "common")) $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.experimentalFeatures != null && Object.hasOwnProperty.call(message, "experimentalFeatures")) + $root.google.api.PythonSettings.ExperimentalFeatures.encode(message.experimentalFeatures, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -140701,6 +143851,10 @@ message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); break; } + case 2: { + message.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -140741,6 +143895,11 @@ if (error) return "common." + error; } + if (message.experimentalFeatures != null && message.hasOwnProperty("experimentalFeatures")) { + var error = $root.google.api.PythonSettings.ExperimentalFeatures.verify(message.experimentalFeatures); + if (error) + return "experimentalFeatures." + error; + } return null; }; @@ -140761,6 +143920,11 @@ throw TypeError(".google.api.PythonSettings.common: object expected"); message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); } + if (object.experimentalFeatures != null) { + if (typeof object.experimentalFeatures !== "object") + throw TypeError(".google.api.PythonSettings.experimentalFeatures: object expected"); + message.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.fromObject(object.experimentalFeatures); + } return message; }; @@ -140777,10 +143941,14 @@ if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.common = null; + object.experimentalFeatures = null; + } if (message.common != null && message.hasOwnProperty("common")) object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + if (message.experimentalFeatures != null && message.hasOwnProperty("experimentalFeatures")) + object.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.toObject(message.experimentalFeatures, options); return object; }; @@ -140810,6 +143978,258 @@ return typeUrlPrefix + "/google.api.PythonSettings"; }; + PythonSettings.ExperimentalFeatures = (function() { + + /** + * Properties of an ExperimentalFeatures. + * @memberof google.api.PythonSettings + * @interface IExperimentalFeatures + * @property {boolean|null} [restAsyncIoEnabled] ExperimentalFeatures restAsyncIoEnabled + * @property {boolean|null} [protobufPythonicTypesEnabled] ExperimentalFeatures protobufPythonicTypesEnabled + * @property {boolean|null} [unversionedPackageDisabled] ExperimentalFeatures unversionedPackageDisabled + */ + + /** + * Constructs a new ExperimentalFeatures. + * @memberof google.api.PythonSettings + * @classdesc Represents an ExperimentalFeatures. + * @implements IExperimentalFeatures + * @constructor + * @param {google.api.PythonSettings.IExperimentalFeatures=} [properties] Properties to set + */ + function ExperimentalFeatures(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExperimentalFeatures restAsyncIoEnabled. + * @member {boolean} restAsyncIoEnabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.restAsyncIoEnabled = false; + + /** + * ExperimentalFeatures protobufPythonicTypesEnabled. + * @member {boolean} protobufPythonicTypesEnabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.protobufPythonicTypesEnabled = false; + + /** + * ExperimentalFeatures unversionedPackageDisabled. + * @member {boolean} unversionedPackageDisabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.unversionedPackageDisabled = false; + + /** + * Creates a new ExperimentalFeatures instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures=} [properties] Properties to set + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures instance + */ + ExperimentalFeatures.create = function create(properties) { + return new ExperimentalFeatures(properties); + }; + + /** + * Encodes the specified ExperimentalFeatures message. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures} message ExperimentalFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExperimentalFeatures.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.restAsyncIoEnabled != null && Object.hasOwnProperty.call(message, "restAsyncIoEnabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.restAsyncIoEnabled); + if (message.protobufPythonicTypesEnabled != null && Object.hasOwnProperty.call(message, "protobufPythonicTypesEnabled")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.protobufPythonicTypesEnabled); + if (message.unversionedPackageDisabled != null && Object.hasOwnProperty.call(message, "unversionedPackageDisabled")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.unversionedPackageDisabled); + return writer; + }; + + /** + * Encodes the specified ExperimentalFeatures message, length delimited. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures} message ExperimentalFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExperimentalFeatures.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExperimentalFeatures.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings.ExperimentalFeatures(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.restAsyncIoEnabled = reader.bool(); + break; + } + case 2: { + message.protobufPythonicTypesEnabled = reader.bool(); + break; + } + case 3: { + message.unversionedPackageDisabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExperimentalFeatures.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExperimentalFeatures message. + * @function verify + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExperimentalFeatures.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.restAsyncIoEnabled != null && message.hasOwnProperty("restAsyncIoEnabled")) + if (typeof message.restAsyncIoEnabled !== "boolean") + return "restAsyncIoEnabled: boolean expected"; + if (message.protobufPythonicTypesEnabled != null && message.hasOwnProperty("protobufPythonicTypesEnabled")) + if (typeof message.protobufPythonicTypesEnabled !== "boolean") + return "protobufPythonicTypesEnabled: boolean expected"; + if (message.unversionedPackageDisabled != null && message.hasOwnProperty("unversionedPackageDisabled")) + if (typeof message.unversionedPackageDisabled !== "boolean") + return "unversionedPackageDisabled: boolean expected"; + return null; + }; + + /** + * Creates an ExperimentalFeatures message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + */ + ExperimentalFeatures.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PythonSettings.ExperimentalFeatures) + return object; + var message = new $root.google.api.PythonSettings.ExperimentalFeatures(); + if (object.restAsyncIoEnabled != null) + message.restAsyncIoEnabled = Boolean(object.restAsyncIoEnabled); + if (object.protobufPythonicTypesEnabled != null) + message.protobufPythonicTypesEnabled = Boolean(object.protobufPythonicTypesEnabled); + if (object.unversionedPackageDisabled != null) + message.unversionedPackageDisabled = Boolean(object.unversionedPackageDisabled); + return message; + }; + + /** + * Creates a plain object from an ExperimentalFeatures message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.ExperimentalFeatures} message ExperimentalFeatures + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExperimentalFeatures.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.restAsyncIoEnabled = false; + object.protobufPythonicTypesEnabled = false; + object.unversionedPackageDisabled = false; + } + if (message.restAsyncIoEnabled != null && message.hasOwnProperty("restAsyncIoEnabled")) + object.restAsyncIoEnabled = message.restAsyncIoEnabled; + if (message.protobufPythonicTypesEnabled != null && message.hasOwnProperty("protobufPythonicTypesEnabled")) + object.protobufPythonicTypesEnabled = message.protobufPythonicTypesEnabled; + if (message.unversionedPackageDisabled != null && message.hasOwnProperty("unversionedPackageDisabled")) + object.unversionedPackageDisabled = message.unversionedPackageDisabled; + return object; + }; + + /** + * Converts this ExperimentalFeatures to JSON. + * @function toJSON + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + * @returns {Object.} JSON object + */ + ExperimentalFeatures.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExperimentalFeatures + * @function getTypeUrl + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExperimentalFeatures.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings.ExperimentalFeatures"; + }; + + return ExperimentalFeatures; + })(); + return PythonSettings; })(); @@ -141686,6 +145106,7 @@ * @memberof google.api * @interface IGoSettings * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common + * @property {Object.|null} [renamedServices] GoSettings renamedServices */ /** @@ -141697,6 +145118,7 @@ * @param {google.api.IGoSettings=} [properties] Properties to set */ function GoSettings(properties) { + this.renamedServices = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -141711,6 +145133,14 @@ */ GoSettings.prototype.common = null; + /** + * GoSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.renamedServices = $util.emptyObject; + /** * Creates a new GoSettings instance using the specified properties. * @function create @@ -141737,6 +145167,9 @@ writer = $Writer.create(); if (message.common != null && Object.hasOwnProperty.call(message, "common")) $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); return writer; }; @@ -141767,7 +145200,7 @@ GoSettings.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(), key, value; while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) @@ -141777,6 +145210,29 @@ message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); break; } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedServices[key] = value; + break; + } default: reader.skipType(tag & 7); break; @@ -141817,6 +145273,14 @@ if (error) return "common." + error; } + if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } return null; }; @@ -141837,6 +145301,13 @@ throw TypeError(".google.api.GoSettings.common: object expected"); message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); } + if (object.renamedServices) { + if (typeof object.renamedServices !== "object") + throw TypeError(".google.api.GoSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } return message; }; @@ -141853,10 +145324,18 @@ if (!options) options = {}; var object = {}; + if (options.objects || options.defaults) + object.renamedServices = {}; if (options.defaults) object.common = null; if (message.common != null && message.hasOwnProperty("common")) object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } return object; }; @@ -142495,6 +145974,251 @@ return values; })(); + api.SelectiveGapicGeneration = (function() { + + /** + * Properties of a SelectiveGapicGeneration. + * @memberof google.api + * @interface ISelectiveGapicGeneration + * @property {Array.|null} [methods] SelectiveGapicGeneration methods + * @property {boolean|null} [generateOmittedAsInternal] SelectiveGapicGeneration generateOmittedAsInternal + */ + + /** + * Constructs a new SelectiveGapicGeneration. + * @memberof google.api + * @classdesc Represents a SelectiveGapicGeneration. + * @implements ISelectiveGapicGeneration + * @constructor + * @param {google.api.ISelectiveGapicGeneration=} [properties] Properties to set + */ + function SelectiveGapicGeneration(properties) { + this.methods = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SelectiveGapicGeneration methods. + * @member {Array.} methods + * @memberof google.api.SelectiveGapicGeneration + * @instance + */ + SelectiveGapicGeneration.prototype.methods = $util.emptyArray; + + /** + * SelectiveGapicGeneration generateOmittedAsInternal. + * @member {boolean} generateOmittedAsInternal + * @memberof google.api.SelectiveGapicGeneration + * @instance + */ + SelectiveGapicGeneration.prototype.generateOmittedAsInternal = false; + + /** + * Creates a new SelectiveGapicGeneration instance using the specified properties. + * @function create + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration=} [properties] Properties to set + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration instance + */ + SelectiveGapicGeneration.create = function create(properties) { + return new SelectiveGapicGeneration(properties); + }; + + /** + * Encodes the specified SelectiveGapicGeneration message. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @function encode + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration} message SelectiveGapicGeneration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelectiveGapicGeneration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.methods != null && message.methods.length) + for (var i = 0; i < message.methods.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.methods[i]); + if (message.generateOmittedAsInternal != null && Object.hasOwnProperty.call(message, "generateOmittedAsInternal")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.generateOmittedAsInternal); + return writer; + }; + + /** + * Encodes the specified SelectiveGapicGeneration message, length delimited. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration} message SelectiveGapicGeneration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelectiveGapicGeneration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer. + * @function decode + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelectiveGapicGeneration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.SelectiveGapicGeneration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.methods && message.methods.length)) + message.methods = []; + message.methods.push(reader.string()); + break; + } + case 2: { + message.generateOmittedAsInternal = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelectiveGapicGeneration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SelectiveGapicGeneration message. + * @function verify + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SelectiveGapicGeneration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.methods != null && message.hasOwnProperty("methods")) { + if (!Array.isArray(message.methods)) + return "methods: array expected"; + for (var i = 0; i < message.methods.length; ++i) + if (!$util.isString(message.methods[i])) + return "methods: string[] expected"; + } + if (message.generateOmittedAsInternal != null && message.hasOwnProperty("generateOmittedAsInternal")) + if (typeof message.generateOmittedAsInternal !== "boolean") + return "generateOmittedAsInternal: boolean expected"; + return null; + }; + + /** + * Creates a SelectiveGapicGeneration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {Object.} object Plain object + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + */ + SelectiveGapicGeneration.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.SelectiveGapicGeneration) + return object; + var message = new $root.google.api.SelectiveGapicGeneration(); + if (object.methods) { + if (!Array.isArray(object.methods)) + throw TypeError(".google.api.SelectiveGapicGeneration.methods: array expected"); + message.methods = []; + for (var i = 0; i < object.methods.length; ++i) + message.methods[i] = String(object.methods[i]); + } + if (object.generateOmittedAsInternal != null) + message.generateOmittedAsInternal = Boolean(object.generateOmittedAsInternal); + return message; + }; + + /** + * Creates a plain object from a SelectiveGapicGeneration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.SelectiveGapicGeneration} message SelectiveGapicGeneration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SelectiveGapicGeneration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.methods = []; + if (options.defaults) + object.generateOmittedAsInternal = false; + if (message.methods && message.methods.length) { + object.methods = []; + for (var j = 0; j < message.methods.length; ++j) + object.methods[j] = message.methods[j]; + } + if (message.generateOmittedAsInternal != null && message.hasOwnProperty("generateOmittedAsInternal")) + object.generateOmittedAsInternal = message.generateOmittedAsInternal; + return object; + }; + + /** + * Converts this SelectiveGapicGeneration to JSON. + * @function toJSON + * @memberof google.api.SelectiveGapicGeneration + * @instance + * @returns {Object.} JSON object + */ + SelectiveGapicGeneration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SelectiveGapicGeneration + * @function getTypeUrl + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SelectiveGapicGeneration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.SelectiveGapicGeneration"; + }; + + return SelectiveGapicGeneration; + })(); + /** * LaunchStage enum. * @name google.api.LaunchStage @@ -143452,6 +147176,7 @@ * @name google.protobuf.Edition * @enum {number} * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value + * @property {number} EDITION_LEGACY=900 EDITION_LEGACY value * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value * @property {number} EDITION_2023=1000 EDITION_2023 value @@ -143466,6 +147191,7 @@ protobuf.Edition = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "EDITION_UNKNOWN"] = 0; + values[valuesById[900] = "EDITION_LEGACY"] = 900; values[valuesById[998] = "EDITION_PROTO2"] = 998; values[valuesById[999] = "EDITION_PROTO3"] = 999; values[valuesById[1000] = "EDITION_2023"] = 1000; @@ -143490,6 +147216,7 @@ * @property {Array.|null} [dependency] FileDescriptorProto dependency * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [optionDependency] FileDescriptorProto optionDependency * @property {Array.|null} [messageType] FileDescriptorProto messageType * @property {Array.|null} [enumType] FileDescriptorProto enumType * @property {Array.|null} [service] FileDescriptorProto service @@ -143512,6 +147239,7 @@ this.dependency = []; this.publicDependency = []; this.weakDependency = []; + this.optionDependency = []; this.messageType = []; this.enumType = []; this.service = []; @@ -143562,6 +147290,14 @@ */ FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + /** + * FileDescriptorProto optionDependency. + * @member {Array.} optionDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.optionDependency = $util.emptyArray; + /** * FileDescriptorProto messageType. * @member {Array.} messageType @@ -143683,6 +147419,9 @@ writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); + if (message.optionDependency != null && message.optionDependency.length) + for (var i = 0; i < message.optionDependency.length; ++i) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.optionDependency[i]); return writer; }; @@ -143755,6 +147494,12 @@ message.weakDependency.push(reader.int32()); break; } + case 15: { + if (!(message.optionDependency && message.optionDependency.length)) + message.optionDependency = []; + message.optionDependency.push(reader.string()); + break; + } case 4: { if (!(message.messageType && message.messageType.length)) message.messageType = []; @@ -143857,6 +147602,13 @@ if (!$util.isInteger(message.weakDependency[i])) return "weakDependency: integer[] expected"; } + if (message.optionDependency != null && message.hasOwnProperty("optionDependency")) { + if (!Array.isArray(message.optionDependency)) + return "optionDependency: array expected"; + for (var i = 0; i < message.optionDependency.length; ++i) + if (!$util.isString(message.optionDependency[i])) + return "optionDependency: string[] expected"; + } if (message.messageType != null && message.hasOwnProperty("messageType")) { if (!Array.isArray(message.messageType)) return "messageType: array expected"; @@ -143911,6 +147663,7 @@ default: return "edition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -143963,6 +147716,13 @@ for (var i = 0; i < object.weakDependency.length; ++i) message.weakDependency[i] = object.weakDependency[i] | 0; } + if (object.optionDependency) { + if (!Array.isArray(object.optionDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.optionDependency: array expected"); + message.optionDependency = []; + for (var i = 0; i < object.optionDependency.length; ++i) + message.optionDependency[i] = String(object.optionDependency[i]); + } if (object.messageType) { if (!Array.isArray(object.messageType)) throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); @@ -144026,6 +147786,10 @@ case 0: message.edition = 0; break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; case "EDITION_PROTO2": case 998: message.edition = 998; @@ -144091,6 +147855,7 @@ object.extension = []; object.publicDependency = []; object.weakDependency = []; + object.optionDependency = []; } if (options.defaults) { object.name = ""; @@ -144147,6 +147912,11 @@ object.syntax = message.syntax; if (message.edition != null && message.hasOwnProperty("edition")) object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + if (message.optionDependency && message.optionDependency.length) { + object.optionDependency = []; + for (var j = 0; j < message.optionDependency.length; ++j) + object.optionDependency[j] = message.optionDependency[j]; + } return object; }; @@ -144195,6 +147965,7 @@ * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options * @property {Array.|null} [reservedRange] DescriptorProto reservedRange * @property {Array.|null} [reservedName] DescriptorProto reservedName + * @property {google.protobuf.SymbolVisibility|null} [visibility] DescriptorProto visibility */ /** @@ -144300,6 +148071,14 @@ */ DescriptorProto.prototype.reservedName = $util.emptyArray; + /** + * DescriptorProto visibility. + * @member {google.protobuf.SymbolVisibility} visibility + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.visibility = 0; + /** * Creates a new DescriptorProto instance using the specified properties. * @function create @@ -144352,6 +148131,8 @@ if (message.reservedName != null && message.reservedName.length) for (var i = 0; i < message.reservedName.length; ++i) writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.visibility); return writer; }; @@ -144444,6 +148225,10 @@ message.reservedName.push(reader.string()); break; } + case 11: { + message.visibility = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -144557,6 +148342,15 @@ if (!$util.isString(message.reservedName[i])) return "reservedName: string[] expected"; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + switch (message.visibility) { + default: + return "visibility: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; @@ -144656,6 +148450,26 @@ for (var i = 0; i < object.reservedName.length; ++i) message.reservedName[i] = String(object.reservedName[i]); } + switch (object.visibility) { + default: + if (typeof object.visibility === "number") { + message.visibility = object.visibility; + break; + } + break; + case "VISIBILITY_UNSET": + case 0: + message.visibility = 0; + break; + case "VISIBILITY_LOCAL": + case 1: + message.visibility = 1; + break; + case "VISIBILITY_EXPORT": + case 2: + message.visibility = 2; + break; + } return message; }; @@ -144685,6 +148499,7 @@ if (options.defaults) { object.name = ""; object.options = null; + object.visibility = options.enums === String ? "VISIBILITY_UNSET" : 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -144730,6 +148545,8 @@ for (var j = 0; j < message.reservedName.length; ++j) object.reservedName[j] = message.reservedName[j]; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + object.visibility = options.enums === String ? $root.google.protobuf.SymbolVisibility[message.visibility] === undefined ? message.visibility : $root.google.protobuf.SymbolVisibility[message.visibility] : message.visibility; return object; }; @@ -146774,6 +150591,7 @@ * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + * @property {google.protobuf.SymbolVisibility|null} [visibility] EnumDescriptorProto visibility */ /** @@ -146834,6 +150652,14 @@ */ EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + /** + * EnumDescriptorProto visibility. + * @member {google.protobuf.SymbolVisibility} visibility + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.visibility = 0; + /** * Creates a new EnumDescriptorProto instance using the specified properties. * @function create @@ -146871,6 +150697,8 @@ if (message.reservedName != null && message.reservedName.length) for (var i = 0; i < message.reservedName.length; ++i) writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.visibility); return writer; }; @@ -146933,6 +150761,10 @@ message.reservedName.push(reader.string()); break; } + case 6: { + message.visibility = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -147001,6 +150833,15 @@ if (!$util.isString(message.reservedName[i])) return "reservedName: string[] expected"; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + switch (message.visibility) { + default: + return "visibility: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; @@ -147050,6 +150891,26 @@ for (var i = 0; i < object.reservedName.length; ++i) message.reservedName[i] = String(object.reservedName[i]); } + switch (object.visibility) { + default: + if (typeof object.visibility === "number") { + message.visibility = object.visibility; + break; + } + break; + case "VISIBILITY_UNSET": + case 0: + message.visibility = 0; + break; + case "VISIBILITY_LOCAL": + case 1: + message.visibility = 1; + break; + case "VISIBILITY_EXPORT": + case 2: + message.visibility = 2; + break; + } return message; }; @@ -147074,6 +150935,7 @@ if (options.defaults) { object.name = ""; object.options = null; + object.visibility = options.enums === String ? "VISIBILITY_UNSET" : 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -147094,6 +150956,8 @@ for (var j = 0; j < message.reservedName.length; ++j) object.reservedName[j] = message.reservedName[j]; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + object.visibility = options.enums === String ? $root.google.protobuf.SymbolVisibility[message.visibility] === undefined ? message.visibility : $root.google.protobuf.SymbolVisibility[message.visibility] : message.visibility; return object; }; @@ -149412,6 +153276,7 @@ * @property {Array.|null} [targets] FieldOptions targets * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features + * @property {google.protobuf.FieldOptions.IFeatureSupport|null} [featureSupport] FieldOptions featureSupport * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference @@ -149532,6 +153397,14 @@ */ FieldOptions.prototype.features = null; + /** + * FieldOptions featureSupport. + * @member {google.protobuf.FieldOptions.IFeatureSupport|null|undefined} featureSupport + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.featureSupport = null; + /** * FieldOptions uninterpretedOption. * @member {Array.} uninterpretedOption @@ -149606,6 +153479,8 @@ $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); if (message.features != null && Object.hasOwnProperty.call(message, "features")) $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) + $root.google.protobuf.FieldOptions.FeatureSupport.encode(message.featureSupport, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); @@ -149707,6 +153582,10 @@ message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); break; } + case 22: { + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.decode(reader, reader.uint32()); + break; + } case 999: { if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; @@ -149842,6 +153721,11 @@ if (error) return "features." + error; } + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) { + var error = $root.google.protobuf.FieldOptions.FeatureSupport.verify(message.featureSupport); + if (error) + return "featureSupport." + error; + } if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; @@ -150030,6 +153914,11 @@ throw TypeError(".google.protobuf.FieldOptions.features: object expected"); message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); } + if (object.featureSupport != null) { + if (typeof object.featureSupport !== "object") + throw TypeError(".google.protobuf.FieldOptions.featureSupport: object expected"); + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.fromObject(object.featureSupport); + } if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); @@ -150127,6 +154016,7 @@ object.debugRedact = false; object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; object.features = null; + object.featureSupport = null; object[".google.api.resourceReference"] = null; } if (message.ctype != null && message.hasOwnProperty("ctype")) @@ -150159,6 +154049,8 @@ } if (message.features != null && message.hasOwnProperty("features")) object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) + object.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.toObject(message.featureSupport, options); if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) @@ -150431,6 +154323,7 @@ default: return "edition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -150472,6 +154365,10 @@ case 0: message.edition = 0; break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; case "EDITION_PROTO2": case 998: message.edition = 998; @@ -150571,6 +154468,488 @@ return EditionDefault; })(); + FieldOptions.FeatureSupport = (function() { + + /** + * Properties of a FeatureSupport. + * @memberof google.protobuf.FieldOptions + * @interface IFeatureSupport + * @property {google.protobuf.Edition|null} [editionIntroduced] FeatureSupport editionIntroduced + * @property {google.protobuf.Edition|null} [editionDeprecated] FeatureSupport editionDeprecated + * @property {string|null} [deprecationWarning] FeatureSupport deprecationWarning + * @property {google.protobuf.Edition|null} [editionRemoved] FeatureSupport editionRemoved + */ + + /** + * Constructs a new FeatureSupport. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents a FeatureSupport. + * @implements IFeatureSupport + * @constructor + * @param {google.protobuf.FieldOptions.IFeatureSupport=} [properties] Properties to set + */ + function FeatureSupport(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSupport editionIntroduced. + * @member {google.protobuf.Edition} editionIntroduced + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionIntroduced = 0; + + /** + * FeatureSupport editionDeprecated. + * @member {google.protobuf.Edition} editionDeprecated + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionDeprecated = 0; + + /** + * FeatureSupport deprecationWarning. + * @member {string} deprecationWarning + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.deprecationWarning = ""; + + /** + * FeatureSupport editionRemoved. + * @member {google.protobuf.Edition} editionRemoved + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionRemoved = 0; + + /** + * Creates a new FeatureSupport instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport instance + */ + FeatureSupport.create = function create(properties) { + return new FeatureSupport(properties); + }; + + /** + * Encodes the specified FeatureSupport message. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport} message FeatureSupport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSupport.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.editionIntroduced != null && Object.hasOwnProperty.call(message, "editionIntroduced")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.editionIntroduced); + if (message.editionDeprecated != null && Object.hasOwnProperty.call(message, "editionDeprecated")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.editionDeprecated); + if (message.deprecationWarning != null && Object.hasOwnProperty.call(message, "deprecationWarning")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.deprecationWarning); + if (message.editionRemoved != null && Object.hasOwnProperty.call(message, "editionRemoved")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.editionRemoved); + return writer; + }; + + /** + * Encodes the specified FeatureSupport message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport} message FeatureSupport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSupport.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSupport.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.FeatureSupport(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.editionIntroduced = reader.int32(); + break; + } + case 2: { + message.editionDeprecated = reader.int32(); + break; + } + case 3: { + message.deprecationWarning = reader.string(); + break; + } + case 4: { + message.editionRemoved = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSupport.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSupport message. + * @function verify + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSupport.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.editionIntroduced != null && message.hasOwnProperty("editionIntroduced")) + switch (message.editionIntroduced) { + default: + return "editionIntroduced: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.editionDeprecated != null && message.hasOwnProperty("editionDeprecated")) + switch (message.editionDeprecated) { + default: + return "editionDeprecated: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.deprecationWarning != null && message.hasOwnProperty("deprecationWarning")) + if (!$util.isString(message.deprecationWarning)) + return "deprecationWarning: string expected"; + if (message.editionRemoved != null && message.hasOwnProperty("editionRemoved")) + switch (message.editionRemoved) { + default: + return "editionRemoved: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FeatureSupport message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + */ + FeatureSupport.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions.FeatureSupport) + return object; + var message = new $root.google.protobuf.FieldOptions.FeatureSupport(); + switch (object.editionIntroduced) { + default: + if (typeof object.editionIntroduced === "number") { + message.editionIntroduced = object.editionIntroduced; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionIntroduced = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionIntroduced = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionIntroduced = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionIntroduced = 999; + break; + case "EDITION_2023": + case 1000: + message.editionIntroduced = 1000; + break; + case "EDITION_2024": + case 1001: + message.editionIntroduced = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.editionIntroduced = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.editionIntroduced = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.editionIntroduced = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.editionIntroduced = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.editionIntroduced = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.editionIntroduced = 2147483647; + break; + } + switch (object.editionDeprecated) { + default: + if (typeof object.editionDeprecated === "number") { + message.editionDeprecated = object.editionDeprecated; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionDeprecated = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionDeprecated = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionDeprecated = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionDeprecated = 999; + break; + case "EDITION_2023": + case 1000: + message.editionDeprecated = 1000; + break; + case "EDITION_2024": + case 1001: + message.editionDeprecated = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.editionDeprecated = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.editionDeprecated = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.editionDeprecated = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.editionDeprecated = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.editionDeprecated = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.editionDeprecated = 2147483647; + break; + } + if (object.deprecationWarning != null) + message.deprecationWarning = String(object.deprecationWarning); + switch (object.editionRemoved) { + default: + if (typeof object.editionRemoved === "number") { + message.editionRemoved = object.editionRemoved; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionRemoved = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionRemoved = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionRemoved = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionRemoved = 999; + break; + case "EDITION_2023": + case 1000: + message.editionRemoved = 1000; + break; + case "EDITION_2024": + case 1001: + message.editionRemoved = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.editionRemoved = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.editionRemoved = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.editionRemoved = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.editionRemoved = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.editionRemoved = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.editionRemoved = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSupport message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.FeatureSupport} message FeatureSupport + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSupport.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.editionIntroduced = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.editionDeprecated = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.deprecationWarning = ""; + object.editionRemoved = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.editionIntroduced != null && message.hasOwnProperty("editionIntroduced")) + object.editionIntroduced = options.enums === String ? $root.google.protobuf.Edition[message.editionIntroduced] === undefined ? message.editionIntroduced : $root.google.protobuf.Edition[message.editionIntroduced] : message.editionIntroduced; + if (message.editionDeprecated != null && message.hasOwnProperty("editionDeprecated")) + object.editionDeprecated = options.enums === String ? $root.google.protobuf.Edition[message.editionDeprecated] === undefined ? message.editionDeprecated : $root.google.protobuf.Edition[message.editionDeprecated] : message.editionDeprecated; + if (message.deprecationWarning != null && message.hasOwnProperty("deprecationWarning")) + object.deprecationWarning = message.deprecationWarning; + if (message.editionRemoved != null && message.hasOwnProperty("editionRemoved")) + object.editionRemoved = options.enums === String ? $root.google.protobuf.Edition[message.editionRemoved] === undefined ? message.editionRemoved : $root.google.protobuf.Edition[message.editionRemoved] : message.editionRemoved; + return object; + }; + + /** + * Converts this FeatureSupport to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + * @returns {Object.} JSON object + */ + FeatureSupport.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSupport + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSupport.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.FeatureSupport"; + }; + + return FeatureSupport; + })(); + return FieldOptions; })(); @@ -151163,6 +155542,7 @@ * @property {boolean|null} [deprecated] EnumValueOptions deprecated * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact + * @property {google.protobuf.FieldOptions.IFeatureSupport|null} [featureSupport] EnumValueOptions featureSupport * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption */ @@ -151206,6 +155586,14 @@ */ EnumValueOptions.prototype.debugRedact = false; + /** + * EnumValueOptions featureSupport. + * @member {google.protobuf.FieldOptions.IFeatureSupport|null|undefined} featureSupport + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.featureSupport = null; + /** * EnumValueOptions uninterpretedOption. * @member {Array.} uninterpretedOption @@ -151244,6 +155632,8 @@ $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); + if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) + $root.google.protobuf.FieldOptions.FeatureSupport.encode(message.featureSupport, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); @@ -151295,6 +155685,10 @@ message.debugRedact = reader.bool(); break; } + case 4: { + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.decode(reader, reader.uint32()); + break; + } case 999: { if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; @@ -151347,6 +155741,11 @@ if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) if (typeof message.debugRedact !== "boolean") return "debugRedact: boolean expected"; + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) { + var error = $root.google.protobuf.FieldOptions.FeatureSupport.verify(message.featureSupport); + if (error) + return "featureSupport." + error; + } if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; @@ -151380,6 +155779,11 @@ } if (object.debugRedact != null) message.debugRedact = Boolean(object.debugRedact); + if (object.featureSupport != null) { + if (typeof object.featureSupport !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.featureSupport: object expected"); + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.fromObject(object.featureSupport); + } if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); @@ -151412,6 +155816,7 @@ object.deprecated = false; object.features = null; object.debugRedact = false; + object.featureSupport = null; } if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; @@ -151419,6 +155824,8 @@ object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) object.debugRedact = message.debugRedact; + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) + object.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.toObject(message.featureSupport, options); if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) @@ -152886,6 +157293,8 @@ * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat + * @property {google.protobuf.FeatureSet.EnforceNamingStyle|null} [enforceNamingStyle] FeatureSet enforceNamingStyle + * @property {google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|null} [defaultSymbolVisibility] FeatureSet defaultSymbolVisibility */ /** @@ -152951,6 +157360,22 @@ */ FeatureSet.prototype.jsonFormat = 0; + /** + * FeatureSet enforceNamingStyle. + * @member {google.protobuf.FeatureSet.EnforceNamingStyle} enforceNamingStyle + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enforceNamingStyle = 0; + + /** + * FeatureSet defaultSymbolVisibility. + * @member {google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility} defaultSymbolVisibility + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.defaultSymbolVisibility = 0; + /** * Creates a new FeatureSet instance using the specified properties. * @function create @@ -152987,6 +157412,10 @@ writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); + if (message.enforceNamingStyle != null && Object.hasOwnProperty.call(message, "enforceNamingStyle")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.enforceNamingStyle); + if (message.defaultSymbolVisibility != null && Object.hasOwnProperty.call(message, "defaultSymbolVisibility")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.defaultSymbolVisibility); return writer; }; @@ -153047,6 +157476,14 @@ message.jsonFormat = reader.int32(); break; } + case 7: { + message.enforceNamingStyle = reader.int32(); + break; + } + case 8: { + message.defaultSymbolVisibility = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -153137,6 +157574,26 @@ case 2: break; } + if (message.enforceNamingStyle != null && message.hasOwnProperty("enforceNamingStyle")) + switch (message.enforceNamingStyle) { + default: + return "enforceNamingStyle: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.defaultSymbolVisibility != null && message.hasOwnProperty("defaultSymbolVisibility")) + switch (message.defaultSymbolVisibility) { + default: + return "defaultSymbolVisibility: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } return null; }; @@ -153276,6 +157733,54 @@ message.jsonFormat = 2; break; } + switch (object.enforceNamingStyle) { + default: + if (typeof object.enforceNamingStyle === "number") { + message.enforceNamingStyle = object.enforceNamingStyle; + break; + } + break; + case "ENFORCE_NAMING_STYLE_UNKNOWN": + case 0: + message.enforceNamingStyle = 0; + break; + case "STYLE2024": + case 1: + message.enforceNamingStyle = 1; + break; + case "STYLE_LEGACY": + case 2: + message.enforceNamingStyle = 2; + break; + } + switch (object.defaultSymbolVisibility) { + default: + if (typeof object.defaultSymbolVisibility === "number") { + message.defaultSymbolVisibility = object.defaultSymbolVisibility; + break; + } + break; + case "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN": + case 0: + message.defaultSymbolVisibility = 0; + break; + case "EXPORT_ALL": + case 1: + message.defaultSymbolVisibility = 1; + break; + case "EXPORT_TOP_LEVEL": + case 2: + message.defaultSymbolVisibility = 2; + break; + case "LOCAL_ALL": + case 3: + message.defaultSymbolVisibility = 3; + break; + case "STRICT": + case 4: + message.defaultSymbolVisibility = 4; + break; + } return message; }; @@ -153299,6 +157804,8 @@ object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; + object.enforceNamingStyle = options.enums === String ? "ENFORCE_NAMING_STYLE_UNKNOWN" : 0; + object.defaultSymbolVisibility = options.enums === String ? "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN" : 0; } if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; @@ -153312,6 +157819,10 @@ object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; + if (message.enforceNamingStyle != null && message.hasOwnProperty("enforceNamingStyle")) + object.enforceNamingStyle = options.enums === String ? $root.google.protobuf.FeatureSet.EnforceNamingStyle[message.enforceNamingStyle] === undefined ? message.enforceNamingStyle : $root.google.protobuf.FeatureSet.EnforceNamingStyle[message.enforceNamingStyle] : message.enforceNamingStyle; + if (message.defaultSymbolVisibility != null && message.hasOwnProperty("defaultSymbolVisibility")) + object.defaultSymbolVisibility = options.enums === String ? $root.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility[message.defaultSymbolVisibility] === undefined ? message.defaultSymbolVisibility : $root.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility[message.defaultSymbolVisibility] : message.defaultSymbolVisibility; return object; }; @@ -153439,6 +157950,219 @@ return values; })(); + /** + * EnforceNamingStyle enum. + * @name google.protobuf.FeatureSet.EnforceNamingStyle + * @enum {number} + * @property {number} ENFORCE_NAMING_STYLE_UNKNOWN=0 ENFORCE_NAMING_STYLE_UNKNOWN value + * @property {number} STYLE2024=1 STYLE2024 value + * @property {number} STYLE_LEGACY=2 STYLE_LEGACY value + */ + FeatureSet.EnforceNamingStyle = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENFORCE_NAMING_STYLE_UNKNOWN"] = 0; + values[valuesById[1] = "STYLE2024"] = 1; + values[valuesById[2] = "STYLE_LEGACY"] = 2; + return values; + })(); + + FeatureSet.VisibilityFeature = (function() { + + /** + * Properties of a VisibilityFeature. + * @memberof google.protobuf.FeatureSet + * @interface IVisibilityFeature + */ + + /** + * Constructs a new VisibilityFeature. + * @memberof google.protobuf.FeatureSet + * @classdesc Represents a VisibilityFeature. + * @implements IVisibilityFeature + * @constructor + * @param {google.protobuf.FeatureSet.IVisibilityFeature=} [properties] Properties to set + */ + function VisibilityFeature(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new VisibilityFeature instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature instance + */ + VisibilityFeature.create = function create(properties) { + return new VisibilityFeature(properties); + }; + + /** + * Encodes the specified VisibilityFeature message. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature} message VisibilityFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VisibilityFeature.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified VisibilityFeature message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature} message VisibilityFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VisibilityFeature.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VisibilityFeature.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet.VisibilityFeature(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VisibilityFeature.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VisibilityFeature message. + * @function verify + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VisibilityFeature.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a VisibilityFeature message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + */ + VisibilityFeature.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSet.VisibilityFeature) + return object; + return new $root.google.protobuf.FeatureSet.VisibilityFeature(); + }; + + /** + * Creates a plain object from a VisibilityFeature message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.VisibilityFeature} message VisibilityFeature + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VisibilityFeature.toObject = function toObject() { + return {}; + }; + + /** + * Converts this VisibilityFeature to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @instance + * @returns {Object.} JSON object + */ + VisibilityFeature.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VisibilityFeature + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VisibilityFeature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet.VisibilityFeature"; + }; + + /** + * DefaultSymbolVisibility enum. + * @name google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility + * @enum {number} + * @property {number} DEFAULT_SYMBOL_VISIBILITY_UNKNOWN=0 DEFAULT_SYMBOL_VISIBILITY_UNKNOWN value + * @property {number} EXPORT_ALL=1 EXPORT_ALL value + * @property {number} EXPORT_TOP_LEVEL=2 EXPORT_TOP_LEVEL value + * @property {number} LOCAL_ALL=3 LOCAL_ALL value + * @property {number} STRICT=4 STRICT value + */ + VisibilityFeature.DefaultSymbolVisibility = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN"] = 0; + values[valuesById[1] = "EXPORT_ALL"] = 1; + values[valuesById[2] = "EXPORT_TOP_LEVEL"] = 2; + values[valuesById[3] = "LOCAL_ALL"] = 3; + values[valuesById[4] = "STRICT"] = 4; + return values; + })(); + + return VisibilityFeature; + })(); + return FeatureSet; })(); @@ -153623,6 +158347,7 @@ default: return "minimumEdition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -153640,6 +158365,7 @@ default: return "maximumEdition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -153688,6 +158414,10 @@ case 0: message.minimumEdition = 0; break; + case "EDITION_LEGACY": + case 900: + message.minimumEdition = 900; + break; case "EDITION_PROTO2": case 998: message.minimumEdition = 998; @@ -153740,6 +158470,10 @@ case 0: message.maximumEdition = 0; break; + case "EDITION_LEGACY": + case 900: + message.maximumEdition = 900; + break; case "EDITION_PROTO2": case 998: message.maximumEdition = 998; @@ -153848,7 +158582,8 @@ * @memberof google.protobuf.FeatureSetDefaults * @interface IFeatureSetEditionDefault * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition - * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features + * @property {google.protobuf.IFeatureSet|null} [overridableFeatures] FeatureSetEditionDefault overridableFeatures + * @property {google.protobuf.IFeatureSet|null} [fixedFeatures] FeatureSetEditionDefault fixedFeatures */ /** @@ -153875,12 +158610,20 @@ FeatureSetEditionDefault.prototype.edition = 0; /** - * FeatureSetEditionDefault features. - * @member {google.protobuf.IFeatureSet|null|undefined} features + * FeatureSetEditionDefault overridableFeatures. + * @member {google.protobuf.IFeatureSet|null|undefined} overridableFeatures * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault * @instance */ - FeatureSetEditionDefault.prototype.features = null; + FeatureSetEditionDefault.prototype.overridableFeatures = null; + + /** + * FeatureSetEditionDefault fixedFeatures. + * @member {google.protobuf.IFeatureSet|null|undefined} fixedFeatures + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.fixedFeatures = null; /** * Creates a new FeatureSetEditionDefault instance using the specified properties. @@ -153906,10 +158649,12 @@ FeatureSetEditionDefault.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + if (message.overridableFeatures != null && Object.hasOwnProperty.call(message, "overridableFeatures")) + $root.google.protobuf.FeatureSet.encode(message.overridableFeatures, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.fixedFeatures != null && Object.hasOwnProperty.call(message, "fixedFeatures")) + $root.google.protobuf.FeatureSet.encode(message.fixedFeatures, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -153950,8 +158695,12 @@ message.edition = reader.int32(); break; } - case 2: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + case 4: { + message.overridableFeatures = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 5: { + message.fixedFeatures = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); break; } default: @@ -153994,6 +158743,7 @@ default: return "edition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -154006,10 +158756,15 @@ case 2147483647: break; } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (message.overridableFeatures != null && message.hasOwnProperty("overridableFeatures")) { + var error = $root.google.protobuf.FeatureSet.verify(message.overridableFeatures); if (error) - return "features." + error; + return "overridableFeatures." + error; + } + if (message.fixedFeatures != null && message.hasOwnProperty("fixedFeatures")) { + var error = $root.google.protobuf.FeatureSet.verify(message.fixedFeatures); + if (error) + return "fixedFeatures." + error; } return null; }; @@ -154037,6 +158792,10 @@ case 0: message.edition = 0; break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; case "EDITION_PROTO2": case 998: message.edition = 998; @@ -154078,10 +158837,15 @@ message.edition = 2147483647; break; } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + if (object.overridableFeatures != null) { + if (typeof object.overridableFeatures !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.overridableFeatures: object expected"); + message.overridableFeatures = $root.google.protobuf.FeatureSet.fromObject(object.overridableFeatures); + } + if (object.fixedFeatures != null) { + if (typeof object.fixedFeatures !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fixedFeatures: object expected"); + message.fixedFeatures = $root.google.protobuf.FeatureSet.fromObject(object.fixedFeatures); } return message; }; @@ -154100,13 +158864,16 @@ options = {}; var object = {}; if (options.defaults) { - object.features = null; object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.overridableFeatures = null; + object.fixedFeatures = null; } - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); if (message.edition != null && message.hasOwnProperty("edition")) object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + if (message.overridableFeatures != null && message.hasOwnProperty("overridableFeatures")) + object.overridableFeatures = $root.google.protobuf.FeatureSet.toObject(message.overridableFeatures, options); + if (message.fixedFeatures != null && message.hasOwnProperty("fixedFeatures")) + object.fixedFeatures = $root.google.protobuf.FeatureSet.toObject(message.fixedFeatures, options); return object; }; @@ -155321,6 +160088,22 @@ return GeneratedCodeInfo; })(); + /** + * SymbolVisibility enum. + * @name google.protobuf.SymbolVisibility + * @enum {number} + * @property {number} VISIBILITY_UNSET=0 VISIBILITY_UNSET value + * @property {number} VISIBILITY_LOCAL=1 VISIBILITY_LOCAL value + * @property {number} VISIBILITY_EXPORT=2 VISIBILITY_EXPORT value + */ + protobuf.SymbolVisibility = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VISIBILITY_UNSET"] = 0; + values[valuesById[1] = "VISIBILITY_LOCAL"] = 1; + values[valuesById[2] = "VISIBILITY_EXPORT"] = 2; + return values; + })(); + protobuf.Duration = (function() { /** @@ -159766,6 +164549,257 @@ return longrunning; })(); + google.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + type.Interval = (function() { + + /** + * Properties of an Interval. + * @memberof google.type + * @interface IInterval + * @property {google.protobuf.ITimestamp|null} [startTime] Interval startTime + * @property {google.protobuf.ITimestamp|null} [endTime] Interval endTime + */ + + /** + * Constructs a new Interval. + * @memberof google.type + * @classdesc Represents an Interval. + * @implements IInterval + * @constructor + * @param {google.type.IInterval=} [properties] Properties to set + */ + function Interval(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Interval startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.type.Interval + * @instance + */ + Interval.prototype.startTime = null; + + /** + * Interval endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.type.Interval + * @instance + */ + Interval.prototype.endTime = null; + + /** + * Creates a new Interval instance using the specified properties. + * @function create + * @memberof google.type.Interval + * @static + * @param {google.type.IInterval=} [properties] Properties to set + * @returns {google.type.Interval} Interval instance + */ + Interval.create = function create(properties) { + return new Interval(properties); + }; + + /** + * Encodes the specified Interval message. Does not implicitly {@link google.type.Interval.verify|verify} messages. + * @function encode + * @memberof google.type.Interval + * @static + * @param {google.type.IInterval} message Interval message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Interval.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Interval message, length delimited. Does not implicitly {@link google.type.Interval.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Interval + * @static + * @param {google.type.IInterval} message Interval message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Interval.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Interval message from the specified reader or buffer. + * @function decode + * @memberof google.type.Interval + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Interval} Interval + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Interval.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Interval(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Interval message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Interval + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Interval} Interval + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Interval.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Interval message. + * @function verify + * @memberof google.type.Interval + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Interval.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates an Interval message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Interval + * @static + * @param {Object.} object Plain object + * @returns {google.type.Interval} Interval + */ + Interval.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Interval) + return object; + var message = new $root.google.type.Interval(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.type.Interval.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.type.Interval.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from an Interval message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Interval + * @static + * @param {google.type.Interval} message Interval + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Interval.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startTime = null; + object.endTime = null; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this Interval to JSON. + * @function toJSON + * @memberof google.type.Interval + * @instance + * @returns {Object.} JSON object + */ + Interval.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Interval + * @function getTypeUrl + * @memberof google.type.Interval + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Interval.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.Interval"; + }; + + return Interval; + })(); + + return type; + })(); + return google; })(); diff --git a/packages/google-ai-generativelanguage/protos/protos.json b/packages/google-ai-generativelanguage/protos/protos.json index 440b9d9a122..582ab12f5f1 100644 --- a/packages/google-ai-generativelanguage/protos/protos.json +++ b/packages/google-ai-generativelanguage/protos/protos.json @@ -114,6 +114,11 @@ "text", "inlineData" ] + }, + "metadata": { + "oneof": [ + "videoMetadata" + ] } }, "fields": { @@ -124,6 +129,13 @@ "inlineData": { "type": "Blob", "id": 3 + }, + "videoMetadata": { + "type": "VideoMetadata", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -139,6 +151,31 @@ } } }, + "VideoMetadata": { + "fields": { + "startOffset": { + "type": "google.protobuf.Duration", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "endOffset": { + "type": "google.protobuf.Duration", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "fps": { + "type": "double", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, "ModalityTokenCount": { "fields": { "modality": { @@ -520,6 +557,13 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "responseId": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } }, "nested": { @@ -685,6 +729,13 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "urlContextMetadata": { + "type": "UrlContextMetadata", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } }, "nested": { @@ -701,7 +752,38 @@ "PROHIBITED_CONTENT": 8, "SPII": 9, "MALFORMED_FUNCTION_CALL": 10, - "IMAGE_SAFETY": 11 + "IMAGE_SAFETY": 11, + "UNEXPECTED_TOOL_CALL": 12 + } + } + } + }, + "UrlContextMetadata": { + "fields": { + "urlMetadata": { + "rule": "repeated", + "type": "UrlMetadata", + "id": 1 + } + } + }, + "UrlMetadata": { + "fields": { + "retrievedUrl": { + "type": "string", + "id": 1 + }, + "urlRetrievalStatus": { + "type": "UrlRetrievalStatus", + "id": 2 + } + }, + "nested": { + "UrlRetrievalStatus": { + "values": { + "URL_RETRIEVAL_STATUS_UNSPECIFIED": 0, + "URL_RETRIEVAL_STATUS_SUCCESS": 1, + "URL_RETRIEVAL_STATUS_ERROR": 2 } } } @@ -1294,6 +1376,10 @@ "options": { "proto3_optional": true } + }, + "thinking": { + "type": "bool", + "id": 15 } } }, @@ -7376,7 +7462,7 @@ "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "OPTIONAL", + "(google.api.field_behavior)": "OUTPUT_ONLY", "proto3_optional": true } }, @@ -7512,6 +7598,11 @@ "executableCode", "codeExecutionResult" ] + }, + "metadata": { + "oneof": [ + "videoMetadata" + ] } }, "fields": { @@ -7543,12 +7634,26 @@ "type": "CodeExecutionResult", "id": 10 }, + "videoMetadata": { + "type": "VideoMetadata", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, "thought": { "type": "bool", "id": 11, "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "thoughtSignature": { + "type": "bytes", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -7582,6 +7687,31 @@ } } }, + "VideoMetadata": { + "fields": { + "startOffset": { + "type": "google.protobuf.Duration", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "endOffset": { + "type": "google.protobuf.Duration", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "fps": { + "type": "double", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, "ExecutableCode": { "fields": { "language": { @@ -7666,14 +7796,32 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "urlContext": { + "type": "UrlContext", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } }, "nested": { "GoogleSearch": { - "fields": {} + "fields": { + "timeRangeFilter": { + "type": "google.type.Interval", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } } } }, + "UrlContext": { + "fields": {} + }, "GoogleSearchRetrieval": { "fields": { "dynamicRetrievalConfig": { @@ -7763,10 +7911,20 @@ "parameters" ] }, + "_parametersJsonSchema": { + "oneof": [ + "parametersJsonSchema" + ] + }, "_response": { "oneof": [ "response" ] + }, + "_responseJsonSchema": { + "oneof": [ + "responseJsonSchema" + ] } }, "fields": { @@ -7792,6 +7950,14 @@ "proto3_optional": true } }, + "parametersJsonSchema": { + "type": "google.protobuf.Value", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, "response": { "type": "Schema", "id": 4, @@ -7799,6 +7965,30 @@ "(google.api.field_behavior)": "OPTIONAL", "proto3_optional": true } + }, + "responseJsonSchema": { + "type": "google.protobuf.Value", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "behavior": { + "type": "Behavior", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Behavior": { + "values": { + "UNSPECIFIED": 0, + "BLOCKING": 1, + "NON_BLOCKING": 2 + } } } }, @@ -7836,6 +8026,13 @@ } }, "FunctionResponse": { + "oneofs": { + "_scheduling": { + "oneof": [ + "scheduling" + ] + } + }, "fields": { "id": { "type": "string", @@ -7857,6 +8054,31 @@ "options": { "(google.api.field_behavior)": "REQUIRED" } + }, + "willContinue": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "scheduling": { + "type": "Scheduling", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + }, + "nested": { + "Scheduling": { + "values": { + "SCHEDULING_UNSPECIFIED": 0, + "SILENT": 1, + "WHEN_IDLE": 2, + "INTERRUPT": 3 + } } } }, @@ -7960,6 +8182,20 @@ "(google.api.field_behavior)": "OPTIONAL" } }, + "minProperties": { + "type": "int64", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maxProperties": { + "type": "int64", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, "minimum": { "type": "double", "id": 11, @@ -7976,6 +8212,34 @@ "proto3_optional": true } }, + "minLength": { + "type": "int64", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maxLength": { + "type": "int64", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pattern": { + "type": "string", + "id": 15, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "example": { + "type": "google.protobuf.Value", + "id": 16, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, "anyOf": { "rule": "repeated", "type": "Schema", @@ -8483,7 +8747,7 @@ }, "fields": { "videoMetadata": { - "type": "VideoMetadata", + "type": "VideoFileMetadata", "id": 12, "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" @@ -8596,7 +8860,7 @@ } } }, - "VideoMetadata": { + "VideoFileMetadata": { "fields": { "videoDuration": { "type": "google.protobuf.Duration", @@ -9073,12 +9337,49 @@ } } }, + "SpeakerVoiceConfig": { + "fields": { + "speaker": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "voiceConfig": { + "type": "VoiceConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "MultiSpeakerVoiceConfig": { + "fields": { + "speakerVoiceConfigs": { + "rule": "repeated", + "type": "SpeakerVoiceConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, "SpeechConfig": { "fields": { "voiceConfig": { "type": "VoiceConfig", "id": 1 }, + "multiSpeakerVoiceConfig": { + "type": "MultiSpeakerVoiceConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, "languageCode": { "type": "string", "id": 2, @@ -9262,6 +9563,13 @@ "(google.api.field_behavior)": "OPTIONAL" } }, + "responseJsonSchema": { + "type": "google.protobuf.Value", + "id": 24, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, "presencePenalty": { "type": "float", "id": 15, @@ -9432,6 +9740,13 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "responseId": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } }, "nested": { @@ -9609,6 +9924,13 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "urlContextMetadata": { + "type": "UrlContextMetadata", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } }, "nested": { @@ -9625,7 +9947,38 @@ "PROHIBITED_CONTENT": 8, "SPII": 9, "MALFORMED_FUNCTION_CALL": 10, - "IMAGE_SAFETY": 11 + "IMAGE_SAFETY": 11, + "UNEXPECTED_TOOL_CALL": 12 + } + } + } + }, + "UrlContextMetadata": { + "fields": { + "urlMetadata": { + "rule": "repeated", + "type": "UrlMetadata", + "id": 1 + } + } + }, + "UrlMetadata": { + "fields": { + "retrievedUrl": { + "type": "string", + "id": 1 + }, + "urlRetrievalStatus": { + "type": "UrlRetrievalStatus", + "id": 2 + } + }, + "nested": { + "UrlRetrievalStatus": { + "values": { + "URL_RETRIEVAL_STATUS_UNSPECIFIED": 0, + "URL_RETRIEVAL_STATUS_SUCCESS": 1, + "URL_RETRIEVAL_STATUS_ERROR": 2 } } } @@ -10526,6 +10879,13 @@ "(google.api.field_behavior)": "OPTIONAL" } }, + "inputAudioTranscription": { + "type": "AudioTranscriptionConfig", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, "outputAudioTranscription": { "type": "AudioTranscriptionConfig", "id": 11, @@ -10732,12 +11092,26 @@ "(google.api.field_behavior)": "OUTPUT_ONLY" } }, + "inputTranscription": { + "type": "BidiGenerateContentTranscription", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, "outputTranscription": { "type": "BidiGenerateContentTranscription", "id": 7, "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "urlContextMetadata": { + "type": "UrlContextMetadata", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } } }, @@ -11294,6 +11668,10 @@ "options": { "proto3_optional": true } + }, + "thinking": { + "type": "bool", + "id": 15 } } }, @@ -12987,6 +13365,10 @@ "chunk": { "type": "Chunk", "id": 2 + }, + "document": { + "type": "Document", + "id": 3 } } }, @@ -16368,8 +16750,7 @@ "java_multiple_files": true, "java_outer_classname": "ResourceProto", "java_package": "com.google.api", - "objc_class_prefix": "GAPI", - "cc_enable_arenas": true + "objc_class_prefix": "GAPI" }, "nested": { "fieldBehavior": { @@ -16515,6 +16896,10 @@ "rule": "repeated", "type": "ClientLibraryDestination", "id": 2 + }, + "selectiveGapicGeneration": { + "type": "SelectiveGapicGeneration", + "id": 3 } } }, @@ -16655,6 +17040,28 @@ "common": { "type": "CommonLanguageSettings", "id": 1 + }, + "experimentalFeatures": { + "type": "ExperimentalFeatures", + "id": 2 + } + }, + "nested": { + "ExperimentalFeatures": { + "fields": { + "restAsyncIoEnabled": { + "type": "bool", + "id": 1 + }, + "protobufPythonicTypesEnabled": { + "type": "bool", + "id": 2 + }, + "unversionedPackageDisabled": { + "type": "bool", + "id": 3 + } + } } } }, @@ -16712,6 +17119,11 @@ "common": { "type": "CommonLanguageSettings", "id": 1 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 } } }, @@ -16773,6 +17185,19 @@ "PACKAGE_MANAGER": 20 } }, + "SelectiveGapicGeneration": { + "fields": { + "methods": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "generateOmittedAsInternal": { + "type": "bool", + "id": 2 + } + } + }, "LaunchStage": { "values": { "LAUNCH_STAGE_UNSPECIFIED": 0, @@ -16883,12 +17308,19 @@ "type": "FileDescriptorProto", "id": 1 } - } + }, + "extensions": [ + [ + 536000000, + 536000000 + ] + ] }, "Edition": { "edition": "proto2", "values": { "EDITION_UNKNOWN": 0, + "EDITION_LEGACY": 900, "EDITION_PROTO2": 998, "EDITION_PROTO3": 999, "EDITION_2023": 1000, @@ -16927,6 +17359,11 @@ "type": "int32", "id": 11 }, + "optionDependency": { + "rule": "repeated", + "type": "string", + "id": 15 + }, "messageType": { "rule": "repeated", "type": "DescriptorProto", @@ -17015,6 +17452,10 @@ "rule": "repeated", "type": "string", "id": 10 + }, + "visibility": { + "type": "SymbolVisibility", + "id": 11 } }, "nested": { @@ -17240,6 +17681,10 @@ "rule": "repeated", "type": "string", "id": 5 + }, + "visibility": { + "type": "SymbolVisibility", + "id": 6 } }, "nested": { @@ -17454,6 +17899,7 @@ 42, 42 ], + "php_generic_services", [ 38, 38 @@ -17589,7 +18035,8 @@ "type": "bool", "id": 10, "options": { - "default": false + "default": false, + "deprecated": true } }, "debugRedact": { @@ -17617,6 +18064,10 @@ "type": "FeatureSet", "id": 21 }, + "featureSupport": { + "type": "FeatureSupport", + "id": 22 + }, "uninterpretedOption": { "rule": "repeated", "type": "UninterpretedOption", @@ -17686,6 +18137,26 @@ "id": 2 } } + }, + "FeatureSupport": { + "fields": { + "editionIntroduced": { + "type": "Edition", + "id": 1 + }, + "editionDeprecated": { + "type": "Edition", + "id": 2 + }, + "deprecationWarning": { + "type": "string", + "id": 3 + }, + "editionRemoved": { + "type": "Edition", + "id": 4 + } + } } } }, @@ -17774,6 +18245,10 @@ "default": false } }, + "featureSupport": { + "type": "FieldOptions.FeatureSupport", + "id": 4 + }, "uninterpretedOption": { "rule": "repeated", "type": "UninterpretedOption", @@ -17916,6 +18391,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_2023", "edition_defaults.value": "EXPLICIT" } @@ -17926,6 +18402,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "OPEN" } @@ -17936,6 +18413,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "PACKED" } @@ -17946,6 +18424,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "VERIFY" } @@ -17956,7 +18435,8 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO2", + "feature_support.edition_introduced": "EDITION_2023", + "edition_defaults.edition": "EDITION_LEGACY", "edition_defaults.value": "LENGTH_PREFIXED" } }, @@ -17966,27 +18446,38 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "ALLOW" } + }, + "enforceNamingStyle": { + "type": "EnforceNamingStyle", + "id": 7, + "options": { + "retention": "RETENTION_SOURCE", + "targets": "TARGET_TYPE_METHOD", + "feature_support.edition_introduced": "EDITION_2024", + "edition_defaults.edition": "EDITION_2024", + "edition_defaults.value": "STYLE2024" + } + }, + "defaultSymbolVisibility": { + "type": "VisibilityFeature.DefaultSymbolVisibility", + "id": 8, + "options": { + "retention": "RETENTION_SOURCE", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2024", + "edition_defaults.edition": "EDITION_2024", + "edition_defaults.value": "EXPORT_TOP_LEVEL" + } } }, "extensions": [ [ 1000, - 1000 - ], - [ - 1001, - 1001 - ], - [ - 1002, - 1002 - ], - [ - 9990, - 9990 + 9994 ], [ 9995, @@ -18031,7 +18522,13 @@ "UTF8_VALIDATION_UNKNOWN": 0, "VERIFY": 2, "NONE": 3 - } + }, + "reserved": [ + [ + 1, + 1 + ] + ] }, "MessageEncoding": { "values": { @@ -18046,6 +18543,33 @@ "ALLOW": 1, "LEGACY_BEST_EFFORT": 2 } + }, + "EnforceNamingStyle": { + "values": { + "ENFORCE_NAMING_STYLE_UNKNOWN": 0, + "STYLE2024": 1, + "STYLE_LEGACY": 2 + } + }, + "VisibilityFeature": { + "fields": {}, + "reserved": [ + [ + 1, + 536870911 + ] + ], + "nested": { + "DefaultSymbolVisibility": { + "values": { + "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN": 0, + "EXPORT_ALL": 1, + "EXPORT_TOP_LEVEL": 2, + "LOCAL_ALL": 3, + "STRICT": 4 + } + } + } } } }, @@ -18073,11 +18597,26 @@ "type": "Edition", "id": 3 }, - "features": { + "overridableFeatures": { "type": "FeatureSet", - "id": 2 + "id": 4 + }, + "fixedFeatures": { + "type": "FeatureSet", + "id": 5 } - } + }, + "reserved": [ + [ + 1, + 1 + ], + [ + 2, + 2 + ], + "features" + ] } } }, @@ -18090,6 +18629,12 @@ "id": 1 } }, + "extensions": [ + [ + 536000000, + 536000000 + ] + ], "nested": { "Location": { "fields": { @@ -18175,6 +18720,14 @@ } } }, + "SymbolVisibility": { + "edition": "proto2", + "values": { + "VISIBILITY_UNSET": 0, + "VISIBILITY_LOCAL": 1, + "VISIBILITY_EXPORT": 2 + } + }, "Duration": { "fields": { "seconds": { @@ -18325,6 +18878,7 @@ "java_multiple_files": true, "java_outer_classname": "OperationsProto", "java_package": "com.google.longrunning", + "objc_class_prefix": "GLRUN", "php_namespace": "Google\\LongRunning" }, "nested": { @@ -18532,6 +19086,30 @@ } } } + }, + "type": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/type/interval;interval", + "java_multiple_files": true, + "java_outer_classname": "IntervalProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP" + }, + "nested": { + "Interval": { + "fields": { + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + } + } } } } diff --git a/packages/google-ai-generativelanguage/samples/generated/v1/snippet_metadata_google.ai.generativelanguage.v1.json b/packages/google-ai-generativelanguage/samples/generated/v1/snippet_metadata_google.ai.generativelanguage.v1.json index 21cee9b1f4f..5ad91820562 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1/snippet_metadata_google.ai.generativelanguage.v1.json +++ b/packages/google-ai-generativelanguage/samples/generated/v1/snippet_metadata_google.ai.generativelanguage.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-generativelanguage", - "version": "3.3.0", + "version": "3.4.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-ai-generativelanguage/samples/generated/v1alpha/snippet_metadata_google.ai.generativelanguage.v1alpha.json b/packages/google-ai-generativelanguage/samples/generated/v1alpha/snippet_metadata_google.ai.generativelanguage.v1alpha.json index ac698c2917f..c9b0e74f483 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1alpha/snippet_metadata_google.ai.generativelanguage.v1alpha.json +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/snippet_metadata_google.ai.generativelanguage.v1alpha.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-generativelanguage", - "version": "3.3.0", + "version": "3.4.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/snippet_metadata_google.ai.generativelanguage.v1beta.json b/packages/google-ai-generativelanguage/samples/generated/v1beta/snippet_metadata_google.ai.generativelanguage.v1beta.json index e28d637e63d..0dbb5532754 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/snippet_metadata_google.ai.generativelanguage.v1beta.json +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/snippet_metadata_google.ai.generativelanguage.v1beta.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-generativelanguage", - "version": "3.3.0", + "version": "3.4.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta2/snippet_metadata.google.ai.generativelanguage.v1beta2.json b/packages/google-ai-generativelanguage/samples/generated/v1beta2/snippet_metadata.google.ai.generativelanguage.v1beta2.json index 5fbcf8c4656..328c0f90a2a 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta2/snippet_metadata.google.ai.generativelanguage.v1beta2.json +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta2/snippet_metadata.google.ai.generativelanguage.v1beta2.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-generativelanguage", - "version": "3.3.0", + "version": "3.4.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta2/snippet_metadata_google.ai.generativelanguage.v1beta2.json b/packages/google-ai-generativelanguage/samples/generated/v1beta2/snippet_metadata_google.ai.generativelanguage.v1beta2.json index 5fbcf8c4656..328c0f90a2a 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta2/snippet_metadata_google.ai.generativelanguage.v1beta2.json +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta2/snippet_metadata_google.ai.generativelanguage.v1beta2.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-generativelanguage", - "version": "3.3.0", + "version": "3.4.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta3/snippet_metadata_google.ai.generativelanguage.v1beta3.json b/packages/google-ai-generativelanguage/samples/generated/v1beta3/snippet_metadata_google.ai.generativelanguage.v1beta3.json index 6ce9154e6a2..b9a03334b06 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta3/snippet_metadata_google.ai.generativelanguage.v1beta3.json +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta3/snippet_metadata_google.ai.generativelanguage.v1beta3.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-generativelanguage", - "version": "3.3.0", + "version": "3.4.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-ai-generativelanguage/samples/package.json b/packages/google-ai-generativelanguage/samples/package.json index 2697f0ff8eb..df72a5f5c6a 100644 --- a/packages/google-ai-generativelanguage/samples/package.json +++ b/packages/google-ai-generativelanguage/samples/package.json @@ -14,7 +14,7 @@ "publish": "echo 'sample test; do not publish'" }, "dependencies": { - "@google-ai/generativelanguage": "^3.3.0" + "@google-ai/generativelanguage": "^3.4.0" }, "devDependencies": { "c8": "^9.0.0", diff --git a/packages/google-ai-generativelanguage/src/v1beta/model_service_client.ts b/packages/google-ai-generativelanguage/src/v1beta/model_service_client.ts index b669353ac49..8e7bf1f7f25 100644 --- a/packages/google-ai-generativelanguage/src/v1beta/model_service_client.ts +++ b/packages/google-ai-generativelanguage/src/v1beta/model_service_client.ts @@ -227,8 +227,8 @@ export class ModelServiceClient { }; if (opts.fallback) { lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.longrunning.Operations.GetOperation',get: '/v1beta/{name=tunedModels/*/operations/*}',additional_bindings: [{get: '/v1beta/{name=generatedFiles/*/operations/*}',},{get: '/v1beta/{name=models/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.ListOperations',get: '/v1beta/{name=tunedModels/*}/operations',additional_bindings: [{get: '/v1beta/{name=models/*}/operations',}], + lroOptions.httpRules = [{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1beta/{name=batches/*}:cancel',},{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v1beta/{name=batches/*}',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v1beta/{name=tunedModels/*/operations/*}',additional_bindings: [{get: '/v1beta/{name=generatedFiles/*/operations/*}',},{get: '/v1beta/{name=batches/*}',},{get: '/v1beta/{name=models/*/operations/*}',},{get: '/v1beta/{name=corpora/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.ListOperations',get: '/v1beta/{name=tunedModels/*}/operations',additional_bindings: [{get: '/v1beta/{name=batches}',},{get: '/v1beta/{name=models/*}/operations',}], }]; } this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); diff --git a/packages/google-ai-generativelanguage/src/v1beta/prediction_service_client.ts b/packages/google-ai-generativelanguage/src/v1beta/prediction_service_client.ts index 2674b3bfba6..6ae52104772 100644 --- a/packages/google-ai-generativelanguage/src/v1beta/prediction_service_client.ts +++ b/packages/google-ai-generativelanguage/src/v1beta/prediction_service_client.ts @@ -217,8 +217,8 @@ export class PredictionServiceClient { }; if (opts.fallback) { lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.longrunning.Operations.GetOperation',get: '/v1beta/{name=tunedModels/*/operations/*}',additional_bindings: [{get: '/v1beta/{name=generatedFiles/*/operations/*}',},{get: '/v1beta/{name=models/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.ListOperations',get: '/v1beta/{name=tunedModels/*}/operations',additional_bindings: [{get: '/v1beta/{name=models/*}/operations',}], + lroOptions.httpRules = [{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1beta/{name=batches/*}:cancel',},{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v1beta/{name=batches/*}',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v1beta/{name=tunedModels/*/operations/*}',additional_bindings: [{get: '/v1beta/{name=generatedFiles/*/operations/*}',},{get: '/v1beta/{name=batches/*}',},{get: '/v1beta/{name=models/*/operations/*}',},{get: '/v1beta/{name=corpora/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.ListOperations',get: '/v1beta/{name=tunedModels/*}/operations',additional_bindings: [{get: '/v1beta/{name=batches}',},{get: '/v1beta/{name=models/*}/operations',}], }]; } this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); diff --git a/packages/google-analytics-admin/CHANGELOG.md b/packages/google-analytics-admin/CHANGELOG.md index bf74407c27b..41cde7c9ad0 100644 --- a/packages/google-analytics-admin/CHANGELOG.md +++ b/packages/google-analytics-admin/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## [9.0.0](https://github.com/googleapis/google-cloud-node/compare/admin-v8.3.0...admin-v9.0.0) (2025-08-21) + + +### âš  BREAKING CHANGES + +* [analytics-admin] remove the `SetAutomatedGa4ConfigurationOptOut` method ([#6613](https://github.com/googleapis/google-cloud-node/issues/6613)) + +### Bug Fixes + +* [analytics-admin] remove the `SetAutomatedGa4ConfigurationOptOut` method ([#6613](https://github.com/googleapis/google-cloud-node/issues/6613)) ([cdd0d85](https://github.com/googleapis/google-cloud-node/commit/cdd0d85a7213734befbb4e95a971d8351af79f23)) + ## [8.3.0](https://github.com/googleapis/google-cloud-node/compare/admin-v8.2.0...admin-v8.3.0) (2025-07-09) diff --git a/packages/google-analytics-admin/README.md b/packages/google-analytics-admin/README.md index 1e1f0e36bf2..4a0bc6aa763 100644 --- a/packages/google-analytics-admin/README.md +++ b/packages/google-analytics-admin/README.md @@ -203,6 +203,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Analytics_admin_service.get_measurement_protocol_secret | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_measurement_protocol_secret.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_measurement_protocol_secret.js,packages/google-analytics-admin/samples/README.md) | | Analytics_admin_service.get_property | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_property.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_property.js,packages/google-analytics-admin/samples/README.md) | | Analytics_admin_service.get_reporting_data_annotation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_reporting_data_annotation.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_reporting_data_annotation.js,packages/google-analytics-admin/samples/README.md) | +| Analytics_admin_service.get_reporting_identity_settings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_reporting_identity_settings.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_reporting_identity_settings.js,packages/google-analytics-admin/samples/README.md) | | Analytics_admin_service.get_rollup_property_source_link | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_rollup_property_source_link.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_rollup_property_source_link.js,packages/google-analytics-admin/samples/README.md) | | Analytics_admin_service.get_s_k_ad_network_conversion_value_schema | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_s_k_ad_network_conversion_value_schema.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_s_k_ad_network_conversion_value_schema.js,packages/google-analytics-admin/samples/README.md) | | Analytics_admin_service.get_search_ads360_link | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_search_ads360_link.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_search_ads360_link.js,packages/google-analytics-admin/samples/README.md) | diff --git a/packages/google-analytics-admin/package.json b/packages/google-analytics-admin/package.json index 0137a45947d..1aab02c27f3 100644 --- a/packages/google-analytics-admin/package.json +++ b/packages/google-analytics-admin/package.json @@ -1,6 +1,6 @@ { "name": "@google-analytics/admin", - "version": "8.3.0", + "version": "9.0.0", "description": "Admin client for Node.js", "repository": { "type": "git", diff --git a/packages/google-analytics-admin/protos/google/analytics/admin/v1alpha/analytics_admin.proto b/packages/google-analytics-admin/protos/google/analytics/admin/v1alpha/analytics_admin.proto index 82d4b4c9c02..2b5ea77d99d 100644 --- a/packages/google-analytics-admin/protos/google/analytics/admin/v1alpha/analytics_admin.proto +++ b/packages/google-analytics-admin/protos/google/analytics/admin/v1alpha/analytics_admin.proto @@ -1132,30 +1132,6 @@ service AnalyticsAdminService { option (google.api.method_signature) = "name"; } - // Sets the opt out status for the automated GA4 setup process for a UA - // property. - // Note: this has no effect on GA4 property. - rpc SetAutomatedGa4ConfigurationOptOut( - SetAutomatedGa4ConfigurationOptOutRequest) - returns (SetAutomatedGa4ConfigurationOptOutResponse) { - option (google.api.http) = { - post: "/v1alpha/properties:setAutomatedGa4ConfigurationOptOut" - body: "*" - }; - } - - // Fetches the opt out status for the automated GA4 setup process for a UA - // property. - // Note: this has no effect on GA4 property. - rpc FetchAutomatedGa4ConfigurationOptOut( - FetchAutomatedGa4ConfigurationOptOutRequest) - returns (FetchAutomatedGa4ConfigurationOptOutResponse) { - option (google.api.http) = { - post: "/v1alpha/properties:fetchAutomatedGa4ConfigurationOptOut" - body: "*" - }; - } - // Creates a BigQueryLink. rpc CreateBigQueryLink(CreateBigQueryLinkRequest) returns (BigQueryLink) { option (google.api.http) = { @@ -1225,47 +1201,6 @@ service AnalyticsAdminService { "enhanced_measurement_settings,update_mask"; } - // Creates a connected site tag for a Universal Analytics property. You can - // create a maximum of 20 connected site tags per property. - // Note: This API cannot be used on GA4 properties. - rpc CreateConnectedSiteTag(CreateConnectedSiteTagRequest) - returns (CreateConnectedSiteTagResponse) { - option (google.api.http) = { - post: "/v1alpha/properties:createConnectedSiteTag" - body: "*" - }; - } - - // Deletes a connected site tag for a Universal Analytics property. - // Note: this has no effect on GA4 properties. - rpc DeleteConnectedSiteTag(DeleteConnectedSiteTagRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1alpha/properties:deleteConnectedSiteTag" - body: "*" - }; - } - - // Lists the connected site tags for a Universal Analytics property. A maximum - // of 20 connected site tags will be returned. Note: this has no effect on GA4 - // property. - rpc ListConnectedSiteTags(ListConnectedSiteTagsRequest) - returns (ListConnectedSiteTagsResponse) { - option (google.api.http) = { - post: "/v1alpha/properties:listConnectedSiteTags" - body: "*" - }; - } - - // Given a specified UA property, looks up the GA4 property connected to it. - // Note: this cannot be used with GA4 properties. - rpc FetchConnectedGa4Property(FetchConnectedGa4PropertyRequest) - returns (FetchConnectedGa4PropertyResponse) { - option (google.api.http) = { - get: "/v1alpha/properties:fetchConnectedGa4Property" - }; - } - // Looks up a single AdSenseLink. rpc GetAdSenseLink(GetAdSenseLinkRequest) returns (AdSenseLink) { option (google.api.http) = { @@ -1638,7 +1573,7 @@ service AnalyticsAdminService { option (google.api.method_signature) = "name"; } - // List all Subproperty Sync Configs on a property. + // List all `SubpropertySyncConfig` resources for a property. rpc ListSubpropertySyncConfigs(ListSubpropertySyncConfigsRequest) returns (ListSubpropertySyncConfigsResponse) { option (google.api.http) = { @@ -1647,7 +1582,7 @@ service AnalyticsAdminService { option (google.api.method_signature) = "parent"; } - // Updates a Subproperty Sync Config. + // Updates a `SubpropertySyncConfig`. rpc UpdateSubpropertySyncConfig(UpdateSubpropertySyncConfigRequest) returns (SubpropertySyncConfig) { option (google.api.http) = { @@ -1658,7 +1593,7 @@ service AnalyticsAdminService { "subproperty_sync_config,update_mask"; } - // Lookup for a single Subproperty Sync Config. + // Lookup for a single `SubpropertySyncConfig`. rpc GetSubpropertySyncConfig(GetSubpropertySyncConfigRequest) returns (SubpropertySyncConfig) { option (google.api.http) = { @@ -1666,6 +1601,15 @@ service AnalyticsAdminService { }; option (google.api.method_signature) = "name"; } + + // Returns the singleton data retention settings for this property. + rpc GetReportingIdentitySettings(GetReportingIdentitySettingsRequest) + returns (ReportingIdentitySettings) { + option (google.api.http) = { + get: "/v1alpha/{name=properties/*/reportingIdentitySettings}" + }; + option (google.api.method_signature) = "name"; + } } // The request for a Data Access Record Report. @@ -3782,38 +3726,6 @@ message ListChannelGroupsResponse { string next_page_token = 2; } -// Request for setting the opt out status for the automated GA4 setup process. -message SetAutomatedGa4ConfigurationOptOutRequest { - // Required. The UA property to set the opt out status. Note this request uses - // the internal property ID, not the tracking ID of the form UA-XXXXXX-YY. - // Format: properties/{internalWebPropertyId} - // Example: properties/1234 - string property = 1 [(google.api.field_behavior) = REQUIRED]; - - // The status to set. - bool opt_out = 2; -} - -// Response message for setting the opt out status for the automated GA4 setup -// process. -message SetAutomatedGa4ConfigurationOptOutResponse {} - -// Request for fetching the opt out status for the automated GA4 setup process. -message FetchAutomatedGa4ConfigurationOptOutRequest { - // Required. The UA property to get the opt out status. Note this request uses - // the internal property ID, not the tracking ID of the form UA-XXXXXX-YY. - // Format: properties/{internalWebPropertyId} - // Example: properties/1234 - string property = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// Response message for fetching the opt out status for the automated GA4 setup -// process. -message FetchAutomatedGa4ConfigurationOptOutResponse { - // The opt out status for the UA property. - bool opt_out = 1; -} - // Request message for CreateBigQueryLink RPC. message CreateBigQueryLinkRequest { // Required. Example format: properties/1234 @@ -3960,51 +3872,6 @@ message UpdateDataRedactionSettingsRequest { [(google.api.field_behavior) = REQUIRED]; } -// Request message for CreateConnectedSiteTag RPC. -message CreateConnectedSiteTagRequest { - // The Universal Analytics property to create connected site tags for. - // This API does not support GA4 properties. - // Format: properties/{universalAnalyticsPropertyId} - // Example: properties/1234 - string property = 1; - - // Required. The tag to add to the Universal Analytics property - ConnectedSiteTag connected_site_tag = 2 - [(google.api.field_behavior) = REQUIRED]; -} - -// Response message for CreateConnectedSiteTag RPC. -message CreateConnectedSiteTagResponse {} - -// Request message for DeleteConnectedSiteTag RPC. -message DeleteConnectedSiteTagRequest { - // The Universal Analytics property to delete connected site tags for. - // This API does not support GA4 properties. - // Format: properties/{universalAnalyticsPropertyId} - // Example: properties/1234 - string property = 1; - - // Tag ID to forward events to. Also known as the Measurement ID, or the - // "G-ID" (For example: G-12345). - string tag_id = 2; -} - -// Request message for ListConnectedSiteTags RPC. -message ListConnectedSiteTagsRequest { - // The Universal Analytics property to fetch connected site tags for. - // This does not work on GA4 properties. A maximum of 20 connected site tags - // will be returned. - // Example Format: `properties/1234` - string property = 1; -} - -// Response message for ListConnectedSiteTags RPC. -message ListConnectedSiteTagsResponse { - // The site tags for the Universal Analytics property. A maximum of 20 - // connected site tags will be returned. - repeated ConnectedSiteTag connected_site_tags = 1; -} - // Request message to be passed to CreateAdSenseLink method. message CreateAdSenseLinkRequest { // Required. The property for which to create an AdSense Link. @@ -4082,32 +3949,6 @@ message ListAdSenseLinksResponse { string next_page_token = 2; } -// Request for looking up GA4 property connected to a UA property. -message FetchConnectedGa4PropertyRequest { - // Required. The UA property for which to look up the connected GA4 property. - // Note this request uses the - // internal property ID, not the tracking ID of the form UA-XXXXXX-YY. - // Format: properties/{internal_web_property_id} - // Example: properties/1234 - string property = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "analyticsadmin.googleapis.com/Property" - } - ]; -} - -// Response for looking up GA4 property connected to a UA property. -message FetchConnectedGa4PropertyResponse { - // The GA4 property connected to the UA property. An empty string is returned - // when there is no connected GA4 property. - // Format: properties/{property_id} - // Example: properties/1234 - string property = 1 [(google.api.resource_reference) = { - type: "analyticsadmin.googleapis.com/Property" - }]; -} - // Request message for CreateEventCreateRule RPC. message CreateEventCreateRuleRequest { // Required. Example format: properties/123/dataStreams/456 @@ -4673,8 +4514,20 @@ message SubmitUserDeletionRequest { // ID](https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics.html#getAppInstanceId). string app_instance_id = 4; - // The un-hashed, unencrypted, [user-provided - // data](https://support.google.com/analytics/answer/14077171). + // [User-provided + // data](https://support.google.com/analytics/answer/14077171). May contain + // either one email address or one phone number. + // + // Email addresses should be normalized as such: + // + // * lowercase + // * remove periods before @ for gmail.com/googlemail.com addresses + // * remove all spaces + // + // Phone numbers should be normalized as such: + // + // * remove all non digit characters + // * add + prefix string user_provided_data = 5; } @@ -4737,7 +4590,7 @@ message ListSubpropertySyncConfigsRequest { // Response message for ListSubpropertySyncConfigs RPC. message ListSubpropertySyncConfigsResponse { - // List of Subproperty Sync Configs. + // List of `SubpropertySyncConfig` resources. repeated SubpropertySyncConfig subproperty_sync_configs = 1; // A token, which can be sent as `page_token` to retrieve the next page. If @@ -4747,7 +4600,7 @@ message ListSubpropertySyncConfigsResponse { // Request message for UpdateSubpropertySyncConfig RPC. message UpdateSubpropertySyncConfigRequest { - // Required. The SubpropertySyncConfig to update. + // Required. The `SubpropertySyncConfig` to update. SubpropertySyncConfig subproperty_sync_config = 1 [(google.api.field_behavior) = REQUIRED]; @@ -4758,3 +4611,17 @@ message UpdateSubpropertySyncConfigRequest { google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; } + +// Request message for GetReportingIdentitySettings RPC. +message GetReportingIdentitySettingsRequest { + // Required. The name of the settings to lookup. + // Format: + // properties/{property}/reportingIdentitySettings + // Example: "properties/1000/reportingIdentitySettings" + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticsadmin.googleapis.com/ReportingIdentitySettings" + } + ]; +} diff --git a/packages/google-analytics-admin/protos/google/analytics/admin/v1alpha/resources.proto b/packages/google-analytics-admin/protos/google/analytics/admin/v1alpha/resources.proto index a9097e1ce28..d666b945c24 100644 --- a/packages/google-analytics-admin/protos/google/analytics/admin/v1alpha/resources.proto +++ b/packages/google-analytics-admin/protos/google/analytics/admin/v1alpha/resources.proto @@ -250,6 +250,9 @@ enum ChangeHistoryResourceType { // SubpropertySyncConfig resource SUBPROPERTY_SYNC_CONFIG = 33; + + // ReportingIdentitySettings resource + REPORTING_IDENTITY_SETTINGS = 34; } // Status of the Google Signals settings. @@ -1036,6 +1039,9 @@ message ChangeHistoryChange { // A snapshot of a SubpropertySyncConfig resource in change history. SubpropertySyncConfig subproperty_sync_config = 33; + + // A snapshot of a ReportingIdentitySettings resource in change history. + ReportingIdentitySettings reporting_identity_settings = 34; } } @@ -1964,17 +1970,6 @@ message EnhancedMeasurementSettings { string uri_query_parameter = 11; } -// Configuration for a specific Connected Site Tag. -message ConnectedSiteTag { - // Required. User-provided display name for the connected site tag. Must be - // less than 256 characters. - string display_name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. "Tag ID to forward events to. Also known as the Measurement ID, - // or the "G-ID" (For example: G-12345). - string tag_id = 2 [(google.api.field_behavior) = REQUIRED]; -} - // Settings for client-side data redaction. Singleton resource under a Web // Stream. message DataRedactionSettings { @@ -2144,17 +2139,17 @@ message SubpropertySyncConfig { singular: "subpropertySyncConfig" }; - // Synchronization modes for a Subproperty + // Synchronization modes for a subproperty enum SynchronizationMode { // Synchronization mode unknown or not specified. SYNCHRONIZATION_MODE_UNSPECIFIED = 0; // Entities are not synchronized. - // Local edits are allowed on the Subproperty. + // Local edits are allowed on the subproperty. NONE = 1; - // Entities are synchronized from Parent Property. - // Local mutations are not allowed on the Subproperty (Create / Update / + // Entities are synchronized from parent property. + // Local mutations are not allowed on the subproperty (Create / Update / // Delete) ALL = 2; } @@ -2167,7 +2162,7 @@ message SubpropertySyncConfig { (google.api.field_behavior) = OUTPUT_ONLY ]; - // Output only. Immutable. Resource name of the Subproperty that these + // Output only. Immutable. Resource name of the subproperty that these // settings apply to. string apply_to_property = 2 [ (google.api.field_behavior) = IMMUTABLE, @@ -2175,11 +2170,11 @@ message SubpropertySyncConfig { ]; // Required. Specifies the Custom Dimension / Metric synchronization mode for - // the Subproperty. + // the subproperty. // // If set to ALL, Custom Dimension / Metric synchronization will be // immediately enabled. Local configuration of Custom Dimensions / Metrics - // will not be allowed on the Subproperty so long as the synchronization mode + // will not be allowed on the subproperty so long as the synchronization mode // is set to ALL. // // If set to NONE, Custom Dimensions / Metric synchronization is disabled. @@ -2188,3 +2183,40 @@ message SubpropertySyncConfig { SynchronizationMode custom_dimension_and_metric_sync_mode = 3 [(google.api.field_behavior) = REQUIRED]; } + +// A resource containing settings related to reporting identity. +message ReportingIdentitySettings { + option (google.api.resource) = { + type: "analyticsadmin.googleapis.com/ReportingIdentitySettings" + pattern: "properties/{property}/reportingIdentitySettings" + plural: "reportingIdentitySettings" + singular: "reportingIdentitySettings" + }; + + // Various strategies for identifying user identities in reports. + enum ReportingIdentity { + // Unspecified blending strategy. + IDENTITY_BLENDING_STRATEGY_UNSPECIFIED = 0; + + // Blended reporting identity strategy. + BLENDED = 1; + + // Observed reporting identity strategy. + OBSERVED = 2; + + // Device-based reporting identity strategy. + DEVICE_BASED = 3; + } + + // Output only. Identifier. Resource name for this reporting identity settings + // singleton resource. Format: + // properties/{property_id}/reportingIdentitySettings Example: + // "properties/1234/reportingIdentitySettings" + string name = 1 [ + (google.api.field_behavior) = IDENTIFIER, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // The strategy used for identifying user identities in reports. + ReportingIdentity reporting_identity = 2; +} diff --git a/packages/google-analytics-admin/protos/protos.d.ts b/packages/google-analytics-admin/protos/protos.d.ts index a8620a064d8..5322bbeee51 100644 --- a/packages/google-analytics-admin/protos/protos.d.ts +++ b/packages/google-analytics-admin/protos/protos.d.ts @@ -3730,34 +3730,6 @@ export namespace google { */ public deleteChannelGroup(request: google.analytics.admin.v1alpha.IDeleteChannelGroupRequest): Promise; - /** - * Calls SetAutomatedGa4ConfigurationOptOut. - * @param request SetAutomatedGa4ConfigurationOptOutRequest message or plain object - * @param callback Node-style callback called with the error, if any, and SetAutomatedGa4ConfigurationOptOutResponse - */ - public setAutomatedGa4ConfigurationOptOut(request: google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutRequest, callback: google.analytics.admin.v1alpha.AnalyticsAdminService.SetAutomatedGa4ConfigurationOptOutCallback): void; - - /** - * Calls SetAutomatedGa4ConfigurationOptOut. - * @param request SetAutomatedGa4ConfigurationOptOutRequest message or plain object - * @returns Promise - */ - public setAutomatedGa4ConfigurationOptOut(request: google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutRequest): Promise; - - /** - * Calls FetchAutomatedGa4ConfigurationOptOut. - * @param request FetchAutomatedGa4ConfigurationOptOutRequest message or plain object - * @param callback Node-style callback called with the error, if any, and FetchAutomatedGa4ConfigurationOptOutResponse - */ - public fetchAutomatedGa4ConfigurationOptOut(request: google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutRequest, callback: google.analytics.admin.v1alpha.AnalyticsAdminService.FetchAutomatedGa4ConfigurationOptOutCallback): void; - - /** - * Calls FetchAutomatedGa4ConfigurationOptOut. - * @param request FetchAutomatedGa4ConfigurationOptOutRequest message or plain object - * @returns Promise - */ - public fetchAutomatedGa4ConfigurationOptOut(request: google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutRequest): Promise; - /** * Calls CreateBigQueryLink. * @param request CreateBigQueryLinkRequest message or plain object @@ -3856,62 +3828,6 @@ export namespace google { */ public updateEnhancedMeasurementSettings(request: google.analytics.admin.v1alpha.IUpdateEnhancedMeasurementSettingsRequest): Promise; - /** - * Calls CreateConnectedSiteTag. - * @param request CreateConnectedSiteTagRequest message or plain object - * @param callback Node-style callback called with the error, if any, and CreateConnectedSiteTagResponse - */ - public createConnectedSiteTag(request: google.analytics.admin.v1alpha.ICreateConnectedSiteTagRequest, callback: google.analytics.admin.v1alpha.AnalyticsAdminService.CreateConnectedSiteTagCallback): void; - - /** - * Calls CreateConnectedSiteTag. - * @param request CreateConnectedSiteTagRequest message or plain object - * @returns Promise - */ - public createConnectedSiteTag(request: google.analytics.admin.v1alpha.ICreateConnectedSiteTagRequest): Promise; - - /** - * Calls DeleteConnectedSiteTag. - * @param request DeleteConnectedSiteTagRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteConnectedSiteTag(request: google.analytics.admin.v1alpha.IDeleteConnectedSiteTagRequest, callback: google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteConnectedSiteTagCallback): void; - - /** - * Calls DeleteConnectedSiteTag. - * @param request DeleteConnectedSiteTagRequest message or plain object - * @returns Promise - */ - public deleteConnectedSiteTag(request: google.analytics.admin.v1alpha.IDeleteConnectedSiteTagRequest): Promise; - - /** - * Calls ListConnectedSiteTags. - * @param request ListConnectedSiteTagsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListConnectedSiteTagsResponse - */ - public listConnectedSiteTags(request: google.analytics.admin.v1alpha.IListConnectedSiteTagsRequest, callback: google.analytics.admin.v1alpha.AnalyticsAdminService.ListConnectedSiteTagsCallback): void; - - /** - * Calls ListConnectedSiteTags. - * @param request ListConnectedSiteTagsRequest message or plain object - * @returns Promise - */ - public listConnectedSiteTags(request: google.analytics.admin.v1alpha.IListConnectedSiteTagsRequest): Promise; - - /** - * Calls FetchConnectedGa4Property. - * @param request FetchConnectedGa4PropertyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and FetchConnectedGa4PropertyResponse - */ - public fetchConnectedGa4Property(request: google.analytics.admin.v1alpha.IFetchConnectedGa4PropertyRequest, callback: google.analytics.admin.v1alpha.AnalyticsAdminService.FetchConnectedGa4PropertyCallback): void; - - /** - * Calls FetchConnectedGa4Property. - * @param request FetchConnectedGa4PropertyRequest message or plain object - * @returns Promise - */ - public fetchConnectedGa4Property(request: google.analytics.admin.v1alpha.IFetchConnectedGa4PropertyRequest): Promise; - /** * Calls GetAdSenseLink. * @param request GetAdSenseLinkRequest message or plain object @@ -4499,6 +4415,20 @@ export namespace google { * @returns Promise */ public getSubpropertySyncConfig(request: google.analytics.admin.v1alpha.IGetSubpropertySyncConfigRequest): Promise; + + /** + * Calls GetReportingIdentitySettings. + * @param request GetReportingIdentitySettingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ReportingIdentitySettings + */ + public getReportingIdentitySettings(request: google.analytics.admin.v1alpha.IGetReportingIdentitySettingsRequest, callback: google.analytics.admin.v1alpha.AnalyticsAdminService.GetReportingIdentitySettingsCallback): void; + + /** + * Calls GetReportingIdentitySettings. + * @param request GetReportingIdentitySettingsRequest message or plain object + * @returns Promise + */ + public getReportingIdentitySettings(request: google.analytics.admin.v1alpha.IGetReportingIdentitySettingsRequest): Promise; } namespace AnalyticsAdminService { @@ -5231,20 +5161,6 @@ export namespace google { */ type DeleteChannelGroupCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - /** - * Callback as used by {@link google.analytics.admin.v1alpha.AnalyticsAdminService|setAutomatedGa4ConfigurationOptOut}. - * @param error Error, if any - * @param [response] SetAutomatedGa4ConfigurationOptOutResponse - */ - type SetAutomatedGa4ConfigurationOptOutCallback = (error: (Error|null), response?: google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutResponse) => void; - - /** - * Callback as used by {@link google.analytics.admin.v1alpha.AnalyticsAdminService|fetchAutomatedGa4ConfigurationOptOut}. - * @param error Error, if any - * @param [response] FetchAutomatedGa4ConfigurationOptOutResponse - */ - type FetchAutomatedGa4ConfigurationOptOutCallback = (error: (Error|null), response?: google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutResponse) => void; - /** * Callback as used by {@link google.analytics.admin.v1alpha.AnalyticsAdminService|createBigQueryLink}. * @param error Error, if any @@ -5294,34 +5210,6 @@ export namespace google { */ type UpdateEnhancedMeasurementSettingsCallback = (error: (Error|null), response?: google.analytics.admin.v1alpha.EnhancedMeasurementSettings) => void; - /** - * Callback as used by {@link google.analytics.admin.v1alpha.AnalyticsAdminService|createConnectedSiteTag}. - * @param error Error, if any - * @param [response] CreateConnectedSiteTagResponse - */ - type CreateConnectedSiteTagCallback = (error: (Error|null), response?: google.analytics.admin.v1alpha.CreateConnectedSiteTagResponse) => void; - - /** - * Callback as used by {@link google.analytics.admin.v1alpha.AnalyticsAdminService|deleteConnectedSiteTag}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteConnectedSiteTagCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.analytics.admin.v1alpha.AnalyticsAdminService|listConnectedSiteTags}. - * @param error Error, if any - * @param [response] ListConnectedSiteTagsResponse - */ - type ListConnectedSiteTagsCallback = (error: (Error|null), response?: google.analytics.admin.v1alpha.ListConnectedSiteTagsResponse) => void; - - /** - * Callback as used by {@link google.analytics.admin.v1alpha.AnalyticsAdminService|fetchConnectedGa4Property}. - * @param error Error, if any - * @param [response] FetchConnectedGa4PropertyResponse - */ - type FetchConnectedGa4PropertyCallback = (error: (Error|null), response?: google.analytics.admin.v1alpha.FetchConnectedGa4PropertyResponse) => void; - /** * Callback as used by {@link google.analytics.admin.v1alpha.AnalyticsAdminService|getAdSenseLink}. * @param error Error, if any @@ -5615,6 +5503,13 @@ export namespace google { * @param [response] SubpropertySyncConfig */ type GetSubpropertySyncConfigCallback = (error: (Error|null), response?: google.analytics.admin.v1alpha.SubpropertySyncConfig) => void; + + /** + * Callback as used by {@link google.analytics.admin.v1alpha.AnalyticsAdminService|getReportingIdentitySettings}. + * @param error Error, if any + * @param [response] ReportingIdentitySettings + */ + type GetReportingIdentitySettingsCallback = (error: (Error|null), response?: google.analytics.admin.v1alpha.ReportingIdentitySettings) => void; } /** Properties of a RunAccessReportRequest. */ @@ -19668,394 +19563,6 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a SetAutomatedGa4ConfigurationOptOutRequest. */ - interface ISetAutomatedGa4ConfigurationOptOutRequest { - - /** SetAutomatedGa4ConfigurationOptOutRequest property */ - property?: (string|null); - - /** SetAutomatedGa4ConfigurationOptOutRequest optOut */ - optOut?: (boolean|null); - } - - /** Represents a SetAutomatedGa4ConfigurationOptOutRequest. */ - class SetAutomatedGa4ConfigurationOptOutRequest implements ISetAutomatedGa4ConfigurationOptOutRequest { - - /** - * Constructs a new SetAutomatedGa4ConfigurationOptOutRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutRequest); - - /** SetAutomatedGa4ConfigurationOptOutRequest property. */ - public property: string; - - /** SetAutomatedGa4ConfigurationOptOutRequest optOut. */ - public optOut: boolean; - - /** - * Creates a new SetAutomatedGa4ConfigurationOptOutRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns SetAutomatedGa4ConfigurationOptOutRequest instance - */ - public static create(properties?: google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutRequest): google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutRequest; - - /** - * Encodes the specified SetAutomatedGa4ConfigurationOptOutRequest message. Does not implicitly {@link google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutRequest.verify|verify} messages. - * @param message SetAutomatedGa4ConfigurationOptOutRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SetAutomatedGa4ConfigurationOptOutRequest message, length delimited. Does not implicitly {@link google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutRequest.verify|verify} messages. - * @param message SetAutomatedGa4ConfigurationOptOutRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SetAutomatedGa4ConfigurationOptOutRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SetAutomatedGa4ConfigurationOptOutRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutRequest; - - /** - * Decodes a SetAutomatedGa4ConfigurationOptOutRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SetAutomatedGa4ConfigurationOptOutRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutRequest; - - /** - * Verifies a SetAutomatedGa4ConfigurationOptOutRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SetAutomatedGa4ConfigurationOptOutRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SetAutomatedGa4ConfigurationOptOutRequest - */ - public static fromObject(object: { [k: string]: any }): google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutRequest; - - /** - * Creates a plain object from a SetAutomatedGa4ConfigurationOptOutRequest message. Also converts values to other types if specified. - * @param message SetAutomatedGa4ConfigurationOptOutRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SetAutomatedGa4ConfigurationOptOutRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SetAutomatedGa4ConfigurationOptOutRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SetAutomatedGa4ConfigurationOptOutResponse. */ - interface ISetAutomatedGa4ConfigurationOptOutResponse { - } - - /** Represents a SetAutomatedGa4ConfigurationOptOutResponse. */ - class SetAutomatedGa4ConfigurationOptOutResponse implements ISetAutomatedGa4ConfigurationOptOutResponse { - - /** - * Constructs a new SetAutomatedGa4ConfigurationOptOutResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutResponse); - - /** - * Creates a new SetAutomatedGa4ConfigurationOptOutResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns SetAutomatedGa4ConfigurationOptOutResponse instance - */ - public static create(properties?: google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutResponse): google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutResponse; - - /** - * Encodes the specified SetAutomatedGa4ConfigurationOptOutResponse message. Does not implicitly {@link google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutResponse.verify|verify} messages. - * @param message SetAutomatedGa4ConfigurationOptOutResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SetAutomatedGa4ConfigurationOptOutResponse message, length delimited. Does not implicitly {@link google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutResponse.verify|verify} messages. - * @param message SetAutomatedGa4ConfigurationOptOutResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SetAutomatedGa4ConfigurationOptOutResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SetAutomatedGa4ConfigurationOptOutResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutResponse; - - /** - * Decodes a SetAutomatedGa4ConfigurationOptOutResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SetAutomatedGa4ConfigurationOptOutResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutResponse; - - /** - * Verifies a SetAutomatedGa4ConfigurationOptOutResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SetAutomatedGa4ConfigurationOptOutResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SetAutomatedGa4ConfigurationOptOutResponse - */ - public static fromObject(object: { [k: string]: any }): google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutResponse; - - /** - * Creates a plain object from a SetAutomatedGa4ConfigurationOptOutResponse message. Also converts values to other types if specified. - * @param message SetAutomatedGa4ConfigurationOptOutResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SetAutomatedGa4ConfigurationOptOutResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SetAutomatedGa4ConfigurationOptOutResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FetchAutomatedGa4ConfigurationOptOutRequest. */ - interface IFetchAutomatedGa4ConfigurationOptOutRequest { - - /** FetchAutomatedGa4ConfigurationOptOutRequest property */ - property?: (string|null); - } - - /** Represents a FetchAutomatedGa4ConfigurationOptOutRequest. */ - class FetchAutomatedGa4ConfigurationOptOutRequest implements IFetchAutomatedGa4ConfigurationOptOutRequest { - - /** - * Constructs a new FetchAutomatedGa4ConfigurationOptOutRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutRequest); - - /** FetchAutomatedGa4ConfigurationOptOutRequest property. */ - public property: string; - - /** - * Creates a new FetchAutomatedGa4ConfigurationOptOutRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns FetchAutomatedGa4ConfigurationOptOutRequest instance - */ - public static create(properties?: google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutRequest): google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutRequest; - - /** - * Encodes the specified FetchAutomatedGa4ConfigurationOptOutRequest message. Does not implicitly {@link google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutRequest.verify|verify} messages. - * @param message FetchAutomatedGa4ConfigurationOptOutRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FetchAutomatedGa4ConfigurationOptOutRequest message, length delimited. Does not implicitly {@link google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutRequest.verify|verify} messages. - * @param message FetchAutomatedGa4ConfigurationOptOutRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FetchAutomatedGa4ConfigurationOptOutRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FetchAutomatedGa4ConfigurationOptOutRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutRequest; - - /** - * Decodes a FetchAutomatedGa4ConfigurationOptOutRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FetchAutomatedGa4ConfigurationOptOutRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutRequest; - - /** - * Verifies a FetchAutomatedGa4ConfigurationOptOutRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FetchAutomatedGa4ConfigurationOptOutRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FetchAutomatedGa4ConfigurationOptOutRequest - */ - public static fromObject(object: { [k: string]: any }): google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutRequest; - - /** - * Creates a plain object from a FetchAutomatedGa4ConfigurationOptOutRequest message. Also converts values to other types if specified. - * @param message FetchAutomatedGa4ConfigurationOptOutRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FetchAutomatedGa4ConfigurationOptOutRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FetchAutomatedGa4ConfigurationOptOutRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FetchAutomatedGa4ConfigurationOptOutResponse. */ - interface IFetchAutomatedGa4ConfigurationOptOutResponse { - - /** FetchAutomatedGa4ConfigurationOptOutResponse optOut */ - optOut?: (boolean|null); - } - - /** Represents a FetchAutomatedGa4ConfigurationOptOutResponse. */ - class FetchAutomatedGa4ConfigurationOptOutResponse implements IFetchAutomatedGa4ConfigurationOptOutResponse { - - /** - * Constructs a new FetchAutomatedGa4ConfigurationOptOutResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutResponse); - - /** FetchAutomatedGa4ConfigurationOptOutResponse optOut. */ - public optOut: boolean; - - /** - * Creates a new FetchAutomatedGa4ConfigurationOptOutResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns FetchAutomatedGa4ConfigurationOptOutResponse instance - */ - public static create(properties?: google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutResponse): google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutResponse; - - /** - * Encodes the specified FetchAutomatedGa4ConfigurationOptOutResponse message. Does not implicitly {@link google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutResponse.verify|verify} messages. - * @param message FetchAutomatedGa4ConfigurationOptOutResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FetchAutomatedGa4ConfigurationOptOutResponse message, length delimited. Does not implicitly {@link google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutResponse.verify|verify} messages. - * @param message FetchAutomatedGa4ConfigurationOptOutResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FetchAutomatedGa4ConfigurationOptOutResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FetchAutomatedGa4ConfigurationOptOutResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutResponse; - - /** - * Decodes a FetchAutomatedGa4ConfigurationOptOutResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FetchAutomatedGa4ConfigurationOptOutResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutResponse; - - /** - * Verifies a FetchAutomatedGa4ConfigurationOptOutResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FetchAutomatedGa4ConfigurationOptOutResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FetchAutomatedGa4ConfigurationOptOutResponse - */ - public static fromObject(object: { [k: string]: any }): google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutResponse; - - /** - * Creates a plain object from a FetchAutomatedGa4ConfigurationOptOutResponse message. Also converts values to other types if specified. - * @param message FetchAutomatedGa4ConfigurationOptOutResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FetchAutomatedGa4ConfigurationOptOutResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FetchAutomatedGa4ConfigurationOptOutResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - /** Properties of a CreateBigQueryLinkRequest. */ interface ICreateBigQueryLinkRequest { @@ -21068,497 +20575,6 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a CreateConnectedSiteTagRequest. */ - interface ICreateConnectedSiteTagRequest { - - /** CreateConnectedSiteTagRequest property */ - property?: (string|null); - - /** CreateConnectedSiteTagRequest connectedSiteTag */ - connectedSiteTag?: (google.analytics.admin.v1alpha.IConnectedSiteTag|null); - } - - /** Represents a CreateConnectedSiteTagRequest. */ - class CreateConnectedSiteTagRequest implements ICreateConnectedSiteTagRequest { - - /** - * Constructs a new CreateConnectedSiteTagRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.analytics.admin.v1alpha.ICreateConnectedSiteTagRequest); - - /** CreateConnectedSiteTagRequest property. */ - public property: string; - - /** CreateConnectedSiteTagRequest connectedSiteTag. */ - public connectedSiteTag?: (google.analytics.admin.v1alpha.IConnectedSiteTag|null); - - /** - * Creates a new CreateConnectedSiteTagRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateConnectedSiteTagRequest instance - */ - public static create(properties?: google.analytics.admin.v1alpha.ICreateConnectedSiteTagRequest): google.analytics.admin.v1alpha.CreateConnectedSiteTagRequest; - - /** - * Encodes the specified CreateConnectedSiteTagRequest message. Does not implicitly {@link google.analytics.admin.v1alpha.CreateConnectedSiteTagRequest.verify|verify} messages. - * @param message CreateConnectedSiteTagRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.analytics.admin.v1alpha.ICreateConnectedSiteTagRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateConnectedSiteTagRequest message, length delimited. Does not implicitly {@link google.analytics.admin.v1alpha.CreateConnectedSiteTagRequest.verify|verify} messages. - * @param message CreateConnectedSiteTagRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.analytics.admin.v1alpha.ICreateConnectedSiteTagRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateConnectedSiteTagRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateConnectedSiteTagRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.admin.v1alpha.CreateConnectedSiteTagRequest; - - /** - * Decodes a CreateConnectedSiteTagRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateConnectedSiteTagRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.admin.v1alpha.CreateConnectedSiteTagRequest; - - /** - * Verifies a CreateConnectedSiteTagRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateConnectedSiteTagRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateConnectedSiteTagRequest - */ - public static fromObject(object: { [k: string]: any }): google.analytics.admin.v1alpha.CreateConnectedSiteTagRequest; - - /** - * Creates a plain object from a CreateConnectedSiteTagRequest message. Also converts values to other types if specified. - * @param message CreateConnectedSiteTagRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.analytics.admin.v1alpha.CreateConnectedSiteTagRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateConnectedSiteTagRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateConnectedSiteTagRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateConnectedSiteTagResponse. */ - interface ICreateConnectedSiteTagResponse { - } - - /** Represents a CreateConnectedSiteTagResponse. */ - class CreateConnectedSiteTagResponse implements ICreateConnectedSiteTagResponse { - - /** - * Constructs a new CreateConnectedSiteTagResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.analytics.admin.v1alpha.ICreateConnectedSiteTagResponse); - - /** - * Creates a new CreateConnectedSiteTagResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateConnectedSiteTagResponse instance - */ - public static create(properties?: google.analytics.admin.v1alpha.ICreateConnectedSiteTagResponse): google.analytics.admin.v1alpha.CreateConnectedSiteTagResponse; - - /** - * Encodes the specified CreateConnectedSiteTagResponse message. Does not implicitly {@link google.analytics.admin.v1alpha.CreateConnectedSiteTagResponse.verify|verify} messages. - * @param message CreateConnectedSiteTagResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.analytics.admin.v1alpha.ICreateConnectedSiteTagResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateConnectedSiteTagResponse message, length delimited. Does not implicitly {@link google.analytics.admin.v1alpha.CreateConnectedSiteTagResponse.verify|verify} messages. - * @param message CreateConnectedSiteTagResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.analytics.admin.v1alpha.ICreateConnectedSiteTagResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateConnectedSiteTagResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateConnectedSiteTagResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.admin.v1alpha.CreateConnectedSiteTagResponse; - - /** - * Decodes a CreateConnectedSiteTagResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateConnectedSiteTagResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.admin.v1alpha.CreateConnectedSiteTagResponse; - - /** - * Verifies a CreateConnectedSiteTagResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateConnectedSiteTagResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateConnectedSiteTagResponse - */ - public static fromObject(object: { [k: string]: any }): google.analytics.admin.v1alpha.CreateConnectedSiteTagResponse; - - /** - * Creates a plain object from a CreateConnectedSiteTagResponse message. Also converts values to other types if specified. - * @param message CreateConnectedSiteTagResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.analytics.admin.v1alpha.CreateConnectedSiteTagResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateConnectedSiteTagResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateConnectedSiteTagResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteConnectedSiteTagRequest. */ - interface IDeleteConnectedSiteTagRequest { - - /** DeleteConnectedSiteTagRequest property */ - property?: (string|null); - - /** DeleteConnectedSiteTagRequest tagId */ - tagId?: (string|null); - } - - /** Represents a DeleteConnectedSiteTagRequest. */ - class DeleteConnectedSiteTagRequest implements IDeleteConnectedSiteTagRequest { - - /** - * Constructs a new DeleteConnectedSiteTagRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.analytics.admin.v1alpha.IDeleteConnectedSiteTagRequest); - - /** DeleteConnectedSiteTagRequest property. */ - public property: string; - - /** DeleteConnectedSiteTagRequest tagId. */ - public tagId: string; - - /** - * Creates a new DeleteConnectedSiteTagRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteConnectedSiteTagRequest instance - */ - public static create(properties?: google.analytics.admin.v1alpha.IDeleteConnectedSiteTagRequest): google.analytics.admin.v1alpha.DeleteConnectedSiteTagRequest; - - /** - * Encodes the specified DeleteConnectedSiteTagRequest message. Does not implicitly {@link google.analytics.admin.v1alpha.DeleteConnectedSiteTagRequest.verify|verify} messages. - * @param message DeleteConnectedSiteTagRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.analytics.admin.v1alpha.IDeleteConnectedSiteTagRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteConnectedSiteTagRequest message, length delimited. Does not implicitly {@link google.analytics.admin.v1alpha.DeleteConnectedSiteTagRequest.verify|verify} messages. - * @param message DeleteConnectedSiteTagRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.analytics.admin.v1alpha.IDeleteConnectedSiteTagRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteConnectedSiteTagRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteConnectedSiteTagRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.admin.v1alpha.DeleteConnectedSiteTagRequest; - - /** - * Decodes a DeleteConnectedSiteTagRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteConnectedSiteTagRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.admin.v1alpha.DeleteConnectedSiteTagRequest; - - /** - * Verifies a DeleteConnectedSiteTagRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteConnectedSiteTagRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteConnectedSiteTagRequest - */ - public static fromObject(object: { [k: string]: any }): google.analytics.admin.v1alpha.DeleteConnectedSiteTagRequest; - - /** - * Creates a plain object from a DeleteConnectedSiteTagRequest message. Also converts values to other types if specified. - * @param message DeleteConnectedSiteTagRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.analytics.admin.v1alpha.DeleteConnectedSiteTagRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteConnectedSiteTagRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteConnectedSiteTagRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListConnectedSiteTagsRequest. */ - interface IListConnectedSiteTagsRequest { - - /** ListConnectedSiteTagsRequest property */ - property?: (string|null); - } - - /** Represents a ListConnectedSiteTagsRequest. */ - class ListConnectedSiteTagsRequest implements IListConnectedSiteTagsRequest { - - /** - * Constructs a new ListConnectedSiteTagsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.analytics.admin.v1alpha.IListConnectedSiteTagsRequest); - - /** ListConnectedSiteTagsRequest property. */ - public property: string; - - /** - * Creates a new ListConnectedSiteTagsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListConnectedSiteTagsRequest instance - */ - public static create(properties?: google.analytics.admin.v1alpha.IListConnectedSiteTagsRequest): google.analytics.admin.v1alpha.ListConnectedSiteTagsRequest; - - /** - * Encodes the specified ListConnectedSiteTagsRequest message. Does not implicitly {@link google.analytics.admin.v1alpha.ListConnectedSiteTagsRequest.verify|verify} messages. - * @param message ListConnectedSiteTagsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.analytics.admin.v1alpha.IListConnectedSiteTagsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListConnectedSiteTagsRequest message, length delimited. Does not implicitly {@link google.analytics.admin.v1alpha.ListConnectedSiteTagsRequest.verify|verify} messages. - * @param message ListConnectedSiteTagsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.analytics.admin.v1alpha.IListConnectedSiteTagsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListConnectedSiteTagsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListConnectedSiteTagsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.admin.v1alpha.ListConnectedSiteTagsRequest; - - /** - * Decodes a ListConnectedSiteTagsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListConnectedSiteTagsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.admin.v1alpha.ListConnectedSiteTagsRequest; - - /** - * Verifies a ListConnectedSiteTagsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListConnectedSiteTagsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListConnectedSiteTagsRequest - */ - public static fromObject(object: { [k: string]: any }): google.analytics.admin.v1alpha.ListConnectedSiteTagsRequest; - - /** - * Creates a plain object from a ListConnectedSiteTagsRequest message. Also converts values to other types if specified. - * @param message ListConnectedSiteTagsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.analytics.admin.v1alpha.ListConnectedSiteTagsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListConnectedSiteTagsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListConnectedSiteTagsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListConnectedSiteTagsResponse. */ - interface IListConnectedSiteTagsResponse { - - /** ListConnectedSiteTagsResponse connectedSiteTags */ - connectedSiteTags?: (google.analytics.admin.v1alpha.IConnectedSiteTag[]|null); - } - - /** Represents a ListConnectedSiteTagsResponse. */ - class ListConnectedSiteTagsResponse implements IListConnectedSiteTagsResponse { - - /** - * Constructs a new ListConnectedSiteTagsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.analytics.admin.v1alpha.IListConnectedSiteTagsResponse); - - /** ListConnectedSiteTagsResponse connectedSiteTags. */ - public connectedSiteTags: google.analytics.admin.v1alpha.IConnectedSiteTag[]; - - /** - * Creates a new ListConnectedSiteTagsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListConnectedSiteTagsResponse instance - */ - public static create(properties?: google.analytics.admin.v1alpha.IListConnectedSiteTagsResponse): google.analytics.admin.v1alpha.ListConnectedSiteTagsResponse; - - /** - * Encodes the specified ListConnectedSiteTagsResponse message. Does not implicitly {@link google.analytics.admin.v1alpha.ListConnectedSiteTagsResponse.verify|verify} messages. - * @param message ListConnectedSiteTagsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.analytics.admin.v1alpha.IListConnectedSiteTagsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListConnectedSiteTagsResponse message, length delimited. Does not implicitly {@link google.analytics.admin.v1alpha.ListConnectedSiteTagsResponse.verify|verify} messages. - * @param message ListConnectedSiteTagsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.analytics.admin.v1alpha.IListConnectedSiteTagsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListConnectedSiteTagsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListConnectedSiteTagsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.admin.v1alpha.ListConnectedSiteTagsResponse; - - /** - * Decodes a ListConnectedSiteTagsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListConnectedSiteTagsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.admin.v1alpha.ListConnectedSiteTagsResponse; - - /** - * Verifies a ListConnectedSiteTagsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListConnectedSiteTagsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListConnectedSiteTagsResponse - */ - public static fromObject(object: { [k: string]: any }): google.analytics.admin.v1alpha.ListConnectedSiteTagsResponse; - - /** - * Creates a plain object from a ListConnectedSiteTagsResponse message. Also converts values to other types if specified. - * @param message ListConnectedSiteTagsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.analytics.admin.v1alpha.ListConnectedSiteTagsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListConnectedSiteTagsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListConnectedSiteTagsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - /** Properties of a CreateAdSenseLinkRequest. */ interface ICreateAdSenseLinkRequest { @@ -22068,200 +21084,6 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a FetchConnectedGa4PropertyRequest. */ - interface IFetchConnectedGa4PropertyRequest { - - /** FetchConnectedGa4PropertyRequest property */ - property?: (string|null); - } - - /** Represents a FetchConnectedGa4PropertyRequest. */ - class FetchConnectedGa4PropertyRequest implements IFetchConnectedGa4PropertyRequest { - - /** - * Constructs a new FetchConnectedGa4PropertyRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.analytics.admin.v1alpha.IFetchConnectedGa4PropertyRequest); - - /** FetchConnectedGa4PropertyRequest property. */ - public property: string; - - /** - * Creates a new FetchConnectedGa4PropertyRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns FetchConnectedGa4PropertyRequest instance - */ - public static create(properties?: google.analytics.admin.v1alpha.IFetchConnectedGa4PropertyRequest): google.analytics.admin.v1alpha.FetchConnectedGa4PropertyRequest; - - /** - * Encodes the specified FetchConnectedGa4PropertyRequest message. Does not implicitly {@link google.analytics.admin.v1alpha.FetchConnectedGa4PropertyRequest.verify|verify} messages. - * @param message FetchConnectedGa4PropertyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.analytics.admin.v1alpha.IFetchConnectedGa4PropertyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FetchConnectedGa4PropertyRequest message, length delimited. Does not implicitly {@link google.analytics.admin.v1alpha.FetchConnectedGa4PropertyRequest.verify|verify} messages. - * @param message FetchConnectedGa4PropertyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.analytics.admin.v1alpha.IFetchConnectedGa4PropertyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FetchConnectedGa4PropertyRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FetchConnectedGa4PropertyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.admin.v1alpha.FetchConnectedGa4PropertyRequest; - - /** - * Decodes a FetchConnectedGa4PropertyRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FetchConnectedGa4PropertyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.admin.v1alpha.FetchConnectedGa4PropertyRequest; - - /** - * Verifies a FetchConnectedGa4PropertyRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FetchConnectedGa4PropertyRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FetchConnectedGa4PropertyRequest - */ - public static fromObject(object: { [k: string]: any }): google.analytics.admin.v1alpha.FetchConnectedGa4PropertyRequest; - - /** - * Creates a plain object from a FetchConnectedGa4PropertyRequest message. Also converts values to other types if specified. - * @param message FetchConnectedGa4PropertyRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.analytics.admin.v1alpha.FetchConnectedGa4PropertyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FetchConnectedGa4PropertyRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FetchConnectedGa4PropertyRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FetchConnectedGa4PropertyResponse. */ - interface IFetchConnectedGa4PropertyResponse { - - /** FetchConnectedGa4PropertyResponse property */ - property?: (string|null); - } - - /** Represents a FetchConnectedGa4PropertyResponse. */ - class FetchConnectedGa4PropertyResponse implements IFetchConnectedGa4PropertyResponse { - - /** - * Constructs a new FetchConnectedGa4PropertyResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.analytics.admin.v1alpha.IFetchConnectedGa4PropertyResponse); - - /** FetchConnectedGa4PropertyResponse property. */ - public property: string; - - /** - * Creates a new FetchConnectedGa4PropertyResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns FetchConnectedGa4PropertyResponse instance - */ - public static create(properties?: google.analytics.admin.v1alpha.IFetchConnectedGa4PropertyResponse): google.analytics.admin.v1alpha.FetchConnectedGa4PropertyResponse; - - /** - * Encodes the specified FetchConnectedGa4PropertyResponse message. Does not implicitly {@link google.analytics.admin.v1alpha.FetchConnectedGa4PropertyResponse.verify|verify} messages. - * @param message FetchConnectedGa4PropertyResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.analytics.admin.v1alpha.IFetchConnectedGa4PropertyResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FetchConnectedGa4PropertyResponse message, length delimited. Does not implicitly {@link google.analytics.admin.v1alpha.FetchConnectedGa4PropertyResponse.verify|verify} messages. - * @param message FetchConnectedGa4PropertyResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.analytics.admin.v1alpha.IFetchConnectedGa4PropertyResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FetchConnectedGa4PropertyResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FetchConnectedGa4PropertyResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.admin.v1alpha.FetchConnectedGa4PropertyResponse; - - /** - * Decodes a FetchConnectedGa4PropertyResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FetchConnectedGa4PropertyResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.admin.v1alpha.FetchConnectedGa4PropertyResponse; - - /** - * Verifies a FetchConnectedGa4PropertyResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FetchConnectedGa4PropertyResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FetchConnectedGa4PropertyResponse - */ - public static fromObject(object: { [k: string]: any }): google.analytics.admin.v1alpha.FetchConnectedGa4PropertyResponse; - - /** - * Creates a plain object from a FetchConnectedGa4PropertyResponse message. Also converts values to other types if specified. - * @param message FetchConnectedGa4PropertyResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.analytics.admin.v1alpha.FetchConnectedGa4PropertyResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FetchConnectedGa4PropertyResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FetchConnectedGa4PropertyResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - /** Properties of a CreateEventCreateRuleRequest. */ interface ICreateEventCreateRuleRequest { @@ -26379,6 +25201,103 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a GetReportingIdentitySettingsRequest. */ + interface IGetReportingIdentitySettingsRequest { + + /** GetReportingIdentitySettingsRequest name */ + name?: (string|null); + } + + /** Represents a GetReportingIdentitySettingsRequest. */ + class GetReportingIdentitySettingsRequest implements IGetReportingIdentitySettingsRequest { + + /** + * Constructs a new GetReportingIdentitySettingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.admin.v1alpha.IGetReportingIdentitySettingsRequest); + + /** GetReportingIdentitySettingsRequest name. */ + public name: string; + + /** + * Creates a new GetReportingIdentitySettingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetReportingIdentitySettingsRequest instance + */ + public static create(properties?: google.analytics.admin.v1alpha.IGetReportingIdentitySettingsRequest): google.analytics.admin.v1alpha.GetReportingIdentitySettingsRequest; + + /** + * Encodes the specified GetReportingIdentitySettingsRequest message. Does not implicitly {@link google.analytics.admin.v1alpha.GetReportingIdentitySettingsRequest.verify|verify} messages. + * @param message GetReportingIdentitySettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.admin.v1alpha.IGetReportingIdentitySettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetReportingIdentitySettingsRequest message, length delimited. Does not implicitly {@link google.analytics.admin.v1alpha.GetReportingIdentitySettingsRequest.verify|verify} messages. + * @param message GetReportingIdentitySettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.admin.v1alpha.IGetReportingIdentitySettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetReportingIdentitySettingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetReportingIdentitySettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.admin.v1alpha.GetReportingIdentitySettingsRequest; + + /** + * Decodes a GetReportingIdentitySettingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetReportingIdentitySettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.admin.v1alpha.GetReportingIdentitySettingsRequest; + + /** + * Verifies a GetReportingIdentitySettingsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetReportingIdentitySettingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetReportingIdentitySettingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.analytics.admin.v1alpha.GetReportingIdentitySettingsRequest; + + /** + * Creates a plain object from a GetReportingIdentitySettingsRequest message. Also converts values to other types if specified. + * @param message GetReportingIdentitySettingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.admin.v1alpha.GetReportingIdentitySettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetReportingIdentitySettingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetReportingIdentitySettingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** AudienceFilterScope enum. */ enum AudienceFilterScope { AUDIENCE_FILTER_SCOPE_UNSPECIFIED = 0, @@ -30137,7 +29056,8 @@ export namespace google { KEY_EVENT = 30, CALCULATED_METRIC = 31, REPORTING_DATA_ANNOTATION = 32, - SUBPROPERTY_SYNC_CONFIG = 33 + SUBPROPERTY_SYNC_CONFIG = 33, + REPORTING_IDENTITY_SETTINGS = 34 } /** GoogleSignalsState enum. */ @@ -32565,6 +31485,9 @@ export namespace google { /** ChangeHistoryResource subpropertySyncConfig */ subpropertySyncConfig?: (google.analytics.admin.v1alpha.ISubpropertySyncConfig|null); + + /** ChangeHistoryResource reportingIdentitySettings */ + reportingIdentitySettings?: (google.analytics.admin.v1alpha.IReportingIdentitySettings|null); } /** Represents a ChangeHistoryResource. */ @@ -32660,8 +31583,11 @@ export namespace google { /** ChangeHistoryResource subpropertySyncConfig. */ public subpropertySyncConfig?: (google.analytics.admin.v1alpha.ISubpropertySyncConfig|null); + /** ChangeHistoryResource reportingIdentitySettings. */ + public reportingIdentitySettings?: (google.analytics.admin.v1alpha.IReportingIdentitySettings|null); + /** ChangeHistoryResource resource. */ - public resource?: ("account"|"property"|"firebaseLink"|"googleAdsLink"|"googleSignalsSettings"|"displayVideo_360AdvertiserLink"|"displayVideo_360AdvertiserLinkProposal"|"conversionEvent"|"measurementProtocolSecret"|"customDimension"|"customMetric"|"dataRetentionSettings"|"searchAds_360Link"|"dataStream"|"attributionSettings"|"expandedDataSet"|"channelGroup"|"bigqueryLink"|"enhancedMeasurementSettings"|"dataRedactionSettings"|"skadnetworkConversionValueSchema"|"adsenseLink"|"audience"|"eventCreateRule"|"keyEvent"|"calculatedMetric"|"reportingDataAnnotation"|"subpropertySyncConfig"); + public resource?: ("account"|"property"|"firebaseLink"|"googleAdsLink"|"googleSignalsSettings"|"displayVideo_360AdvertiserLink"|"displayVideo_360AdvertiserLinkProposal"|"conversionEvent"|"measurementProtocolSecret"|"customDimension"|"customMetric"|"dataRetentionSettings"|"searchAds_360Link"|"dataStream"|"attributionSettings"|"expandedDataSet"|"channelGroup"|"bigqueryLink"|"enhancedMeasurementSettings"|"dataRedactionSettings"|"skadnetworkConversionValueSchema"|"adsenseLink"|"audience"|"eventCreateRule"|"keyEvent"|"calculatedMetric"|"reportingDataAnnotation"|"subpropertySyncConfig"|"reportingIdentitySettings"); /** * Creates a new ChangeHistoryResource instance using the specified properties. @@ -35020,109 +33946,6 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ConnectedSiteTag. */ - interface IConnectedSiteTag { - - /** ConnectedSiteTag displayName */ - displayName?: (string|null); - - /** ConnectedSiteTag tagId */ - tagId?: (string|null); - } - - /** Represents a ConnectedSiteTag. */ - class ConnectedSiteTag implements IConnectedSiteTag { - - /** - * Constructs a new ConnectedSiteTag. - * @param [properties] Properties to set - */ - constructor(properties?: google.analytics.admin.v1alpha.IConnectedSiteTag); - - /** ConnectedSiteTag displayName. */ - public displayName: string; - - /** ConnectedSiteTag tagId. */ - public tagId: string; - - /** - * Creates a new ConnectedSiteTag instance using the specified properties. - * @param [properties] Properties to set - * @returns ConnectedSiteTag instance - */ - public static create(properties?: google.analytics.admin.v1alpha.IConnectedSiteTag): google.analytics.admin.v1alpha.ConnectedSiteTag; - - /** - * Encodes the specified ConnectedSiteTag message. Does not implicitly {@link google.analytics.admin.v1alpha.ConnectedSiteTag.verify|verify} messages. - * @param message ConnectedSiteTag message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.analytics.admin.v1alpha.IConnectedSiteTag, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ConnectedSiteTag message, length delimited. Does not implicitly {@link google.analytics.admin.v1alpha.ConnectedSiteTag.verify|verify} messages. - * @param message ConnectedSiteTag message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.analytics.admin.v1alpha.IConnectedSiteTag, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ConnectedSiteTag message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ConnectedSiteTag - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.admin.v1alpha.ConnectedSiteTag; - - /** - * Decodes a ConnectedSiteTag message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ConnectedSiteTag - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.admin.v1alpha.ConnectedSiteTag; - - /** - * Verifies a ConnectedSiteTag message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ConnectedSiteTag message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ConnectedSiteTag - */ - public static fromObject(object: { [k: string]: any }): google.analytics.admin.v1alpha.ConnectedSiteTag; - - /** - * Creates a plain object from a ConnectedSiteTag message. Also converts values to other types if specified. - * @param message ConnectedSiteTag - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.analytics.admin.v1alpha.ConnectedSiteTag, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ConnectedSiteTag to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ConnectedSiteTag - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - /** Properties of a DataRedactionSettings. */ interface IDataRedactionSettings { @@ -35817,6 +34640,120 @@ export namespace google { } } + /** Properties of a ReportingIdentitySettings. */ + interface IReportingIdentitySettings { + + /** ReportingIdentitySettings name */ + name?: (string|null); + + /** ReportingIdentitySettings reportingIdentity */ + reportingIdentity?: (google.analytics.admin.v1alpha.ReportingIdentitySettings.ReportingIdentity|keyof typeof google.analytics.admin.v1alpha.ReportingIdentitySettings.ReportingIdentity|null); + } + + /** Represents a ReportingIdentitySettings. */ + class ReportingIdentitySettings implements IReportingIdentitySettings { + + /** + * Constructs a new ReportingIdentitySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.admin.v1alpha.IReportingIdentitySettings); + + /** ReportingIdentitySettings name. */ + public name: string; + + /** ReportingIdentitySettings reportingIdentity. */ + public reportingIdentity: (google.analytics.admin.v1alpha.ReportingIdentitySettings.ReportingIdentity|keyof typeof google.analytics.admin.v1alpha.ReportingIdentitySettings.ReportingIdentity); + + /** + * Creates a new ReportingIdentitySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ReportingIdentitySettings instance + */ + public static create(properties?: google.analytics.admin.v1alpha.IReportingIdentitySettings): google.analytics.admin.v1alpha.ReportingIdentitySettings; + + /** + * Encodes the specified ReportingIdentitySettings message. Does not implicitly {@link google.analytics.admin.v1alpha.ReportingIdentitySettings.verify|verify} messages. + * @param message ReportingIdentitySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.admin.v1alpha.IReportingIdentitySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReportingIdentitySettings message, length delimited. Does not implicitly {@link google.analytics.admin.v1alpha.ReportingIdentitySettings.verify|verify} messages. + * @param message ReportingIdentitySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.admin.v1alpha.IReportingIdentitySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReportingIdentitySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReportingIdentitySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.analytics.admin.v1alpha.ReportingIdentitySettings; + + /** + * Decodes a ReportingIdentitySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReportingIdentitySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.analytics.admin.v1alpha.ReportingIdentitySettings; + + /** + * Verifies a ReportingIdentitySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReportingIdentitySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReportingIdentitySettings + */ + public static fromObject(object: { [k: string]: any }): google.analytics.admin.v1alpha.ReportingIdentitySettings; + + /** + * Creates a plain object from a ReportingIdentitySettings message. Also converts values to other types if specified. + * @param message ReportingIdentitySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.admin.v1alpha.ReportingIdentitySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReportingIdentitySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReportingIdentitySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ReportingIdentitySettings { + + /** ReportingIdentity enum. */ + enum ReportingIdentity { + IDENTITY_BLENDING_STRATEGY_UNSPECIFIED = 0, + BLENDED = 1, + OBSERVED = 2, + DEVICE_BASED = 3 + } + } + /** Properties of a SubpropertyEventFilterCondition. */ interface ISubpropertyEventFilterCondition { @@ -50538,6 +49475,9 @@ export namespace google { /** CommonLanguageSettings destinations */ destinations?: (google.api.ClientLibraryDestination[]|null); + + /** CommonLanguageSettings selectiveGapicGeneration */ + selectiveGapicGeneration?: (google.api.ISelectiveGapicGeneration|null); } /** Represents a CommonLanguageSettings. */ @@ -50555,6 +49495,9 @@ export namespace google { /** CommonLanguageSettings destinations. */ public destinations: google.api.ClientLibraryDestination[]; + /** CommonLanguageSettings selectiveGapicGeneration. */ + public selectiveGapicGeneration?: (google.api.ISelectiveGapicGeneration|null); + /** * Creates a new CommonLanguageSettings instance using the specified properties. * @param [properties] Properties to set @@ -51255,6 +50198,9 @@ export namespace google { /** PythonSettings common */ common?: (google.api.ICommonLanguageSettings|null); + + /** PythonSettings experimentalFeatures */ + experimentalFeatures?: (google.api.PythonSettings.IExperimentalFeatures|null); } /** Represents a PythonSettings. */ @@ -51269,6 +50215,9 @@ export namespace google { /** PythonSettings common. */ public common?: (google.api.ICommonLanguageSettings|null); + /** PythonSettings experimentalFeatures. */ + public experimentalFeatures?: (google.api.PythonSettings.IExperimentalFeatures|null); + /** * Creates a new PythonSettings instance using the specified properties. * @param [properties] Properties to set @@ -51347,6 +50296,118 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + namespace PythonSettings { + + /** Properties of an ExperimentalFeatures. */ + interface IExperimentalFeatures { + + /** ExperimentalFeatures restAsyncIoEnabled */ + restAsyncIoEnabled?: (boolean|null); + + /** ExperimentalFeatures protobufPythonicTypesEnabled */ + protobufPythonicTypesEnabled?: (boolean|null); + + /** ExperimentalFeatures unversionedPackageDisabled */ + unversionedPackageDisabled?: (boolean|null); + } + + /** Represents an ExperimentalFeatures. */ + class ExperimentalFeatures implements IExperimentalFeatures { + + /** + * Constructs a new ExperimentalFeatures. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.PythonSettings.IExperimentalFeatures); + + /** ExperimentalFeatures restAsyncIoEnabled. */ + public restAsyncIoEnabled: boolean; + + /** ExperimentalFeatures protobufPythonicTypesEnabled. */ + public protobufPythonicTypesEnabled: boolean; + + /** ExperimentalFeatures unversionedPackageDisabled. */ + public unversionedPackageDisabled: boolean; + + /** + * Creates a new ExperimentalFeatures instance using the specified properties. + * @param [properties] Properties to set + * @returns ExperimentalFeatures instance + */ + public static create(properties?: google.api.PythonSettings.IExperimentalFeatures): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Encodes the specified ExperimentalFeatures message. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @param message ExperimentalFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.PythonSettings.IExperimentalFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExperimentalFeatures message, length delimited. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @param message ExperimentalFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.PythonSettings.IExperimentalFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Verifies an ExperimentalFeatures message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExperimentalFeatures message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExperimentalFeatures + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Creates a plain object from an ExperimentalFeatures message. Also converts values to other types if specified. + * @param message ExperimentalFeatures + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings.ExperimentalFeatures, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExperimentalFeatures to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExperimentalFeatures + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + /** Properties of a NodeSettings. */ interface INodeSettings { @@ -51673,6 +50734,9 @@ export namespace google { /** GoSettings common */ common?: (google.api.ICommonLanguageSettings|null); + + /** GoSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|null); } /** Represents a GoSettings. */ @@ -51687,6 +50751,9 @@ export namespace google { /** GoSettings common. */ public common?: (google.api.ICommonLanguageSettings|null); + /** GoSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + /** * Creates a new GoSettings instance using the specified properties. * @param [properties] Properties to set @@ -52011,6 +51078,109 @@ export namespace google { PACKAGE_MANAGER = 20 } + /** Properties of a SelectiveGapicGeneration. */ + interface ISelectiveGapicGeneration { + + /** SelectiveGapicGeneration methods */ + methods?: (string[]|null); + + /** SelectiveGapicGeneration generateOmittedAsInternal */ + generateOmittedAsInternal?: (boolean|null); + } + + /** Represents a SelectiveGapicGeneration. */ + class SelectiveGapicGeneration implements ISelectiveGapicGeneration { + + /** + * Constructs a new SelectiveGapicGeneration. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ISelectiveGapicGeneration); + + /** SelectiveGapicGeneration methods. */ + public methods: string[]; + + /** SelectiveGapicGeneration generateOmittedAsInternal. */ + public generateOmittedAsInternal: boolean; + + /** + * Creates a new SelectiveGapicGeneration instance using the specified properties. + * @param [properties] Properties to set + * @returns SelectiveGapicGeneration instance + */ + public static create(properties?: google.api.ISelectiveGapicGeneration): google.api.SelectiveGapicGeneration; + + /** + * Encodes the specified SelectiveGapicGeneration message. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @param message SelectiveGapicGeneration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ISelectiveGapicGeneration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SelectiveGapicGeneration message, length delimited. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @param message SelectiveGapicGeneration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ISelectiveGapicGeneration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.SelectiveGapicGeneration; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.SelectiveGapicGeneration; + + /** + * Verifies a SelectiveGapicGeneration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SelectiveGapicGeneration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SelectiveGapicGeneration + */ + public static fromObject(object: { [k: string]: any }): google.api.SelectiveGapicGeneration; + + /** + * Creates a plain object from a SelectiveGapicGeneration message. Also converts values to other types if specified. + * @param message SelectiveGapicGeneration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.SelectiveGapicGeneration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SelectiveGapicGeneration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SelectiveGapicGeneration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** LaunchStage enum. */ enum LaunchStage { LAUNCH_STAGE_UNSPECIFIED = 0, @@ -52127,6 +51297,7 @@ export namespace google { /** Edition enum. */ enum Edition { EDITION_UNKNOWN = 0, + EDITION_LEGACY = 900, EDITION_PROTO2 = 998, EDITION_PROTO3 = 999, EDITION_2023 = 1000, @@ -52157,6 +51328,9 @@ export namespace google { /** FileDescriptorProto weakDependency */ weakDependency?: (number[]|null); + /** FileDescriptorProto optionDependency */ + optionDependency?: (string[]|null); + /** FileDescriptorProto messageType */ messageType?: (google.protobuf.IDescriptorProto[]|null); @@ -52206,6 +51380,9 @@ export namespace google { /** FileDescriptorProto weakDependency. */ public weakDependency: number[]; + /** FileDescriptorProto optionDependency. */ + public optionDependency: string[]; + /** FileDescriptorProto messageType. */ public messageType: google.protobuf.IDescriptorProto[]; @@ -52340,6 +51517,9 @@ export namespace google { /** DescriptorProto reservedName */ reservedName?: (string[]|null); + + /** DescriptorProto visibility */ + visibility?: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility|null); } /** Represents a DescriptorProto. */ @@ -52381,6 +51561,9 @@ export namespace google { /** DescriptorProto reservedName. */ public reservedName: string[]; + /** DescriptorProto visibility. */ + public visibility: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility); + /** * Creates a new DescriptorProto instance using the specified properties. * @param [properties] Properties to set @@ -53228,6 +52411,9 @@ export namespace google { /** EnumDescriptorProto reservedName */ reservedName?: (string[]|null); + + /** EnumDescriptorProto visibility */ + visibility?: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility|null); } /** Represents an EnumDescriptorProto. */ @@ -53254,6 +52440,9 @@ export namespace google { /** EnumDescriptorProto reservedName. */ public reservedName: string[]; + /** EnumDescriptorProto visibility. */ + public visibility: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility); + /** * Creates a new EnumDescriptorProto instance using the specified properties. * @param [properties] Properties to set @@ -54188,6 +53377,9 @@ export namespace google { /** FieldOptions features */ features?: (google.protobuf.IFeatureSet|null); + /** FieldOptions featureSupport */ + featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** FieldOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); @@ -54243,6 +53435,9 @@ export namespace google { /** FieldOptions features. */ public features?: (google.protobuf.IFeatureSet|null); + /** FieldOptions featureSupport. */ + public featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** FieldOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; @@ -54463,6 +53658,121 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** Properties of a FeatureSupport. */ + interface IFeatureSupport { + + /** FeatureSupport editionIntroduced */ + editionIntroduced?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSupport editionDeprecated */ + editionDeprecated?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSupport deprecationWarning */ + deprecationWarning?: (string|null); + + /** FeatureSupport editionRemoved */ + editionRemoved?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSupport. */ + class FeatureSupport implements IFeatureSupport { + + /** + * Constructs a new FeatureSupport. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IFeatureSupport); + + /** FeatureSupport editionIntroduced. */ + public editionIntroduced: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSupport editionDeprecated. */ + public editionDeprecated: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSupport deprecationWarning. */ + public deprecationWarning: string; + + /** FeatureSupport editionRemoved. */ + public editionRemoved: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSupport instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSupport instance + */ + public static create(properties?: google.protobuf.FieldOptions.IFeatureSupport): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Encodes the specified FeatureSupport message. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @param message FeatureSupport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IFeatureSupport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSupport message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @param message FeatureSupport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IFeatureSupport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Verifies a FeatureSupport message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSupport message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSupport + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Creates a plain object from a FeatureSupport message. Also converts values to other types if specified. + * @param message FeatureSupport + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.FeatureSupport, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSupport to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSupport + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } /** Properties of an OneofOptions. */ @@ -54701,6 +54011,9 @@ export namespace google { /** EnumValueOptions debugRedact */ debugRedact?: (boolean|null); + /** EnumValueOptions featureSupport */ + featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** EnumValueOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); } @@ -54723,6 +54036,9 @@ export namespace google { /** EnumValueOptions debugRedact. */ public debugRedact: boolean; + /** EnumValueOptions featureSupport. */ + public featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** EnumValueOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; @@ -55312,6 +54628,12 @@ export namespace google { /** FeatureSet jsonFormat */ jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); + + /** FeatureSet enforceNamingStyle */ + enforceNamingStyle?: (google.protobuf.FeatureSet.EnforceNamingStyle|keyof typeof google.protobuf.FeatureSet.EnforceNamingStyle|null); + + /** FeatureSet defaultSymbolVisibility */ + defaultSymbolVisibility?: (google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|keyof typeof google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|null); } /** Represents a FeatureSet. */ @@ -55341,6 +54663,12 @@ export namespace google { /** FeatureSet jsonFormat. */ public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); + /** FeatureSet enforceNamingStyle. */ + public enforceNamingStyle: (google.protobuf.FeatureSet.EnforceNamingStyle|keyof typeof google.protobuf.FeatureSet.EnforceNamingStyle); + + /** FeatureSet defaultSymbolVisibility. */ + public defaultSymbolVisibility: (google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|keyof typeof google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility); + /** * Creates a new FeatureSet instance using the specified properties. * @param [properties] Properties to set @@ -55463,6 +54791,116 @@ export namespace google { ALLOW = 1, LEGACY_BEST_EFFORT = 2 } + + /** EnforceNamingStyle enum. */ + enum EnforceNamingStyle { + ENFORCE_NAMING_STYLE_UNKNOWN = 0, + STYLE2024 = 1, + STYLE_LEGACY = 2 + } + + /** Properties of a VisibilityFeature. */ + interface IVisibilityFeature { + } + + /** Represents a VisibilityFeature. */ + class VisibilityFeature implements IVisibilityFeature { + + /** + * Constructs a new VisibilityFeature. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSet.IVisibilityFeature); + + /** + * Creates a new VisibilityFeature instance using the specified properties. + * @param [properties] Properties to set + * @returns VisibilityFeature instance + */ + public static create(properties?: google.protobuf.FeatureSet.IVisibilityFeature): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Encodes the specified VisibilityFeature message. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @param message VisibilityFeature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSet.IVisibilityFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VisibilityFeature message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @param message VisibilityFeature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSet.IVisibilityFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Verifies a VisibilityFeature message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VisibilityFeature message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VisibilityFeature + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Creates a plain object from a VisibilityFeature message. Also converts values to other types if specified. + * @param message VisibilityFeature + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet.VisibilityFeature, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VisibilityFeature to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VisibilityFeature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace VisibilityFeature { + + /** DefaultSymbolVisibility enum. */ + enum DefaultSymbolVisibility { + DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0, + EXPORT_ALL = 1, + EXPORT_TOP_LEVEL = 2, + LOCAL_ALL = 3, + STRICT = 4 + } + } } /** Properties of a FeatureSetDefaults. */ @@ -55582,8 +55020,11 @@ export namespace google { /** FeatureSetEditionDefault edition */ edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - /** FeatureSetEditionDefault features */ - features?: (google.protobuf.IFeatureSet|null); + /** FeatureSetEditionDefault overridableFeatures */ + overridableFeatures?: (google.protobuf.IFeatureSet|null); + + /** FeatureSetEditionDefault fixedFeatures */ + fixedFeatures?: (google.protobuf.IFeatureSet|null); } /** Represents a FeatureSetEditionDefault. */ @@ -55598,8 +55039,11 @@ export namespace google { /** FeatureSetEditionDefault edition. */ public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - /** FeatureSetEditionDefault features. */ - public features?: (google.protobuf.IFeatureSet|null); + /** FeatureSetEditionDefault overridableFeatures. */ + public overridableFeatures?: (google.protobuf.IFeatureSet|null); + + /** FeatureSetEditionDefault fixedFeatures. */ + public fixedFeatures?: (google.protobuf.IFeatureSet|null); /** * Creates a new FeatureSetEditionDefault instance using the specified properties. @@ -56132,6 +55576,13 @@ export namespace google { } } + /** SymbolVisibility enum. */ + enum SymbolVisibility { + VISIBILITY_UNSET = 0, + VISIBILITY_LOCAL = 1, + VISIBILITY_EXPORT = 2 + } + /** Properties of a Duration. */ interface IDuration { diff --git a/packages/google-analytics-admin/protos/protos.js b/packages/google-analytics-admin/protos/protos.js index 474d888d473..ef2e72b4803 100644 --- a/packages/google-analytics-admin/protos/protos.js +++ b/packages/google-analytics-admin/protos/protos.js @@ -8860,72 +8860,6 @@ * @variation 2 */ - /** - * Callback as used by {@link google.analytics.admin.v1alpha.AnalyticsAdminService|setAutomatedGa4ConfigurationOptOut}. - * @memberof google.analytics.admin.v1alpha.AnalyticsAdminService - * @typedef SetAutomatedGa4ConfigurationOptOutCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutResponse} [response] SetAutomatedGa4ConfigurationOptOutResponse - */ - - /** - * Calls SetAutomatedGa4ConfigurationOptOut. - * @function setAutomatedGa4ConfigurationOptOut - * @memberof google.analytics.admin.v1alpha.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutRequest} request SetAutomatedGa4ConfigurationOptOutRequest message or plain object - * @param {google.analytics.admin.v1alpha.AnalyticsAdminService.SetAutomatedGa4ConfigurationOptOutCallback} callback Node-style callback called with the error, if any, and SetAutomatedGa4ConfigurationOptOutResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AnalyticsAdminService.prototype.setAutomatedGa4ConfigurationOptOut = function setAutomatedGa4ConfigurationOptOut(request, callback) { - return this.rpcCall(setAutomatedGa4ConfigurationOptOut, $root.google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutRequest, $root.google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutResponse, request, callback); - }, "name", { value: "SetAutomatedGa4ConfigurationOptOut" }); - - /** - * Calls SetAutomatedGa4ConfigurationOptOut. - * @function setAutomatedGa4ConfigurationOptOut - * @memberof google.analytics.admin.v1alpha.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutRequest} request SetAutomatedGa4ConfigurationOptOutRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.analytics.admin.v1alpha.AnalyticsAdminService|fetchAutomatedGa4ConfigurationOptOut}. - * @memberof google.analytics.admin.v1alpha.AnalyticsAdminService - * @typedef FetchAutomatedGa4ConfigurationOptOutCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutResponse} [response] FetchAutomatedGa4ConfigurationOptOutResponse - */ - - /** - * Calls FetchAutomatedGa4ConfigurationOptOut. - * @function fetchAutomatedGa4ConfigurationOptOut - * @memberof google.analytics.admin.v1alpha.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutRequest} request FetchAutomatedGa4ConfigurationOptOutRequest message or plain object - * @param {google.analytics.admin.v1alpha.AnalyticsAdminService.FetchAutomatedGa4ConfigurationOptOutCallback} callback Node-style callback called with the error, if any, and FetchAutomatedGa4ConfigurationOptOutResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AnalyticsAdminService.prototype.fetchAutomatedGa4ConfigurationOptOut = function fetchAutomatedGa4ConfigurationOptOut(request, callback) { - return this.rpcCall(fetchAutomatedGa4ConfigurationOptOut, $root.google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutRequest, $root.google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutResponse, request, callback); - }, "name", { value: "FetchAutomatedGa4ConfigurationOptOut" }); - - /** - * Calls FetchAutomatedGa4ConfigurationOptOut. - * @function fetchAutomatedGa4ConfigurationOptOut - * @memberof google.analytics.admin.v1alpha.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutRequest} request FetchAutomatedGa4ConfigurationOptOutRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - /** * Callback as used by {@link google.analytics.admin.v1alpha.AnalyticsAdminService|createBigQueryLink}. * @memberof google.analytics.admin.v1alpha.AnalyticsAdminService @@ -9157,138 +9091,6 @@ * @variation 2 */ - /** - * Callback as used by {@link google.analytics.admin.v1alpha.AnalyticsAdminService|createConnectedSiteTag}. - * @memberof google.analytics.admin.v1alpha.AnalyticsAdminService - * @typedef CreateConnectedSiteTagCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.analytics.admin.v1alpha.CreateConnectedSiteTagResponse} [response] CreateConnectedSiteTagResponse - */ - - /** - * Calls CreateConnectedSiteTag. - * @function createConnectedSiteTag - * @memberof google.analytics.admin.v1alpha.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1alpha.ICreateConnectedSiteTagRequest} request CreateConnectedSiteTagRequest message or plain object - * @param {google.analytics.admin.v1alpha.AnalyticsAdminService.CreateConnectedSiteTagCallback} callback Node-style callback called with the error, if any, and CreateConnectedSiteTagResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AnalyticsAdminService.prototype.createConnectedSiteTag = function createConnectedSiteTag(request, callback) { - return this.rpcCall(createConnectedSiteTag, $root.google.analytics.admin.v1alpha.CreateConnectedSiteTagRequest, $root.google.analytics.admin.v1alpha.CreateConnectedSiteTagResponse, request, callback); - }, "name", { value: "CreateConnectedSiteTag" }); - - /** - * Calls CreateConnectedSiteTag. - * @function createConnectedSiteTag - * @memberof google.analytics.admin.v1alpha.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1alpha.ICreateConnectedSiteTagRequest} request CreateConnectedSiteTagRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.analytics.admin.v1alpha.AnalyticsAdminService|deleteConnectedSiteTag}. - * @memberof google.analytics.admin.v1alpha.AnalyticsAdminService - * @typedef DeleteConnectedSiteTagCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteConnectedSiteTag. - * @function deleteConnectedSiteTag - * @memberof google.analytics.admin.v1alpha.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1alpha.IDeleteConnectedSiteTagRequest} request DeleteConnectedSiteTagRequest message or plain object - * @param {google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteConnectedSiteTagCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AnalyticsAdminService.prototype.deleteConnectedSiteTag = function deleteConnectedSiteTag(request, callback) { - return this.rpcCall(deleteConnectedSiteTag, $root.google.analytics.admin.v1alpha.DeleteConnectedSiteTagRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteConnectedSiteTag" }); - - /** - * Calls DeleteConnectedSiteTag. - * @function deleteConnectedSiteTag - * @memberof google.analytics.admin.v1alpha.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1alpha.IDeleteConnectedSiteTagRequest} request DeleteConnectedSiteTagRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.analytics.admin.v1alpha.AnalyticsAdminService|listConnectedSiteTags}. - * @memberof google.analytics.admin.v1alpha.AnalyticsAdminService - * @typedef ListConnectedSiteTagsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.analytics.admin.v1alpha.ListConnectedSiteTagsResponse} [response] ListConnectedSiteTagsResponse - */ - - /** - * Calls ListConnectedSiteTags. - * @function listConnectedSiteTags - * @memberof google.analytics.admin.v1alpha.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1alpha.IListConnectedSiteTagsRequest} request ListConnectedSiteTagsRequest message or plain object - * @param {google.analytics.admin.v1alpha.AnalyticsAdminService.ListConnectedSiteTagsCallback} callback Node-style callback called with the error, if any, and ListConnectedSiteTagsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AnalyticsAdminService.prototype.listConnectedSiteTags = function listConnectedSiteTags(request, callback) { - return this.rpcCall(listConnectedSiteTags, $root.google.analytics.admin.v1alpha.ListConnectedSiteTagsRequest, $root.google.analytics.admin.v1alpha.ListConnectedSiteTagsResponse, request, callback); - }, "name", { value: "ListConnectedSiteTags" }); - - /** - * Calls ListConnectedSiteTags. - * @function listConnectedSiteTags - * @memberof google.analytics.admin.v1alpha.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1alpha.IListConnectedSiteTagsRequest} request ListConnectedSiteTagsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.analytics.admin.v1alpha.AnalyticsAdminService|fetchConnectedGa4Property}. - * @memberof google.analytics.admin.v1alpha.AnalyticsAdminService - * @typedef FetchConnectedGa4PropertyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.analytics.admin.v1alpha.FetchConnectedGa4PropertyResponse} [response] FetchConnectedGa4PropertyResponse - */ - - /** - * Calls FetchConnectedGa4Property. - * @function fetchConnectedGa4Property - * @memberof google.analytics.admin.v1alpha.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1alpha.IFetchConnectedGa4PropertyRequest} request FetchConnectedGa4PropertyRequest message or plain object - * @param {google.analytics.admin.v1alpha.AnalyticsAdminService.FetchConnectedGa4PropertyCallback} callback Node-style callback called with the error, if any, and FetchConnectedGa4PropertyResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AnalyticsAdminService.prototype.fetchConnectedGa4Property = function fetchConnectedGa4Property(request, callback) { - return this.rpcCall(fetchConnectedGa4Property, $root.google.analytics.admin.v1alpha.FetchConnectedGa4PropertyRequest, $root.google.analytics.admin.v1alpha.FetchConnectedGa4PropertyResponse, request, callback); - }, "name", { value: "FetchConnectedGa4Property" }); - - /** - * Calls FetchConnectedGa4Property. - * @function fetchConnectedGa4Property - * @memberof google.analytics.admin.v1alpha.AnalyticsAdminService - * @instance - * @param {google.analytics.admin.v1alpha.IFetchConnectedGa4PropertyRequest} request FetchConnectedGa4PropertyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - /** * Callback as used by {@link google.analytics.admin.v1alpha.AnalyticsAdminService|getAdSenseLink}. * @memberof google.analytics.admin.v1alpha.AnalyticsAdminService @@ -10675,6 +10477,39 @@ * @variation 2 */ + /** + * Callback as used by {@link google.analytics.admin.v1alpha.AnalyticsAdminService|getReportingIdentitySettings}. + * @memberof google.analytics.admin.v1alpha.AnalyticsAdminService + * @typedef GetReportingIdentitySettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.analytics.admin.v1alpha.ReportingIdentitySettings} [response] ReportingIdentitySettings + */ + + /** + * Calls GetReportingIdentitySettings. + * @function getReportingIdentitySettings + * @memberof google.analytics.admin.v1alpha.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1alpha.IGetReportingIdentitySettingsRequest} request GetReportingIdentitySettingsRequest message or plain object + * @param {google.analytics.admin.v1alpha.AnalyticsAdminService.GetReportingIdentitySettingsCallback} callback Node-style callback called with the error, if any, and ReportingIdentitySettings + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsAdminService.prototype.getReportingIdentitySettings = function getReportingIdentitySettings(request, callback) { + return this.rpcCall(getReportingIdentitySettings, $root.google.analytics.admin.v1alpha.GetReportingIdentitySettingsRequest, $root.google.analytics.admin.v1alpha.ReportingIdentitySettings, request, callback); + }, "name", { value: "GetReportingIdentitySettings" }); + + /** + * Calls GetReportingIdentitySettings. + * @function getReportingIdentitySettings + * @memberof google.analytics.admin.v1alpha.AnalyticsAdminService + * @instance + * @param {google.analytics.admin.v1alpha.IGetReportingIdentitySettingsRequest} request GetReportingIdentitySettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + return AnalyticsAdminService; })(); @@ -18365,6 +18200,7 @@ case 31: case 32: case 33: + case 34: break; } } @@ -18551,6 +18387,10 @@ case 33: message.resourceType[i] = 33; break; + case "REPORTING_IDENTITY_SETTINGS": + case 34: + message.resourceType[i] = 34; + break; } } if (object.action) { @@ -43096,25 +42936,25 @@ return ListChannelGroupsResponse; })(); - v1alpha.SetAutomatedGa4ConfigurationOptOutRequest = (function() { + v1alpha.CreateBigQueryLinkRequest = (function() { /** - * Properties of a SetAutomatedGa4ConfigurationOptOutRequest. + * Properties of a CreateBigQueryLinkRequest. * @memberof google.analytics.admin.v1alpha - * @interface ISetAutomatedGa4ConfigurationOptOutRequest - * @property {string|null} [property] SetAutomatedGa4ConfigurationOptOutRequest property - * @property {boolean|null} [optOut] SetAutomatedGa4ConfigurationOptOutRequest optOut + * @interface ICreateBigQueryLinkRequest + * @property {string|null} [parent] CreateBigQueryLinkRequest parent + * @property {google.analytics.admin.v1alpha.IBigQueryLink|null} [bigqueryLink] CreateBigQueryLinkRequest bigqueryLink */ /** - * Constructs a new SetAutomatedGa4ConfigurationOptOutRequest. + * Constructs a new CreateBigQueryLinkRequest. * @memberof google.analytics.admin.v1alpha - * @classdesc Represents a SetAutomatedGa4ConfigurationOptOutRequest. - * @implements ISetAutomatedGa4ConfigurationOptOutRequest + * @classdesc Represents a CreateBigQueryLinkRequest. + * @implements ICreateBigQueryLinkRequest * @constructor - * @param {google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutRequest=} [properties] Properties to set + * @param {google.analytics.admin.v1alpha.ICreateBigQueryLinkRequest=} [properties] Properties to set */ - function SetAutomatedGa4ConfigurationOptOutRequest(properties) { + function CreateBigQueryLinkRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -43122,91 +42962,91 @@ } /** - * SetAutomatedGa4ConfigurationOptOutRequest property. - * @member {string} property - * @memberof google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutRequest + * CreateBigQueryLinkRequest parent. + * @member {string} parent + * @memberof google.analytics.admin.v1alpha.CreateBigQueryLinkRequest * @instance */ - SetAutomatedGa4ConfigurationOptOutRequest.prototype.property = ""; + CreateBigQueryLinkRequest.prototype.parent = ""; /** - * SetAutomatedGa4ConfigurationOptOutRequest optOut. - * @member {boolean} optOut - * @memberof google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutRequest + * CreateBigQueryLinkRequest bigqueryLink. + * @member {google.analytics.admin.v1alpha.IBigQueryLink|null|undefined} bigqueryLink + * @memberof google.analytics.admin.v1alpha.CreateBigQueryLinkRequest * @instance */ - SetAutomatedGa4ConfigurationOptOutRequest.prototype.optOut = false; + CreateBigQueryLinkRequest.prototype.bigqueryLink = null; /** - * Creates a new SetAutomatedGa4ConfigurationOptOutRequest instance using the specified properties. + * Creates a new CreateBigQueryLinkRequest instance using the specified properties. * @function create - * @memberof google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutRequest + * @memberof google.analytics.admin.v1alpha.CreateBigQueryLinkRequest * @static - * @param {google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutRequest=} [properties] Properties to set - * @returns {google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutRequest} SetAutomatedGa4ConfigurationOptOutRequest instance + * @param {google.analytics.admin.v1alpha.ICreateBigQueryLinkRequest=} [properties] Properties to set + * @returns {google.analytics.admin.v1alpha.CreateBigQueryLinkRequest} CreateBigQueryLinkRequest instance */ - SetAutomatedGa4ConfigurationOptOutRequest.create = function create(properties) { - return new SetAutomatedGa4ConfigurationOptOutRequest(properties); + CreateBigQueryLinkRequest.create = function create(properties) { + return new CreateBigQueryLinkRequest(properties); }; /** - * Encodes the specified SetAutomatedGa4ConfigurationOptOutRequest message. Does not implicitly {@link google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutRequest.verify|verify} messages. + * Encodes the specified CreateBigQueryLinkRequest message. Does not implicitly {@link google.analytics.admin.v1alpha.CreateBigQueryLinkRequest.verify|verify} messages. * @function encode - * @memberof google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutRequest + * @memberof google.analytics.admin.v1alpha.CreateBigQueryLinkRequest * @static - * @param {google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutRequest} message SetAutomatedGa4ConfigurationOptOutRequest message or plain object to encode + * @param {google.analytics.admin.v1alpha.ICreateBigQueryLinkRequest} message CreateBigQueryLinkRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SetAutomatedGa4ConfigurationOptOutRequest.encode = function encode(message, writer) { + CreateBigQueryLinkRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.property != null && Object.hasOwnProperty.call(message, "property")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.property); - if (message.optOut != null && Object.hasOwnProperty.call(message, "optOut")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.optOut); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.bigqueryLink != null && Object.hasOwnProperty.call(message, "bigqueryLink")) + $root.google.analytics.admin.v1alpha.BigQueryLink.encode(message.bigqueryLink, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified SetAutomatedGa4ConfigurationOptOutRequest message, length delimited. Does not implicitly {@link google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutRequest.verify|verify} messages. + * Encodes the specified CreateBigQueryLinkRequest message, length delimited. Does not implicitly {@link google.analytics.admin.v1alpha.CreateBigQueryLinkRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutRequest + * @memberof google.analytics.admin.v1alpha.CreateBigQueryLinkRequest * @static - * @param {google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutRequest} message SetAutomatedGa4ConfigurationOptOutRequest message or plain object to encode + * @param {google.analytics.admin.v1alpha.ICreateBigQueryLinkRequest} message CreateBigQueryLinkRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SetAutomatedGa4ConfigurationOptOutRequest.encodeDelimited = function encodeDelimited(message, writer) { + CreateBigQueryLinkRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SetAutomatedGa4ConfigurationOptOutRequest message from the specified reader or buffer. + * Decodes a CreateBigQueryLinkRequest message from the specified reader or buffer. * @function decode - * @memberof google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutRequest + * @memberof google.analytics.admin.v1alpha.CreateBigQueryLinkRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutRequest} SetAutomatedGa4ConfigurationOptOutRequest + * @returns {google.analytics.admin.v1alpha.CreateBigQueryLinkRequest} CreateBigQueryLinkRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SetAutomatedGa4ConfigurationOptOutRequest.decode = function decode(reader, length, error) { + CreateBigQueryLinkRequest.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.admin.v1alpha.CreateBigQueryLinkRequest(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { - message.property = reader.string(); + message.parent = reader.string(); break; } case 2: { - message.optOut = reader.bool(); + message.bigqueryLink = $root.google.analytics.admin.v1alpha.BigQueryLink.decode(reader, reader.uint32()); break; } default: @@ -43218,130 +43058,136 @@ }; /** - * Decodes a SetAutomatedGa4ConfigurationOptOutRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateBigQueryLinkRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutRequest + * @memberof google.analytics.admin.v1alpha.CreateBigQueryLinkRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutRequest} SetAutomatedGa4ConfigurationOptOutRequest + * @returns {google.analytics.admin.v1alpha.CreateBigQueryLinkRequest} CreateBigQueryLinkRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SetAutomatedGa4ConfigurationOptOutRequest.decodeDelimited = function decodeDelimited(reader) { + CreateBigQueryLinkRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SetAutomatedGa4ConfigurationOptOutRequest message. + * Verifies a CreateBigQueryLinkRequest message. * @function verify - * @memberof google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutRequest + * @memberof google.analytics.admin.v1alpha.CreateBigQueryLinkRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SetAutomatedGa4ConfigurationOptOutRequest.verify = function verify(message) { + CreateBigQueryLinkRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.property != null && message.hasOwnProperty("property")) - if (!$util.isString(message.property)) - return "property: string expected"; - if (message.optOut != null && message.hasOwnProperty("optOut")) - if (typeof message.optOut !== "boolean") - return "optOut: boolean expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.bigqueryLink != null && message.hasOwnProperty("bigqueryLink")) { + var error = $root.google.analytics.admin.v1alpha.BigQueryLink.verify(message.bigqueryLink); + if (error) + return "bigqueryLink." + error; + } return null; }; /** - * Creates a SetAutomatedGa4ConfigurationOptOutRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateBigQueryLinkRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutRequest + * @memberof google.analytics.admin.v1alpha.CreateBigQueryLinkRequest * @static * @param {Object.} object Plain object - * @returns {google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutRequest} SetAutomatedGa4ConfigurationOptOutRequest + * @returns {google.analytics.admin.v1alpha.CreateBigQueryLinkRequest} CreateBigQueryLinkRequest */ - SetAutomatedGa4ConfigurationOptOutRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutRequest) + CreateBigQueryLinkRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.admin.v1alpha.CreateBigQueryLinkRequest) return object; - var message = new $root.google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutRequest(); - if (object.property != null) - message.property = String(object.property); - if (object.optOut != null) - message.optOut = Boolean(object.optOut); + var message = new $root.google.analytics.admin.v1alpha.CreateBigQueryLinkRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.bigqueryLink != null) { + if (typeof object.bigqueryLink !== "object") + throw TypeError(".google.analytics.admin.v1alpha.CreateBigQueryLinkRequest.bigqueryLink: object expected"); + message.bigqueryLink = $root.google.analytics.admin.v1alpha.BigQueryLink.fromObject(object.bigqueryLink); + } return message; }; /** - * Creates a plain object from a SetAutomatedGa4ConfigurationOptOutRequest message. Also converts values to other types if specified. + * Creates a plain object from a CreateBigQueryLinkRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutRequest + * @memberof google.analytics.admin.v1alpha.CreateBigQueryLinkRequest * @static - * @param {google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutRequest} message SetAutomatedGa4ConfigurationOptOutRequest + * @param {google.analytics.admin.v1alpha.CreateBigQueryLinkRequest} message CreateBigQueryLinkRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SetAutomatedGa4ConfigurationOptOutRequest.toObject = function toObject(message, options) { + CreateBigQueryLinkRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.property = ""; - object.optOut = false; + object.parent = ""; + object.bigqueryLink = null; } - if (message.property != null && message.hasOwnProperty("property")) - object.property = message.property; - if (message.optOut != null && message.hasOwnProperty("optOut")) - object.optOut = message.optOut; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.bigqueryLink != null && message.hasOwnProperty("bigqueryLink")) + object.bigqueryLink = $root.google.analytics.admin.v1alpha.BigQueryLink.toObject(message.bigqueryLink, options); return object; }; /** - * Converts this SetAutomatedGa4ConfigurationOptOutRequest to JSON. + * Converts this CreateBigQueryLinkRequest to JSON. * @function toJSON - * @memberof google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutRequest + * @memberof google.analytics.admin.v1alpha.CreateBigQueryLinkRequest * @instance * @returns {Object.} JSON object */ - SetAutomatedGa4ConfigurationOptOutRequest.prototype.toJSON = function toJSON() { + CreateBigQueryLinkRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for SetAutomatedGa4ConfigurationOptOutRequest + * Gets the default type url for CreateBigQueryLinkRequest * @function getTypeUrl - * @memberof google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutRequest + * @memberof google.analytics.admin.v1alpha.CreateBigQueryLinkRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - SetAutomatedGa4ConfigurationOptOutRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateBigQueryLinkRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutRequest"; + return typeUrlPrefix + "/google.analytics.admin.v1alpha.CreateBigQueryLinkRequest"; }; - return SetAutomatedGa4ConfigurationOptOutRequest; + return CreateBigQueryLinkRequest; })(); - v1alpha.SetAutomatedGa4ConfigurationOptOutResponse = (function() { + v1alpha.GetBigQueryLinkRequest = (function() { /** - * Properties of a SetAutomatedGa4ConfigurationOptOutResponse. + * Properties of a GetBigQueryLinkRequest. * @memberof google.analytics.admin.v1alpha - * @interface ISetAutomatedGa4ConfigurationOptOutResponse + * @interface IGetBigQueryLinkRequest + * @property {string|null} [name] GetBigQueryLinkRequest name */ /** - * Constructs a new SetAutomatedGa4ConfigurationOptOutResponse. + * Constructs a new GetBigQueryLinkRequest. * @memberof google.analytics.admin.v1alpha - * @classdesc Represents a SetAutomatedGa4ConfigurationOptOutResponse. - * @implements ISetAutomatedGa4ConfigurationOptOutResponse + * @classdesc Represents a GetBigQueryLinkRequest. + * @implements IGetBigQueryLinkRequest * @constructor - * @param {google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutResponse=} [properties] Properties to set + * @param {google.analytics.admin.v1alpha.IGetBigQueryLinkRequest=} [properties] Properties to set */ - function SetAutomatedGa4ConfigurationOptOutResponse(properties) { + function GetBigQueryLinkRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -43349,65 +43195,79 @@ } /** - * Creates a new SetAutomatedGa4ConfigurationOptOutResponse instance using the specified properties. + * GetBigQueryLinkRequest name. + * @member {string} name + * @memberof google.analytics.admin.v1alpha.GetBigQueryLinkRequest + * @instance + */ + GetBigQueryLinkRequest.prototype.name = ""; + + /** + * Creates a new GetBigQueryLinkRequest instance using the specified properties. * @function create - * @memberof google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutResponse + * @memberof google.analytics.admin.v1alpha.GetBigQueryLinkRequest * @static - * @param {google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutResponse=} [properties] Properties to set - * @returns {google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutResponse} SetAutomatedGa4ConfigurationOptOutResponse instance + * @param {google.analytics.admin.v1alpha.IGetBigQueryLinkRequest=} [properties] Properties to set + * @returns {google.analytics.admin.v1alpha.GetBigQueryLinkRequest} GetBigQueryLinkRequest instance */ - SetAutomatedGa4ConfigurationOptOutResponse.create = function create(properties) { - return new SetAutomatedGa4ConfigurationOptOutResponse(properties); + GetBigQueryLinkRequest.create = function create(properties) { + return new GetBigQueryLinkRequest(properties); }; /** - * Encodes the specified SetAutomatedGa4ConfigurationOptOutResponse message. Does not implicitly {@link google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutResponse.verify|verify} messages. + * Encodes the specified GetBigQueryLinkRequest message. Does not implicitly {@link google.analytics.admin.v1alpha.GetBigQueryLinkRequest.verify|verify} messages. * @function encode - * @memberof google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutResponse + * @memberof google.analytics.admin.v1alpha.GetBigQueryLinkRequest * @static - * @param {google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutResponse} message SetAutomatedGa4ConfigurationOptOutResponse message or plain object to encode + * @param {google.analytics.admin.v1alpha.IGetBigQueryLinkRequest} message GetBigQueryLinkRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SetAutomatedGa4ConfigurationOptOutResponse.encode = function encode(message, writer) { + GetBigQueryLinkRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified SetAutomatedGa4ConfigurationOptOutResponse message, length delimited. Does not implicitly {@link google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutResponse.verify|verify} messages. + * Encodes the specified GetBigQueryLinkRequest message, length delimited. Does not implicitly {@link google.analytics.admin.v1alpha.GetBigQueryLinkRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutResponse + * @memberof google.analytics.admin.v1alpha.GetBigQueryLinkRequest * @static - * @param {google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutResponse} message SetAutomatedGa4ConfigurationOptOutResponse message or plain object to encode + * @param {google.analytics.admin.v1alpha.IGetBigQueryLinkRequest} message GetBigQueryLinkRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SetAutomatedGa4ConfigurationOptOutResponse.encodeDelimited = function encodeDelimited(message, writer) { + GetBigQueryLinkRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SetAutomatedGa4ConfigurationOptOutResponse message from the specified reader or buffer. + * Decodes a GetBigQueryLinkRequest message from the specified reader or buffer. * @function decode - * @memberof google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutResponse + * @memberof google.analytics.admin.v1alpha.GetBigQueryLinkRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutResponse} SetAutomatedGa4ConfigurationOptOutResponse + * @returns {google.analytics.admin.v1alpha.GetBigQueryLinkRequest} GetBigQueryLinkRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SetAutomatedGa4ConfigurationOptOutResponse.decode = function decode(reader, length, error) { + GetBigQueryLinkRequest.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.admin.v1alpha.GetBigQueryLinkRequest(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -43417,109 +43277,124 @@ }; /** - * Decodes a SetAutomatedGa4ConfigurationOptOutResponse message from the specified reader or buffer, length delimited. + * Decodes a GetBigQueryLinkRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutResponse + * @memberof google.analytics.admin.v1alpha.GetBigQueryLinkRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutResponse} SetAutomatedGa4ConfigurationOptOutResponse + * @returns {google.analytics.admin.v1alpha.GetBigQueryLinkRequest} GetBigQueryLinkRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SetAutomatedGa4ConfigurationOptOutResponse.decodeDelimited = function decodeDelimited(reader) { + GetBigQueryLinkRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SetAutomatedGa4ConfigurationOptOutResponse message. + * Verifies a GetBigQueryLinkRequest message. * @function verify - * @memberof google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutResponse + * @memberof google.analytics.admin.v1alpha.GetBigQueryLinkRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SetAutomatedGa4ConfigurationOptOutResponse.verify = function verify(message) { + GetBigQueryLinkRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a SetAutomatedGa4ConfigurationOptOutResponse message from a plain object. Also converts values to their respective internal types. + * Creates a GetBigQueryLinkRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutResponse + * @memberof google.analytics.admin.v1alpha.GetBigQueryLinkRequest * @static * @param {Object.} object Plain object - * @returns {google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutResponse} SetAutomatedGa4ConfigurationOptOutResponse + * @returns {google.analytics.admin.v1alpha.GetBigQueryLinkRequest} GetBigQueryLinkRequest */ - SetAutomatedGa4ConfigurationOptOutResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutResponse) + GetBigQueryLinkRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.admin.v1alpha.GetBigQueryLinkRequest) return object; - return new $root.google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutResponse(); + var message = new $root.google.analytics.admin.v1alpha.GetBigQueryLinkRequest(); + if (object.name != null) + message.name = String(object.name); + return message; }; /** - * Creates a plain object from a SetAutomatedGa4ConfigurationOptOutResponse message. Also converts values to other types if specified. + * Creates a plain object from a GetBigQueryLinkRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutResponse + * @memberof google.analytics.admin.v1alpha.GetBigQueryLinkRequest * @static - * @param {google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutResponse} message SetAutomatedGa4ConfigurationOptOutResponse + * @param {google.analytics.admin.v1alpha.GetBigQueryLinkRequest} message GetBigQueryLinkRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SetAutomatedGa4ConfigurationOptOutResponse.toObject = function toObject() { - return {}; + GetBigQueryLinkRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; }; /** - * Converts this SetAutomatedGa4ConfigurationOptOutResponse to JSON. + * Converts this GetBigQueryLinkRequest to JSON. * @function toJSON - * @memberof google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutResponse + * @memberof google.analytics.admin.v1alpha.GetBigQueryLinkRequest * @instance * @returns {Object.} JSON object */ - SetAutomatedGa4ConfigurationOptOutResponse.prototype.toJSON = function toJSON() { + GetBigQueryLinkRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for SetAutomatedGa4ConfigurationOptOutResponse + * Gets the default type url for GetBigQueryLinkRequest * @function getTypeUrl - * @memberof google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutResponse + * @memberof google.analytics.admin.v1alpha.GetBigQueryLinkRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - SetAutomatedGa4ConfigurationOptOutResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetBigQueryLinkRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutResponse"; + return typeUrlPrefix + "/google.analytics.admin.v1alpha.GetBigQueryLinkRequest"; }; - return SetAutomatedGa4ConfigurationOptOutResponse; + return GetBigQueryLinkRequest; })(); - v1alpha.FetchAutomatedGa4ConfigurationOptOutRequest = (function() { + v1alpha.ListBigQueryLinksRequest = (function() { /** - * Properties of a FetchAutomatedGa4ConfigurationOptOutRequest. + * Properties of a ListBigQueryLinksRequest. * @memberof google.analytics.admin.v1alpha - * @interface IFetchAutomatedGa4ConfigurationOptOutRequest - * @property {string|null} [property] FetchAutomatedGa4ConfigurationOptOutRequest property + * @interface IListBigQueryLinksRequest + * @property {string|null} [parent] ListBigQueryLinksRequest parent + * @property {number|null} [pageSize] ListBigQueryLinksRequest pageSize + * @property {string|null} [pageToken] ListBigQueryLinksRequest pageToken */ /** - * Constructs a new FetchAutomatedGa4ConfigurationOptOutRequest. + * Constructs a new ListBigQueryLinksRequest. * @memberof google.analytics.admin.v1alpha - * @classdesc Represents a FetchAutomatedGa4ConfigurationOptOutRequest. - * @implements IFetchAutomatedGa4ConfigurationOptOutRequest + * @classdesc Represents a ListBigQueryLinksRequest. + * @implements IListBigQueryLinksRequest * @constructor - * @param {google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutRequest=} [properties] Properties to set + * @param {google.analytics.admin.v1alpha.IListBigQueryLinksRequest=} [properties] Properties to set */ - function FetchAutomatedGa4ConfigurationOptOutRequest(properties) { + function ListBigQueryLinksRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -43527,77 +43402,105 @@ } /** - * FetchAutomatedGa4ConfigurationOptOutRequest property. - * @member {string} property - * @memberof google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutRequest + * ListBigQueryLinksRequest parent. + * @member {string} parent + * @memberof google.analytics.admin.v1alpha.ListBigQueryLinksRequest + * @instance + */ + ListBigQueryLinksRequest.prototype.parent = ""; + + /** + * ListBigQueryLinksRequest pageSize. + * @member {number} pageSize + * @memberof google.analytics.admin.v1alpha.ListBigQueryLinksRequest + * @instance + */ + ListBigQueryLinksRequest.prototype.pageSize = 0; + + /** + * ListBigQueryLinksRequest pageToken. + * @member {string} pageToken + * @memberof google.analytics.admin.v1alpha.ListBigQueryLinksRequest * @instance */ - FetchAutomatedGa4ConfigurationOptOutRequest.prototype.property = ""; + ListBigQueryLinksRequest.prototype.pageToken = ""; /** - * Creates a new FetchAutomatedGa4ConfigurationOptOutRequest instance using the specified properties. + * Creates a new ListBigQueryLinksRequest instance using the specified properties. * @function create - * @memberof google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutRequest + * @memberof google.analytics.admin.v1alpha.ListBigQueryLinksRequest * @static - * @param {google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutRequest=} [properties] Properties to set - * @returns {google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutRequest} FetchAutomatedGa4ConfigurationOptOutRequest instance + * @param {google.analytics.admin.v1alpha.IListBigQueryLinksRequest=} [properties] Properties to set + * @returns {google.analytics.admin.v1alpha.ListBigQueryLinksRequest} ListBigQueryLinksRequest instance */ - FetchAutomatedGa4ConfigurationOptOutRequest.create = function create(properties) { - return new FetchAutomatedGa4ConfigurationOptOutRequest(properties); + ListBigQueryLinksRequest.create = function create(properties) { + return new ListBigQueryLinksRequest(properties); }; /** - * Encodes the specified FetchAutomatedGa4ConfigurationOptOutRequest message. Does not implicitly {@link google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutRequest.verify|verify} messages. + * Encodes the specified ListBigQueryLinksRequest message. Does not implicitly {@link google.analytics.admin.v1alpha.ListBigQueryLinksRequest.verify|verify} messages. * @function encode - * @memberof google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutRequest + * @memberof google.analytics.admin.v1alpha.ListBigQueryLinksRequest * @static - * @param {google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutRequest} message FetchAutomatedGa4ConfigurationOptOutRequest message or plain object to encode + * @param {google.analytics.admin.v1alpha.IListBigQueryLinksRequest} message ListBigQueryLinksRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FetchAutomatedGa4ConfigurationOptOutRequest.encode = function encode(message, writer) { + ListBigQueryLinksRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.property != null && Object.hasOwnProperty.call(message, "property")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.property); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); return writer; }; /** - * Encodes the specified FetchAutomatedGa4ConfigurationOptOutRequest message, length delimited. Does not implicitly {@link google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutRequest.verify|verify} messages. + * Encodes the specified ListBigQueryLinksRequest message, length delimited. Does not implicitly {@link google.analytics.admin.v1alpha.ListBigQueryLinksRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutRequest + * @memberof google.analytics.admin.v1alpha.ListBigQueryLinksRequest * @static - * @param {google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutRequest} message FetchAutomatedGa4ConfigurationOptOutRequest message or plain object to encode + * @param {google.analytics.admin.v1alpha.IListBigQueryLinksRequest} message ListBigQueryLinksRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FetchAutomatedGa4ConfigurationOptOutRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListBigQueryLinksRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FetchAutomatedGa4ConfigurationOptOutRequest message from the specified reader or buffer. + * Decodes a ListBigQueryLinksRequest message from the specified reader or buffer. * @function decode - * @memberof google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutRequest + * @memberof google.analytics.admin.v1alpha.ListBigQueryLinksRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutRequest} FetchAutomatedGa4ConfigurationOptOutRequest + * @returns {google.analytics.admin.v1alpha.ListBigQueryLinksRequest} ListBigQueryLinksRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FetchAutomatedGa4ConfigurationOptOutRequest.decode = function decode(reader, length, error) { + ListBigQueryLinksRequest.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.admin.v1alpha.ListBigQueryLinksRequest(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { - message.property = reader.string(); + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); break; } default: @@ -43609,122 +43512,141 @@ }; /** - * Decodes a FetchAutomatedGa4ConfigurationOptOutRequest message from the specified reader or buffer, length delimited. + * Decodes a ListBigQueryLinksRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutRequest + * @memberof google.analytics.admin.v1alpha.ListBigQueryLinksRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutRequest} FetchAutomatedGa4ConfigurationOptOutRequest + * @returns {google.analytics.admin.v1alpha.ListBigQueryLinksRequest} ListBigQueryLinksRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FetchAutomatedGa4ConfigurationOptOutRequest.decodeDelimited = function decodeDelimited(reader) { + ListBigQueryLinksRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FetchAutomatedGa4ConfigurationOptOutRequest message. + * Verifies a ListBigQueryLinksRequest message. * @function verify - * @memberof google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutRequest + * @memberof google.analytics.admin.v1alpha.ListBigQueryLinksRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - FetchAutomatedGa4ConfigurationOptOutRequest.verify = function verify(message) { + ListBigQueryLinksRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.property != null && message.hasOwnProperty("property")) - if (!$util.isString(message.property)) - return "property: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; return null; }; /** - * Creates a FetchAutomatedGa4ConfigurationOptOutRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListBigQueryLinksRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutRequest + * @memberof google.analytics.admin.v1alpha.ListBigQueryLinksRequest * @static * @param {Object.} object Plain object - * @returns {google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutRequest} FetchAutomatedGa4ConfigurationOptOutRequest + * @returns {google.analytics.admin.v1alpha.ListBigQueryLinksRequest} ListBigQueryLinksRequest */ - FetchAutomatedGa4ConfigurationOptOutRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutRequest) + ListBigQueryLinksRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.admin.v1alpha.ListBigQueryLinksRequest) return object; - var message = new $root.google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutRequest(); - if (object.property != null) - message.property = String(object.property); + var message = new $root.google.analytics.admin.v1alpha.ListBigQueryLinksRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); return message; }; /** - * Creates a plain object from a FetchAutomatedGa4ConfigurationOptOutRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListBigQueryLinksRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutRequest + * @memberof google.analytics.admin.v1alpha.ListBigQueryLinksRequest * @static - * @param {google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutRequest} message FetchAutomatedGa4ConfigurationOptOutRequest + * @param {google.analytics.admin.v1alpha.ListBigQueryLinksRequest} message ListBigQueryLinksRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FetchAutomatedGa4ConfigurationOptOutRequest.toObject = function toObject(message, options) { + ListBigQueryLinksRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.property = ""; - if (message.property != null && message.hasOwnProperty("property")) - object.property = message.property; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; return object; }; /** - * Converts this FetchAutomatedGa4ConfigurationOptOutRequest to JSON. + * Converts this ListBigQueryLinksRequest to JSON. * @function toJSON - * @memberof google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutRequest + * @memberof google.analytics.admin.v1alpha.ListBigQueryLinksRequest * @instance * @returns {Object.} JSON object */ - FetchAutomatedGa4ConfigurationOptOutRequest.prototype.toJSON = function toJSON() { + ListBigQueryLinksRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for FetchAutomatedGa4ConfigurationOptOutRequest + * Gets the default type url for ListBigQueryLinksRequest * @function getTypeUrl - * @memberof google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutRequest + * @memberof google.analytics.admin.v1alpha.ListBigQueryLinksRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - FetchAutomatedGa4ConfigurationOptOutRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListBigQueryLinksRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutRequest"; + return typeUrlPrefix + "/google.analytics.admin.v1alpha.ListBigQueryLinksRequest"; }; - return FetchAutomatedGa4ConfigurationOptOutRequest; + return ListBigQueryLinksRequest; })(); - v1alpha.FetchAutomatedGa4ConfigurationOptOutResponse = (function() { + v1alpha.ListBigQueryLinksResponse = (function() { /** - * Properties of a FetchAutomatedGa4ConfigurationOptOutResponse. + * Properties of a ListBigQueryLinksResponse. * @memberof google.analytics.admin.v1alpha - * @interface IFetchAutomatedGa4ConfigurationOptOutResponse - * @property {boolean|null} [optOut] FetchAutomatedGa4ConfigurationOptOutResponse optOut + * @interface IListBigQueryLinksResponse + * @property {Array.|null} [bigqueryLinks] ListBigQueryLinksResponse bigqueryLinks + * @property {string|null} [nextPageToken] ListBigQueryLinksResponse nextPageToken */ /** - * Constructs a new FetchAutomatedGa4ConfigurationOptOutResponse. + * Constructs a new ListBigQueryLinksResponse. * @memberof google.analytics.admin.v1alpha - * @classdesc Represents a FetchAutomatedGa4ConfigurationOptOutResponse. - * @implements IFetchAutomatedGa4ConfigurationOptOutResponse + * @classdesc Represents a ListBigQueryLinksResponse. + * @implements IListBigQueryLinksResponse * @constructor - * @param {google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutResponse=} [properties] Properties to set + * @param {google.analytics.admin.v1alpha.IListBigQueryLinksResponse=} [properties] Properties to set */ - function FetchAutomatedGa4ConfigurationOptOutResponse(properties) { + function ListBigQueryLinksResponse(properties) { + this.bigqueryLinks = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -43732,77 +43654,94 @@ } /** - * FetchAutomatedGa4ConfigurationOptOutResponse optOut. - * @member {boolean} optOut - * @memberof google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutResponse + * ListBigQueryLinksResponse bigqueryLinks. + * @member {Array.} bigqueryLinks + * @memberof google.analytics.admin.v1alpha.ListBigQueryLinksResponse + * @instance + */ + ListBigQueryLinksResponse.prototype.bigqueryLinks = $util.emptyArray; + + /** + * ListBigQueryLinksResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.analytics.admin.v1alpha.ListBigQueryLinksResponse * @instance */ - FetchAutomatedGa4ConfigurationOptOutResponse.prototype.optOut = false; + ListBigQueryLinksResponse.prototype.nextPageToken = ""; /** - * Creates a new FetchAutomatedGa4ConfigurationOptOutResponse instance using the specified properties. + * Creates a new ListBigQueryLinksResponse instance using the specified properties. * @function create - * @memberof google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutResponse + * @memberof google.analytics.admin.v1alpha.ListBigQueryLinksResponse * @static - * @param {google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutResponse=} [properties] Properties to set - * @returns {google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutResponse} FetchAutomatedGa4ConfigurationOptOutResponse instance + * @param {google.analytics.admin.v1alpha.IListBigQueryLinksResponse=} [properties] Properties to set + * @returns {google.analytics.admin.v1alpha.ListBigQueryLinksResponse} ListBigQueryLinksResponse instance */ - FetchAutomatedGa4ConfigurationOptOutResponse.create = function create(properties) { - return new FetchAutomatedGa4ConfigurationOptOutResponse(properties); + ListBigQueryLinksResponse.create = function create(properties) { + return new ListBigQueryLinksResponse(properties); }; /** - * Encodes the specified FetchAutomatedGa4ConfigurationOptOutResponse message. Does not implicitly {@link google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutResponse.verify|verify} messages. + * Encodes the specified ListBigQueryLinksResponse message. Does not implicitly {@link google.analytics.admin.v1alpha.ListBigQueryLinksResponse.verify|verify} messages. * @function encode - * @memberof google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutResponse + * @memberof google.analytics.admin.v1alpha.ListBigQueryLinksResponse * @static - * @param {google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutResponse} message FetchAutomatedGa4ConfigurationOptOutResponse message or plain object to encode + * @param {google.analytics.admin.v1alpha.IListBigQueryLinksResponse} message ListBigQueryLinksResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FetchAutomatedGa4ConfigurationOptOutResponse.encode = function encode(message, writer) { + ListBigQueryLinksResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.optOut != null && Object.hasOwnProperty.call(message, "optOut")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.optOut); + if (message.bigqueryLinks != null && message.bigqueryLinks.length) + for (var i = 0; i < message.bigqueryLinks.length; ++i) + $root.google.analytics.admin.v1alpha.BigQueryLink.encode(message.bigqueryLinks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** - * Encodes the specified FetchAutomatedGa4ConfigurationOptOutResponse message, length delimited. Does not implicitly {@link google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutResponse.verify|verify} messages. + * Encodes the specified ListBigQueryLinksResponse message, length delimited. Does not implicitly {@link google.analytics.admin.v1alpha.ListBigQueryLinksResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutResponse + * @memberof google.analytics.admin.v1alpha.ListBigQueryLinksResponse * @static - * @param {google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutResponse} message FetchAutomatedGa4ConfigurationOptOutResponse message or plain object to encode + * @param {google.analytics.admin.v1alpha.IListBigQueryLinksResponse} message ListBigQueryLinksResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FetchAutomatedGa4ConfigurationOptOutResponse.encodeDelimited = function encodeDelimited(message, writer) { + ListBigQueryLinksResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FetchAutomatedGa4ConfigurationOptOutResponse message from the specified reader or buffer. + * Decodes a ListBigQueryLinksResponse message from the specified reader or buffer. * @function decode - * @memberof google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutResponse + * @memberof google.analytics.admin.v1alpha.ListBigQueryLinksResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutResponse} FetchAutomatedGa4ConfigurationOptOutResponse + * @returns {google.analytics.admin.v1alpha.ListBigQueryLinksResponse} ListBigQueryLinksResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FetchAutomatedGa4ConfigurationOptOutResponse.decode = function decode(reader, length, error) { + ListBigQueryLinksResponse.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.admin.v1alpha.ListBigQueryLinksResponse(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { - message.optOut = reader.bool(); + if (!(message.bigqueryLinks && message.bigqueryLinks.length)) + message.bigqueryLinks = []; + message.bigqueryLinks.push($root.google.analytics.admin.v1alpha.BigQueryLink.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); break; } default: @@ -43814,2157 +43753,149 @@ }; /** - * Decodes a FetchAutomatedGa4ConfigurationOptOutResponse message from the specified reader or buffer, length delimited. + * Decodes a ListBigQueryLinksResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutResponse + * @memberof google.analytics.admin.v1alpha.ListBigQueryLinksResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutResponse} FetchAutomatedGa4ConfigurationOptOutResponse + * @returns {google.analytics.admin.v1alpha.ListBigQueryLinksResponse} ListBigQueryLinksResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FetchAutomatedGa4ConfigurationOptOutResponse.decodeDelimited = function decodeDelimited(reader) { + ListBigQueryLinksResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FetchAutomatedGa4ConfigurationOptOutResponse message. + * Verifies a ListBigQueryLinksResponse message. * @function verify - * @memberof google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutResponse + * @memberof google.analytics.admin.v1alpha.ListBigQueryLinksResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - FetchAutomatedGa4ConfigurationOptOutResponse.verify = function verify(message) { + ListBigQueryLinksResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.optOut != null && message.hasOwnProperty("optOut")) - if (typeof message.optOut !== "boolean") - return "optOut: boolean expected"; - return null; - }; - - /** - * Creates a FetchAutomatedGa4ConfigurationOptOutResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutResponse - * @static - * @param {Object.} object Plain object - * @returns {google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutResponse} FetchAutomatedGa4ConfigurationOptOutResponse - */ - FetchAutomatedGa4ConfigurationOptOutResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutResponse) - return object; - var message = new $root.google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutResponse(); - if (object.optOut != null) - message.optOut = Boolean(object.optOut); - return message; - }; - - /** - * Creates a plain object from a FetchAutomatedGa4ConfigurationOptOutResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutResponse - * @static - * @param {google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutResponse} message FetchAutomatedGa4ConfigurationOptOutResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FetchAutomatedGa4ConfigurationOptOutResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.optOut = false; - if (message.optOut != null && message.hasOwnProperty("optOut")) - object.optOut = message.optOut; - return object; - }; - - /** - * Converts this FetchAutomatedGa4ConfigurationOptOutResponse to JSON. - * @function toJSON - * @memberof google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutResponse - * @instance - * @returns {Object.} JSON object - */ - FetchAutomatedGa4ConfigurationOptOutResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FetchAutomatedGa4ConfigurationOptOutResponse - * @function getTypeUrl - * @memberof google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FetchAutomatedGa4ConfigurationOptOutResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutResponse"; - }; - - return FetchAutomatedGa4ConfigurationOptOutResponse; - })(); - - v1alpha.CreateBigQueryLinkRequest = (function() { - - /** - * Properties of a CreateBigQueryLinkRequest. - * @memberof google.analytics.admin.v1alpha - * @interface ICreateBigQueryLinkRequest - * @property {string|null} [parent] CreateBigQueryLinkRequest parent - * @property {google.analytics.admin.v1alpha.IBigQueryLink|null} [bigqueryLink] CreateBigQueryLinkRequest bigqueryLink - */ - - /** - * Constructs a new CreateBigQueryLinkRequest. - * @memberof google.analytics.admin.v1alpha - * @classdesc Represents a CreateBigQueryLinkRequest. - * @implements ICreateBigQueryLinkRequest - * @constructor - * @param {google.analytics.admin.v1alpha.ICreateBigQueryLinkRequest=} [properties] Properties to set - */ - function CreateBigQueryLinkRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateBigQueryLinkRequest parent. - * @member {string} parent - * @memberof google.analytics.admin.v1alpha.CreateBigQueryLinkRequest - * @instance - */ - CreateBigQueryLinkRequest.prototype.parent = ""; - - /** - * CreateBigQueryLinkRequest bigqueryLink. - * @member {google.analytics.admin.v1alpha.IBigQueryLink|null|undefined} bigqueryLink - * @memberof google.analytics.admin.v1alpha.CreateBigQueryLinkRequest - * @instance - */ - CreateBigQueryLinkRequest.prototype.bigqueryLink = null; - - /** - * Creates a new CreateBigQueryLinkRequest instance using the specified properties. - * @function create - * @memberof google.analytics.admin.v1alpha.CreateBigQueryLinkRequest - * @static - * @param {google.analytics.admin.v1alpha.ICreateBigQueryLinkRequest=} [properties] Properties to set - * @returns {google.analytics.admin.v1alpha.CreateBigQueryLinkRequest} CreateBigQueryLinkRequest instance - */ - CreateBigQueryLinkRequest.create = function create(properties) { - return new CreateBigQueryLinkRequest(properties); - }; - - /** - * Encodes the specified CreateBigQueryLinkRequest message. Does not implicitly {@link google.analytics.admin.v1alpha.CreateBigQueryLinkRequest.verify|verify} messages. - * @function encode - * @memberof google.analytics.admin.v1alpha.CreateBigQueryLinkRequest - * @static - * @param {google.analytics.admin.v1alpha.ICreateBigQueryLinkRequest} message CreateBigQueryLinkRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateBigQueryLinkRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.bigqueryLink != null && Object.hasOwnProperty.call(message, "bigqueryLink")) - $root.google.analytics.admin.v1alpha.BigQueryLink.encode(message.bigqueryLink, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateBigQueryLinkRequest message, length delimited. Does not implicitly {@link google.analytics.admin.v1alpha.CreateBigQueryLinkRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.analytics.admin.v1alpha.CreateBigQueryLinkRequest - * @static - * @param {google.analytics.admin.v1alpha.ICreateBigQueryLinkRequest} message CreateBigQueryLinkRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateBigQueryLinkRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateBigQueryLinkRequest message from the specified reader or buffer. - * @function decode - * @memberof google.analytics.admin.v1alpha.CreateBigQueryLinkRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.analytics.admin.v1alpha.CreateBigQueryLinkRequest} CreateBigQueryLinkRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateBigQueryLinkRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.admin.v1alpha.CreateBigQueryLinkRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.bigqueryLink = $root.google.analytics.admin.v1alpha.BigQueryLink.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateBigQueryLinkRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.analytics.admin.v1alpha.CreateBigQueryLinkRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.analytics.admin.v1alpha.CreateBigQueryLinkRequest} CreateBigQueryLinkRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateBigQueryLinkRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateBigQueryLinkRequest message. - * @function verify - * @memberof google.analytics.admin.v1alpha.CreateBigQueryLinkRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateBigQueryLinkRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.bigqueryLink != null && message.hasOwnProperty("bigqueryLink")) { - var error = $root.google.analytics.admin.v1alpha.BigQueryLink.verify(message.bigqueryLink); - if (error) - return "bigqueryLink." + error; - } - return null; - }; - - /** - * Creates a CreateBigQueryLinkRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.analytics.admin.v1alpha.CreateBigQueryLinkRequest - * @static - * @param {Object.} object Plain object - * @returns {google.analytics.admin.v1alpha.CreateBigQueryLinkRequest} CreateBigQueryLinkRequest - */ - CreateBigQueryLinkRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.analytics.admin.v1alpha.CreateBigQueryLinkRequest) - return object; - var message = new $root.google.analytics.admin.v1alpha.CreateBigQueryLinkRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.bigqueryLink != null) { - if (typeof object.bigqueryLink !== "object") - throw TypeError(".google.analytics.admin.v1alpha.CreateBigQueryLinkRequest.bigqueryLink: object expected"); - message.bigqueryLink = $root.google.analytics.admin.v1alpha.BigQueryLink.fromObject(object.bigqueryLink); - } - return message; - }; - - /** - * Creates a plain object from a CreateBigQueryLinkRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.analytics.admin.v1alpha.CreateBigQueryLinkRequest - * @static - * @param {google.analytics.admin.v1alpha.CreateBigQueryLinkRequest} message CreateBigQueryLinkRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateBigQueryLinkRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.bigqueryLink = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.bigqueryLink != null && message.hasOwnProperty("bigqueryLink")) - object.bigqueryLink = $root.google.analytics.admin.v1alpha.BigQueryLink.toObject(message.bigqueryLink, options); - return object; - }; - - /** - * Converts this CreateBigQueryLinkRequest to JSON. - * @function toJSON - * @memberof google.analytics.admin.v1alpha.CreateBigQueryLinkRequest - * @instance - * @returns {Object.} JSON object - */ - CreateBigQueryLinkRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateBigQueryLinkRequest - * @function getTypeUrl - * @memberof google.analytics.admin.v1alpha.CreateBigQueryLinkRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateBigQueryLinkRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.analytics.admin.v1alpha.CreateBigQueryLinkRequest"; - }; - - return CreateBigQueryLinkRequest; - })(); - - v1alpha.GetBigQueryLinkRequest = (function() { - - /** - * Properties of a GetBigQueryLinkRequest. - * @memberof google.analytics.admin.v1alpha - * @interface IGetBigQueryLinkRequest - * @property {string|null} [name] GetBigQueryLinkRequest name - */ - - /** - * Constructs a new GetBigQueryLinkRequest. - * @memberof google.analytics.admin.v1alpha - * @classdesc Represents a GetBigQueryLinkRequest. - * @implements IGetBigQueryLinkRequest - * @constructor - * @param {google.analytics.admin.v1alpha.IGetBigQueryLinkRequest=} [properties] Properties to set - */ - function GetBigQueryLinkRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetBigQueryLinkRequest name. - * @member {string} name - * @memberof google.analytics.admin.v1alpha.GetBigQueryLinkRequest - * @instance - */ - GetBigQueryLinkRequest.prototype.name = ""; - - /** - * Creates a new GetBigQueryLinkRequest instance using the specified properties. - * @function create - * @memberof google.analytics.admin.v1alpha.GetBigQueryLinkRequest - * @static - * @param {google.analytics.admin.v1alpha.IGetBigQueryLinkRequest=} [properties] Properties to set - * @returns {google.analytics.admin.v1alpha.GetBigQueryLinkRequest} GetBigQueryLinkRequest instance - */ - GetBigQueryLinkRequest.create = function create(properties) { - return new GetBigQueryLinkRequest(properties); - }; - - /** - * Encodes the specified GetBigQueryLinkRequest message. Does not implicitly {@link google.analytics.admin.v1alpha.GetBigQueryLinkRequest.verify|verify} messages. - * @function encode - * @memberof google.analytics.admin.v1alpha.GetBigQueryLinkRequest - * @static - * @param {google.analytics.admin.v1alpha.IGetBigQueryLinkRequest} message GetBigQueryLinkRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetBigQueryLinkRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified GetBigQueryLinkRequest message, length delimited. Does not implicitly {@link google.analytics.admin.v1alpha.GetBigQueryLinkRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.analytics.admin.v1alpha.GetBigQueryLinkRequest - * @static - * @param {google.analytics.admin.v1alpha.IGetBigQueryLinkRequest} message GetBigQueryLinkRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetBigQueryLinkRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetBigQueryLinkRequest message from the specified reader or buffer. - * @function decode - * @memberof google.analytics.admin.v1alpha.GetBigQueryLinkRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.analytics.admin.v1alpha.GetBigQueryLinkRequest} GetBigQueryLinkRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetBigQueryLinkRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.admin.v1alpha.GetBigQueryLinkRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetBigQueryLinkRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.analytics.admin.v1alpha.GetBigQueryLinkRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.analytics.admin.v1alpha.GetBigQueryLinkRequest} GetBigQueryLinkRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetBigQueryLinkRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetBigQueryLinkRequest message. - * @function verify - * @memberof google.analytics.admin.v1alpha.GetBigQueryLinkRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetBigQueryLinkRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a GetBigQueryLinkRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.analytics.admin.v1alpha.GetBigQueryLinkRequest - * @static - * @param {Object.} object Plain object - * @returns {google.analytics.admin.v1alpha.GetBigQueryLinkRequest} GetBigQueryLinkRequest - */ - GetBigQueryLinkRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.analytics.admin.v1alpha.GetBigQueryLinkRequest) - return object; - var message = new $root.google.analytics.admin.v1alpha.GetBigQueryLinkRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetBigQueryLinkRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.analytics.admin.v1alpha.GetBigQueryLinkRequest - * @static - * @param {google.analytics.admin.v1alpha.GetBigQueryLinkRequest} message GetBigQueryLinkRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetBigQueryLinkRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this GetBigQueryLinkRequest to JSON. - * @function toJSON - * @memberof google.analytics.admin.v1alpha.GetBigQueryLinkRequest - * @instance - * @returns {Object.} JSON object - */ - GetBigQueryLinkRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetBigQueryLinkRequest - * @function getTypeUrl - * @memberof google.analytics.admin.v1alpha.GetBigQueryLinkRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetBigQueryLinkRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.analytics.admin.v1alpha.GetBigQueryLinkRequest"; - }; - - return GetBigQueryLinkRequest; - })(); - - v1alpha.ListBigQueryLinksRequest = (function() { - - /** - * Properties of a ListBigQueryLinksRequest. - * @memberof google.analytics.admin.v1alpha - * @interface IListBigQueryLinksRequest - * @property {string|null} [parent] ListBigQueryLinksRequest parent - * @property {number|null} [pageSize] ListBigQueryLinksRequest pageSize - * @property {string|null} [pageToken] ListBigQueryLinksRequest pageToken - */ - - /** - * Constructs a new ListBigQueryLinksRequest. - * @memberof google.analytics.admin.v1alpha - * @classdesc Represents a ListBigQueryLinksRequest. - * @implements IListBigQueryLinksRequest - * @constructor - * @param {google.analytics.admin.v1alpha.IListBigQueryLinksRequest=} [properties] Properties to set - */ - function ListBigQueryLinksRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListBigQueryLinksRequest parent. - * @member {string} parent - * @memberof google.analytics.admin.v1alpha.ListBigQueryLinksRequest - * @instance - */ - ListBigQueryLinksRequest.prototype.parent = ""; - - /** - * ListBigQueryLinksRequest pageSize. - * @member {number} pageSize - * @memberof google.analytics.admin.v1alpha.ListBigQueryLinksRequest - * @instance - */ - ListBigQueryLinksRequest.prototype.pageSize = 0; - - /** - * ListBigQueryLinksRequest pageToken. - * @member {string} pageToken - * @memberof google.analytics.admin.v1alpha.ListBigQueryLinksRequest - * @instance - */ - ListBigQueryLinksRequest.prototype.pageToken = ""; - - /** - * Creates a new ListBigQueryLinksRequest instance using the specified properties. - * @function create - * @memberof google.analytics.admin.v1alpha.ListBigQueryLinksRequest - * @static - * @param {google.analytics.admin.v1alpha.IListBigQueryLinksRequest=} [properties] Properties to set - * @returns {google.analytics.admin.v1alpha.ListBigQueryLinksRequest} ListBigQueryLinksRequest instance - */ - ListBigQueryLinksRequest.create = function create(properties) { - return new ListBigQueryLinksRequest(properties); - }; - - /** - * Encodes the specified ListBigQueryLinksRequest message. Does not implicitly {@link google.analytics.admin.v1alpha.ListBigQueryLinksRequest.verify|verify} messages. - * @function encode - * @memberof google.analytics.admin.v1alpha.ListBigQueryLinksRequest - * @static - * @param {google.analytics.admin.v1alpha.IListBigQueryLinksRequest} message ListBigQueryLinksRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBigQueryLinksRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - return writer; - }; - - /** - * Encodes the specified ListBigQueryLinksRequest message, length delimited. Does not implicitly {@link google.analytics.admin.v1alpha.ListBigQueryLinksRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.analytics.admin.v1alpha.ListBigQueryLinksRequest - * @static - * @param {google.analytics.admin.v1alpha.IListBigQueryLinksRequest} message ListBigQueryLinksRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBigQueryLinksRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListBigQueryLinksRequest message from the specified reader or buffer. - * @function decode - * @memberof google.analytics.admin.v1alpha.ListBigQueryLinksRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.analytics.admin.v1alpha.ListBigQueryLinksRequest} ListBigQueryLinksRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBigQueryLinksRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.admin.v1alpha.ListBigQueryLinksRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListBigQueryLinksRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.analytics.admin.v1alpha.ListBigQueryLinksRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.analytics.admin.v1alpha.ListBigQueryLinksRequest} ListBigQueryLinksRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBigQueryLinksRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListBigQueryLinksRequest message. - * @function verify - * @memberof google.analytics.admin.v1alpha.ListBigQueryLinksRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListBigQueryLinksRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; - - /** - * Creates a ListBigQueryLinksRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.analytics.admin.v1alpha.ListBigQueryLinksRequest - * @static - * @param {Object.} object Plain object - * @returns {google.analytics.admin.v1alpha.ListBigQueryLinksRequest} ListBigQueryLinksRequest - */ - ListBigQueryLinksRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.analytics.admin.v1alpha.ListBigQueryLinksRequest) - return object; - var message = new $root.google.analytics.admin.v1alpha.ListBigQueryLinksRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListBigQueryLinksRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.analytics.admin.v1alpha.ListBigQueryLinksRequest - * @static - * @param {google.analytics.admin.v1alpha.ListBigQueryLinksRequest} message ListBigQueryLinksRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListBigQueryLinksRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this ListBigQueryLinksRequest to JSON. - * @function toJSON - * @memberof google.analytics.admin.v1alpha.ListBigQueryLinksRequest - * @instance - * @returns {Object.} JSON object - */ - ListBigQueryLinksRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListBigQueryLinksRequest - * @function getTypeUrl - * @memberof google.analytics.admin.v1alpha.ListBigQueryLinksRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListBigQueryLinksRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.analytics.admin.v1alpha.ListBigQueryLinksRequest"; - }; - - return ListBigQueryLinksRequest; - })(); - - v1alpha.ListBigQueryLinksResponse = (function() { - - /** - * Properties of a ListBigQueryLinksResponse. - * @memberof google.analytics.admin.v1alpha - * @interface IListBigQueryLinksResponse - * @property {Array.|null} [bigqueryLinks] ListBigQueryLinksResponse bigqueryLinks - * @property {string|null} [nextPageToken] ListBigQueryLinksResponse nextPageToken - */ - - /** - * Constructs a new ListBigQueryLinksResponse. - * @memberof google.analytics.admin.v1alpha - * @classdesc Represents a ListBigQueryLinksResponse. - * @implements IListBigQueryLinksResponse - * @constructor - * @param {google.analytics.admin.v1alpha.IListBigQueryLinksResponse=} [properties] Properties to set - */ - function ListBigQueryLinksResponse(properties) { - this.bigqueryLinks = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListBigQueryLinksResponse bigqueryLinks. - * @member {Array.} bigqueryLinks - * @memberof google.analytics.admin.v1alpha.ListBigQueryLinksResponse - * @instance - */ - ListBigQueryLinksResponse.prototype.bigqueryLinks = $util.emptyArray; - - /** - * ListBigQueryLinksResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.analytics.admin.v1alpha.ListBigQueryLinksResponse - * @instance - */ - ListBigQueryLinksResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListBigQueryLinksResponse instance using the specified properties. - * @function create - * @memberof google.analytics.admin.v1alpha.ListBigQueryLinksResponse - * @static - * @param {google.analytics.admin.v1alpha.IListBigQueryLinksResponse=} [properties] Properties to set - * @returns {google.analytics.admin.v1alpha.ListBigQueryLinksResponse} ListBigQueryLinksResponse instance - */ - ListBigQueryLinksResponse.create = function create(properties) { - return new ListBigQueryLinksResponse(properties); - }; - - /** - * Encodes the specified ListBigQueryLinksResponse message. Does not implicitly {@link google.analytics.admin.v1alpha.ListBigQueryLinksResponse.verify|verify} messages. - * @function encode - * @memberof google.analytics.admin.v1alpha.ListBigQueryLinksResponse - * @static - * @param {google.analytics.admin.v1alpha.IListBigQueryLinksResponse} message ListBigQueryLinksResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBigQueryLinksResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.bigqueryLinks != null && message.bigqueryLinks.length) - for (var i = 0; i < message.bigqueryLinks.length; ++i) - $root.google.analytics.admin.v1alpha.BigQueryLink.encode(message.bigqueryLinks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified ListBigQueryLinksResponse message, length delimited. Does not implicitly {@link google.analytics.admin.v1alpha.ListBigQueryLinksResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.analytics.admin.v1alpha.ListBigQueryLinksResponse - * @static - * @param {google.analytics.admin.v1alpha.IListBigQueryLinksResponse} message ListBigQueryLinksResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBigQueryLinksResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListBigQueryLinksResponse message from the specified reader or buffer. - * @function decode - * @memberof google.analytics.admin.v1alpha.ListBigQueryLinksResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.analytics.admin.v1alpha.ListBigQueryLinksResponse} ListBigQueryLinksResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBigQueryLinksResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.admin.v1alpha.ListBigQueryLinksResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.bigqueryLinks && message.bigqueryLinks.length)) - message.bigqueryLinks = []; - message.bigqueryLinks.push($root.google.analytics.admin.v1alpha.BigQueryLink.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListBigQueryLinksResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.analytics.admin.v1alpha.ListBigQueryLinksResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.analytics.admin.v1alpha.ListBigQueryLinksResponse} ListBigQueryLinksResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBigQueryLinksResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListBigQueryLinksResponse message. - * @function verify - * @memberof google.analytics.admin.v1alpha.ListBigQueryLinksResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListBigQueryLinksResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.bigqueryLinks != null && message.hasOwnProperty("bigqueryLinks")) { - if (!Array.isArray(message.bigqueryLinks)) - return "bigqueryLinks: array expected"; - for (var i = 0; i < message.bigqueryLinks.length; ++i) { - var error = $root.google.analytics.admin.v1alpha.BigQueryLink.verify(message.bigqueryLinks[i]); - if (error) - return "bigqueryLinks." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListBigQueryLinksResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.analytics.admin.v1alpha.ListBigQueryLinksResponse - * @static - * @param {Object.} object Plain object - * @returns {google.analytics.admin.v1alpha.ListBigQueryLinksResponse} ListBigQueryLinksResponse - */ - ListBigQueryLinksResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.analytics.admin.v1alpha.ListBigQueryLinksResponse) - return object; - var message = new $root.google.analytics.admin.v1alpha.ListBigQueryLinksResponse(); - if (object.bigqueryLinks) { - if (!Array.isArray(object.bigqueryLinks)) - throw TypeError(".google.analytics.admin.v1alpha.ListBigQueryLinksResponse.bigqueryLinks: array expected"); - message.bigqueryLinks = []; - for (var i = 0; i < object.bigqueryLinks.length; ++i) { - if (typeof object.bigqueryLinks[i] !== "object") - throw TypeError(".google.analytics.admin.v1alpha.ListBigQueryLinksResponse.bigqueryLinks: object expected"); - message.bigqueryLinks[i] = $root.google.analytics.admin.v1alpha.BigQueryLink.fromObject(object.bigqueryLinks[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListBigQueryLinksResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.analytics.admin.v1alpha.ListBigQueryLinksResponse - * @static - * @param {google.analytics.admin.v1alpha.ListBigQueryLinksResponse} message ListBigQueryLinksResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListBigQueryLinksResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.bigqueryLinks = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.bigqueryLinks && message.bigqueryLinks.length) { - object.bigqueryLinks = []; - for (var j = 0; j < message.bigqueryLinks.length; ++j) - object.bigqueryLinks[j] = $root.google.analytics.admin.v1alpha.BigQueryLink.toObject(message.bigqueryLinks[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListBigQueryLinksResponse to JSON. - * @function toJSON - * @memberof google.analytics.admin.v1alpha.ListBigQueryLinksResponse - * @instance - * @returns {Object.} JSON object - */ - ListBigQueryLinksResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListBigQueryLinksResponse - * @function getTypeUrl - * @memberof google.analytics.admin.v1alpha.ListBigQueryLinksResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListBigQueryLinksResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.analytics.admin.v1alpha.ListBigQueryLinksResponse"; - }; - - return ListBigQueryLinksResponse; - })(); - - v1alpha.UpdateBigQueryLinkRequest = (function() { - - /** - * Properties of an UpdateBigQueryLinkRequest. - * @memberof google.analytics.admin.v1alpha - * @interface IUpdateBigQueryLinkRequest - * @property {google.analytics.admin.v1alpha.IBigQueryLink|null} [bigqueryLink] UpdateBigQueryLinkRequest bigqueryLink - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateBigQueryLinkRequest updateMask - */ - - /** - * Constructs a new UpdateBigQueryLinkRequest. - * @memberof google.analytics.admin.v1alpha - * @classdesc Represents an UpdateBigQueryLinkRequest. - * @implements IUpdateBigQueryLinkRequest - * @constructor - * @param {google.analytics.admin.v1alpha.IUpdateBigQueryLinkRequest=} [properties] Properties to set - */ - function UpdateBigQueryLinkRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateBigQueryLinkRequest bigqueryLink. - * @member {google.analytics.admin.v1alpha.IBigQueryLink|null|undefined} bigqueryLink - * @memberof google.analytics.admin.v1alpha.UpdateBigQueryLinkRequest - * @instance - */ - UpdateBigQueryLinkRequest.prototype.bigqueryLink = null; - - /** - * UpdateBigQueryLinkRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.analytics.admin.v1alpha.UpdateBigQueryLinkRequest - * @instance - */ - UpdateBigQueryLinkRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateBigQueryLinkRequest instance using the specified properties. - * @function create - * @memberof google.analytics.admin.v1alpha.UpdateBigQueryLinkRequest - * @static - * @param {google.analytics.admin.v1alpha.IUpdateBigQueryLinkRequest=} [properties] Properties to set - * @returns {google.analytics.admin.v1alpha.UpdateBigQueryLinkRequest} UpdateBigQueryLinkRequest instance - */ - UpdateBigQueryLinkRequest.create = function create(properties) { - return new UpdateBigQueryLinkRequest(properties); - }; - - /** - * Encodes the specified UpdateBigQueryLinkRequest message. Does not implicitly {@link google.analytics.admin.v1alpha.UpdateBigQueryLinkRequest.verify|verify} messages. - * @function encode - * @memberof google.analytics.admin.v1alpha.UpdateBigQueryLinkRequest - * @static - * @param {google.analytics.admin.v1alpha.IUpdateBigQueryLinkRequest} message UpdateBigQueryLinkRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateBigQueryLinkRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.bigqueryLink != null && Object.hasOwnProperty.call(message, "bigqueryLink")) - $root.google.analytics.admin.v1alpha.BigQueryLink.encode(message.bigqueryLink, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateBigQueryLinkRequest message, length delimited. Does not implicitly {@link google.analytics.admin.v1alpha.UpdateBigQueryLinkRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.analytics.admin.v1alpha.UpdateBigQueryLinkRequest - * @static - * @param {google.analytics.admin.v1alpha.IUpdateBigQueryLinkRequest} message UpdateBigQueryLinkRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateBigQueryLinkRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateBigQueryLinkRequest message from the specified reader or buffer. - * @function decode - * @memberof google.analytics.admin.v1alpha.UpdateBigQueryLinkRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.analytics.admin.v1alpha.UpdateBigQueryLinkRequest} UpdateBigQueryLinkRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateBigQueryLinkRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.admin.v1alpha.UpdateBigQueryLinkRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.bigqueryLink = $root.google.analytics.admin.v1alpha.BigQueryLink.decode(reader, reader.uint32()); - break; - } - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateBigQueryLinkRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.analytics.admin.v1alpha.UpdateBigQueryLinkRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.analytics.admin.v1alpha.UpdateBigQueryLinkRequest} UpdateBigQueryLinkRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateBigQueryLinkRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateBigQueryLinkRequest message. - * @function verify - * @memberof google.analytics.admin.v1alpha.UpdateBigQueryLinkRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateBigQueryLinkRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.bigqueryLink != null && message.hasOwnProperty("bigqueryLink")) { - var error = $root.google.analytics.admin.v1alpha.BigQueryLink.verify(message.bigqueryLink); - if (error) - return "bigqueryLink." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - return null; - }; - - /** - * Creates an UpdateBigQueryLinkRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.analytics.admin.v1alpha.UpdateBigQueryLinkRequest - * @static - * @param {Object.} object Plain object - * @returns {google.analytics.admin.v1alpha.UpdateBigQueryLinkRequest} UpdateBigQueryLinkRequest - */ - UpdateBigQueryLinkRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.analytics.admin.v1alpha.UpdateBigQueryLinkRequest) - return object; - var message = new $root.google.analytics.admin.v1alpha.UpdateBigQueryLinkRequest(); - if (object.bigqueryLink != null) { - if (typeof object.bigqueryLink !== "object") - throw TypeError(".google.analytics.admin.v1alpha.UpdateBigQueryLinkRequest.bigqueryLink: object expected"); - message.bigqueryLink = $root.google.analytics.admin.v1alpha.BigQueryLink.fromObject(object.bigqueryLink); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.analytics.admin.v1alpha.UpdateBigQueryLinkRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateBigQueryLinkRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.analytics.admin.v1alpha.UpdateBigQueryLinkRequest - * @static - * @param {google.analytics.admin.v1alpha.UpdateBigQueryLinkRequest} message UpdateBigQueryLinkRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateBigQueryLinkRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.bigqueryLink = null; - object.updateMask = null; - } - if (message.bigqueryLink != null && message.hasOwnProperty("bigqueryLink")) - object.bigqueryLink = $root.google.analytics.admin.v1alpha.BigQueryLink.toObject(message.bigqueryLink, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateBigQueryLinkRequest to JSON. - * @function toJSON - * @memberof google.analytics.admin.v1alpha.UpdateBigQueryLinkRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateBigQueryLinkRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateBigQueryLinkRequest - * @function getTypeUrl - * @memberof google.analytics.admin.v1alpha.UpdateBigQueryLinkRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateBigQueryLinkRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.analytics.admin.v1alpha.UpdateBigQueryLinkRequest"; - }; - - return UpdateBigQueryLinkRequest; - })(); - - v1alpha.DeleteBigQueryLinkRequest = (function() { - - /** - * Properties of a DeleteBigQueryLinkRequest. - * @memberof google.analytics.admin.v1alpha - * @interface IDeleteBigQueryLinkRequest - * @property {string|null} [name] DeleteBigQueryLinkRequest name - */ - - /** - * Constructs a new DeleteBigQueryLinkRequest. - * @memberof google.analytics.admin.v1alpha - * @classdesc Represents a DeleteBigQueryLinkRequest. - * @implements IDeleteBigQueryLinkRequest - * @constructor - * @param {google.analytics.admin.v1alpha.IDeleteBigQueryLinkRequest=} [properties] Properties to set - */ - function DeleteBigQueryLinkRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteBigQueryLinkRequest name. - * @member {string} name - * @memberof google.analytics.admin.v1alpha.DeleteBigQueryLinkRequest - * @instance - */ - DeleteBigQueryLinkRequest.prototype.name = ""; - - /** - * Creates a new DeleteBigQueryLinkRequest instance using the specified properties. - * @function create - * @memberof google.analytics.admin.v1alpha.DeleteBigQueryLinkRequest - * @static - * @param {google.analytics.admin.v1alpha.IDeleteBigQueryLinkRequest=} [properties] Properties to set - * @returns {google.analytics.admin.v1alpha.DeleteBigQueryLinkRequest} DeleteBigQueryLinkRequest instance - */ - DeleteBigQueryLinkRequest.create = function create(properties) { - return new DeleteBigQueryLinkRequest(properties); - }; - - /** - * Encodes the specified DeleteBigQueryLinkRequest message. Does not implicitly {@link google.analytics.admin.v1alpha.DeleteBigQueryLinkRequest.verify|verify} messages. - * @function encode - * @memberof google.analytics.admin.v1alpha.DeleteBigQueryLinkRequest - * @static - * @param {google.analytics.admin.v1alpha.IDeleteBigQueryLinkRequest} message DeleteBigQueryLinkRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteBigQueryLinkRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified DeleteBigQueryLinkRequest message, length delimited. Does not implicitly {@link google.analytics.admin.v1alpha.DeleteBigQueryLinkRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.analytics.admin.v1alpha.DeleteBigQueryLinkRequest - * @static - * @param {google.analytics.admin.v1alpha.IDeleteBigQueryLinkRequest} message DeleteBigQueryLinkRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteBigQueryLinkRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteBigQueryLinkRequest message from the specified reader or buffer. - * @function decode - * @memberof google.analytics.admin.v1alpha.DeleteBigQueryLinkRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.analytics.admin.v1alpha.DeleteBigQueryLinkRequest} DeleteBigQueryLinkRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteBigQueryLinkRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.admin.v1alpha.DeleteBigQueryLinkRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteBigQueryLinkRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.analytics.admin.v1alpha.DeleteBigQueryLinkRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.analytics.admin.v1alpha.DeleteBigQueryLinkRequest} DeleteBigQueryLinkRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteBigQueryLinkRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteBigQueryLinkRequest message. - * @function verify - * @memberof google.analytics.admin.v1alpha.DeleteBigQueryLinkRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteBigQueryLinkRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a DeleteBigQueryLinkRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.analytics.admin.v1alpha.DeleteBigQueryLinkRequest - * @static - * @param {Object.} object Plain object - * @returns {google.analytics.admin.v1alpha.DeleteBigQueryLinkRequest} DeleteBigQueryLinkRequest - */ - DeleteBigQueryLinkRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.analytics.admin.v1alpha.DeleteBigQueryLinkRequest) - return object; - var message = new $root.google.analytics.admin.v1alpha.DeleteBigQueryLinkRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteBigQueryLinkRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.analytics.admin.v1alpha.DeleteBigQueryLinkRequest - * @static - * @param {google.analytics.admin.v1alpha.DeleteBigQueryLinkRequest} message DeleteBigQueryLinkRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteBigQueryLinkRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this DeleteBigQueryLinkRequest to JSON. - * @function toJSON - * @memberof google.analytics.admin.v1alpha.DeleteBigQueryLinkRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteBigQueryLinkRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteBigQueryLinkRequest - * @function getTypeUrl - * @memberof google.analytics.admin.v1alpha.DeleteBigQueryLinkRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteBigQueryLinkRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.analytics.admin.v1alpha.DeleteBigQueryLinkRequest"; - }; - - return DeleteBigQueryLinkRequest; - })(); - - v1alpha.GetEnhancedMeasurementSettingsRequest = (function() { - - /** - * Properties of a GetEnhancedMeasurementSettingsRequest. - * @memberof google.analytics.admin.v1alpha - * @interface IGetEnhancedMeasurementSettingsRequest - * @property {string|null} [name] GetEnhancedMeasurementSettingsRequest name - */ - - /** - * Constructs a new GetEnhancedMeasurementSettingsRequest. - * @memberof google.analytics.admin.v1alpha - * @classdesc Represents a GetEnhancedMeasurementSettingsRequest. - * @implements IGetEnhancedMeasurementSettingsRequest - * @constructor - * @param {google.analytics.admin.v1alpha.IGetEnhancedMeasurementSettingsRequest=} [properties] Properties to set - */ - function GetEnhancedMeasurementSettingsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetEnhancedMeasurementSettingsRequest name. - * @member {string} name - * @memberof google.analytics.admin.v1alpha.GetEnhancedMeasurementSettingsRequest - * @instance - */ - GetEnhancedMeasurementSettingsRequest.prototype.name = ""; - - /** - * Creates a new GetEnhancedMeasurementSettingsRequest instance using the specified properties. - * @function create - * @memberof google.analytics.admin.v1alpha.GetEnhancedMeasurementSettingsRequest - * @static - * @param {google.analytics.admin.v1alpha.IGetEnhancedMeasurementSettingsRequest=} [properties] Properties to set - * @returns {google.analytics.admin.v1alpha.GetEnhancedMeasurementSettingsRequest} GetEnhancedMeasurementSettingsRequest instance - */ - GetEnhancedMeasurementSettingsRequest.create = function create(properties) { - return new GetEnhancedMeasurementSettingsRequest(properties); - }; - - /** - * Encodes the specified GetEnhancedMeasurementSettingsRequest message. Does not implicitly {@link google.analytics.admin.v1alpha.GetEnhancedMeasurementSettingsRequest.verify|verify} messages. - * @function encode - * @memberof google.analytics.admin.v1alpha.GetEnhancedMeasurementSettingsRequest - * @static - * @param {google.analytics.admin.v1alpha.IGetEnhancedMeasurementSettingsRequest} message GetEnhancedMeasurementSettingsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEnhancedMeasurementSettingsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified GetEnhancedMeasurementSettingsRequest message, length delimited. Does not implicitly {@link google.analytics.admin.v1alpha.GetEnhancedMeasurementSettingsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.analytics.admin.v1alpha.GetEnhancedMeasurementSettingsRequest - * @static - * @param {google.analytics.admin.v1alpha.IGetEnhancedMeasurementSettingsRequest} message GetEnhancedMeasurementSettingsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEnhancedMeasurementSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetEnhancedMeasurementSettingsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.analytics.admin.v1alpha.GetEnhancedMeasurementSettingsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.analytics.admin.v1alpha.GetEnhancedMeasurementSettingsRequest} GetEnhancedMeasurementSettingsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEnhancedMeasurementSettingsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.admin.v1alpha.GetEnhancedMeasurementSettingsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetEnhancedMeasurementSettingsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.analytics.admin.v1alpha.GetEnhancedMeasurementSettingsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.analytics.admin.v1alpha.GetEnhancedMeasurementSettingsRequest} GetEnhancedMeasurementSettingsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEnhancedMeasurementSettingsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetEnhancedMeasurementSettingsRequest message. - * @function verify - * @memberof google.analytics.admin.v1alpha.GetEnhancedMeasurementSettingsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetEnhancedMeasurementSettingsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a GetEnhancedMeasurementSettingsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.analytics.admin.v1alpha.GetEnhancedMeasurementSettingsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.analytics.admin.v1alpha.GetEnhancedMeasurementSettingsRequest} GetEnhancedMeasurementSettingsRequest - */ - GetEnhancedMeasurementSettingsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.analytics.admin.v1alpha.GetEnhancedMeasurementSettingsRequest) - return object; - var message = new $root.google.analytics.admin.v1alpha.GetEnhancedMeasurementSettingsRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetEnhancedMeasurementSettingsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.analytics.admin.v1alpha.GetEnhancedMeasurementSettingsRequest - * @static - * @param {google.analytics.admin.v1alpha.GetEnhancedMeasurementSettingsRequest} message GetEnhancedMeasurementSettingsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetEnhancedMeasurementSettingsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this GetEnhancedMeasurementSettingsRequest to JSON. - * @function toJSON - * @memberof google.analytics.admin.v1alpha.GetEnhancedMeasurementSettingsRequest - * @instance - * @returns {Object.} JSON object - */ - GetEnhancedMeasurementSettingsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetEnhancedMeasurementSettingsRequest - * @function getTypeUrl - * @memberof google.analytics.admin.v1alpha.GetEnhancedMeasurementSettingsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetEnhancedMeasurementSettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.analytics.admin.v1alpha.GetEnhancedMeasurementSettingsRequest"; - }; - - return GetEnhancedMeasurementSettingsRequest; - })(); - - v1alpha.UpdateEnhancedMeasurementSettingsRequest = (function() { - - /** - * Properties of an UpdateEnhancedMeasurementSettingsRequest. - * @memberof google.analytics.admin.v1alpha - * @interface IUpdateEnhancedMeasurementSettingsRequest - * @property {google.analytics.admin.v1alpha.IEnhancedMeasurementSettings|null} [enhancedMeasurementSettings] UpdateEnhancedMeasurementSettingsRequest enhancedMeasurementSettings - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateEnhancedMeasurementSettingsRequest updateMask - */ - - /** - * Constructs a new UpdateEnhancedMeasurementSettingsRequest. - * @memberof google.analytics.admin.v1alpha - * @classdesc Represents an UpdateEnhancedMeasurementSettingsRequest. - * @implements IUpdateEnhancedMeasurementSettingsRequest - * @constructor - * @param {google.analytics.admin.v1alpha.IUpdateEnhancedMeasurementSettingsRequest=} [properties] Properties to set - */ - function UpdateEnhancedMeasurementSettingsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateEnhancedMeasurementSettingsRequest enhancedMeasurementSettings. - * @member {google.analytics.admin.v1alpha.IEnhancedMeasurementSettings|null|undefined} enhancedMeasurementSettings - * @memberof google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest - * @instance - */ - UpdateEnhancedMeasurementSettingsRequest.prototype.enhancedMeasurementSettings = null; - - /** - * UpdateEnhancedMeasurementSettingsRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest - * @instance - */ - UpdateEnhancedMeasurementSettingsRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateEnhancedMeasurementSettingsRequest instance using the specified properties. - * @function create - * @memberof google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest - * @static - * @param {google.analytics.admin.v1alpha.IUpdateEnhancedMeasurementSettingsRequest=} [properties] Properties to set - * @returns {google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest} UpdateEnhancedMeasurementSettingsRequest instance - */ - UpdateEnhancedMeasurementSettingsRequest.create = function create(properties) { - return new UpdateEnhancedMeasurementSettingsRequest(properties); - }; - - /** - * Encodes the specified UpdateEnhancedMeasurementSettingsRequest message. Does not implicitly {@link google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest.verify|verify} messages. - * @function encode - * @memberof google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest - * @static - * @param {google.analytics.admin.v1alpha.IUpdateEnhancedMeasurementSettingsRequest} message UpdateEnhancedMeasurementSettingsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateEnhancedMeasurementSettingsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.enhancedMeasurementSettings != null && Object.hasOwnProperty.call(message, "enhancedMeasurementSettings")) - $root.google.analytics.admin.v1alpha.EnhancedMeasurementSettings.encode(message.enhancedMeasurementSettings, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateEnhancedMeasurementSettingsRequest message, length delimited. Does not implicitly {@link google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest - * @static - * @param {google.analytics.admin.v1alpha.IUpdateEnhancedMeasurementSettingsRequest} message UpdateEnhancedMeasurementSettingsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateEnhancedMeasurementSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateEnhancedMeasurementSettingsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest} UpdateEnhancedMeasurementSettingsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateEnhancedMeasurementSettingsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.enhancedMeasurementSettings = $root.google.analytics.admin.v1alpha.EnhancedMeasurementSettings.decode(reader, reader.uint32()); - break; - } - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; + if (message.bigqueryLinks != null && message.hasOwnProperty("bigqueryLinks")) { + if (!Array.isArray(message.bigqueryLinks)) + return "bigqueryLinks: array expected"; + for (var i = 0; i < message.bigqueryLinks.length; ++i) { + var error = $root.google.analytics.admin.v1alpha.BigQueryLink.verify(message.bigqueryLinks[i]); + if (error) + return "bigqueryLinks." + error; } } - return message; - }; - - /** - * Decodes an UpdateEnhancedMeasurementSettingsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest} UpdateEnhancedMeasurementSettingsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateEnhancedMeasurementSettingsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateEnhancedMeasurementSettingsRequest message. - * @function verify - * @memberof google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateEnhancedMeasurementSettingsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.enhancedMeasurementSettings != null && message.hasOwnProperty("enhancedMeasurementSettings")) { - var error = $root.google.analytics.admin.v1alpha.EnhancedMeasurementSettings.verify(message.enhancedMeasurementSettings); - if (error) - return "enhancedMeasurementSettings." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates an UpdateEnhancedMeasurementSettingsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListBigQueryLinksResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest + * @memberof google.analytics.admin.v1alpha.ListBigQueryLinksResponse * @static * @param {Object.} object Plain object - * @returns {google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest} UpdateEnhancedMeasurementSettingsRequest + * @returns {google.analytics.admin.v1alpha.ListBigQueryLinksResponse} ListBigQueryLinksResponse */ - UpdateEnhancedMeasurementSettingsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest) + ListBigQueryLinksResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.admin.v1alpha.ListBigQueryLinksResponse) return object; - var message = new $root.google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest(); - if (object.enhancedMeasurementSettings != null) { - if (typeof object.enhancedMeasurementSettings !== "object") - throw TypeError(".google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest.enhancedMeasurementSettings: object expected"); - message.enhancedMeasurementSettings = $root.google.analytics.admin.v1alpha.EnhancedMeasurementSettings.fromObject(object.enhancedMeasurementSettings); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateEnhancedMeasurementSettingsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest - * @static - * @param {google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest} message UpdateEnhancedMeasurementSettingsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateEnhancedMeasurementSettingsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.enhancedMeasurementSettings = null; - object.updateMask = null; - } - if (message.enhancedMeasurementSettings != null && message.hasOwnProperty("enhancedMeasurementSettings")) - object.enhancedMeasurementSettings = $root.google.analytics.admin.v1alpha.EnhancedMeasurementSettings.toObject(message.enhancedMeasurementSettings, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateEnhancedMeasurementSettingsRequest to JSON. - * @function toJSON - * @memberof google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateEnhancedMeasurementSettingsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateEnhancedMeasurementSettingsRequest - * @function getTypeUrl - * @memberof google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateEnhancedMeasurementSettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest"; - }; - - return UpdateEnhancedMeasurementSettingsRequest; - })(); - - v1alpha.GetDataRedactionSettingsRequest = (function() { - - /** - * Properties of a GetDataRedactionSettingsRequest. - * @memberof google.analytics.admin.v1alpha - * @interface IGetDataRedactionSettingsRequest - * @property {string|null} [name] GetDataRedactionSettingsRequest name - */ - - /** - * Constructs a new GetDataRedactionSettingsRequest. - * @memberof google.analytics.admin.v1alpha - * @classdesc Represents a GetDataRedactionSettingsRequest. - * @implements IGetDataRedactionSettingsRequest - * @constructor - * @param {google.analytics.admin.v1alpha.IGetDataRedactionSettingsRequest=} [properties] Properties to set - */ - function GetDataRedactionSettingsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetDataRedactionSettingsRequest name. - * @member {string} name - * @memberof google.analytics.admin.v1alpha.GetDataRedactionSettingsRequest - * @instance - */ - GetDataRedactionSettingsRequest.prototype.name = ""; - - /** - * Creates a new GetDataRedactionSettingsRequest instance using the specified properties. - * @function create - * @memberof google.analytics.admin.v1alpha.GetDataRedactionSettingsRequest - * @static - * @param {google.analytics.admin.v1alpha.IGetDataRedactionSettingsRequest=} [properties] Properties to set - * @returns {google.analytics.admin.v1alpha.GetDataRedactionSettingsRequest} GetDataRedactionSettingsRequest instance - */ - GetDataRedactionSettingsRequest.create = function create(properties) { - return new GetDataRedactionSettingsRequest(properties); - }; - - /** - * Encodes the specified GetDataRedactionSettingsRequest message. Does not implicitly {@link google.analytics.admin.v1alpha.GetDataRedactionSettingsRequest.verify|verify} messages. - * @function encode - * @memberof google.analytics.admin.v1alpha.GetDataRedactionSettingsRequest - * @static - * @param {google.analytics.admin.v1alpha.IGetDataRedactionSettingsRequest} message GetDataRedactionSettingsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDataRedactionSettingsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified GetDataRedactionSettingsRequest message, length delimited. Does not implicitly {@link google.analytics.admin.v1alpha.GetDataRedactionSettingsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.analytics.admin.v1alpha.GetDataRedactionSettingsRequest - * @static - * @param {google.analytics.admin.v1alpha.IGetDataRedactionSettingsRequest} message GetDataRedactionSettingsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDataRedactionSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetDataRedactionSettingsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.analytics.admin.v1alpha.GetDataRedactionSettingsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.analytics.admin.v1alpha.GetDataRedactionSettingsRequest} GetDataRedactionSettingsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDataRedactionSettingsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.admin.v1alpha.GetDataRedactionSettingsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; + var message = new $root.google.analytics.admin.v1alpha.ListBigQueryLinksResponse(); + if (object.bigqueryLinks) { + if (!Array.isArray(object.bigqueryLinks)) + throw TypeError(".google.analytics.admin.v1alpha.ListBigQueryLinksResponse.bigqueryLinks: array expected"); + message.bigqueryLinks = []; + for (var i = 0; i < object.bigqueryLinks.length; ++i) { + if (typeof object.bigqueryLinks[i] !== "object") + throw TypeError(".google.analytics.admin.v1alpha.ListBigQueryLinksResponse.bigqueryLinks: object expected"); + message.bigqueryLinks[i] = $root.google.analytics.admin.v1alpha.BigQueryLink.fromObject(object.bigqueryLinks[i]); } } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Decodes a GetDataRedactionSettingsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.analytics.admin.v1alpha.GetDataRedactionSettingsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.analytics.admin.v1alpha.GetDataRedactionSettingsRequest} GetDataRedactionSettingsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDataRedactionSettingsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetDataRedactionSettingsRequest message. - * @function verify - * @memberof google.analytics.admin.v1alpha.GetDataRedactionSettingsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetDataRedactionSettingsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a GetDataRedactionSettingsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.analytics.admin.v1alpha.GetDataRedactionSettingsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.analytics.admin.v1alpha.GetDataRedactionSettingsRequest} GetDataRedactionSettingsRequest - */ - GetDataRedactionSettingsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.analytics.admin.v1alpha.GetDataRedactionSettingsRequest) - return object; - var message = new $root.google.analytics.admin.v1alpha.GetDataRedactionSettingsRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetDataRedactionSettingsRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListBigQueryLinksResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.analytics.admin.v1alpha.GetDataRedactionSettingsRequest + * @memberof google.analytics.admin.v1alpha.ListBigQueryLinksResponse * @static - * @param {google.analytics.admin.v1alpha.GetDataRedactionSettingsRequest} message GetDataRedactionSettingsRequest + * @param {google.analytics.admin.v1alpha.ListBigQueryLinksResponse} message ListBigQueryLinksResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetDataRedactionSettingsRequest.toObject = function toObject(message, options) { + ListBigQueryLinksResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.bigqueryLinks = []; if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + object.nextPageToken = ""; + if (message.bigqueryLinks && message.bigqueryLinks.length) { + object.bigqueryLinks = []; + for (var j = 0; j < message.bigqueryLinks.length; ++j) + object.bigqueryLinks[j] = $root.google.analytics.admin.v1alpha.BigQueryLink.toObject(message.bigqueryLinks[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this GetDataRedactionSettingsRequest to JSON. + * Converts this ListBigQueryLinksResponse to JSON. * @function toJSON - * @memberof google.analytics.admin.v1alpha.GetDataRedactionSettingsRequest + * @memberof google.analytics.admin.v1alpha.ListBigQueryLinksResponse * @instance * @returns {Object.} JSON object */ - GetDataRedactionSettingsRequest.prototype.toJSON = function toJSON() { + ListBigQueryLinksResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetDataRedactionSettingsRequest + * Gets the default type url for ListBigQueryLinksResponse * @function getTypeUrl - * @memberof google.analytics.admin.v1alpha.GetDataRedactionSettingsRequest + * @memberof google.analytics.admin.v1alpha.ListBigQueryLinksResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetDataRedactionSettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListBigQueryLinksResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.analytics.admin.v1alpha.GetDataRedactionSettingsRequest"; + return typeUrlPrefix + "/google.analytics.admin.v1alpha.ListBigQueryLinksResponse"; }; - return GetDataRedactionSettingsRequest; + return ListBigQueryLinksResponse; })(); - v1alpha.UpdateDataRedactionSettingsRequest = (function() { + v1alpha.UpdateBigQueryLinkRequest = (function() { /** - * Properties of an UpdateDataRedactionSettingsRequest. + * Properties of an UpdateBigQueryLinkRequest. * @memberof google.analytics.admin.v1alpha - * @interface IUpdateDataRedactionSettingsRequest - * @property {google.analytics.admin.v1alpha.IDataRedactionSettings|null} [dataRedactionSettings] UpdateDataRedactionSettingsRequest dataRedactionSettings - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateDataRedactionSettingsRequest updateMask + * @interface IUpdateBigQueryLinkRequest + * @property {google.analytics.admin.v1alpha.IBigQueryLink|null} [bigqueryLink] UpdateBigQueryLinkRequest bigqueryLink + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateBigQueryLinkRequest updateMask */ /** - * Constructs a new UpdateDataRedactionSettingsRequest. + * Constructs a new UpdateBigQueryLinkRequest. * @memberof google.analytics.admin.v1alpha - * @classdesc Represents an UpdateDataRedactionSettingsRequest. - * @implements IUpdateDataRedactionSettingsRequest + * @classdesc Represents an UpdateBigQueryLinkRequest. + * @implements IUpdateBigQueryLinkRequest * @constructor - * @param {google.analytics.admin.v1alpha.IUpdateDataRedactionSettingsRequest=} [properties] Properties to set + * @param {google.analytics.admin.v1alpha.IUpdateBigQueryLinkRequest=} [properties] Properties to set */ - function UpdateDataRedactionSettingsRequest(properties) { + function UpdateBigQueryLinkRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -45972,87 +43903,87 @@ } /** - * UpdateDataRedactionSettingsRequest dataRedactionSettings. - * @member {google.analytics.admin.v1alpha.IDataRedactionSettings|null|undefined} dataRedactionSettings - * @memberof google.analytics.admin.v1alpha.UpdateDataRedactionSettingsRequest + * UpdateBigQueryLinkRequest bigqueryLink. + * @member {google.analytics.admin.v1alpha.IBigQueryLink|null|undefined} bigqueryLink + * @memberof google.analytics.admin.v1alpha.UpdateBigQueryLinkRequest * @instance */ - UpdateDataRedactionSettingsRequest.prototype.dataRedactionSettings = null; + UpdateBigQueryLinkRequest.prototype.bigqueryLink = null; /** - * UpdateDataRedactionSettingsRequest updateMask. + * UpdateBigQueryLinkRequest updateMask. * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.analytics.admin.v1alpha.UpdateDataRedactionSettingsRequest + * @memberof google.analytics.admin.v1alpha.UpdateBigQueryLinkRequest * @instance */ - UpdateDataRedactionSettingsRequest.prototype.updateMask = null; + UpdateBigQueryLinkRequest.prototype.updateMask = null; /** - * Creates a new UpdateDataRedactionSettingsRequest instance using the specified properties. + * Creates a new UpdateBigQueryLinkRequest instance using the specified properties. * @function create - * @memberof google.analytics.admin.v1alpha.UpdateDataRedactionSettingsRequest + * @memberof google.analytics.admin.v1alpha.UpdateBigQueryLinkRequest * @static - * @param {google.analytics.admin.v1alpha.IUpdateDataRedactionSettingsRequest=} [properties] Properties to set - * @returns {google.analytics.admin.v1alpha.UpdateDataRedactionSettingsRequest} UpdateDataRedactionSettingsRequest instance + * @param {google.analytics.admin.v1alpha.IUpdateBigQueryLinkRequest=} [properties] Properties to set + * @returns {google.analytics.admin.v1alpha.UpdateBigQueryLinkRequest} UpdateBigQueryLinkRequest instance */ - UpdateDataRedactionSettingsRequest.create = function create(properties) { - return new UpdateDataRedactionSettingsRequest(properties); + UpdateBigQueryLinkRequest.create = function create(properties) { + return new UpdateBigQueryLinkRequest(properties); }; /** - * Encodes the specified UpdateDataRedactionSettingsRequest message. Does not implicitly {@link google.analytics.admin.v1alpha.UpdateDataRedactionSettingsRequest.verify|verify} messages. + * Encodes the specified UpdateBigQueryLinkRequest message. Does not implicitly {@link google.analytics.admin.v1alpha.UpdateBigQueryLinkRequest.verify|verify} messages. * @function encode - * @memberof google.analytics.admin.v1alpha.UpdateDataRedactionSettingsRequest + * @memberof google.analytics.admin.v1alpha.UpdateBigQueryLinkRequest * @static - * @param {google.analytics.admin.v1alpha.IUpdateDataRedactionSettingsRequest} message UpdateDataRedactionSettingsRequest message or plain object to encode + * @param {google.analytics.admin.v1alpha.IUpdateBigQueryLinkRequest} message UpdateBigQueryLinkRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateDataRedactionSettingsRequest.encode = function encode(message, writer) { + UpdateBigQueryLinkRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.dataRedactionSettings != null && Object.hasOwnProperty.call(message, "dataRedactionSettings")) - $root.google.analytics.admin.v1alpha.DataRedactionSettings.encode(message.dataRedactionSettings, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.bigqueryLink != null && Object.hasOwnProperty.call(message, "bigqueryLink")) + $root.google.analytics.admin.v1alpha.BigQueryLink.encode(message.bigqueryLink, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified UpdateDataRedactionSettingsRequest message, length delimited. Does not implicitly {@link google.analytics.admin.v1alpha.UpdateDataRedactionSettingsRequest.verify|verify} messages. + * Encodes the specified UpdateBigQueryLinkRequest message, length delimited. Does not implicitly {@link google.analytics.admin.v1alpha.UpdateBigQueryLinkRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.analytics.admin.v1alpha.UpdateDataRedactionSettingsRequest + * @memberof google.analytics.admin.v1alpha.UpdateBigQueryLinkRequest * @static - * @param {google.analytics.admin.v1alpha.IUpdateDataRedactionSettingsRequest} message UpdateDataRedactionSettingsRequest message or plain object to encode + * @param {google.analytics.admin.v1alpha.IUpdateBigQueryLinkRequest} message UpdateBigQueryLinkRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateDataRedactionSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + UpdateBigQueryLinkRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateDataRedactionSettingsRequest message from the specified reader or buffer. + * Decodes an UpdateBigQueryLinkRequest message from the specified reader or buffer. * @function decode - * @memberof google.analytics.admin.v1alpha.UpdateDataRedactionSettingsRequest + * @memberof google.analytics.admin.v1alpha.UpdateBigQueryLinkRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.analytics.admin.v1alpha.UpdateDataRedactionSettingsRequest} UpdateDataRedactionSettingsRequest + * @returns {google.analytics.admin.v1alpha.UpdateBigQueryLinkRequest} UpdateBigQueryLinkRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateDataRedactionSettingsRequest.decode = function decode(reader, length, error) { + UpdateBigQueryLinkRequest.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.admin.v1alpha.UpdateDataRedactionSettingsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.admin.v1alpha.UpdateBigQueryLinkRequest(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { - message.dataRedactionSettings = $root.google.analytics.admin.v1alpha.DataRedactionSettings.decode(reader, reader.uint32()); + message.bigqueryLink = $root.google.analytics.admin.v1alpha.BigQueryLink.decode(reader, reader.uint32()); break; } case 2: { @@ -46068,36 +43999,36 @@ }; /** - * Decodes an UpdateDataRedactionSettingsRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateBigQueryLinkRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.analytics.admin.v1alpha.UpdateDataRedactionSettingsRequest + * @memberof google.analytics.admin.v1alpha.UpdateBigQueryLinkRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.analytics.admin.v1alpha.UpdateDataRedactionSettingsRequest} UpdateDataRedactionSettingsRequest + * @returns {google.analytics.admin.v1alpha.UpdateBigQueryLinkRequest} UpdateBigQueryLinkRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateDataRedactionSettingsRequest.decodeDelimited = function decodeDelimited(reader) { + UpdateBigQueryLinkRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateDataRedactionSettingsRequest message. + * Verifies an UpdateBigQueryLinkRequest message. * @function verify - * @memberof google.analytics.admin.v1alpha.UpdateDataRedactionSettingsRequest + * @memberof google.analytics.admin.v1alpha.UpdateBigQueryLinkRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateDataRedactionSettingsRequest.verify = function verify(message) { + UpdateBigQueryLinkRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.dataRedactionSettings != null && message.hasOwnProperty("dataRedactionSettings")) { - var error = $root.google.analytics.admin.v1alpha.DataRedactionSettings.verify(message.dataRedactionSettings); + if (message.bigqueryLink != null && message.hasOwnProperty("bigqueryLink")) { + var error = $root.google.analytics.admin.v1alpha.BigQueryLink.verify(message.bigqueryLink); if (error) - return "dataRedactionSettings." + error; + return "bigqueryLink." + error; } if (message.updateMask != null && message.hasOwnProperty("updateMask")) { var error = $root.google.protobuf.FieldMask.verify(message.updateMask); @@ -46108,102 +44039,101 @@ }; /** - * Creates an UpdateDataRedactionSettingsRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateBigQueryLinkRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.analytics.admin.v1alpha.UpdateDataRedactionSettingsRequest + * @memberof google.analytics.admin.v1alpha.UpdateBigQueryLinkRequest * @static * @param {Object.} object Plain object - * @returns {google.analytics.admin.v1alpha.UpdateDataRedactionSettingsRequest} UpdateDataRedactionSettingsRequest + * @returns {google.analytics.admin.v1alpha.UpdateBigQueryLinkRequest} UpdateBigQueryLinkRequest */ - UpdateDataRedactionSettingsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.analytics.admin.v1alpha.UpdateDataRedactionSettingsRequest) + UpdateBigQueryLinkRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.admin.v1alpha.UpdateBigQueryLinkRequest) return object; - var message = new $root.google.analytics.admin.v1alpha.UpdateDataRedactionSettingsRequest(); - if (object.dataRedactionSettings != null) { - if (typeof object.dataRedactionSettings !== "object") - throw TypeError(".google.analytics.admin.v1alpha.UpdateDataRedactionSettingsRequest.dataRedactionSettings: object expected"); - message.dataRedactionSettings = $root.google.analytics.admin.v1alpha.DataRedactionSettings.fromObject(object.dataRedactionSettings); + var message = new $root.google.analytics.admin.v1alpha.UpdateBigQueryLinkRequest(); + if (object.bigqueryLink != null) { + if (typeof object.bigqueryLink !== "object") + throw TypeError(".google.analytics.admin.v1alpha.UpdateBigQueryLinkRequest.bigqueryLink: object expected"); + message.bigqueryLink = $root.google.analytics.admin.v1alpha.BigQueryLink.fromObject(object.bigqueryLink); } if (object.updateMask != null) { if (typeof object.updateMask !== "object") - throw TypeError(".google.analytics.admin.v1alpha.UpdateDataRedactionSettingsRequest.updateMask: object expected"); + throw TypeError(".google.analytics.admin.v1alpha.UpdateBigQueryLinkRequest.updateMask: object expected"); message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); } return message; }; /** - * Creates a plain object from an UpdateDataRedactionSettingsRequest message. Also converts values to other types if specified. + * Creates a plain object from an UpdateBigQueryLinkRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.analytics.admin.v1alpha.UpdateDataRedactionSettingsRequest + * @memberof google.analytics.admin.v1alpha.UpdateBigQueryLinkRequest * @static - * @param {google.analytics.admin.v1alpha.UpdateDataRedactionSettingsRequest} message UpdateDataRedactionSettingsRequest + * @param {google.analytics.admin.v1alpha.UpdateBigQueryLinkRequest} message UpdateBigQueryLinkRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateDataRedactionSettingsRequest.toObject = function toObject(message, options) { + UpdateBigQueryLinkRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.dataRedactionSettings = null; + object.bigqueryLink = null; object.updateMask = null; } - if (message.dataRedactionSettings != null && message.hasOwnProperty("dataRedactionSettings")) - object.dataRedactionSettings = $root.google.analytics.admin.v1alpha.DataRedactionSettings.toObject(message.dataRedactionSettings, options); + if (message.bigqueryLink != null && message.hasOwnProperty("bigqueryLink")) + object.bigqueryLink = $root.google.analytics.admin.v1alpha.BigQueryLink.toObject(message.bigqueryLink, options); if (message.updateMask != null && message.hasOwnProperty("updateMask")) object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); return object; }; /** - * Converts this UpdateDataRedactionSettingsRequest to JSON. + * Converts this UpdateBigQueryLinkRequest to JSON. * @function toJSON - * @memberof google.analytics.admin.v1alpha.UpdateDataRedactionSettingsRequest + * @memberof google.analytics.admin.v1alpha.UpdateBigQueryLinkRequest * @instance * @returns {Object.} JSON object */ - UpdateDataRedactionSettingsRequest.prototype.toJSON = function toJSON() { + UpdateBigQueryLinkRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UpdateDataRedactionSettingsRequest + * Gets the default type url for UpdateBigQueryLinkRequest * @function getTypeUrl - * @memberof google.analytics.admin.v1alpha.UpdateDataRedactionSettingsRequest + * @memberof google.analytics.admin.v1alpha.UpdateBigQueryLinkRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UpdateDataRedactionSettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateBigQueryLinkRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.analytics.admin.v1alpha.UpdateDataRedactionSettingsRequest"; + return typeUrlPrefix + "/google.analytics.admin.v1alpha.UpdateBigQueryLinkRequest"; }; - return UpdateDataRedactionSettingsRequest; + return UpdateBigQueryLinkRequest; })(); - v1alpha.CreateConnectedSiteTagRequest = (function() { + v1alpha.DeleteBigQueryLinkRequest = (function() { /** - * Properties of a CreateConnectedSiteTagRequest. + * Properties of a DeleteBigQueryLinkRequest. * @memberof google.analytics.admin.v1alpha - * @interface ICreateConnectedSiteTagRequest - * @property {string|null} [property] CreateConnectedSiteTagRequest property - * @property {google.analytics.admin.v1alpha.IConnectedSiteTag|null} [connectedSiteTag] CreateConnectedSiteTagRequest connectedSiteTag + * @interface IDeleteBigQueryLinkRequest + * @property {string|null} [name] DeleteBigQueryLinkRequest name */ /** - * Constructs a new CreateConnectedSiteTagRequest. + * Constructs a new DeleteBigQueryLinkRequest. * @memberof google.analytics.admin.v1alpha - * @classdesc Represents a CreateConnectedSiteTagRequest. - * @implements ICreateConnectedSiteTagRequest + * @classdesc Represents a DeleteBigQueryLinkRequest. + * @implements IDeleteBigQueryLinkRequest * @constructor - * @param {google.analytics.admin.v1alpha.ICreateConnectedSiteTagRequest=} [properties] Properties to set + * @param {google.analytics.admin.v1alpha.IDeleteBigQueryLinkRequest=} [properties] Properties to set */ - function CreateConnectedSiteTagRequest(properties) { + function DeleteBigQueryLinkRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -46211,91 +44141,77 @@ } /** - * CreateConnectedSiteTagRequest property. - * @member {string} property - * @memberof google.analytics.admin.v1alpha.CreateConnectedSiteTagRequest - * @instance - */ - CreateConnectedSiteTagRequest.prototype.property = ""; - - /** - * CreateConnectedSiteTagRequest connectedSiteTag. - * @member {google.analytics.admin.v1alpha.IConnectedSiteTag|null|undefined} connectedSiteTag - * @memberof google.analytics.admin.v1alpha.CreateConnectedSiteTagRequest + * DeleteBigQueryLinkRequest name. + * @member {string} name + * @memberof google.analytics.admin.v1alpha.DeleteBigQueryLinkRequest * @instance */ - CreateConnectedSiteTagRequest.prototype.connectedSiteTag = null; + DeleteBigQueryLinkRequest.prototype.name = ""; /** - * Creates a new CreateConnectedSiteTagRequest instance using the specified properties. + * Creates a new DeleteBigQueryLinkRequest instance using the specified properties. * @function create - * @memberof google.analytics.admin.v1alpha.CreateConnectedSiteTagRequest + * @memberof google.analytics.admin.v1alpha.DeleteBigQueryLinkRequest * @static - * @param {google.analytics.admin.v1alpha.ICreateConnectedSiteTagRequest=} [properties] Properties to set - * @returns {google.analytics.admin.v1alpha.CreateConnectedSiteTagRequest} CreateConnectedSiteTagRequest instance + * @param {google.analytics.admin.v1alpha.IDeleteBigQueryLinkRequest=} [properties] Properties to set + * @returns {google.analytics.admin.v1alpha.DeleteBigQueryLinkRequest} DeleteBigQueryLinkRequest instance */ - CreateConnectedSiteTagRequest.create = function create(properties) { - return new CreateConnectedSiteTagRequest(properties); + DeleteBigQueryLinkRequest.create = function create(properties) { + return new DeleteBigQueryLinkRequest(properties); }; /** - * Encodes the specified CreateConnectedSiteTagRequest message. Does not implicitly {@link google.analytics.admin.v1alpha.CreateConnectedSiteTagRequest.verify|verify} messages. + * Encodes the specified DeleteBigQueryLinkRequest message. Does not implicitly {@link google.analytics.admin.v1alpha.DeleteBigQueryLinkRequest.verify|verify} messages. * @function encode - * @memberof google.analytics.admin.v1alpha.CreateConnectedSiteTagRequest + * @memberof google.analytics.admin.v1alpha.DeleteBigQueryLinkRequest * @static - * @param {google.analytics.admin.v1alpha.ICreateConnectedSiteTagRequest} message CreateConnectedSiteTagRequest message or plain object to encode + * @param {google.analytics.admin.v1alpha.IDeleteBigQueryLinkRequest} message DeleteBigQueryLinkRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateConnectedSiteTagRequest.encode = function encode(message, writer) { + DeleteBigQueryLinkRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.property != null && Object.hasOwnProperty.call(message, "property")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.property); - if (message.connectedSiteTag != null && Object.hasOwnProperty.call(message, "connectedSiteTag")) - $root.google.analytics.admin.v1alpha.ConnectedSiteTag.encode(message.connectedSiteTag, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified CreateConnectedSiteTagRequest message, length delimited. Does not implicitly {@link google.analytics.admin.v1alpha.CreateConnectedSiteTagRequest.verify|verify} messages. + * Encodes the specified DeleteBigQueryLinkRequest message, length delimited. Does not implicitly {@link google.analytics.admin.v1alpha.DeleteBigQueryLinkRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.analytics.admin.v1alpha.CreateConnectedSiteTagRequest + * @memberof google.analytics.admin.v1alpha.DeleteBigQueryLinkRequest * @static - * @param {google.analytics.admin.v1alpha.ICreateConnectedSiteTagRequest} message CreateConnectedSiteTagRequest message or plain object to encode + * @param {google.analytics.admin.v1alpha.IDeleteBigQueryLinkRequest} message DeleteBigQueryLinkRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateConnectedSiteTagRequest.encodeDelimited = function encodeDelimited(message, writer) { + DeleteBigQueryLinkRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateConnectedSiteTagRequest message from the specified reader or buffer. + * Decodes a DeleteBigQueryLinkRequest message from the specified reader or buffer. * @function decode - * @memberof google.analytics.admin.v1alpha.CreateConnectedSiteTagRequest + * @memberof google.analytics.admin.v1alpha.DeleteBigQueryLinkRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.analytics.admin.v1alpha.CreateConnectedSiteTagRequest} CreateConnectedSiteTagRequest + * @returns {google.analytics.admin.v1alpha.DeleteBigQueryLinkRequest} DeleteBigQueryLinkRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateConnectedSiteTagRequest.decode = function decode(reader, length, error) { + DeleteBigQueryLinkRequest.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.admin.v1alpha.CreateConnectedSiteTagRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.admin.v1alpha.DeleteBigQueryLinkRequest(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { - message.property = reader.string(); - break; - } - case 2: { - message.connectedSiteTag = $root.google.analytics.admin.v1alpha.ConnectedSiteTag.decode(reader, reader.uint32()); + message.name = reader.string(); break; } default: @@ -46307,135 +44223,122 @@ }; /** - * Decodes a CreateConnectedSiteTagRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteBigQueryLinkRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.analytics.admin.v1alpha.CreateConnectedSiteTagRequest + * @memberof google.analytics.admin.v1alpha.DeleteBigQueryLinkRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.analytics.admin.v1alpha.CreateConnectedSiteTagRequest} CreateConnectedSiteTagRequest + * @returns {google.analytics.admin.v1alpha.DeleteBigQueryLinkRequest} DeleteBigQueryLinkRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateConnectedSiteTagRequest.decodeDelimited = function decodeDelimited(reader) { + DeleteBigQueryLinkRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateConnectedSiteTagRequest message. + * Verifies a DeleteBigQueryLinkRequest message. * @function verify - * @memberof google.analytics.admin.v1alpha.CreateConnectedSiteTagRequest + * @memberof google.analytics.admin.v1alpha.DeleteBigQueryLinkRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateConnectedSiteTagRequest.verify = function verify(message) { + DeleteBigQueryLinkRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.property != null && message.hasOwnProperty("property")) - if (!$util.isString(message.property)) - return "property: string expected"; - if (message.connectedSiteTag != null && message.hasOwnProperty("connectedSiteTag")) { - var error = $root.google.analytics.admin.v1alpha.ConnectedSiteTag.verify(message.connectedSiteTag); - if (error) - return "connectedSiteTag." + error; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a CreateConnectedSiteTagRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteBigQueryLinkRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.analytics.admin.v1alpha.CreateConnectedSiteTagRequest + * @memberof google.analytics.admin.v1alpha.DeleteBigQueryLinkRequest * @static * @param {Object.} object Plain object - * @returns {google.analytics.admin.v1alpha.CreateConnectedSiteTagRequest} CreateConnectedSiteTagRequest + * @returns {google.analytics.admin.v1alpha.DeleteBigQueryLinkRequest} DeleteBigQueryLinkRequest */ - CreateConnectedSiteTagRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.analytics.admin.v1alpha.CreateConnectedSiteTagRequest) + DeleteBigQueryLinkRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.admin.v1alpha.DeleteBigQueryLinkRequest) return object; - var message = new $root.google.analytics.admin.v1alpha.CreateConnectedSiteTagRequest(); - if (object.property != null) - message.property = String(object.property); - if (object.connectedSiteTag != null) { - if (typeof object.connectedSiteTag !== "object") - throw TypeError(".google.analytics.admin.v1alpha.CreateConnectedSiteTagRequest.connectedSiteTag: object expected"); - message.connectedSiteTag = $root.google.analytics.admin.v1alpha.ConnectedSiteTag.fromObject(object.connectedSiteTag); - } + var message = new $root.google.analytics.admin.v1alpha.DeleteBigQueryLinkRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a CreateConnectedSiteTagRequest message. Also converts values to other types if specified. + * Creates a plain object from a DeleteBigQueryLinkRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.analytics.admin.v1alpha.CreateConnectedSiteTagRequest + * @memberof google.analytics.admin.v1alpha.DeleteBigQueryLinkRequest * @static - * @param {google.analytics.admin.v1alpha.CreateConnectedSiteTagRequest} message CreateConnectedSiteTagRequest + * @param {google.analytics.admin.v1alpha.DeleteBigQueryLinkRequest} message DeleteBigQueryLinkRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateConnectedSiteTagRequest.toObject = function toObject(message, options) { + DeleteBigQueryLinkRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.property = ""; - object.connectedSiteTag = null; - } - if (message.property != null && message.hasOwnProperty("property")) - object.property = message.property; - if (message.connectedSiteTag != null && message.hasOwnProperty("connectedSiteTag")) - object.connectedSiteTag = $root.google.analytics.admin.v1alpha.ConnectedSiteTag.toObject(message.connectedSiteTag, options); + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this CreateConnectedSiteTagRequest to JSON. + * Converts this DeleteBigQueryLinkRequest to JSON. * @function toJSON - * @memberof google.analytics.admin.v1alpha.CreateConnectedSiteTagRequest + * @memberof google.analytics.admin.v1alpha.DeleteBigQueryLinkRequest * @instance * @returns {Object.} JSON object */ - CreateConnectedSiteTagRequest.prototype.toJSON = function toJSON() { + DeleteBigQueryLinkRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateConnectedSiteTagRequest + * Gets the default type url for DeleteBigQueryLinkRequest * @function getTypeUrl - * @memberof google.analytics.admin.v1alpha.CreateConnectedSiteTagRequest + * @memberof google.analytics.admin.v1alpha.DeleteBigQueryLinkRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateConnectedSiteTagRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DeleteBigQueryLinkRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.analytics.admin.v1alpha.CreateConnectedSiteTagRequest"; + return typeUrlPrefix + "/google.analytics.admin.v1alpha.DeleteBigQueryLinkRequest"; }; - return CreateConnectedSiteTagRequest; + return DeleteBigQueryLinkRequest; })(); - v1alpha.CreateConnectedSiteTagResponse = (function() { + v1alpha.GetEnhancedMeasurementSettingsRequest = (function() { /** - * Properties of a CreateConnectedSiteTagResponse. + * Properties of a GetEnhancedMeasurementSettingsRequest. * @memberof google.analytics.admin.v1alpha - * @interface ICreateConnectedSiteTagResponse + * @interface IGetEnhancedMeasurementSettingsRequest + * @property {string|null} [name] GetEnhancedMeasurementSettingsRequest name */ /** - * Constructs a new CreateConnectedSiteTagResponse. + * Constructs a new GetEnhancedMeasurementSettingsRequest. * @memberof google.analytics.admin.v1alpha - * @classdesc Represents a CreateConnectedSiteTagResponse. - * @implements ICreateConnectedSiteTagResponse + * @classdesc Represents a GetEnhancedMeasurementSettingsRequest. + * @implements IGetEnhancedMeasurementSettingsRequest * @constructor - * @param {google.analytics.admin.v1alpha.ICreateConnectedSiteTagResponse=} [properties] Properties to set + * @param {google.analytics.admin.v1alpha.IGetEnhancedMeasurementSettingsRequest=} [properties] Properties to set */ - function CreateConnectedSiteTagResponse(properties) { + function GetEnhancedMeasurementSettingsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -46443,65 +44346,79 @@ } /** - * Creates a new CreateConnectedSiteTagResponse instance using the specified properties. + * GetEnhancedMeasurementSettingsRequest name. + * @member {string} name + * @memberof google.analytics.admin.v1alpha.GetEnhancedMeasurementSettingsRequest + * @instance + */ + GetEnhancedMeasurementSettingsRequest.prototype.name = ""; + + /** + * Creates a new GetEnhancedMeasurementSettingsRequest instance using the specified properties. * @function create - * @memberof google.analytics.admin.v1alpha.CreateConnectedSiteTagResponse + * @memberof google.analytics.admin.v1alpha.GetEnhancedMeasurementSettingsRequest * @static - * @param {google.analytics.admin.v1alpha.ICreateConnectedSiteTagResponse=} [properties] Properties to set - * @returns {google.analytics.admin.v1alpha.CreateConnectedSiteTagResponse} CreateConnectedSiteTagResponse instance + * @param {google.analytics.admin.v1alpha.IGetEnhancedMeasurementSettingsRequest=} [properties] Properties to set + * @returns {google.analytics.admin.v1alpha.GetEnhancedMeasurementSettingsRequest} GetEnhancedMeasurementSettingsRequest instance */ - CreateConnectedSiteTagResponse.create = function create(properties) { - return new CreateConnectedSiteTagResponse(properties); + GetEnhancedMeasurementSettingsRequest.create = function create(properties) { + return new GetEnhancedMeasurementSettingsRequest(properties); }; /** - * Encodes the specified CreateConnectedSiteTagResponse message. Does not implicitly {@link google.analytics.admin.v1alpha.CreateConnectedSiteTagResponse.verify|verify} messages. + * Encodes the specified GetEnhancedMeasurementSettingsRequest message. Does not implicitly {@link google.analytics.admin.v1alpha.GetEnhancedMeasurementSettingsRequest.verify|verify} messages. * @function encode - * @memberof google.analytics.admin.v1alpha.CreateConnectedSiteTagResponse + * @memberof google.analytics.admin.v1alpha.GetEnhancedMeasurementSettingsRequest * @static - * @param {google.analytics.admin.v1alpha.ICreateConnectedSiteTagResponse} message CreateConnectedSiteTagResponse message or plain object to encode + * @param {google.analytics.admin.v1alpha.IGetEnhancedMeasurementSettingsRequest} message GetEnhancedMeasurementSettingsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateConnectedSiteTagResponse.encode = function encode(message, writer) { + GetEnhancedMeasurementSettingsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified CreateConnectedSiteTagResponse message, length delimited. Does not implicitly {@link google.analytics.admin.v1alpha.CreateConnectedSiteTagResponse.verify|verify} messages. + * Encodes the specified GetEnhancedMeasurementSettingsRequest message, length delimited. Does not implicitly {@link google.analytics.admin.v1alpha.GetEnhancedMeasurementSettingsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.analytics.admin.v1alpha.CreateConnectedSiteTagResponse + * @memberof google.analytics.admin.v1alpha.GetEnhancedMeasurementSettingsRequest * @static - * @param {google.analytics.admin.v1alpha.ICreateConnectedSiteTagResponse} message CreateConnectedSiteTagResponse message or plain object to encode + * @param {google.analytics.admin.v1alpha.IGetEnhancedMeasurementSettingsRequest} message GetEnhancedMeasurementSettingsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateConnectedSiteTagResponse.encodeDelimited = function encodeDelimited(message, writer) { + GetEnhancedMeasurementSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateConnectedSiteTagResponse message from the specified reader or buffer. + * Decodes a GetEnhancedMeasurementSettingsRequest message from the specified reader or buffer. * @function decode - * @memberof google.analytics.admin.v1alpha.CreateConnectedSiteTagResponse + * @memberof google.analytics.admin.v1alpha.GetEnhancedMeasurementSettingsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.analytics.admin.v1alpha.CreateConnectedSiteTagResponse} CreateConnectedSiteTagResponse + * @returns {google.analytics.admin.v1alpha.GetEnhancedMeasurementSettingsRequest} GetEnhancedMeasurementSettingsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateConnectedSiteTagResponse.decode = function decode(reader, length, error) { + GetEnhancedMeasurementSettingsRequest.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.admin.v1alpha.CreateConnectedSiteTagResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.admin.v1alpha.GetEnhancedMeasurementSettingsRequest(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -46511,110 +44428,123 @@ }; /** - * Decodes a CreateConnectedSiteTagResponse message from the specified reader or buffer, length delimited. + * Decodes a GetEnhancedMeasurementSettingsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.analytics.admin.v1alpha.CreateConnectedSiteTagResponse + * @memberof google.analytics.admin.v1alpha.GetEnhancedMeasurementSettingsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.analytics.admin.v1alpha.CreateConnectedSiteTagResponse} CreateConnectedSiteTagResponse + * @returns {google.analytics.admin.v1alpha.GetEnhancedMeasurementSettingsRequest} GetEnhancedMeasurementSettingsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateConnectedSiteTagResponse.decodeDelimited = function decodeDelimited(reader) { + GetEnhancedMeasurementSettingsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateConnectedSiteTagResponse message. + * Verifies a GetEnhancedMeasurementSettingsRequest message. * @function verify - * @memberof google.analytics.admin.v1alpha.CreateConnectedSiteTagResponse + * @memberof google.analytics.admin.v1alpha.GetEnhancedMeasurementSettingsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateConnectedSiteTagResponse.verify = function verify(message) { + GetEnhancedMeasurementSettingsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a CreateConnectedSiteTagResponse message from a plain object. Also converts values to their respective internal types. + * Creates a GetEnhancedMeasurementSettingsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.analytics.admin.v1alpha.CreateConnectedSiteTagResponse + * @memberof google.analytics.admin.v1alpha.GetEnhancedMeasurementSettingsRequest * @static * @param {Object.} object Plain object - * @returns {google.analytics.admin.v1alpha.CreateConnectedSiteTagResponse} CreateConnectedSiteTagResponse + * @returns {google.analytics.admin.v1alpha.GetEnhancedMeasurementSettingsRequest} GetEnhancedMeasurementSettingsRequest */ - CreateConnectedSiteTagResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.analytics.admin.v1alpha.CreateConnectedSiteTagResponse) + GetEnhancedMeasurementSettingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.admin.v1alpha.GetEnhancedMeasurementSettingsRequest) return object; - return new $root.google.analytics.admin.v1alpha.CreateConnectedSiteTagResponse(); + var message = new $root.google.analytics.admin.v1alpha.GetEnhancedMeasurementSettingsRequest(); + if (object.name != null) + message.name = String(object.name); + return message; }; /** - * Creates a plain object from a CreateConnectedSiteTagResponse message. Also converts values to other types if specified. + * Creates a plain object from a GetEnhancedMeasurementSettingsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.analytics.admin.v1alpha.CreateConnectedSiteTagResponse + * @memberof google.analytics.admin.v1alpha.GetEnhancedMeasurementSettingsRequest * @static - * @param {google.analytics.admin.v1alpha.CreateConnectedSiteTagResponse} message CreateConnectedSiteTagResponse + * @param {google.analytics.admin.v1alpha.GetEnhancedMeasurementSettingsRequest} message GetEnhancedMeasurementSettingsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateConnectedSiteTagResponse.toObject = function toObject() { - return {}; + GetEnhancedMeasurementSettingsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; }; /** - * Converts this CreateConnectedSiteTagResponse to JSON. + * Converts this GetEnhancedMeasurementSettingsRequest to JSON. * @function toJSON - * @memberof google.analytics.admin.v1alpha.CreateConnectedSiteTagResponse + * @memberof google.analytics.admin.v1alpha.GetEnhancedMeasurementSettingsRequest * @instance * @returns {Object.} JSON object */ - CreateConnectedSiteTagResponse.prototype.toJSON = function toJSON() { + GetEnhancedMeasurementSettingsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateConnectedSiteTagResponse + * Gets the default type url for GetEnhancedMeasurementSettingsRequest * @function getTypeUrl - * @memberof google.analytics.admin.v1alpha.CreateConnectedSiteTagResponse + * @memberof google.analytics.admin.v1alpha.GetEnhancedMeasurementSettingsRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateConnectedSiteTagResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetEnhancedMeasurementSettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.analytics.admin.v1alpha.CreateConnectedSiteTagResponse"; + return typeUrlPrefix + "/google.analytics.admin.v1alpha.GetEnhancedMeasurementSettingsRequest"; }; - return CreateConnectedSiteTagResponse; + return GetEnhancedMeasurementSettingsRequest; })(); - v1alpha.DeleteConnectedSiteTagRequest = (function() { + v1alpha.UpdateEnhancedMeasurementSettingsRequest = (function() { /** - * Properties of a DeleteConnectedSiteTagRequest. + * Properties of an UpdateEnhancedMeasurementSettingsRequest. * @memberof google.analytics.admin.v1alpha - * @interface IDeleteConnectedSiteTagRequest - * @property {string|null} [property] DeleteConnectedSiteTagRequest property - * @property {string|null} [tagId] DeleteConnectedSiteTagRequest tagId + * @interface IUpdateEnhancedMeasurementSettingsRequest + * @property {google.analytics.admin.v1alpha.IEnhancedMeasurementSettings|null} [enhancedMeasurementSettings] UpdateEnhancedMeasurementSettingsRequest enhancedMeasurementSettings + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateEnhancedMeasurementSettingsRequest updateMask */ /** - * Constructs a new DeleteConnectedSiteTagRequest. + * Constructs a new UpdateEnhancedMeasurementSettingsRequest. * @memberof google.analytics.admin.v1alpha - * @classdesc Represents a DeleteConnectedSiteTagRequest. - * @implements IDeleteConnectedSiteTagRequest + * @classdesc Represents an UpdateEnhancedMeasurementSettingsRequest. + * @implements IUpdateEnhancedMeasurementSettingsRequest * @constructor - * @param {google.analytics.admin.v1alpha.IDeleteConnectedSiteTagRequest=} [properties] Properties to set + * @param {google.analytics.admin.v1alpha.IUpdateEnhancedMeasurementSettingsRequest=} [properties] Properties to set */ - function DeleteConnectedSiteTagRequest(properties) { + function UpdateEnhancedMeasurementSettingsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -46622,91 +44552,91 @@ } /** - * DeleteConnectedSiteTagRequest property. - * @member {string} property - * @memberof google.analytics.admin.v1alpha.DeleteConnectedSiteTagRequest + * UpdateEnhancedMeasurementSettingsRequest enhancedMeasurementSettings. + * @member {google.analytics.admin.v1alpha.IEnhancedMeasurementSettings|null|undefined} enhancedMeasurementSettings + * @memberof google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest * @instance */ - DeleteConnectedSiteTagRequest.prototype.property = ""; + UpdateEnhancedMeasurementSettingsRequest.prototype.enhancedMeasurementSettings = null; /** - * DeleteConnectedSiteTagRequest tagId. - * @member {string} tagId - * @memberof google.analytics.admin.v1alpha.DeleteConnectedSiteTagRequest + * UpdateEnhancedMeasurementSettingsRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest * @instance */ - DeleteConnectedSiteTagRequest.prototype.tagId = ""; + UpdateEnhancedMeasurementSettingsRequest.prototype.updateMask = null; /** - * Creates a new DeleteConnectedSiteTagRequest instance using the specified properties. + * Creates a new UpdateEnhancedMeasurementSettingsRequest instance using the specified properties. * @function create - * @memberof google.analytics.admin.v1alpha.DeleteConnectedSiteTagRequest + * @memberof google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest * @static - * @param {google.analytics.admin.v1alpha.IDeleteConnectedSiteTagRequest=} [properties] Properties to set - * @returns {google.analytics.admin.v1alpha.DeleteConnectedSiteTagRequest} DeleteConnectedSiteTagRequest instance + * @param {google.analytics.admin.v1alpha.IUpdateEnhancedMeasurementSettingsRequest=} [properties] Properties to set + * @returns {google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest} UpdateEnhancedMeasurementSettingsRequest instance */ - DeleteConnectedSiteTagRequest.create = function create(properties) { - return new DeleteConnectedSiteTagRequest(properties); + UpdateEnhancedMeasurementSettingsRequest.create = function create(properties) { + return new UpdateEnhancedMeasurementSettingsRequest(properties); }; /** - * Encodes the specified DeleteConnectedSiteTagRequest message. Does not implicitly {@link google.analytics.admin.v1alpha.DeleteConnectedSiteTagRequest.verify|verify} messages. + * Encodes the specified UpdateEnhancedMeasurementSettingsRequest message. Does not implicitly {@link google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest.verify|verify} messages. * @function encode - * @memberof google.analytics.admin.v1alpha.DeleteConnectedSiteTagRequest + * @memberof google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest * @static - * @param {google.analytics.admin.v1alpha.IDeleteConnectedSiteTagRequest} message DeleteConnectedSiteTagRequest message or plain object to encode + * @param {google.analytics.admin.v1alpha.IUpdateEnhancedMeasurementSettingsRequest} message UpdateEnhancedMeasurementSettingsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteConnectedSiteTagRequest.encode = function encode(message, writer) { + UpdateEnhancedMeasurementSettingsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.property != null && Object.hasOwnProperty.call(message, "property")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.property); - if (message.tagId != null && Object.hasOwnProperty.call(message, "tagId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.tagId); + if (message.enhancedMeasurementSettings != null && Object.hasOwnProperty.call(message, "enhancedMeasurementSettings")) + $root.google.analytics.admin.v1alpha.EnhancedMeasurementSettings.encode(message.enhancedMeasurementSettings, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified DeleteConnectedSiteTagRequest message, length delimited. Does not implicitly {@link google.analytics.admin.v1alpha.DeleteConnectedSiteTagRequest.verify|verify} messages. + * Encodes the specified UpdateEnhancedMeasurementSettingsRequest message, length delimited. Does not implicitly {@link google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.analytics.admin.v1alpha.DeleteConnectedSiteTagRequest + * @memberof google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest * @static - * @param {google.analytics.admin.v1alpha.IDeleteConnectedSiteTagRequest} message DeleteConnectedSiteTagRequest message or plain object to encode + * @param {google.analytics.admin.v1alpha.IUpdateEnhancedMeasurementSettingsRequest} message UpdateEnhancedMeasurementSettingsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteConnectedSiteTagRequest.encodeDelimited = function encodeDelimited(message, writer) { + UpdateEnhancedMeasurementSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteConnectedSiteTagRequest message from the specified reader or buffer. + * Decodes an UpdateEnhancedMeasurementSettingsRequest message from the specified reader or buffer. * @function decode - * @memberof google.analytics.admin.v1alpha.DeleteConnectedSiteTagRequest + * @memberof google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.analytics.admin.v1alpha.DeleteConnectedSiteTagRequest} DeleteConnectedSiteTagRequest + * @returns {google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest} UpdateEnhancedMeasurementSettingsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteConnectedSiteTagRequest.decode = function decode(reader, length, error) { + UpdateEnhancedMeasurementSettingsRequest.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.admin.v1alpha.DeleteConnectedSiteTagRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { - message.property = reader.string(); + message.enhancedMeasurementSettings = $root.google.analytics.admin.v1alpha.EnhancedMeasurementSettings.decode(reader, reader.uint32()); break; } case 2: { - message.tagId = reader.string(); + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; } default: @@ -46718,131 +44648,141 @@ }; /** - * Decodes a DeleteConnectedSiteTagRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateEnhancedMeasurementSettingsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.analytics.admin.v1alpha.DeleteConnectedSiteTagRequest + * @memberof google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.analytics.admin.v1alpha.DeleteConnectedSiteTagRequest} DeleteConnectedSiteTagRequest + * @returns {google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest} UpdateEnhancedMeasurementSettingsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteConnectedSiteTagRequest.decodeDelimited = function decodeDelimited(reader) { + UpdateEnhancedMeasurementSettingsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteConnectedSiteTagRequest message. + * Verifies an UpdateEnhancedMeasurementSettingsRequest message. * @function verify - * @memberof google.analytics.admin.v1alpha.DeleteConnectedSiteTagRequest + * @memberof google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteConnectedSiteTagRequest.verify = function verify(message) { + UpdateEnhancedMeasurementSettingsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.property != null && message.hasOwnProperty("property")) - if (!$util.isString(message.property)) - return "property: string expected"; - if (message.tagId != null && message.hasOwnProperty("tagId")) - if (!$util.isString(message.tagId)) - return "tagId: string expected"; + if (message.enhancedMeasurementSettings != null && message.hasOwnProperty("enhancedMeasurementSettings")) { + var error = $root.google.analytics.admin.v1alpha.EnhancedMeasurementSettings.verify(message.enhancedMeasurementSettings); + if (error) + return "enhancedMeasurementSettings." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } return null; }; /** - * Creates a DeleteConnectedSiteTagRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateEnhancedMeasurementSettingsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.analytics.admin.v1alpha.DeleteConnectedSiteTagRequest + * @memberof google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest * @static * @param {Object.} object Plain object - * @returns {google.analytics.admin.v1alpha.DeleteConnectedSiteTagRequest} DeleteConnectedSiteTagRequest + * @returns {google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest} UpdateEnhancedMeasurementSettingsRequest */ - DeleteConnectedSiteTagRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.analytics.admin.v1alpha.DeleteConnectedSiteTagRequest) + UpdateEnhancedMeasurementSettingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest) return object; - var message = new $root.google.analytics.admin.v1alpha.DeleteConnectedSiteTagRequest(); - if (object.property != null) - message.property = String(object.property); - if (object.tagId != null) - message.tagId = String(object.tagId); + var message = new $root.google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest(); + if (object.enhancedMeasurementSettings != null) { + if (typeof object.enhancedMeasurementSettings !== "object") + throw TypeError(".google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest.enhancedMeasurementSettings: object expected"); + message.enhancedMeasurementSettings = $root.google.analytics.admin.v1alpha.EnhancedMeasurementSettings.fromObject(object.enhancedMeasurementSettings); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } return message; }; /** - * Creates a plain object from a DeleteConnectedSiteTagRequest message. Also converts values to other types if specified. + * Creates a plain object from an UpdateEnhancedMeasurementSettingsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.analytics.admin.v1alpha.DeleteConnectedSiteTagRequest + * @memberof google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest * @static - * @param {google.analytics.admin.v1alpha.DeleteConnectedSiteTagRequest} message DeleteConnectedSiteTagRequest + * @param {google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest} message UpdateEnhancedMeasurementSettingsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteConnectedSiteTagRequest.toObject = function toObject(message, options) { + UpdateEnhancedMeasurementSettingsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.property = ""; - object.tagId = ""; + object.enhancedMeasurementSettings = null; + object.updateMask = null; } - if (message.property != null && message.hasOwnProperty("property")) - object.property = message.property; - if (message.tagId != null && message.hasOwnProperty("tagId")) - object.tagId = message.tagId; + if (message.enhancedMeasurementSettings != null && message.hasOwnProperty("enhancedMeasurementSettings")) + object.enhancedMeasurementSettings = $root.google.analytics.admin.v1alpha.EnhancedMeasurementSettings.toObject(message.enhancedMeasurementSettings, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); return object; }; /** - * Converts this DeleteConnectedSiteTagRequest to JSON. + * Converts this UpdateEnhancedMeasurementSettingsRequest to JSON. * @function toJSON - * @memberof google.analytics.admin.v1alpha.DeleteConnectedSiteTagRequest + * @memberof google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest * @instance * @returns {Object.} JSON object */ - DeleteConnectedSiteTagRequest.prototype.toJSON = function toJSON() { + UpdateEnhancedMeasurementSettingsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DeleteConnectedSiteTagRequest + * Gets the default type url for UpdateEnhancedMeasurementSettingsRequest * @function getTypeUrl - * @memberof google.analytics.admin.v1alpha.DeleteConnectedSiteTagRequest + * @memberof google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DeleteConnectedSiteTagRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateEnhancedMeasurementSettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.analytics.admin.v1alpha.DeleteConnectedSiteTagRequest"; + return typeUrlPrefix + "/google.analytics.admin.v1alpha.UpdateEnhancedMeasurementSettingsRequest"; }; - return DeleteConnectedSiteTagRequest; + return UpdateEnhancedMeasurementSettingsRequest; })(); - v1alpha.ListConnectedSiteTagsRequest = (function() { + v1alpha.GetDataRedactionSettingsRequest = (function() { /** - * Properties of a ListConnectedSiteTagsRequest. + * Properties of a GetDataRedactionSettingsRequest. * @memberof google.analytics.admin.v1alpha - * @interface IListConnectedSiteTagsRequest - * @property {string|null} [property] ListConnectedSiteTagsRequest property + * @interface IGetDataRedactionSettingsRequest + * @property {string|null} [name] GetDataRedactionSettingsRequest name */ /** - * Constructs a new ListConnectedSiteTagsRequest. + * Constructs a new GetDataRedactionSettingsRequest. * @memberof google.analytics.admin.v1alpha - * @classdesc Represents a ListConnectedSiteTagsRequest. - * @implements IListConnectedSiteTagsRequest + * @classdesc Represents a GetDataRedactionSettingsRequest. + * @implements IGetDataRedactionSettingsRequest * @constructor - * @param {google.analytics.admin.v1alpha.IListConnectedSiteTagsRequest=} [properties] Properties to set + * @param {google.analytics.admin.v1alpha.IGetDataRedactionSettingsRequest=} [properties] Properties to set */ - function ListConnectedSiteTagsRequest(properties) { + function GetDataRedactionSettingsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -46850,77 +44790,77 @@ } /** - * ListConnectedSiteTagsRequest property. - * @member {string} property - * @memberof google.analytics.admin.v1alpha.ListConnectedSiteTagsRequest + * GetDataRedactionSettingsRequest name. + * @member {string} name + * @memberof google.analytics.admin.v1alpha.GetDataRedactionSettingsRequest * @instance */ - ListConnectedSiteTagsRequest.prototype.property = ""; + GetDataRedactionSettingsRequest.prototype.name = ""; /** - * Creates a new ListConnectedSiteTagsRequest instance using the specified properties. + * Creates a new GetDataRedactionSettingsRequest instance using the specified properties. * @function create - * @memberof google.analytics.admin.v1alpha.ListConnectedSiteTagsRequest + * @memberof google.analytics.admin.v1alpha.GetDataRedactionSettingsRequest * @static - * @param {google.analytics.admin.v1alpha.IListConnectedSiteTagsRequest=} [properties] Properties to set - * @returns {google.analytics.admin.v1alpha.ListConnectedSiteTagsRequest} ListConnectedSiteTagsRequest instance + * @param {google.analytics.admin.v1alpha.IGetDataRedactionSettingsRequest=} [properties] Properties to set + * @returns {google.analytics.admin.v1alpha.GetDataRedactionSettingsRequest} GetDataRedactionSettingsRequest instance */ - ListConnectedSiteTagsRequest.create = function create(properties) { - return new ListConnectedSiteTagsRequest(properties); + GetDataRedactionSettingsRequest.create = function create(properties) { + return new GetDataRedactionSettingsRequest(properties); }; /** - * Encodes the specified ListConnectedSiteTagsRequest message. Does not implicitly {@link google.analytics.admin.v1alpha.ListConnectedSiteTagsRequest.verify|verify} messages. + * Encodes the specified GetDataRedactionSettingsRequest message. Does not implicitly {@link google.analytics.admin.v1alpha.GetDataRedactionSettingsRequest.verify|verify} messages. * @function encode - * @memberof google.analytics.admin.v1alpha.ListConnectedSiteTagsRequest + * @memberof google.analytics.admin.v1alpha.GetDataRedactionSettingsRequest * @static - * @param {google.analytics.admin.v1alpha.IListConnectedSiteTagsRequest} message ListConnectedSiteTagsRequest message or plain object to encode + * @param {google.analytics.admin.v1alpha.IGetDataRedactionSettingsRequest} message GetDataRedactionSettingsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListConnectedSiteTagsRequest.encode = function encode(message, writer) { + GetDataRedactionSettingsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.property != null && Object.hasOwnProperty.call(message, "property")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.property); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified ListConnectedSiteTagsRequest message, length delimited. Does not implicitly {@link google.analytics.admin.v1alpha.ListConnectedSiteTagsRequest.verify|verify} messages. + * Encodes the specified GetDataRedactionSettingsRequest message, length delimited. Does not implicitly {@link google.analytics.admin.v1alpha.GetDataRedactionSettingsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.analytics.admin.v1alpha.ListConnectedSiteTagsRequest + * @memberof google.analytics.admin.v1alpha.GetDataRedactionSettingsRequest * @static - * @param {google.analytics.admin.v1alpha.IListConnectedSiteTagsRequest} message ListConnectedSiteTagsRequest message or plain object to encode + * @param {google.analytics.admin.v1alpha.IGetDataRedactionSettingsRequest} message GetDataRedactionSettingsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListConnectedSiteTagsRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetDataRedactionSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListConnectedSiteTagsRequest message from the specified reader or buffer. + * Decodes a GetDataRedactionSettingsRequest message from the specified reader or buffer. * @function decode - * @memberof google.analytics.admin.v1alpha.ListConnectedSiteTagsRequest + * @memberof google.analytics.admin.v1alpha.GetDataRedactionSettingsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.analytics.admin.v1alpha.ListConnectedSiteTagsRequest} ListConnectedSiteTagsRequest + * @returns {google.analytics.admin.v1alpha.GetDataRedactionSettingsRequest} GetDataRedactionSettingsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListConnectedSiteTagsRequest.decode = function decode(reader, length, error) { + GetDataRedactionSettingsRequest.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.admin.v1alpha.ListConnectedSiteTagsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.admin.v1alpha.GetDataRedactionSettingsRequest(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { - message.property = reader.string(); + message.name = reader.string(); break; } default: @@ -46932,123 +44872,123 @@ }; /** - * Decodes a ListConnectedSiteTagsRequest message from the specified reader or buffer, length delimited. + * Decodes a GetDataRedactionSettingsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.analytics.admin.v1alpha.ListConnectedSiteTagsRequest + * @memberof google.analytics.admin.v1alpha.GetDataRedactionSettingsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.analytics.admin.v1alpha.ListConnectedSiteTagsRequest} ListConnectedSiteTagsRequest + * @returns {google.analytics.admin.v1alpha.GetDataRedactionSettingsRequest} GetDataRedactionSettingsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListConnectedSiteTagsRequest.decodeDelimited = function decodeDelimited(reader) { + GetDataRedactionSettingsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListConnectedSiteTagsRequest message. + * Verifies a GetDataRedactionSettingsRequest message. * @function verify - * @memberof google.analytics.admin.v1alpha.ListConnectedSiteTagsRequest + * @memberof google.analytics.admin.v1alpha.GetDataRedactionSettingsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListConnectedSiteTagsRequest.verify = function verify(message) { + GetDataRedactionSettingsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.property != null && message.hasOwnProperty("property")) - if (!$util.isString(message.property)) - return "property: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a ListConnectedSiteTagsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetDataRedactionSettingsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.analytics.admin.v1alpha.ListConnectedSiteTagsRequest + * @memberof google.analytics.admin.v1alpha.GetDataRedactionSettingsRequest * @static * @param {Object.} object Plain object - * @returns {google.analytics.admin.v1alpha.ListConnectedSiteTagsRequest} ListConnectedSiteTagsRequest + * @returns {google.analytics.admin.v1alpha.GetDataRedactionSettingsRequest} GetDataRedactionSettingsRequest */ - ListConnectedSiteTagsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.analytics.admin.v1alpha.ListConnectedSiteTagsRequest) + GetDataRedactionSettingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.admin.v1alpha.GetDataRedactionSettingsRequest) return object; - var message = new $root.google.analytics.admin.v1alpha.ListConnectedSiteTagsRequest(); - if (object.property != null) - message.property = String(object.property); + var message = new $root.google.analytics.admin.v1alpha.GetDataRedactionSettingsRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a ListConnectedSiteTagsRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetDataRedactionSettingsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.analytics.admin.v1alpha.ListConnectedSiteTagsRequest + * @memberof google.analytics.admin.v1alpha.GetDataRedactionSettingsRequest * @static - * @param {google.analytics.admin.v1alpha.ListConnectedSiteTagsRequest} message ListConnectedSiteTagsRequest + * @param {google.analytics.admin.v1alpha.GetDataRedactionSettingsRequest} message GetDataRedactionSettingsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListConnectedSiteTagsRequest.toObject = function toObject(message, options) { + GetDataRedactionSettingsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) - object.property = ""; - if (message.property != null && message.hasOwnProperty("property")) - object.property = message.property; + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this ListConnectedSiteTagsRequest to JSON. + * Converts this GetDataRedactionSettingsRequest to JSON. * @function toJSON - * @memberof google.analytics.admin.v1alpha.ListConnectedSiteTagsRequest + * @memberof google.analytics.admin.v1alpha.GetDataRedactionSettingsRequest * @instance * @returns {Object.} JSON object */ - ListConnectedSiteTagsRequest.prototype.toJSON = function toJSON() { + GetDataRedactionSettingsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListConnectedSiteTagsRequest + * Gets the default type url for GetDataRedactionSettingsRequest * @function getTypeUrl - * @memberof google.analytics.admin.v1alpha.ListConnectedSiteTagsRequest + * @memberof google.analytics.admin.v1alpha.GetDataRedactionSettingsRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListConnectedSiteTagsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetDataRedactionSettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.analytics.admin.v1alpha.ListConnectedSiteTagsRequest"; + return typeUrlPrefix + "/google.analytics.admin.v1alpha.GetDataRedactionSettingsRequest"; }; - return ListConnectedSiteTagsRequest; + return GetDataRedactionSettingsRequest; })(); - v1alpha.ListConnectedSiteTagsResponse = (function() { + v1alpha.UpdateDataRedactionSettingsRequest = (function() { /** - * Properties of a ListConnectedSiteTagsResponse. + * Properties of an UpdateDataRedactionSettingsRequest. * @memberof google.analytics.admin.v1alpha - * @interface IListConnectedSiteTagsResponse - * @property {Array.|null} [connectedSiteTags] ListConnectedSiteTagsResponse connectedSiteTags + * @interface IUpdateDataRedactionSettingsRequest + * @property {google.analytics.admin.v1alpha.IDataRedactionSettings|null} [dataRedactionSettings] UpdateDataRedactionSettingsRequest dataRedactionSettings + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateDataRedactionSettingsRequest updateMask */ /** - * Constructs a new ListConnectedSiteTagsResponse. + * Constructs a new UpdateDataRedactionSettingsRequest. * @memberof google.analytics.admin.v1alpha - * @classdesc Represents a ListConnectedSiteTagsResponse. - * @implements IListConnectedSiteTagsResponse + * @classdesc Represents an UpdateDataRedactionSettingsRequest. + * @implements IUpdateDataRedactionSettingsRequest * @constructor - * @param {google.analytics.admin.v1alpha.IListConnectedSiteTagsResponse=} [properties] Properties to set + * @param {google.analytics.admin.v1alpha.IUpdateDataRedactionSettingsRequest=} [properties] Properties to set */ - function ListConnectedSiteTagsResponse(properties) { - this.connectedSiteTags = []; + function UpdateDataRedactionSettingsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -47056,80 +44996,91 @@ } /** - * ListConnectedSiteTagsResponse connectedSiteTags. - * @member {Array.} connectedSiteTags - * @memberof google.analytics.admin.v1alpha.ListConnectedSiteTagsResponse + * UpdateDataRedactionSettingsRequest dataRedactionSettings. + * @member {google.analytics.admin.v1alpha.IDataRedactionSettings|null|undefined} dataRedactionSettings + * @memberof google.analytics.admin.v1alpha.UpdateDataRedactionSettingsRequest + * @instance + */ + UpdateDataRedactionSettingsRequest.prototype.dataRedactionSettings = null; + + /** + * UpdateDataRedactionSettingsRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.analytics.admin.v1alpha.UpdateDataRedactionSettingsRequest * @instance */ - ListConnectedSiteTagsResponse.prototype.connectedSiteTags = $util.emptyArray; + UpdateDataRedactionSettingsRequest.prototype.updateMask = null; /** - * Creates a new ListConnectedSiteTagsResponse instance using the specified properties. + * Creates a new UpdateDataRedactionSettingsRequest instance using the specified properties. * @function create - * @memberof google.analytics.admin.v1alpha.ListConnectedSiteTagsResponse + * @memberof google.analytics.admin.v1alpha.UpdateDataRedactionSettingsRequest * @static - * @param {google.analytics.admin.v1alpha.IListConnectedSiteTagsResponse=} [properties] Properties to set - * @returns {google.analytics.admin.v1alpha.ListConnectedSiteTagsResponse} ListConnectedSiteTagsResponse instance + * @param {google.analytics.admin.v1alpha.IUpdateDataRedactionSettingsRequest=} [properties] Properties to set + * @returns {google.analytics.admin.v1alpha.UpdateDataRedactionSettingsRequest} UpdateDataRedactionSettingsRequest instance */ - ListConnectedSiteTagsResponse.create = function create(properties) { - return new ListConnectedSiteTagsResponse(properties); + UpdateDataRedactionSettingsRequest.create = function create(properties) { + return new UpdateDataRedactionSettingsRequest(properties); }; /** - * Encodes the specified ListConnectedSiteTagsResponse message. Does not implicitly {@link google.analytics.admin.v1alpha.ListConnectedSiteTagsResponse.verify|verify} messages. + * Encodes the specified UpdateDataRedactionSettingsRequest message. Does not implicitly {@link google.analytics.admin.v1alpha.UpdateDataRedactionSettingsRequest.verify|verify} messages. * @function encode - * @memberof google.analytics.admin.v1alpha.ListConnectedSiteTagsResponse + * @memberof google.analytics.admin.v1alpha.UpdateDataRedactionSettingsRequest * @static - * @param {google.analytics.admin.v1alpha.IListConnectedSiteTagsResponse} message ListConnectedSiteTagsResponse message or plain object to encode + * @param {google.analytics.admin.v1alpha.IUpdateDataRedactionSettingsRequest} message UpdateDataRedactionSettingsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListConnectedSiteTagsResponse.encode = function encode(message, writer) { + UpdateDataRedactionSettingsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.connectedSiteTags != null && message.connectedSiteTags.length) - for (var i = 0; i < message.connectedSiteTags.length; ++i) - $root.google.analytics.admin.v1alpha.ConnectedSiteTag.encode(message.connectedSiteTags[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.dataRedactionSettings != null && Object.hasOwnProperty.call(message, "dataRedactionSettings")) + $root.google.analytics.admin.v1alpha.DataRedactionSettings.encode(message.dataRedactionSettings, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListConnectedSiteTagsResponse message, length delimited. Does not implicitly {@link google.analytics.admin.v1alpha.ListConnectedSiteTagsResponse.verify|verify} messages. + * Encodes the specified UpdateDataRedactionSettingsRequest message, length delimited. Does not implicitly {@link google.analytics.admin.v1alpha.UpdateDataRedactionSettingsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.analytics.admin.v1alpha.ListConnectedSiteTagsResponse + * @memberof google.analytics.admin.v1alpha.UpdateDataRedactionSettingsRequest * @static - * @param {google.analytics.admin.v1alpha.IListConnectedSiteTagsResponse} message ListConnectedSiteTagsResponse message or plain object to encode + * @param {google.analytics.admin.v1alpha.IUpdateDataRedactionSettingsRequest} message UpdateDataRedactionSettingsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListConnectedSiteTagsResponse.encodeDelimited = function encodeDelimited(message, writer) { + UpdateDataRedactionSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListConnectedSiteTagsResponse message from the specified reader or buffer. + * Decodes an UpdateDataRedactionSettingsRequest message from the specified reader or buffer. * @function decode - * @memberof google.analytics.admin.v1alpha.ListConnectedSiteTagsResponse + * @memberof google.analytics.admin.v1alpha.UpdateDataRedactionSettingsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.analytics.admin.v1alpha.ListConnectedSiteTagsResponse} ListConnectedSiteTagsResponse + * @returns {google.analytics.admin.v1alpha.UpdateDataRedactionSettingsRequest} UpdateDataRedactionSettingsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListConnectedSiteTagsResponse.decode = function decode(reader, length, error) { + UpdateDataRedactionSettingsRequest.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.admin.v1alpha.ListConnectedSiteTagsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.admin.v1alpha.UpdateDataRedactionSettingsRequest(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { - if (!(message.connectedSiteTags && message.connectedSiteTags.length)) - message.connectedSiteTags = []; - message.connectedSiteTags.push($root.google.analytics.admin.v1alpha.ConnectedSiteTag.decode(reader, reader.uint32())); + message.dataRedactionSettings = $root.google.analytics.admin.v1alpha.DataRedactionSettings.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; } default: @@ -47141,119 +45092,121 @@ }; /** - * Decodes a ListConnectedSiteTagsResponse message from the specified reader or buffer, length delimited. + * Decodes an UpdateDataRedactionSettingsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.analytics.admin.v1alpha.ListConnectedSiteTagsResponse + * @memberof google.analytics.admin.v1alpha.UpdateDataRedactionSettingsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.analytics.admin.v1alpha.ListConnectedSiteTagsResponse} ListConnectedSiteTagsResponse + * @returns {google.analytics.admin.v1alpha.UpdateDataRedactionSettingsRequest} UpdateDataRedactionSettingsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListConnectedSiteTagsResponse.decodeDelimited = function decodeDelimited(reader) { + UpdateDataRedactionSettingsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListConnectedSiteTagsResponse message. + * Verifies an UpdateDataRedactionSettingsRequest message. * @function verify - * @memberof google.analytics.admin.v1alpha.ListConnectedSiteTagsResponse + * @memberof google.analytics.admin.v1alpha.UpdateDataRedactionSettingsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListConnectedSiteTagsResponse.verify = function verify(message) { + UpdateDataRedactionSettingsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.connectedSiteTags != null && message.hasOwnProperty("connectedSiteTags")) { - if (!Array.isArray(message.connectedSiteTags)) - return "connectedSiteTags: array expected"; - for (var i = 0; i < message.connectedSiteTags.length; ++i) { - var error = $root.google.analytics.admin.v1alpha.ConnectedSiteTag.verify(message.connectedSiteTags[i]); - if (error) - return "connectedSiteTags." + error; - } + if (message.dataRedactionSettings != null && message.hasOwnProperty("dataRedactionSettings")) { + var error = $root.google.analytics.admin.v1alpha.DataRedactionSettings.verify(message.dataRedactionSettings); + if (error) + return "dataRedactionSettings." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; } return null; }; /** - * Creates a ListConnectedSiteTagsResponse message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateDataRedactionSettingsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.analytics.admin.v1alpha.ListConnectedSiteTagsResponse + * @memberof google.analytics.admin.v1alpha.UpdateDataRedactionSettingsRequest * @static * @param {Object.} object Plain object - * @returns {google.analytics.admin.v1alpha.ListConnectedSiteTagsResponse} ListConnectedSiteTagsResponse + * @returns {google.analytics.admin.v1alpha.UpdateDataRedactionSettingsRequest} UpdateDataRedactionSettingsRequest */ - ListConnectedSiteTagsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.analytics.admin.v1alpha.ListConnectedSiteTagsResponse) + UpdateDataRedactionSettingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.admin.v1alpha.UpdateDataRedactionSettingsRequest) return object; - var message = new $root.google.analytics.admin.v1alpha.ListConnectedSiteTagsResponse(); - if (object.connectedSiteTags) { - if (!Array.isArray(object.connectedSiteTags)) - throw TypeError(".google.analytics.admin.v1alpha.ListConnectedSiteTagsResponse.connectedSiteTags: array expected"); - message.connectedSiteTags = []; - for (var i = 0; i < object.connectedSiteTags.length; ++i) { - if (typeof object.connectedSiteTags[i] !== "object") - throw TypeError(".google.analytics.admin.v1alpha.ListConnectedSiteTagsResponse.connectedSiteTags: object expected"); - message.connectedSiteTags[i] = $root.google.analytics.admin.v1alpha.ConnectedSiteTag.fromObject(object.connectedSiteTags[i]); - } + var message = new $root.google.analytics.admin.v1alpha.UpdateDataRedactionSettingsRequest(); + if (object.dataRedactionSettings != null) { + if (typeof object.dataRedactionSettings !== "object") + throw TypeError(".google.analytics.admin.v1alpha.UpdateDataRedactionSettingsRequest.dataRedactionSettings: object expected"); + message.dataRedactionSettings = $root.google.analytics.admin.v1alpha.DataRedactionSettings.fromObject(object.dataRedactionSettings); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.analytics.admin.v1alpha.UpdateDataRedactionSettingsRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); } return message; }; /** - * Creates a plain object from a ListConnectedSiteTagsResponse message. Also converts values to other types if specified. + * Creates a plain object from an UpdateDataRedactionSettingsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.analytics.admin.v1alpha.ListConnectedSiteTagsResponse + * @memberof google.analytics.admin.v1alpha.UpdateDataRedactionSettingsRequest * @static - * @param {google.analytics.admin.v1alpha.ListConnectedSiteTagsResponse} message ListConnectedSiteTagsResponse + * @param {google.analytics.admin.v1alpha.UpdateDataRedactionSettingsRequest} message UpdateDataRedactionSettingsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListConnectedSiteTagsResponse.toObject = function toObject(message, options) { + UpdateDataRedactionSettingsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.connectedSiteTags = []; - if (message.connectedSiteTags && message.connectedSiteTags.length) { - object.connectedSiteTags = []; - for (var j = 0; j < message.connectedSiteTags.length; ++j) - object.connectedSiteTags[j] = $root.google.analytics.admin.v1alpha.ConnectedSiteTag.toObject(message.connectedSiteTags[j], options); + if (options.defaults) { + object.dataRedactionSettings = null; + object.updateMask = null; } + if (message.dataRedactionSettings != null && message.hasOwnProperty("dataRedactionSettings")) + object.dataRedactionSettings = $root.google.analytics.admin.v1alpha.DataRedactionSettings.toObject(message.dataRedactionSettings, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); return object; }; /** - * Converts this ListConnectedSiteTagsResponse to JSON. + * Converts this UpdateDataRedactionSettingsRequest to JSON. * @function toJSON - * @memberof google.analytics.admin.v1alpha.ListConnectedSiteTagsResponse + * @memberof google.analytics.admin.v1alpha.UpdateDataRedactionSettingsRequest * @instance * @returns {Object.} JSON object */ - ListConnectedSiteTagsResponse.prototype.toJSON = function toJSON() { + UpdateDataRedactionSettingsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListConnectedSiteTagsResponse + * Gets the default type url for UpdateDataRedactionSettingsRequest * @function getTypeUrl - * @memberof google.analytics.admin.v1alpha.ListConnectedSiteTagsResponse + * @memberof google.analytics.admin.v1alpha.UpdateDataRedactionSettingsRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListConnectedSiteTagsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateDataRedactionSettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.analytics.admin.v1alpha.ListConnectedSiteTagsResponse"; + return typeUrlPrefix + "/google.analytics.admin.v1alpha.UpdateDataRedactionSettingsRequest"; }; - return ListConnectedSiteTagsResponse; + return UpdateDataRedactionSettingsRequest; })(); v1alpha.CreateAdSenseLinkRequest = (function() { @@ -48402,416 +46355,6 @@ return ListAdSenseLinksResponse; })(); - v1alpha.FetchConnectedGa4PropertyRequest = (function() { - - /** - * Properties of a FetchConnectedGa4PropertyRequest. - * @memberof google.analytics.admin.v1alpha - * @interface IFetchConnectedGa4PropertyRequest - * @property {string|null} [property] FetchConnectedGa4PropertyRequest property - */ - - /** - * Constructs a new FetchConnectedGa4PropertyRequest. - * @memberof google.analytics.admin.v1alpha - * @classdesc Represents a FetchConnectedGa4PropertyRequest. - * @implements IFetchConnectedGa4PropertyRequest - * @constructor - * @param {google.analytics.admin.v1alpha.IFetchConnectedGa4PropertyRequest=} [properties] Properties to set - */ - function FetchConnectedGa4PropertyRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FetchConnectedGa4PropertyRequest property. - * @member {string} property - * @memberof google.analytics.admin.v1alpha.FetchConnectedGa4PropertyRequest - * @instance - */ - FetchConnectedGa4PropertyRequest.prototype.property = ""; - - /** - * Creates a new FetchConnectedGa4PropertyRequest instance using the specified properties. - * @function create - * @memberof google.analytics.admin.v1alpha.FetchConnectedGa4PropertyRequest - * @static - * @param {google.analytics.admin.v1alpha.IFetchConnectedGa4PropertyRequest=} [properties] Properties to set - * @returns {google.analytics.admin.v1alpha.FetchConnectedGa4PropertyRequest} FetchConnectedGa4PropertyRequest instance - */ - FetchConnectedGa4PropertyRequest.create = function create(properties) { - return new FetchConnectedGa4PropertyRequest(properties); - }; - - /** - * Encodes the specified FetchConnectedGa4PropertyRequest message. Does not implicitly {@link google.analytics.admin.v1alpha.FetchConnectedGa4PropertyRequest.verify|verify} messages. - * @function encode - * @memberof google.analytics.admin.v1alpha.FetchConnectedGa4PropertyRequest - * @static - * @param {google.analytics.admin.v1alpha.IFetchConnectedGa4PropertyRequest} message FetchConnectedGa4PropertyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FetchConnectedGa4PropertyRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.property != null && Object.hasOwnProperty.call(message, "property")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.property); - return writer; - }; - - /** - * Encodes the specified FetchConnectedGa4PropertyRequest message, length delimited. Does not implicitly {@link google.analytics.admin.v1alpha.FetchConnectedGa4PropertyRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.analytics.admin.v1alpha.FetchConnectedGa4PropertyRequest - * @static - * @param {google.analytics.admin.v1alpha.IFetchConnectedGa4PropertyRequest} message FetchConnectedGa4PropertyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FetchConnectedGa4PropertyRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FetchConnectedGa4PropertyRequest message from the specified reader or buffer. - * @function decode - * @memberof google.analytics.admin.v1alpha.FetchConnectedGa4PropertyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.analytics.admin.v1alpha.FetchConnectedGa4PropertyRequest} FetchConnectedGa4PropertyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FetchConnectedGa4PropertyRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.admin.v1alpha.FetchConnectedGa4PropertyRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.property = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FetchConnectedGa4PropertyRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.analytics.admin.v1alpha.FetchConnectedGa4PropertyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.analytics.admin.v1alpha.FetchConnectedGa4PropertyRequest} FetchConnectedGa4PropertyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FetchConnectedGa4PropertyRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FetchConnectedGa4PropertyRequest message. - * @function verify - * @memberof google.analytics.admin.v1alpha.FetchConnectedGa4PropertyRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FetchConnectedGa4PropertyRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.property != null && message.hasOwnProperty("property")) - if (!$util.isString(message.property)) - return "property: string expected"; - return null; - }; - - /** - * Creates a FetchConnectedGa4PropertyRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.analytics.admin.v1alpha.FetchConnectedGa4PropertyRequest - * @static - * @param {Object.} object Plain object - * @returns {google.analytics.admin.v1alpha.FetchConnectedGa4PropertyRequest} FetchConnectedGa4PropertyRequest - */ - FetchConnectedGa4PropertyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.analytics.admin.v1alpha.FetchConnectedGa4PropertyRequest) - return object; - var message = new $root.google.analytics.admin.v1alpha.FetchConnectedGa4PropertyRequest(); - if (object.property != null) - message.property = String(object.property); - return message; - }; - - /** - * Creates a plain object from a FetchConnectedGa4PropertyRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.analytics.admin.v1alpha.FetchConnectedGa4PropertyRequest - * @static - * @param {google.analytics.admin.v1alpha.FetchConnectedGa4PropertyRequest} message FetchConnectedGa4PropertyRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FetchConnectedGa4PropertyRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.property = ""; - if (message.property != null && message.hasOwnProperty("property")) - object.property = message.property; - return object; - }; - - /** - * Converts this FetchConnectedGa4PropertyRequest to JSON. - * @function toJSON - * @memberof google.analytics.admin.v1alpha.FetchConnectedGa4PropertyRequest - * @instance - * @returns {Object.} JSON object - */ - FetchConnectedGa4PropertyRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FetchConnectedGa4PropertyRequest - * @function getTypeUrl - * @memberof google.analytics.admin.v1alpha.FetchConnectedGa4PropertyRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FetchConnectedGa4PropertyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.analytics.admin.v1alpha.FetchConnectedGa4PropertyRequest"; - }; - - return FetchConnectedGa4PropertyRequest; - })(); - - v1alpha.FetchConnectedGa4PropertyResponse = (function() { - - /** - * Properties of a FetchConnectedGa4PropertyResponse. - * @memberof google.analytics.admin.v1alpha - * @interface IFetchConnectedGa4PropertyResponse - * @property {string|null} [property] FetchConnectedGa4PropertyResponse property - */ - - /** - * Constructs a new FetchConnectedGa4PropertyResponse. - * @memberof google.analytics.admin.v1alpha - * @classdesc Represents a FetchConnectedGa4PropertyResponse. - * @implements IFetchConnectedGa4PropertyResponse - * @constructor - * @param {google.analytics.admin.v1alpha.IFetchConnectedGa4PropertyResponse=} [properties] Properties to set - */ - function FetchConnectedGa4PropertyResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FetchConnectedGa4PropertyResponse property. - * @member {string} property - * @memberof google.analytics.admin.v1alpha.FetchConnectedGa4PropertyResponse - * @instance - */ - FetchConnectedGa4PropertyResponse.prototype.property = ""; - - /** - * Creates a new FetchConnectedGa4PropertyResponse instance using the specified properties. - * @function create - * @memberof google.analytics.admin.v1alpha.FetchConnectedGa4PropertyResponse - * @static - * @param {google.analytics.admin.v1alpha.IFetchConnectedGa4PropertyResponse=} [properties] Properties to set - * @returns {google.analytics.admin.v1alpha.FetchConnectedGa4PropertyResponse} FetchConnectedGa4PropertyResponse instance - */ - FetchConnectedGa4PropertyResponse.create = function create(properties) { - return new FetchConnectedGa4PropertyResponse(properties); - }; - - /** - * Encodes the specified FetchConnectedGa4PropertyResponse message. Does not implicitly {@link google.analytics.admin.v1alpha.FetchConnectedGa4PropertyResponse.verify|verify} messages. - * @function encode - * @memberof google.analytics.admin.v1alpha.FetchConnectedGa4PropertyResponse - * @static - * @param {google.analytics.admin.v1alpha.IFetchConnectedGa4PropertyResponse} message FetchConnectedGa4PropertyResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FetchConnectedGa4PropertyResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.property != null && Object.hasOwnProperty.call(message, "property")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.property); - return writer; - }; - - /** - * Encodes the specified FetchConnectedGa4PropertyResponse message, length delimited. Does not implicitly {@link google.analytics.admin.v1alpha.FetchConnectedGa4PropertyResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.analytics.admin.v1alpha.FetchConnectedGa4PropertyResponse - * @static - * @param {google.analytics.admin.v1alpha.IFetchConnectedGa4PropertyResponse} message FetchConnectedGa4PropertyResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FetchConnectedGa4PropertyResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FetchConnectedGa4PropertyResponse message from the specified reader or buffer. - * @function decode - * @memberof google.analytics.admin.v1alpha.FetchConnectedGa4PropertyResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.analytics.admin.v1alpha.FetchConnectedGa4PropertyResponse} FetchConnectedGa4PropertyResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FetchConnectedGa4PropertyResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.admin.v1alpha.FetchConnectedGa4PropertyResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.property = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FetchConnectedGa4PropertyResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.analytics.admin.v1alpha.FetchConnectedGa4PropertyResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.analytics.admin.v1alpha.FetchConnectedGa4PropertyResponse} FetchConnectedGa4PropertyResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FetchConnectedGa4PropertyResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FetchConnectedGa4PropertyResponse message. - * @function verify - * @memberof google.analytics.admin.v1alpha.FetchConnectedGa4PropertyResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FetchConnectedGa4PropertyResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.property != null && message.hasOwnProperty("property")) - if (!$util.isString(message.property)) - return "property: string expected"; - return null; - }; - - /** - * Creates a FetchConnectedGa4PropertyResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.analytics.admin.v1alpha.FetchConnectedGa4PropertyResponse - * @static - * @param {Object.} object Plain object - * @returns {google.analytics.admin.v1alpha.FetchConnectedGa4PropertyResponse} FetchConnectedGa4PropertyResponse - */ - FetchConnectedGa4PropertyResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.analytics.admin.v1alpha.FetchConnectedGa4PropertyResponse) - return object; - var message = new $root.google.analytics.admin.v1alpha.FetchConnectedGa4PropertyResponse(); - if (object.property != null) - message.property = String(object.property); - return message; - }; - - /** - * Creates a plain object from a FetchConnectedGa4PropertyResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.analytics.admin.v1alpha.FetchConnectedGa4PropertyResponse - * @static - * @param {google.analytics.admin.v1alpha.FetchConnectedGa4PropertyResponse} message FetchConnectedGa4PropertyResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FetchConnectedGa4PropertyResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.property = ""; - if (message.property != null && message.hasOwnProperty("property")) - object.property = message.property; - return object; - }; - - /** - * Converts this FetchConnectedGa4PropertyResponse to JSON. - * @function toJSON - * @memberof google.analytics.admin.v1alpha.FetchConnectedGa4PropertyResponse - * @instance - * @returns {Object.} JSON object - */ - FetchConnectedGa4PropertyResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FetchConnectedGa4PropertyResponse - * @function getTypeUrl - * @memberof google.analytics.admin.v1alpha.FetchConnectedGa4PropertyResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FetchConnectedGa4PropertyResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.analytics.admin.v1alpha.FetchConnectedGa4PropertyResponse"; - }; - - return FetchConnectedGa4PropertyResponse; - })(); - v1alpha.CreateEventCreateRuleRequest = (function() { /** @@ -58286,6 +55829,211 @@ return UpdateSubpropertySyncConfigRequest; })(); + v1alpha.GetReportingIdentitySettingsRequest = (function() { + + /** + * Properties of a GetReportingIdentitySettingsRequest. + * @memberof google.analytics.admin.v1alpha + * @interface IGetReportingIdentitySettingsRequest + * @property {string|null} [name] GetReportingIdentitySettingsRequest name + */ + + /** + * Constructs a new GetReportingIdentitySettingsRequest. + * @memberof google.analytics.admin.v1alpha + * @classdesc Represents a GetReportingIdentitySettingsRequest. + * @implements IGetReportingIdentitySettingsRequest + * @constructor + * @param {google.analytics.admin.v1alpha.IGetReportingIdentitySettingsRequest=} [properties] Properties to set + */ + function GetReportingIdentitySettingsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetReportingIdentitySettingsRequest name. + * @member {string} name + * @memberof google.analytics.admin.v1alpha.GetReportingIdentitySettingsRequest + * @instance + */ + GetReportingIdentitySettingsRequest.prototype.name = ""; + + /** + * Creates a new GetReportingIdentitySettingsRequest instance using the specified properties. + * @function create + * @memberof google.analytics.admin.v1alpha.GetReportingIdentitySettingsRequest + * @static + * @param {google.analytics.admin.v1alpha.IGetReportingIdentitySettingsRequest=} [properties] Properties to set + * @returns {google.analytics.admin.v1alpha.GetReportingIdentitySettingsRequest} GetReportingIdentitySettingsRequest instance + */ + GetReportingIdentitySettingsRequest.create = function create(properties) { + return new GetReportingIdentitySettingsRequest(properties); + }; + + /** + * Encodes the specified GetReportingIdentitySettingsRequest message. Does not implicitly {@link google.analytics.admin.v1alpha.GetReportingIdentitySettingsRequest.verify|verify} messages. + * @function encode + * @memberof google.analytics.admin.v1alpha.GetReportingIdentitySettingsRequest + * @static + * @param {google.analytics.admin.v1alpha.IGetReportingIdentitySettingsRequest} message GetReportingIdentitySettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetReportingIdentitySettingsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetReportingIdentitySettingsRequest message, length delimited. Does not implicitly {@link google.analytics.admin.v1alpha.GetReportingIdentitySettingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.admin.v1alpha.GetReportingIdentitySettingsRequest + * @static + * @param {google.analytics.admin.v1alpha.IGetReportingIdentitySettingsRequest} message GetReportingIdentitySettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetReportingIdentitySettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetReportingIdentitySettingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.admin.v1alpha.GetReportingIdentitySettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.admin.v1alpha.GetReportingIdentitySettingsRequest} GetReportingIdentitySettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetReportingIdentitySettingsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.admin.v1alpha.GetReportingIdentitySettingsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetReportingIdentitySettingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.admin.v1alpha.GetReportingIdentitySettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.admin.v1alpha.GetReportingIdentitySettingsRequest} GetReportingIdentitySettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetReportingIdentitySettingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetReportingIdentitySettingsRequest message. + * @function verify + * @memberof google.analytics.admin.v1alpha.GetReportingIdentitySettingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetReportingIdentitySettingsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetReportingIdentitySettingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.admin.v1alpha.GetReportingIdentitySettingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.admin.v1alpha.GetReportingIdentitySettingsRequest} GetReportingIdentitySettingsRequest + */ + GetReportingIdentitySettingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.admin.v1alpha.GetReportingIdentitySettingsRequest) + return object; + var message = new $root.google.analytics.admin.v1alpha.GetReportingIdentitySettingsRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetReportingIdentitySettingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.admin.v1alpha.GetReportingIdentitySettingsRequest + * @static + * @param {google.analytics.admin.v1alpha.GetReportingIdentitySettingsRequest} message GetReportingIdentitySettingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetReportingIdentitySettingsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetReportingIdentitySettingsRequest to JSON. + * @function toJSON + * @memberof google.analytics.admin.v1alpha.GetReportingIdentitySettingsRequest + * @instance + * @returns {Object.} JSON object + */ + GetReportingIdentitySettingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetReportingIdentitySettingsRequest + * @function getTypeUrl + * @memberof google.analytics.admin.v1alpha.GetReportingIdentitySettingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetReportingIdentitySettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.admin.v1alpha.GetReportingIdentitySettingsRequest"; + }; + + return GetReportingIdentitySettingsRequest; + })(); + /** * AudienceFilterScope enum. * @name google.analytics.admin.v1alpha.AudienceFilterScope @@ -67978,6 +65726,7 @@ * @property {number} CALCULATED_METRIC=31 CALCULATED_METRIC value * @property {number} REPORTING_DATA_ANNOTATION=32 REPORTING_DATA_ANNOTATION value * @property {number} SUBPROPERTY_SYNC_CONFIG=33 SUBPROPERTY_SYNC_CONFIG value + * @property {number} REPORTING_IDENTITY_SETTINGS=34 REPORTING_IDENTITY_SETTINGS value */ v1alpha.ChangeHistoryResourceType = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -68010,6 +65759,7 @@ values[valuesById[31] = "CALCULATED_METRIC"] = 31; values[valuesById[32] = "REPORTING_DATA_ANNOTATION"] = 32; values[valuesById[33] = "SUBPROPERTY_SYNC_CONFIG"] = 33; + values[valuesById[34] = "REPORTING_IDENTITY_SETTINGS"] = 34; return values; })(); @@ -74385,6 +72135,7 @@ * @property {google.analytics.admin.v1alpha.ICalculatedMetric|null} [calculatedMetric] ChangeHistoryResource calculatedMetric * @property {google.analytics.admin.v1alpha.IReportingDataAnnotation|null} [reportingDataAnnotation] ChangeHistoryResource reportingDataAnnotation * @property {google.analytics.admin.v1alpha.ISubpropertySyncConfig|null} [subpropertySyncConfig] ChangeHistoryResource subpropertySyncConfig + * @property {google.analytics.admin.v1alpha.IReportingIdentitySettings|null} [reportingIdentitySettings] ChangeHistoryResource reportingIdentitySettings */ /** @@ -74626,17 +72377,25 @@ */ ChangeHistoryResource.prototype.subpropertySyncConfig = null; + /** + * ChangeHistoryResource reportingIdentitySettings. + * @member {google.analytics.admin.v1alpha.IReportingIdentitySettings|null|undefined} reportingIdentitySettings + * @memberof google.analytics.admin.v1alpha.ChangeHistoryChange.ChangeHistoryResource + * @instance + */ + ChangeHistoryResource.prototype.reportingIdentitySettings = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; /** * ChangeHistoryResource resource. - * @member {"account"|"property"|"firebaseLink"|"googleAdsLink"|"googleSignalsSettings"|"displayVideo_360AdvertiserLink"|"displayVideo_360AdvertiserLinkProposal"|"conversionEvent"|"measurementProtocolSecret"|"customDimension"|"customMetric"|"dataRetentionSettings"|"searchAds_360Link"|"dataStream"|"attributionSettings"|"expandedDataSet"|"channelGroup"|"bigqueryLink"|"enhancedMeasurementSettings"|"dataRedactionSettings"|"skadnetworkConversionValueSchema"|"adsenseLink"|"audience"|"eventCreateRule"|"keyEvent"|"calculatedMetric"|"reportingDataAnnotation"|"subpropertySyncConfig"|undefined} resource + * @member {"account"|"property"|"firebaseLink"|"googleAdsLink"|"googleSignalsSettings"|"displayVideo_360AdvertiserLink"|"displayVideo_360AdvertiserLinkProposal"|"conversionEvent"|"measurementProtocolSecret"|"customDimension"|"customMetric"|"dataRetentionSettings"|"searchAds_360Link"|"dataStream"|"attributionSettings"|"expandedDataSet"|"channelGroup"|"bigqueryLink"|"enhancedMeasurementSettings"|"dataRedactionSettings"|"skadnetworkConversionValueSchema"|"adsenseLink"|"audience"|"eventCreateRule"|"keyEvent"|"calculatedMetric"|"reportingDataAnnotation"|"subpropertySyncConfig"|"reportingIdentitySettings"|undefined} resource * @memberof google.analytics.admin.v1alpha.ChangeHistoryChange.ChangeHistoryResource * @instance */ Object.defineProperty(ChangeHistoryResource.prototype, "resource", { - get: $util.oneOfGetter($oneOfFields = ["account", "property", "firebaseLink", "googleAdsLink", "googleSignalsSettings", "displayVideo_360AdvertiserLink", "displayVideo_360AdvertiserLinkProposal", "conversionEvent", "measurementProtocolSecret", "customDimension", "customMetric", "dataRetentionSettings", "searchAds_360Link", "dataStream", "attributionSettings", "expandedDataSet", "channelGroup", "bigqueryLink", "enhancedMeasurementSettings", "dataRedactionSettings", "skadnetworkConversionValueSchema", "adsenseLink", "audience", "eventCreateRule", "keyEvent", "calculatedMetric", "reportingDataAnnotation", "subpropertySyncConfig"]), + get: $util.oneOfGetter($oneOfFields = ["account", "property", "firebaseLink", "googleAdsLink", "googleSignalsSettings", "displayVideo_360AdvertiserLink", "displayVideo_360AdvertiserLinkProposal", "conversionEvent", "measurementProtocolSecret", "customDimension", "customMetric", "dataRetentionSettings", "searchAds_360Link", "dataStream", "attributionSettings", "expandedDataSet", "channelGroup", "bigqueryLink", "enhancedMeasurementSettings", "dataRedactionSettings", "skadnetworkConversionValueSchema", "adsenseLink", "audience", "eventCreateRule", "keyEvent", "calculatedMetric", "reportingDataAnnotation", "subpropertySyncConfig", "reportingIdentitySettings"]), set: $util.oneOfSetter($oneOfFields) }); @@ -74720,6 +72479,8 @@ $root.google.analytics.admin.v1alpha.ReportingDataAnnotation.encode(message.reportingDataAnnotation, writer.uint32(/* id 32, wireType 2 =*/258).fork()).ldelim(); if (message.subpropertySyncConfig != null && Object.hasOwnProperty.call(message, "subpropertySyncConfig")) $root.google.analytics.admin.v1alpha.SubpropertySyncConfig.encode(message.subpropertySyncConfig, writer.uint32(/* id 33, wireType 2 =*/266).fork()).ldelim(); + if (message.reportingIdentitySettings != null && Object.hasOwnProperty.call(message, "reportingIdentitySettings")) + $root.google.analytics.admin.v1alpha.ReportingIdentitySettings.encode(message.reportingIdentitySettings, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); return writer; }; @@ -74868,6 +72629,10 @@ message.subpropertySyncConfig = $root.google.analytics.admin.v1alpha.SubpropertySyncConfig.decode(reader, reader.uint32()); break; } + case 34: { + message.reportingIdentitySettings = $root.google.analytics.admin.v1alpha.ReportingIdentitySettings.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -75182,6 +72947,16 @@ return "subpropertySyncConfig." + error; } } + if (message.reportingIdentitySettings != null && message.hasOwnProperty("reportingIdentitySettings")) { + if (properties.resource === 1) + return "resource: multiple values"; + properties.resource = 1; + { + var error = $root.google.analytics.admin.v1alpha.ReportingIdentitySettings.verify(message.reportingIdentitySettings); + if (error) + return "reportingIdentitySettings." + error; + } + } return null; }; @@ -75337,6 +73112,11 @@ throw TypeError(".google.analytics.admin.v1alpha.ChangeHistoryChange.ChangeHistoryResource.subpropertySyncConfig: object expected"); message.subpropertySyncConfig = $root.google.analytics.admin.v1alpha.SubpropertySyncConfig.fromObject(object.subpropertySyncConfig); } + if (object.reportingIdentitySettings != null) { + if (typeof object.reportingIdentitySettings !== "object") + throw TypeError(".google.analytics.admin.v1alpha.ChangeHistoryChange.ChangeHistoryResource.reportingIdentitySettings: object expected"); + message.reportingIdentitySettings = $root.google.analytics.admin.v1alpha.ReportingIdentitySettings.fromObject(object.reportingIdentitySettings); + } return message; }; @@ -75493,6 +73273,11 @@ if (options.oneofs) object.resource = "subpropertySyncConfig"; } + if (message.reportingIdentitySettings != null && message.hasOwnProperty("reportingIdentitySettings")) { + object.reportingIdentitySettings = $root.google.analytics.admin.v1alpha.ReportingIdentitySettings.toObject(message.reportingIdentitySettings, options); + if (options.oneofs) + object.resource = "reportingIdentitySettings"; + } return object; }; @@ -81981,235 +79766,6 @@ return EnhancedMeasurementSettings; })(); - v1alpha.ConnectedSiteTag = (function() { - - /** - * Properties of a ConnectedSiteTag. - * @memberof google.analytics.admin.v1alpha - * @interface IConnectedSiteTag - * @property {string|null} [displayName] ConnectedSiteTag displayName - * @property {string|null} [tagId] ConnectedSiteTag tagId - */ - - /** - * Constructs a new ConnectedSiteTag. - * @memberof google.analytics.admin.v1alpha - * @classdesc Represents a ConnectedSiteTag. - * @implements IConnectedSiteTag - * @constructor - * @param {google.analytics.admin.v1alpha.IConnectedSiteTag=} [properties] Properties to set - */ - function ConnectedSiteTag(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ConnectedSiteTag displayName. - * @member {string} displayName - * @memberof google.analytics.admin.v1alpha.ConnectedSiteTag - * @instance - */ - ConnectedSiteTag.prototype.displayName = ""; - - /** - * ConnectedSiteTag tagId. - * @member {string} tagId - * @memberof google.analytics.admin.v1alpha.ConnectedSiteTag - * @instance - */ - ConnectedSiteTag.prototype.tagId = ""; - - /** - * Creates a new ConnectedSiteTag instance using the specified properties. - * @function create - * @memberof google.analytics.admin.v1alpha.ConnectedSiteTag - * @static - * @param {google.analytics.admin.v1alpha.IConnectedSiteTag=} [properties] Properties to set - * @returns {google.analytics.admin.v1alpha.ConnectedSiteTag} ConnectedSiteTag instance - */ - ConnectedSiteTag.create = function create(properties) { - return new ConnectedSiteTag(properties); - }; - - /** - * Encodes the specified ConnectedSiteTag message. Does not implicitly {@link google.analytics.admin.v1alpha.ConnectedSiteTag.verify|verify} messages. - * @function encode - * @memberof google.analytics.admin.v1alpha.ConnectedSiteTag - * @static - * @param {google.analytics.admin.v1alpha.IConnectedSiteTag} message ConnectedSiteTag message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConnectedSiteTag.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); - if (message.tagId != null && Object.hasOwnProperty.call(message, "tagId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.tagId); - return writer; - }; - - /** - * Encodes the specified ConnectedSiteTag message, length delimited. Does not implicitly {@link google.analytics.admin.v1alpha.ConnectedSiteTag.verify|verify} messages. - * @function encodeDelimited - * @memberof google.analytics.admin.v1alpha.ConnectedSiteTag - * @static - * @param {google.analytics.admin.v1alpha.IConnectedSiteTag} message ConnectedSiteTag message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConnectedSiteTag.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ConnectedSiteTag message from the specified reader or buffer. - * @function decode - * @memberof google.analytics.admin.v1alpha.ConnectedSiteTag - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.analytics.admin.v1alpha.ConnectedSiteTag} ConnectedSiteTag - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConnectedSiteTag.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.admin.v1alpha.ConnectedSiteTag(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.displayName = reader.string(); - break; - } - case 2: { - message.tagId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ConnectedSiteTag message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.analytics.admin.v1alpha.ConnectedSiteTag - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.analytics.admin.v1alpha.ConnectedSiteTag} ConnectedSiteTag - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConnectedSiteTag.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ConnectedSiteTag message. - * @function verify - * @memberof google.analytics.admin.v1alpha.ConnectedSiteTag - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ConnectedSiteTag.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.tagId != null && message.hasOwnProperty("tagId")) - if (!$util.isString(message.tagId)) - return "tagId: string expected"; - return null; - }; - - /** - * Creates a ConnectedSiteTag message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.analytics.admin.v1alpha.ConnectedSiteTag - * @static - * @param {Object.} object Plain object - * @returns {google.analytics.admin.v1alpha.ConnectedSiteTag} ConnectedSiteTag - */ - ConnectedSiteTag.fromObject = function fromObject(object) { - if (object instanceof $root.google.analytics.admin.v1alpha.ConnectedSiteTag) - return object; - var message = new $root.google.analytics.admin.v1alpha.ConnectedSiteTag(); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.tagId != null) - message.tagId = String(object.tagId); - return message; - }; - - /** - * Creates a plain object from a ConnectedSiteTag message. Also converts values to other types if specified. - * @function toObject - * @memberof google.analytics.admin.v1alpha.ConnectedSiteTag - * @static - * @param {google.analytics.admin.v1alpha.ConnectedSiteTag} message ConnectedSiteTag - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ConnectedSiteTag.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.displayName = ""; - object.tagId = ""; - } - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.tagId != null && message.hasOwnProperty("tagId")) - object.tagId = message.tagId; - return object; - }; - - /** - * Converts this ConnectedSiteTag to JSON. - * @function toJSON - * @memberof google.analytics.admin.v1alpha.ConnectedSiteTag - * @instance - * @returns {Object.} JSON object - */ - ConnectedSiteTag.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ConnectedSiteTag - * @function getTypeUrl - * @memberof google.analytics.admin.v1alpha.ConnectedSiteTag - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ConnectedSiteTag.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.analytics.admin.v1alpha.ConnectedSiteTag"; - }; - - return ConnectedSiteTag; - })(); - v1alpha.DataRedactionSettings = (function() { /** @@ -83947,6 +81503,282 @@ return SubpropertySyncConfig; })(); + v1alpha.ReportingIdentitySettings = (function() { + + /** + * Properties of a ReportingIdentitySettings. + * @memberof google.analytics.admin.v1alpha + * @interface IReportingIdentitySettings + * @property {string|null} [name] ReportingIdentitySettings name + * @property {google.analytics.admin.v1alpha.ReportingIdentitySettings.ReportingIdentity|null} [reportingIdentity] ReportingIdentitySettings reportingIdentity + */ + + /** + * Constructs a new ReportingIdentitySettings. + * @memberof google.analytics.admin.v1alpha + * @classdesc Represents a ReportingIdentitySettings. + * @implements IReportingIdentitySettings + * @constructor + * @param {google.analytics.admin.v1alpha.IReportingIdentitySettings=} [properties] Properties to set + */ + function ReportingIdentitySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReportingIdentitySettings name. + * @member {string} name + * @memberof google.analytics.admin.v1alpha.ReportingIdentitySettings + * @instance + */ + ReportingIdentitySettings.prototype.name = ""; + + /** + * ReportingIdentitySettings reportingIdentity. + * @member {google.analytics.admin.v1alpha.ReportingIdentitySettings.ReportingIdentity} reportingIdentity + * @memberof google.analytics.admin.v1alpha.ReportingIdentitySettings + * @instance + */ + ReportingIdentitySettings.prototype.reportingIdentity = 0; + + /** + * Creates a new ReportingIdentitySettings instance using the specified properties. + * @function create + * @memberof google.analytics.admin.v1alpha.ReportingIdentitySettings + * @static + * @param {google.analytics.admin.v1alpha.IReportingIdentitySettings=} [properties] Properties to set + * @returns {google.analytics.admin.v1alpha.ReportingIdentitySettings} ReportingIdentitySettings instance + */ + ReportingIdentitySettings.create = function create(properties) { + return new ReportingIdentitySettings(properties); + }; + + /** + * Encodes the specified ReportingIdentitySettings message. Does not implicitly {@link google.analytics.admin.v1alpha.ReportingIdentitySettings.verify|verify} messages. + * @function encode + * @memberof google.analytics.admin.v1alpha.ReportingIdentitySettings + * @static + * @param {google.analytics.admin.v1alpha.IReportingIdentitySettings} message ReportingIdentitySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReportingIdentitySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.reportingIdentity != null && Object.hasOwnProperty.call(message, "reportingIdentity")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.reportingIdentity); + return writer; + }; + + /** + * Encodes the specified ReportingIdentitySettings message, length delimited. Does not implicitly {@link google.analytics.admin.v1alpha.ReportingIdentitySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.admin.v1alpha.ReportingIdentitySettings + * @static + * @param {google.analytics.admin.v1alpha.IReportingIdentitySettings} message ReportingIdentitySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReportingIdentitySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReportingIdentitySettings message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.admin.v1alpha.ReportingIdentitySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.admin.v1alpha.ReportingIdentitySettings} ReportingIdentitySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReportingIdentitySettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.analytics.admin.v1alpha.ReportingIdentitySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.reportingIdentity = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReportingIdentitySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.admin.v1alpha.ReportingIdentitySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.admin.v1alpha.ReportingIdentitySettings} ReportingIdentitySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReportingIdentitySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReportingIdentitySettings message. + * @function verify + * @memberof google.analytics.admin.v1alpha.ReportingIdentitySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReportingIdentitySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.reportingIdentity != null && message.hasOwnProperty("reportingIdentity")) + switch (message.reportingIdentity) { + default: + return "reportingIdentity: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a ReportingIdentitySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.admin.v1alpha.ReportingIdentitySettings + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.admin.v1alpha.ReportingIdentitySettings} ReportingIdentitySettings + */ + ReportingIdentitySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.admin.v1alpha.ReportingIdentitySettings) + return object; + var message = new $root.google.analytics.admin.v1alpha.ReportingIdentitySettings(); + if (object.name != null) + message.name = String(object.name); + switch (object.reportingIdentity) { + default: + if (typeof object.reportingIdentity === "number") { + message.reportingIdentity = object.reportingIdentity; + break; + } + break; + case "IDENTITY_BLENDING_STRATEGY_UNSPECIFIED": + case 0: + message.reportingIdentity = 0; + break; + case "BLENDED": + case 1: + message.reportingIdentity = 1; + break; + case "OBSERVED": + case 2: + message.reportingIdentity = 2; + break; + case "DEVICE_BASED": + case 3: + message.reportingIdentity = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a ReportingIdentitySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.admin.v1alpha.ReportingIdentitySettings + * @static + * @param {google.analytics.admin.v1alpha.ReportingIdentitySettings} message ReportingIdentitySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReportingIdentitySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.reportingIdentity = options.enums === String ? "IDENTITY_BLENDING_STRATEGY_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.reportingIdentity != null && message.hasOwnProperty("reportingIdentity")) + object.reportingIdentity = options.enums === String ? $root.google.analytics.admin.v1alpha.ReportingIdentitySettings.ReportingIdentity[message.reportingIdentity] === undefined ? message.reportingIdentity : $root.google.analytics.admin.v1alpha.ReportingIdentitySettings.ReportingIdentity[message.reportingIdentity] : message.reportingIdentity; + return object; + }; + + /** + * Converts this ReportingIdentitySettings to JSON. + * @function toJSON + * @memberof google.analytics.admin.v1alpha.ReportingIdentitySettings + * @instance + * @returns {Object.} JSON object + */ + ReportingIdentitySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReportingIdentitySettings + * @function getTypeUrl + * @memberof google.analytics.admin.v1alpha.ReportingIdentitySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReportingIdentitySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.admin.v1alpha.ReportingIdentitySettings"; + }; + + /** + * ReportingIdentity enum. + * @name google.analytics.admin.v1alpha.ReportingIdentitySettings.ReportingIdentity + * @enum {number} + * @property {number} IDENTITY_BLENDING_STRATEGY_UNSPECIFIED=0 IDENTITY_BLENDING_STRATEGY_UNSPECIFIED value + * @property {number} BLENDED=1 BLENDED value + * @property {number} OBSERVED=2 OBSERVED value + * @property {number} DEVICE_BASED=3 DEVICE_BASED value + */ + ReportingIdentitySettings.ReportingIdentity = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDENTITY_BLENDING_STRATEGY_UNSPECIFIED"] = 0; + values[valuesById[1] = "BLENDED"] = 1; + values[valuesById[2] = "OBSERVED"] = 2; + values[valuesById[3] = "DEVICE_BASED"] = 3; + return values; + })(); + + return ReportingIdentitySettings; + })(); + v1alpha.SubpropertyEventFilterCondition = (function() { /** @@ -119176,6 +117008,7 @@ * @interface ICommonLanguageSettings * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri * @property {Array.|null} [destinations] CommonLanguageSettings destinations + * @property {google.api.ISelectiveGapicGeneration|null} [selectiveGapicGeneration] CommonLanguageSettings selectiveGapicGeneration */ /** @@ -119210,6 +117043,14 @@ */ CommonLanguageSettings.prototype.destinations = $util.emptyArray; + /** + * CommonLanguageSettings selectiveGapicGeneration. + * @member {google.api.ISelectiveGapicGeneration|null|undefined} selectiveGapicGeneration + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.selectiveGapicGeneration = null; + /** * Creates a new CommonLanguageSettings instance using the specified properties. * @function create @@ -119242,6 +117083,8 @@ writer.int32(message.destinations[i]); writer.ldelim(); } + if (message.selectiveGapicGeneration != null && Object.hasOwnProperty.call(message, "selectiveGapicGeneration")) + $root.google.api.SelectiveGapicGeneration.encode(message.selectiveGapicGeneration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -119293,6 +117136,10 @@ message.destinations.push(reader.int32()); break; } + case 3: { + message.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -119344,6 +117191,11 @@ break; } } + if (message.selectiveGapicGeneration != null && message.hasOwnProperty("selectiveGapicGeneration")) { + var error = $root.google.api.SelectiveGapicGeneration.verify(message.selectiveGapicGeneration); + if (error) + return "selectiveGapicGeneration." + error; + } return null; }; @@ -119386,6 +117238,11 @@ break; } } + if (object.selectiveGapicGeneration != null) { + if (typeof object.selectiveGapicGeneration !== "object") + throw TypeError(".google.api.CommonLanguageSettings.selectiveGapicGeneration: object expected"); + message.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.fromObject(object.selectiveGapicGeneration); + } return message; }; @@ -119404,8 +117261,10 @@ var object = {}; if (options.arrays || options.defaults) object.destinations = []; - if (options.defaults) + if (options.defaults) { object.referenceDocsUri = ""; + object.selectiveGapicGeneration = null; + } if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) object.referenceDocsUri = message.referenceDocsUri; if (message.destinations && message.destinations.length) { @@ -119413,6 +117272,8 @@ for (var j = 0; j < message.destinations.length; ++j) object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; } + if (message.selectiveGapicGeneration != null && message.hasOwnProperty("selectiveGapicGeneration")) + object.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.toObject(message.selectiveGapicGeneration, options); return object; }; @@ -121235,6 +119096,7 @@ * @memberof google.api * @interface IPythonSettings * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common + * @property {google.api.PythonSettings.IExperimentalFeatures|null} [experimentalFeatures] PythonSettings experimentalFeatures */ /** @@ -121260,6 +119122,14 @@ */ PythonSettings.prototype.common = null; + /** + * PythonSettings experimentalFeatures. + * @member {google.api.PythonSettings.IExperimentalFeatures|null|undefined} experimentalFeatures + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.experimentalFeatures = null; + /** * Creates a new PythonSettings instance using the specified properties. * @function create @@ -121286,6 +119156,8 @@ writer = $Writer.create(); if (message.common != null && Object.hasOwnProperty.call(message, "common")) $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.experimentalFeatures != null && Object.hasOwnProperty.call(message, "experimentalFeatures")) + $root.google.api.PythonSettings.ExperimentalFeatures.encode(message.experimentalFeatures, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -121326,6 +119198,10 @@ message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); break; } + case 2: { + message.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -121366,6 +119242,11 @@ if (error) return "common." + error; } + if (message.experimentalFeatures != null && message.hasOwnProperty("experimentalFeatures")) { + var error = $root.google.api.PythonSettings.ExperimentalFeatures.verify(message.experimentalFeatures); + if (error) + return "experimentalFeatures." + error; + } return null; }; @@ -121386,6 +119267,11 @@ throw TypeError(".google.api.PythonSettings.common: object expected"); message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); } + if (object.experimentalFeatures != null) { + if (typeof object.experimentalFeatures !== "object") + throw TypeError(".google.api.PythonSettings.experimentalFeatures: object expected"); + message.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.fromObject(object.experimentalFeatures); + } return message; }; @@ -121402,10 +119288,14 @@ if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.common = null; + object.experimentalFeatures = null; + } if (message.common != null && message.hasOwnProperty("common")) object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + if (message.experimentalFeatures != null && message.hasOwnProperty("experimentalFeatures")) + object.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.toObject(message.experimentalFeatures, options); return object; }; @@ -121435,6 +119325,258 @@ return typeUrlPrefix + "/google.api.PythonSettings"; }; + PythonSettings.ExperimentalFeatures = (function() { + + /** + * Properties of an ExperimentalFeatures. + * @memberof google.api.PythonSettings + * @interface IExperimentalFeatures + * @property {boolean|null} [restAsyncIoEnabled] ExperimentalFeatures restAsyncIoEnabled + * @property {boolean|null} [protobufPythonicTypesEnabled] ExperimentalFeatures protobufPythonicTypesEnabled + * @property {boolean|null} [unversionedPackageDisabled] ExperimentalFeatures unversionedPackageDisabled + */ + + /** + * Constructs a new ExperimentalFeatures. + * @memberof google.api.PythonSettings + * @classdesc Represents an ExperimentalFeatures. + * @implements IExperimentalFeatures + * @constructor + * @param {google.api.PythonSettings.IExperimentalFeatures=} [properties] Properties to set + */ + function ExperimentalFeatures(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExperimentalFeatures restAsyncIoEnabled. + * @member {boolean} restAsyncIoEnabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.restAsyncIoEnabled = false; + + /** + * ExperimentalFeatures protobufPythonicTypesEnabled. + * @member {boolean} protobufPythonicTypesEnabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.protobufPythonicTypesEnabled = false; + + /** + * ExperimentalFeatures unversionedPackageDisabled. + * @member {boolean} unversionedPackageDisabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.unversionedPackageDisabled = false; + + /** + * Creates a new ExperimentalFeatures instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures=} [properties] Properties to set + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures instance + */ + ExperimentalFeatures.create = function create(properties) { + return new ExperimentalFeatures(properties); + }; + + /** + * Encodes the specified ExperimentalFeatures message. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures} message ExperimentalFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExperimentalFeatures.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.restAsyncIoEnabled != null && Object.hasOwnProperty.call(message, "restAsyncIoEnabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.restAsyncIoEnabled); + if (message.protobufPythonicTypesEnabled != null && Object.hasOwnProperty.call(message, "protobufPythonicTypesEnabled")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.protobufPythonicTypesEnabled); + if (message.unversionedPackageDisabled != null && Object.hasOwnProperty.call(message, "unversionedPackageDisabled")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.unversionedPackageDisabled); + return writer; + }; + + /** + * Encodes the specified ExperimentalFeatures message, length delimited. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures} message ExperimentalFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExperimentalFeatures.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExperimentalFeatures.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings.ExperimentalFeatures(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.restAsyncIoEnabled = reader.bool(); + break; + } + case 2: { + message.protobufPythonicTypesEnabled = reader.bool(); + break; + } + case 3: { + message.unversionedPackageDisabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExperimentalFeatures.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExperimentalFeatures message. + * @function verify + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExperimentalFeatures.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.restAsyncIoEnabled != null && message.hasOwnProperty("restAsyncIoEnabled")) + if (typeof message.restAsyncIoEnabled !== "boolean") + return "restAsyncIoEnabled: boolean expected"; + if (message.protobufPythonicTypesEnabled != null && message.hasOwnProperty("protobufPythonicTypesEnabled")) + if (typeof message.protobufPythonicTypesEnabled !== "boolean") + return "protobufPythonicTypesEnabled: boolean expected"; + if (message.unversionedPackageDisabled != null && message.hasOwnProperty("unversionedPackageDisabled")) + if (typeof message.unversionedPackageDisabled !== "boolean") + return "unversionedPackageDisabled: boolean expected"; + return null; + }; + + /** + * Creates an ExperimentalFeatures message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + */ + ExperimentalFeatures.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PythonSettings.ExperimentalFeatures) + return object; + var message = new $root.google.api.PythonSettings.ExperimentalFeatures(); + if (object.restAsyncIoEnabled != null) + message.restAsyncIoEnabled = Boolean(object.restAsyncIoEnabled); + if (object.protobufPythonicTypesEnabled != null) + message.protobufPythonicTypesEnabled = Boolean(object.protobufPythonicTypesEnabled); + if (object.unversionedPackageDisabled != null) + message.unversionedPackageDisabled = Boolean(object.unversionedPackageDisabled); + return message; + }; + + /** + * Creates a plain object from an ExperimentalFeatures message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.ExperimentalFeatures} message ExperimentalFeatures + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExperimentalFeatures.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.restAsyncIoEnabled = false; + object.protobufPythonicTypesEnabled = false; + object.unversionedPackageDisabled = false; + } + if (message.restAsyncIoEnabled != null && message.hasOwnProperty("restAsyncIoEnabled")) + object.restAsyncIoEnabled = message.restAsyncIoEnabled; + if (message.protobufPythonicTypesEnabled != null && message.hasOwnProperty("protobufPythonicTypesEnabled")) + object.protobufPythonicTypesEnabled = message.protobufPythonicTypesEnabled; + if (message.unversionedPackageDisabled != null && message.hasOwnProperty("unversionedPackageDisabled")) + object.unversionedPackageDisabled = message.unversionedPackageDisabled; + return object; + }; + + /** + * Converts this ExperimentalFeatures to JSON. + * @function toJSON + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + * @returns {Object.} JSON object + */ + ExperimentalFeatures.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExperimentalFeatures + * @function getTypeUrl + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExperimentalFeatures.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings.ExperimentalFeatures"; + }; + + return ExperimentalFeatures; + })(); + return PythonSettings; })(); @@ -122311,6 +120453,7 @@ * @memberof google.api * @interface IGoSettings * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common + * @property {Object.|null} [renamedServices] GoSettings renamedServices */ /** @@ -122322,6 +120465,7 @@ * @param {google.api.IGoSettings=} [properties] Properties to set */ function GoSettings(properties) { + this.renamedServices = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -122336,6 +120480,14 @@ */ GoSettings.prototype.common = null; + /** + * GoSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.renamedServices = $util.emptyObject; + /** * Creates a new GoSettings instance using the specified properties. * @function create @@ -122362,6 +120514,9 @@ writer = $Writer.create(); if (message.common != null && Object.hasOwnProperty.call(message, "common")) $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); return writer; }; @@ -122392,7 +120547,7 @@ GoSettings.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(), key, value; while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) @@ -122402,6 +120557,29 @@ message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); break; } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedServices[key] = value; + break; + } default: reader.skipType(tag & 7); break; @@ -122442,6 +120620,14 @@ if (error) return "common." + error; } + if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } return null; }; @@ -122462,6 +120648,13 @@ throw TypeError(".google.api.GoSettings.common: object expected"); message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); } + if (object.renamedServices) { + if (typeof object.renamedServices !== "object") + throw TypeError(".google.api.GoSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } return message; }; @@ -122478,10 +120671,18 @@ if (!options) options = {}; var object = {}; + if (options.objects || options.defaults) + object.renamedServices = {}; if (options.defaults) object.common = null; if (message.common != null && message.hasOwnProperty("common")) object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } return object; }; @@ -123120,6 +121321,251 @@ return values; })(); + api.SelectiveGapicGeneration = (function() { + + /** + * Properties of a SelectiveGapicGeneration. + * @memberof google.api + * @interface ISelectiveGapicGeneration + * @property {Array.|null} [methods] SelectiveGapicGeneration methods + * @property {boolean|null} [generateOmittedAsInternal] SelectiveGapicGeneration generateOmittedAsInternal + */ + + /** + * Constructs a new SelectiveGapicGeneration. + * @memberof google.api + * @classdesc Represents a SelectiveGapicGeneration. + * @implements ISelectiveGapicGeneration + * @constructor + * @param {google.api.ISelectiveGapicGeneration=} [properties] Properties to set + */ + function SelectiveGapicGeneration(properties) { + this.methods = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SelectiveGapicGeneration methods. + * @member {Array.} methods + * @memberof google.api.SelectiveGapicGeneration + * @instance + */ + SelectiveGapicGeneration.prototype.methods = $util.emptyArray; + + /** + * SelectiveGapicGeneration generateOmittedAsInternal. + * @member {boolean} generateOmittedAsInternal + * @memberof google.api.SelectiveGapicGeneration + * @instance + */ + SelectiveGapicGeneration.prototype.generateOmittedAsInternal = false; + + /** + * Creates a new SelectiveGapicGeneration instance using the specified properties. + * @function create + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration=} [properties] Properties to set + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration instance + */ + SelectiveGapicGeneration.create = function create(properties) { + return new SelectiveGapicGeneration(properties); + }; + + /** + * Encodes the specified SelectiveGapicGeneration message. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @function encode + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration} message SelectiveGapicGeneration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelectiveGapicGeneration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.methods != null && message.methods.length) + for (var i = 0; i < message.methods.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.methods[i]); + if (message.generateOmittedAsInternal != null && Object.hasOwnProperty.call(message, "generateOmittedAsInternal")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.generateOmittedAsInternal); + return writer; + }; + + /** + * Encodes the specified SelectiveGapicGeneration message, length delimited. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration} message SelectiveGapicGeneration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelectiveGapicGeneration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer. + * @function decode + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelectiveGapicGeneration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.SelectiveGapicGeneration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.methods && message.methods.length)) + message.methods = []; + message.methods.push(reader.string()); + break; + } + case 2: { + message.generateOmittedAsInternal = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelectiveGapicGeneration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SelectiveGapicGeneration message. + * @function verify + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SelectiveGapicGeneration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.methods != null && message.hasOwnProperty("methods")) { + if (!Array.isArray(message.methods)) + return "methods: array expected"; + for (var i = 0; i < message.methods.length; ++i) + if (!$util.isString(message.methods[i])) + return "methods: string[] expected"; + } + if (message.generateOmittedAsInternal != null && message.hasOwnProperty("generateOmittedAsInternal")) + if (typeof message.generateOmittedAsInternal !== "boolean") + return "generateOmittedAsInternal: boolean expected"; + return null; + }; + + /** + * Creates a SelectiveGapicGeneration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {Object.} object Plain object + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + */ + SelectiveGapicGeneration.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.SelectiveGapicGeneration) + return object; + var message = new $root.google.api.SelectiveGapicGeneration(); + if (object.methods) { + if (!Array.isArray(object.methods)) + throw TypeError(".google.api.SelectiveGapicGeneration.methods: array expected"); + message.methods = []; + for (var i = 0; i < object.methods.length; ++i) + message.methods[i] = String(object.methods[i]); + } + if (object.generateOmittedAsInternal != null) + message.generateOmittedAsInternal = Boolean(object.generateOmittedAsInternal); + return message; + }; + + /** + * Creates a plain object from a SelectiveGapicGeneration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.SelectiveGapicGeneration} message SelectiveGapicGeneration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SelectiveGapicGeneration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.methods = []; + if (options.defaults) + object.generateOmittedAsInternal = false; + if (message.methods && message.methods.length) { + object.methods = []; + for (var j = 0; j < message.methods.length; ++j) + object.methods[j] = message.methods[j]; + } + if (message.generateOmittedAsInternal != null && message.hasOwnProperty("generateOmittedAsInternal")) + object.generateOmittedAsInternal = message.generateOmittedAsInternal; + return object; + }; + + /** + * Converts this SelectiveGapicGeneration to JSON. + * @function toJSON + * @memberof google.api.SelectiveGapicGeneration + * @instance + * @returns {Object.} JSON object + */ + SelectiveGapicGeneration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SelectiveGapicGeneration + * @function getTypeUrl + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SelectiveGapicGeneration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.SelectiveGapicGeneration"; + }; + + return SelectiveGapicGeneration; + })(); + /** * LaunchStage enum. * @name google.api.LaunchStage @@ -123389,6 +121835,7 @@ * @name google.protobuf.Edition * @enum {number} * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value + * @property {number} EDITION_LEGACY=900 EDITION_LEGACY value * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value * @property {number} EDITION_2023=1000 EDITION_2023 value @@ -123403,6 +121850,7 @@ protobuf.Edition = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "EDITION_UNKNOWN"] = 0; + values[valuesById[900] = "EDITION_LEGACY"] = 900; values[valuesById[998] = "EDITION_PROTO2"] = 998; values[valuesById[999] = "EDITION_PROTO3"] = 999; values[valuesById[1000] = "EDITION_2023"] = 1000; @@ -123427,6 +121875,7 @@ * @property {Array.|null} [dependency] FileDescriptorProto dependency * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [optionDependency] FileDescriptorProto optionDependency * @property {Array.|null} [messageType] FileDescriptorProto messageType * @property {Array.|null} [enumType] FileDescriptorProto enumType * @property {Array.|null} [service] FileDescriptorProto service @@ -123449,6 +121898,7 @@ this.dependency = []; this.publicDependency = []; this.weakDependency = []; + this.optionDependency = []; this.messageType = []; this.enumType = []; this.service = []; @@ -123499,6 +121949,14 @@ */ FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + /** + * FileDescriptorProto optionDependency. + * @member {Array.} optionDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.optionDependency = $util.emptyArray; + /** * FileDescriptorProto messageType. * @member {Array.} messageType @@ -123620,6 +122078,9 @@ writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); + if (message.optionDependency != null && message.optionDependency.length) + for (var i = 0; i < message.optionDependency.length; ++i) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.optionDependency[i]); return writer; }; @@ -123692,6 +122153,12 @@ message.weakDependency.push(reader.int32()); break; } + case 15: { + if (!(message.optionDependency && message.optionDependency.length)) + message.optionDependency = []; + message.optionDependency.push(reader.string()); + break; + } case 4: { if (!(message.messageType && message.messageType.length)) message.messageType = []; @@ -123794,6 +122261,13 @@ if (!$util.isInteger(message.weakDependency[i])) return "weakDependency: integer[] expected"; } + if (message.optionDependency != null && message.hasOwnProperty("optionDependency")) { + if (!Array.isArray(message.optionDependency)) + return "optionDependency: array expected"; + for (var i = 0; i < message.optionDependency.length; ++i) + if (!$util.isString(message.optionDependency[i])) + return "optionDependency: string[] expected"; + } if (message.messageType != null && message.hasOwnProperty("messageType")) { if (!Array.isArray(message.messageType)) return "messageType: array expected"; @@ -123848,6 +122322,7 @@ default: return "edition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -123900,6 +122375,13 @@ for (var i = 0; i < object.weakDependency.length; ++i) message.weakDependency[i] = object.weakDependency[i] | 0; } + if (object.optionDependency) { + if (!Array.isArray(object.optionDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.optionDependency: array expected"); + message.optionDependency = []; + for (var i = 0; i < object.optionDependency.length; ++i) + message.optionDependency[i] = String(object.optionDependency[i]); + } if (object.messageType) { if (!Array.isArray(object.messageType)) throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); @@ -123963,6 +122445,10 @@ case 0: message.edition = 0; break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; case "EDITION_PROTO2": case 998: message.edition = 998; @@ -124028,6 +122514,7 @@ object.extension = []; object.publicDependency = []; object.weakDependency = []; + object.optionDependency = []; } if (options.defaults) { object.name = ""; @@ -124084,6 +122571,11 @@ object.syntax = message.syntax; if (message.edition != null && message.hasOwnProperty("edition")) object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + if (message.optionDependency && message.optionDependency.length) { + object.optionDependency = []; + for (var j = 0; j < message.optionDependency.length; ++j) + object.optionDependency[j] = message.optionDependency[j]; + } return object; }; @@ -124132,6 +122624,7 @@ * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options * @property {Array.|null} [reservedRange] DescriptorProto reservedRange * @property {Array.|null} [reservedName] DescriptorProto reservedName + * @property {google.protobuf.SymbolVisibility|null} [visibility] DescriptorProto visibility */ /** @@ -124237,6 +122730,14 @@ */ DescriptorProto.prototype.reservedName = $util.emptyArray; + /** + * DescriptorProto visibility. + * @member {google.protobuf.SymbolVisibility} visibility + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.visibility = 0; + /** * Creates a new DescriptorProto instance using the specified properties. * @function create @@ -124289,6 +122790,8 @@ if (message.reservedName != null && message.reservedName.length) for (var i = 0; i < message.reservedName.length; ++i) writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.visibility); return writer; }; @@ -124381,6 +122884,10 @@ message.reservedName.push(reader.string()); break; } + case 11: { + message.visibility = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -124494,6 +123001,15 @@ if (!$util.isString(message.reservedName[i])) return "reservedName: string[] expected"; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + switch (message.visibility) { + default: + return "visibility: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; @@ -124593,6 +123109,26 @@ for (var i = 0; i < object.reservedName.length; ++i) message.reservedName[i] = String(object.reservedName[i]); } + switch (object.visibility) { + default: + if (typeof object.visibility === "number") { + message.visibility = object.visibility; + break; + } + break; + case "VISIBILITY_UNSET": + case 0: + message.visibility = 0; + break; + case "VISIBILITY_LOCAL": + case 1: + message.visibility = 1; + break; + case "VISIBILITY_EXPORT": + case 2: + message.visibility = 2; + break; + } return message; }; @@ -124622,6 +123158,7 @@ if (options.defaults) { object.name = ""; object.options = null; + object.visibility = options.enums === String ? "VISIBILITY_UNSET" : 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -124667,6 +123204,8 @@ for (var j = 0; j < message.reservedName.length; ++j) object.reservedName[j] = message.reservedName[j]; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + object.visibility = options.enums === String ? $root.google.protobuf.SymbolVisibility[message.visibility] === undefined ? message.visibility : $root.google.protobuf.SymbolVisibility[message.visibility] : message.visibility; return object; }; @@ -126711,6 +125250,7 @@ * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + * @property {google.protobuf.SymbolVisibility|null} [visibility] EnumDescriptorProto visibility */ /** @@ -126771,6 +125311,14 @@ */ EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + /** + * EnumDescriptorProto visibility. + * @member {google.protobuf.SymbolVisibility} visibility + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.visibility = 0; + /** * Creates a new EnumDescriptorProto instance using the specified properties. * @function create @@ -126808,6 +125356,8 @@ if (message.reservedName != null && message.reservedName.length) for (var i = 0; i < message.reservedName.length; ++i) writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.visibility); return writer; }; @@ -126870,6 +125420,10 @@ message.reservedName.push(reader.string()); break; } + case 6: { + message.visibility = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -126938,6 +125492,15 @@ if (!$util.isString(message.reservedName[i])) return "reservedName: string[] expected"; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + switch (message.visibility) { + default: + return "visibility: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; @@ -126987,6 +125550,26 @@ for (var i = 0; i < object.reservedName.length; ++i) message.reservedName[i] = String(object.reservedName[i]); } + switch (object.visibility) { + default: + if (typeof object.visibility === "number") { + message.visibility = object.visibility; + break; + } + break; + case "VISIBILITY_UNSET": + case 0: + message.visibility = 0; + break; + case "VISIBILITY_LOCAL": + case 1: + message.visibility = 1; + break; + case "VISIBILITY_EXPORT": + case 2: + message.visibility = 2; + break; + } return message; }; @@ -127011,6 +125594,7 @@ if (options.defaults) { object.name = ""; object.options = null; + object.visibility = options.enums === String ? "VISIBILITY_UNSET" : 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -127031,6 +125615,8 @@ for (var j = 0; j < message.reservedName.length; ++j) object.reservedName[j] = message.reservedName[j]; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + object.visibility = options.enums === String ? $root.google.protobuf.SymbolVisibility[message.visibility] === undefined ? message.visibility : $root.google.protobuf.SymbolVisibility[message.visibility] : message.visibility; return object; }; @@ -129349,6 +127935,7 @@ * @property {Array.|null} [targets] FieldOptions targets * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features + * @property {google.protobuf.FieldOptions.IFeatureSupport|null} [featureSupport] FieldOptions featureSupport * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference @@ -129469,6 +128056,14 @@ */ FieldOptions.prototype.features = null; + /** + * FieldOptions featureSupport. + * @member {google.protobuf.FieldOptions.IFeatureSupport|null|undefined} featureSupport + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.featureSupport = null; + /** * FieldOptions uninterpretedOption. * @member {Array.} uninterpretedOption @@ -129543,6 +128138,8 @@ $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); if (message.features != null && Object.hasOwnProperty.call(message, "features")) $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) + $root.google.protobuf.FieldOptions.FeatureSupport.encode(message.featureSupport, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); @@ -129644,6 +128241,10 @@ message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); break; } + case 22: { + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.decode(reader, reader.uint32()); + break; + } case 999: { if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; @@ -129779,6 +128380,11 @@ if (error) return "features." + error; } + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) { + var error = $root.google.protobuf.FieldOptions.FeatureSupport.verify(message.featureSupport); + if (error) + return "featureSupport." + error; + } if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; @@ -129967,6 +128573,11 @@ throw TypeError(".google.protobuf.FieldOptions.features: object expected"); message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); } + if (object.featureSupport != null) { + if (typeof object.featureSupport !== "object") + throw TypeError(".google.protobuf.FieldOptions.featureSupport: object expected"); + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.fromObject(object.featureSupport); + } if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); @@ -130064,6 +128675,7 @@ object.debugRedact = false; object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; object.features = null; + object.featureSupport = null; object[".google.api.resourceReference"] = null; } if (message.ctype != null && message.hasOwnProperty("ctype")) @@ -130096,6 +128708,8 @@ } if (message.features != null && message.hasOwnProperty("features")) object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) + object.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.toObject(message.featureSupport, options); if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) @@ -130169,71 +128783,371 @@ return values; })(); - /** - * OptionRetention enum. - * @name google.protobuf.FieldOptions.OptionRetention - * @enum {number} - * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value - * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value - * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value - */ - FieldOptions.OptionRetention = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; - values[valuesById[1] = "RETENTION_RUNTIME"] = 1; - values[valuesById[2] = "RETENTION_SOURCE"] = 2; - return values; - })(); + /** + * OptionRetention enum. + * @name google.protobuf.FieldOptions.OptionRetention + * @enum {number} + * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value + * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value + * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value + */ + FieldOptions.OptionRetention = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; + values[valuesById[1] = "RETENTION_RUNTIME"] = 1; + values[valuesById[2] = "RETENTION_SOURCE"] = 2; + return values; + })(); + + /** + * OptionTargetType enum. + * @name google.protobuf.FieldOptions.OptionTargetType + * @enum {number} + * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value + * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value + * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value + * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value + * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value + * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value + * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value + * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value + * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value + * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value + */ + FieldOptions.OptionTargetType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; + values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; + values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; + values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; + values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; + values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; + values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; + values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; + values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; + return values; + })(); + + FieldOptions.EditionDefault = (function() { + + /** + * Properties of an EditionDefault. + * @memberof google.protobuf.FieldOptions + * @interface IEditionDefault + * @property {google.protobuf.Edition|null} [edition] EditionDefault edition + * @property {string|null} [value] EditionDefault value + */ + + /** + * Constructs a new EditionDefault. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents an EditionDefault. + * @implements IEditionDefault + * @constructor + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + */ + function EditionDefault(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.edition = 0; + + /** + * EditionDefault value. + * @member {string} value + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.value = ""; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance + */ + EditionDefault.create = function create(properties) { + return new EditionDefault(properties); + }; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EditionDefault message. + * @function verify + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + */ + EditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) + return object; + var message = new $root.google.protobuf.FieldOptions.EditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this EditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + * @returns {Object.} JSON object + */ + EditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; + }; - /** - * OptionTargetType enum. - * @name google.protobuf.FieldOptions.OptionTargetType - * @enum {number} - * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value - * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value - * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value - * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value - * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value - * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value - * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value - * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value - * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value - * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value - */ - FieldOptions.OptionTargetType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; - values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; - values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; - values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; - values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; - values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; - values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; - values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; - values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; - values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; - return values; + return EditionDefault; })(); - FieldOptions.EditionDefault = (function() { + FieldOptions.FeatureSupport = (function() { /** - * Properties of an EditionDefault. + * Properties of a FeatureSupport. * @memberof google.protobuf.FieldOptions - * @interface IEditionDefault - * @property {google.protobuf.Edition|null} [edition] EditionDefault edition - * @property {string|null} [value] EditionDefault value + * @interface IFeatureSupport + * @property {google.protobuf.Edition|null} [editionIntroduced] FeatureSupport editionIntroduced + * @property {google.protobuf.Edition|null} [editionDeprecated] FeatureSupport editionDeprecated + * @property {string|null} [deprecationWarning] FeatureSupport deprecationWarning + * @property {google.protobuf.Edition|null} [editionRemoved] FeatureSupport editionRemoved */ /** - * Constructs a new EditionDefault. + * Constructs a new FeatureSupport. * @memberof google.protobuf.FieldOptions - * @classdesc Represents an EditionDefault. - * @implements IEditionDefault + * @classdesc Represents a FeatureSupport. + * @implements IFeatureSupport * @constructor - * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + * @param {google.protobuf.FieldOptions.IFeatureSupport=} [properties] Properties to set */ - function EditionDefault(properties) { + function FeatureSupport(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -130241,91 +129155,119 @@ } /** - * EditionDefault edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FieldOptions.EditionDefault + * FeatureSupport editionIntroduced. + * @member {google.protobuf.Edition} editionIntroduced + * @memberof google.protobuf.FieldOptions.FeatureSupport * @instance */ - EditionDefault.prototype.edition = 0; + FeatureSupport.prototype.editionIntroduced = 0; /** - * EditionDefault value. - * @member {string} value - * @memberof google.protobuf.FieldOptions.EditionDefault + * FeatureSupport editionDeprecated. + * @member {google.protobuf.Edition} editionDeprecated + * @memberof google.protobuf.FieldOptions.FeatureSupport * @instance */ - EditionDefault.prototype.value = ""; + FeatureSupport.prototype.editionDeprecated = 0; /** - * Creates a new EditionDefault instance using the specified properties. + * FeatureSupport deprecationWarning. + * @member {string} deprecationWarning + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.deprecationWarning = ""; + + /** + * FeatureSupport editionRemoved. + * @member {google.protobuf.Edition} editionRemoved + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionRemoved = 0; + + /** + * Creates a new FeatureSupport instance using the specified properties. * @function create - * @memberof google.protobuf.FieldOptions.EditionDefault + * @memberof google.protobuf.FieldOptions.FeatureSupport * @static - * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance + * @param {google.protobuf.FieldOptions.IFeatureSupport=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport instance */ - EditionDefault.create = function create(properties) { - return new EditionDefault(properties); + FeatureSupport.create = function create(properties) { + return new FeatureSupport(properties); }; /** - * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * Encodes the specified FeatureSupport message. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. * @function encode - * @memberof google.protobuf.FieldOptions.EditionDefault + * @memberof google.protobuf.FieldOptions.FeatureSupport * @static - * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {google.protobuf.FieldOptions.IFeatureSupport} message FeatureSupport message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EditionDefault.encode = function encode(message, writer) { + FeatureSupport.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + if (message.editionIntroduced != null && Object.hasOwnProperty.call(message, "editionIntroduced")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.editionIntroduced); + if (message.editionDeprecated != null && Object.hasOwnProperty.call(message, "editionDeprecated")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.editionDeprecated); + if (message.deprecationWarning != null && Object.hasOwnProperty.call(message, "deprecationWarning")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.deprecationWarning); + if (message.editionRemoved != null && Object.hasOwnProperty.call(message, "editionRemoved")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.editionRemoved); return writer; }; /** - * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * Encodes the specified FeatureSupport message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.FieldOptions.EditionDefault + * @memberof google.protobuf.FieldOptions.FeatureSupport * @static - * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {google.protobuf.FieldOptions.IFeatureSupport} message FeatureSupport message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + FeatureSupport.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an EditionDefault message from the specified reader or buffer. + * Decodes a FeatureSupport message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.FieldOptions.EditionDefault + * @memberof google.protobuf.FieldOptions.FeatureSupport * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EditionDefault.decode = function decode(reader, length, error) { + FeatureSupport.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.FeatureSupport(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { - case 3: { - message.edition = reader.int32(); + case 1: { + message.editionIntroduced = reader.int32(); break; } case 2: { - message.value = reader.string(); + message.editionDeprecated = reader.int32(); + break; + } + case 3: { + message.deprecationWarning = reader.string(); + break; + } + case 4: { + message.editionRemoved = reader.int32(); break; } default: @@ -130337,37 +129279,77 @@ }; /** - * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * Decodes a FeatureSupport message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.FieldOptions.EditionDefault + * @memberof google.protobuf.FieldOptions.FeatureSupport * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EditionDefault.decodeDelimited = function decodeDelimited(reader) { + FeatureSupport.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an EditionDefault message. + * Verifies a FeatureSupport message. * @function verify - * @memberof google.protobuf.FieldOptions.EditionDefault + * @memberof google.protobuf.FieldOptions.FeatureSupport * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - EditionDefault.verify = function verify(message) { + FeatureSupport.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { + if (message.editionIntroduced != null && message.hasOwnProperty("editionIntroduced")) + switch (message.editionIntroduced) { default: - return "edition: enum value expected"; + return "editionIntroduced: enum value expected"; case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.editionDeprecated != null && message.hasOwnProperty("editionDeprecated")) + switch (message.editionDeprecated) { + default: + return "editionDeprecated: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.deprecationWarning != null && message.hasOwnProperty("deprecationWarning")) + if (!$util.isString(message.deprecationWarning)) + return "deprecationWarning: string expected"; + if (message.editionRemoved != null && message.hasOwnProperty("editionRemoved")) + switch (message.editionRemoved) { + default: + return "editionRemoved: enum value expected"; + case 0: + case 900: case 998: case 999: case 1000: @@ -130380,132 +129362,251 @@ case 2147483647: break; } - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isString(message.value)) - return "value: string expected"; return null; }; /** - * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * Creates a FeatureSupport message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.FieldOptions.EditionDefault + * @memberof google.protobuf.FieldOptions.FeatureSupport * @static * @param {Object.} object Plain object - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport */ - EditionDefault.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) + FeatureSupport.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions.FeatureSupport) return object; - var message = new $root.google.protobuf.FieldOptions.EditionDefault(); - switch (object.edition) { + var message = new $root.google.protobuf.FieldOptions.FeatureSupport(); + switch (object.editionIntroduced) { default: - if (typeof object.edition === "number") { - message.edition = object.edition; + if (typeof object.editionIntroduced === "number") { + message.editionIntroduced = object.editionIntroduced; break; } break; case "EDITION_UNKNOWN": case 0: - message.edition = 0; + message.editionIntroduced = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionIntroduced = 900; break; case "EDITION_PROTO2": case 998: - message.edition = 998; + message.editionIntroduced = 998; break; case "EDITION_PROTO3": case 999: - message.edition = 999; + message.editionIntroduced = 999; break; case "EDITION_2023": case 1000: - message.edition = 1000; + message.editionIntroduced = 1000; break; case "EDITION_2024": case 1001: - message.edition = 1001; + message.editionIntroduced = 1001; break; case "EDITION_1_TEST_ONLY": case 1: - message.edition = 1; + message.editionIntroduced = 1; break; case "EDITION_2_TEST_ONLY": case 2: - message.edition = 2; + message.editionIntroduced = 2; break; case "EDITION_99997_TEST_ONLY": case 99997: - message.edition = 99997; + message.editionIntroduced = 99997; break; case "EDITION_99998_TEST_ONLY": case 99998: - message.edition = 99998; + message.editionIntroduced = 99998; break; case "EDITION_99999_TEST_ONLY": case 99999: - message.edition = 99999; + message.editionIntroduced = 99999; break; case "EDITION_MAX": case 2147483647: - message.edition = 2147483647; + message.editionIntroduced = 2147483647; + break; + } + switch (object.editionDeprecated) { + default: + if (typeof object.editionDeprecated === "number") { + message.editionDeprecated = object.editionDeprecated; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionDeprecated = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionDeprecated = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionDeprecated = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionDeprecated = 999; + break; + case "EDITION_2023": + case 1000: + message.editionDeprecated = 1000; + break; + case "EDITION_2024": + case 1001: + message.editionDeprecated = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.editionDeprecated = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.editionDeprecated = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.editionDeprecated = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.editionDeprecated = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.editionDeprecated = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.editionDeprecated = 2147483647; + break; + } + if (object.deprecationWarning != null) + message.deprecationWarning = String(object.deprecationWarning); + switch (object.editionRemoved) { + default: + if (typeof object.editionRemoved === "number") { + message.editionRemoved = object.editionRemoved; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionRemoved = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionRemoved = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionRemoved = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionRemoved = 999; + break; + case "EDITION_2023": + case 1000: + message.editionRemoved = 1000; + break; + case "EDITION_2024": + case 1001: + message.editionRemoved = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.editionRemoved = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.editionRemoved = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.editionRemoved = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.editionRemoved = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.editionRemoved = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.editionRemoved = 2147483647; break; } - if (object.value != null) - message.value = String(object.value); return message; }; /** - * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * Creates a plain object from a FeatureSupport message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.FieldOptions.EditionDefault + * @memberof google.protobuf.FieldOptions.FeatureSupport * @static - * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault + * @param {google.protobuf.FieldOptions.FeatureSupport} message FeatureSupport * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EditionDefault.toObject = function toObject(message, options) { + FeatureSupport.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.value = ""; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + object.editionIntroduced = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.editionDeprecated = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.deprecationWarning = ""; + object.editionRemoved = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.editionIntroduced != null && message.hasOwnProperty("editionIntroduced")) + object.editionIntroduced = options.enums === String ? $root.google.protobuf.Edition[message.editionIntroduced] === undefined ? message.editionIntroduced : $root.google.protobuf.Edition[message.editionIntroduced] : message.editionIntroduced; + if (message.editionDeprecated != null && message.hasOwnProperty("editionDeprecated")) + object.editionDeprecated = options.enums === String ? $root.google.protobuf.Edition[message.editionDeprecated] === undefined ? message.editionDeprecated : $root.google.protobuf.Edition[message.editionDeprecated] : message.editionDeprecated; + if (message.deprecationWarning != null && message.hasOwnProperty("deprecationWarning")) + object.deprecationWarning = message.deprecationWarning; + if (message.editionRemoved != null && message.hasOwnProperty("editionRemoved")) + object.editionRemoved = options.enums === String ? $root.google.protobuf.Edition[message.editionRemoved] === undefined ? message.editionRemoved : $root.google.protobuf.Edition[message.editionRemoved] : message.editionRemoved; return object; }; /** - * Converts this EditionDefault to JSON. + * Converts this FeatureSupport to JSON. * @function toJSON - * @memberof google.protobuf.FieldOptions.EditionDefault + * @memberof google.protobuf.FieldOptions.FeatureSupport * @instance * @returns {Object.} JSON object */ - EditionDefault.prototype.toJSON = function toJSON() { + FeatureSupport.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for EditionDefault + * Gets the default type url for FeatureSupport * @function getTypeUrl - * @memberof google.protobuf.FieldOptions.EditionDefault + * @memberof google.protobuf.FieldOptions.FeatureSupport * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + FeatureSupport.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; + return typeUrlPrefix + "/google.protobuf.FieldOptions.FeatureSupport"; }; - return EditionDefault; + return FeatureSupport; })(); return FieldOptions; @@ -131100,6 +130201,7 @@ * @property {boolean|null} [deprecated] EnumValueOptions deprecated * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact + * @property {google.protobuf.FieldOptions.IFeatureSupport|null} [featureSupport] EnumValueOptions featureSupport * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption */ @@ -131143,6 +130245,14 @@ */ EnumValueOptions.prototype.debugRedact = false; + /** + * EnumValueOptions featureSupport. + * @member {google.protobuf.FieldOptions.IFeatureSupport|null|undefined} featureSupport + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.featureSupport = null; + /** * EnumValueOptions uninterpretedOption. * @member {Array.} uninterpretedOption @@ -131181,6 +130291,8 @@ $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); + if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) + $root.google.protobuf.FieldOptions.FeatureSupport.encode(message.featureSupport, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); @@ -131232,6 +130344,10 @@ message.debugRedact = reader.bool(); break; } + case 4: { + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.decode(reader, reader.uint32()); + break; + } case 999: { if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; @@ -131284,6 +130400,11 @@ if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) if (typeof message.debugRedact !== "boolean") return "debugRedact: boolean expected"; + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) { + var error = $root.google.protobuf.FieldOptions.FeatureSupport.verify(message.featureSupport); + if (error) + return "featureSupport." + error; + } if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; @@ -131317,6 +130438,11 @@ } if (object.debugRedact != null) message.debugRedact = Boolean(object.debugRedact); + if (object.featureSupport != null) { + if (typeof object.featureSupport !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.featureSupport: object expected"); + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.fromObject(object.featureSupport); + } if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); @@ -131349,6 +130475,7 @@ object.deprecated = false; object.features = null; object.debugRedact = false; + object.featureSupport = null; } if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; @@ -131356,6 +130483,8 @@ object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) object.debugRedact = message.debugRedact; + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) + object.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.toObject(message.featureSupport, options); if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) @@ -132795,6 +131924,8 @@ * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat + * @property {google.protobuf.FeatureSet.EnforceNamingStyle|null} [enforceNamingStyle] FeatureSet enforceNamingStyle + * @property {google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|null} [defaultSymbolVisibility] FeatureSet defaultSymbolVisibility */ /** @@ -132860,6 +131991,22 @@ */ FeatureSet.prototype.jsonFormat = 0; + /** + * FeatureSet enforceNamingStyle. + * @member {google.protobuf.FeatureSet.EnforceNamingStyle} enforceNamingStyle + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enforceNamingStyle = 0; + + /** + * FeatureSet defaultSymbolVisibility. + * @member {google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility} defaultSymbolVisibility + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.defaultSymbolVisibility = 0; + /** * Creates a new FeatureSet instance using the specified properties. * @function create @@ -132896,6 +132043,10 @@ writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); + if (message.enforceNamingStyle != null && Object.hasOwnProperty.call(message, "enforceNamingStyle")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.enforceNamingStyle); + if (message.defaultSymbolVisibility != null && Object.hasOwnProperty.call(message, "defaultSymbolVisibility")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.defaultSymbolVisibility); return writer; }; @@ -132956,6 +132107,14 @@ message.jsonFormat = reader.int32(); break; } + case 7: { + message.enforceNamingStyle = reader.int32(); + break; + } + case 8: { + message.defaultSymbolVisibility = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -133046,6 +132205,26 @@ case 2: break; } + if (message.enforceNamingStyle != null && message.hasOwnProperty("enforceNamingStyle")) + switch (message.enforceNamingStyle) { + default: + return "enforceNamingStyle: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.defaultSymbolVisibility != null && message.hasOwnProperty("defaultSymbolVisibility")) + switch (message.defaultSymbolVisibility) { + default: + return "defaultSymbolVisibility: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } return null; }; @@ -133185,6 +132364,54 @@ message.jsonFormat = 2; break; } + switch (object.enforceNamingStyle) { + default: + if (typeof object.enforceNamingStyle === "number") { + message.enforceNamingStyle = object.enforceNamingStyle; + break; + } + break; + case "ENFORCE_NAMING_STYLE_UNKNOWN": + case 0: + message.enforceNamingStyle = 0; + break; + case "STYLE2024": + case 1: + message.enforceNamingStyle = 1; + break; + case "STYLE_LEGACY": + case 2: + message.enforceNamingStyle = 2; + break; + } + switch (object.defaultSymbolVisibility) { + default: + if (typeof object.defaultSymbolVisibility === "number") { + message.defaultSymbolVisibility = object.defaultSymbolVisibility; + break; + } + break; + case "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN": + case 0: + message.defaultSymbolVisibility = 0; + break; + case "EXPORT_ALL": + case 1: + message.defaultSymbolVisibility = 1; + break; + case "EXPORT_TOP_LEVEL": + case 2: + message.defaultSymbolVisibility = 2; + break; + case "LOCAL_ALL": + case 3: + message.defaultSymbolVisibility = 3; + break; + case "STRICT": + case 4: + message.defaultSymbolVisibility = 4; + break; + } return message; }; @@ -133208,6 +132435,8 @@ object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; + object.enforceNamingStyle = options.enums === String ? "ENFORCE_NAMING_STYLE_UNKNOWN" : 0; + object.defaultSymbolVisibility = options.enums === String ? "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN" : 0; } if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; @@ -133221,6 +132450,10 @@ object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; + if (message.enforceNamingStyle != null && message.hasOwnProperty("enforceNamingStyle")) + object.enforceNamingStyle = options.enums === String ? $root.google.protobuf.FeatureSet.EnforceNamingStyle[message.enforceNamingStyle] === undefined ? message.enforceNamingStyle : $root.google.protobuf.FeatureSet.EnforceNamingStyle[message.enforceNamingStyle] : message.enforceNamingStyle; + if (message.defaultSymbolVisibility != null && message.hasOwnProperty("defaultSymbolVisibility")) + object.defaultSymbolVisibility = options.enums === String ? $root.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility[message.defaultSymbolVisibility] === undefined ? message.defaultSymbolVisibility : $root.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility[message.defaultSymbolVisibility] : message.defaultSymbolVisibility; return object; }; @@ -133348,6 +132581,219 @@ return values; })(); + /** + * EnforceNamingStyle enum. + * @name google.protobuf.FeatureSet.EnforceNamingStyle + * @enum {number} + * @property {number} ENFORCE_NAMING_STYLE_UNKNOWN=0 ENFORCE_NAMING_STYLE_UNKNOWN value + * @property {number} STYLE2024=1 STYLE2024 value + * @property {number} STYLE_LEGACY=2 STYLE_LEGACY value + */ + FeatureSet.EnforceNamingStyle = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENFORCE_NAMING_STYLE_UNKNOWN"] = 0; + values[valuesById[1] = "STYLE2024"] = 1; + values[valuesById[2] = "STYLE_LEGACY"] = 2; + return values; + })(); + + FeatureSet.VisibilityFeature = (function() { + + /** + * Properties of a VisibilityFeature. + * @memberof google.protobuf.FeatureSet + * @interface IVisibilityFeature + */ + + /** + * Constructs a new VisibilityFeature. + * @memberof google.protobuf.FeatureSet + * @classdesc Represents a VisibilityFeature. + * @implements IVisibilityFeature + * @constructor + * @param {google.protobuf.FeatureSet.IVisibilityFeature=} [properties] Properties to set + */ + function VisibilityFeature(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new VisibilityFeature instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature instance + */ + VisibilityFeature.create = function create(properties) { + return new VisibilityFeature(properties); + }; + + /** + * Encodes the specified VisibilityFeature message. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature} message VisibilityFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VisibilityFeature.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified VisibilityFeature message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature} message VisibilityFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VisibilityFeature.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VisibilityFeature.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet.VisibilityFeature(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VisibilityFeature.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VisibilityFeature message. + * @function verify + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VisibilityFeature.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a VisibilityFeature message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + */ + VisibilityFeature.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSet.VisibilityFeature) + return object; + return new $root.google.protobuf.FeatureSet.VisibilityFeature(); + }; + + /** + * Creates a plain object from a VisibilityFeature message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.VisibilityFeature} message VisibilityFeature + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VisibilityFeature.toObject = function toObject() { + return {}; + }; + + /** + * Converts this VisibilityFeature to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @instance + * @returns {Object.} JSON object + */ + VisibilityFeature.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VisibilityFeature + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VisibilityFeature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet.VisibilityFeature"; + }; + + /** + * DefaultSymbolVisibility enum. + * @name google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility + * @enum {number} + * @property {number} DEFAULT_SYMBOL_VISIBILITY_UNKNOWN=0 DEFAULT_SYMBOL_VISIBILITY_UNKNOWN value + * @property {number} EXPORT_ALL=1 EXPORT_ALL value + * @property {number} EXPORT_TOP_LEVEL=2 EXPORT_TOP_LEVEL value + * @property {number} LOCAL_ALL=3 LOCAL_ALL value + * @property {number} STRICT=4 STRICT value + */ + VisibilityFeature.DefaultSymbolVisibility = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN"] = 0; + values[valuesById[1] = "EXPORT_ALL"] = 1; + values[valuesById[2] = "EXPORT_TOP_LEVEL"] = 2; + values[valuesById[3] = "LOCAL_ALL"] = 3; + values[valuesById[4] = "STRICT"] = 4; + return values; + })(); + + return VisibilityFeature; + })(); + return FeatureSet; })(); @@ -133532,6 +132978,7 @@ default: return "minimumEdition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -133549,6 +132996,7 @@ default: return "maximumEdition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -133597,6 +133045,10 @@ case 0: message.minimumEdition = 0; break; + case "EDITION_LEGACY": + case 900: + message.minimumEdition = 900; + break; case "EDITION_PROTO2": case 998: message.minimumEdition = 998; @@ -133649,6 +133101,10 @@ case 0: message.maximumEdition = 0; break; + case "EDITION_LEGACY": + case 900: + message.maximumEdition = 900; + break; case "EDITION_PROTO2": case 998: message.maximumEdition = 998; @@ -133757,7 +133213,8 @@ * @memberof google.protobuf.FeatureSetDefaults * @interface IFeatureSetEditionDefault * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition - * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features + * @property {google.protobuf.IFeatureSet|null} [overridableFeatures] FeatureSetEditionDefault overridableFeatures + * @property {google.protobuf.IFeatureSet|null} [fixedFeatures] FeatureSetEditionDefault fixedFeatures */ /** @@ -133784,12 +133241,20 @@ FeatureSetEditionDefault.prototype.edition = 0; /** - * FeatureSetEditionDefault features. - * @member {google.protobuf.IFeatureSet|null|undefined} features + * FeatureSetEditionDefault overridableFeatures. + * @member {google.protobuf.IFeatureSet|null|undefined} overridableFeatures + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.overridableFeatures = null; + + /** + * FeatureSetEditionDefault fixedFeatures. + * @member {google.protobuf.IFeatureSet|null|undefined} fixedFeatures * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault * @instance */ - FeatureSetEditionDefault.prototype.features = null; + FeatureSetEditionDefault.prototype.fixedFeatures = null; /** * Creates a new FeatureSetEditionDefault instance using the specified properties. @@ -133815,10 +133280,12 @@ FeatureSetEditionDefault.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + if (message.overridableFeatures != null && Object.hasOwnProperty.call(message, "overridableFeatures")) + $root.google.protobuf.FeatureSet.encode(message.overridableFeatures, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.fixedFeatures != null && Object.hasOwnProperty.call(message, "fixedFeatures")) + $root.google.protobuf.FeatureSet.encode(message.fixedFeatures, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -133859,8 +133326,12 @@ message.edition = reader.int32(); break; } - case 2: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + case 4: { + message.overridableFeatures = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 5: { + message.fixedFeatures = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); break; } default: @@ -133903,6 +133374,7 @@ default: return "edition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -133915,10 +133387,15 @@ case 2147483647: break; } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (message.overridableFeatures != null && message.hasOwnProperty("overridableFeatures")) { + var error = $root.google.protobuf.FeatureSet.verify(message.overridableFeatures); + if (error) + return "overridableFeatures." + error; + } + if (message.fixedFeatures != null && message.hasOwnProperty("fixedFeatures")) { + var error = $root.google.protobuf.FeatureSet.verify(message.fixedFeatures); if (error) - return "features." + error; + return "fixedFeatures." + error; } return null; }; @@ -133946,6 +133423,10 @@ case 0: message.edition = 0; break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; case "EDITION_PROTO2": case 998: message.edition = 998; @@ -133987,10 +133468,15 @@ message.edition = 2147483647; break; } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + if (object.overridableFeatures != null) { + if (typeof object.overridableFeatures !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.overridableFeatures: object expected"); + message.overridableFeatures = $root.google.protobuf.FeatureSet.fromObject(object.overridableFeatures); + } + if (object.fixedFeatures != null) { + if (typeof object.fixedFeatures !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fixedFeatures: object expected"); + message.fixedFeatures = $root.google.protobuf.FeatureSet.fromObject(object.fixedFeatures); } return message; }; @@ -134009,13 +133495,16 @@ options = {}; var object = {}; if (options.defaults) { - object.features = null; object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.overridableFeatures = null; + object.fixedFeatures = null; } - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); if (message.edition != null && message.hasOwnProperty("edition")) object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + if (message.overridableFeatures != null && message.hasOwnProperty("overridableFeatures")) + object.overridableFeatures = $root.google.protobuf.FeatureSet.toObject(message.overridableFeatures, options); + if (message.fixedFeatures != null && message.hasOwnProperty("fixedFeatures")) + object.fixedFeatures = $root.google.protobuf.FeatureSet.toObject(message.fixedFeatures, options); return object; }; @@ -135230,6 +134719,22 @@ return GeneratedCodeInfo; })(); + /** + * SymbolVisibility enum. + * @name google.protobuf.SymbolVisibility + * @enum {number} + * @property {number} VISIBILITY_UNSET=0 VISIBILITY_UNSET value + * @property {number} VISIBILITY_LOCAL=1 VISIBILITY_LOCAL value + * @property {number} VISIBILITY_EXPORT=2 VISIBILITY_EXPORT value + */ + protobuf.SymbolVisibility = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VISIBILITY_UNSET"] = 0; + values[valuesById[1] = "VISIBILITY_LOCAL"] = 1; + values[valuesById[2] = "VISIBILITY_EXPORT"] = 2; + return values; + })(); + protobuf.Duration = (function() { /** diff --git a/packages/google-analytics-admin/protos/protos.json b/packages/google-analytics-admin/protos/protos.json index c62d8ef011f..b0f99b355da 100644 --- a/packages/google-analytics-admin/protos/protos.json +++ b/packages/google-analytics-admin/protos/protos.json @@ -2343,38 +2343,6 @@ } ] }, - "SetAutomatedGa4ConfigurationOptOut": { - "requestType": "SetAutomatedGa4ConfigurationOptOutRequest", - "responseType": "SetAutomatedGa4ConfigurationOptOutResponse", - "options": { - "(google.api.http).post": "/v1alpha/properties:setAutomatedGa4ConfigurationOptOut", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1alpha/properties:setAutomatedGa4ConfigurationOptOut", - "body": "*" - } - } - ] - }, - "FetchAutomatedGa4ConfigurationOptOut": { - "requestType": "FetchAutomatedGa4ConfigurationOptOutRequest", - "responseType": "FetchAutomatedGa4ConfigurationOptOutResponse", - "options": { - "(google.api.http).post": "/v1alpha/properties:fetchAutomatedGa4ConfigurationOptOut", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1alpha/properties:fetchAutomatedGa4ConfigurationOptOut", - "body": "*" - } - } - ] - }, "CreateBigQueryLink": { "requestType": "CreateBigQueryLinkRequest", "responseType": "BigQueryLink", @@ -2507,68 +2475,6 @@ } ] }, - "CreateConnectedSiteTag": { - "requestType": "CreateConnectedSiteTagRequest", - "responseType": "CreateConnectedSiteTagResponse", - "options": { - "(google.api.http).post": "/v1alpha/properties:createConnectedSiteTag", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1alpha/properties:createConnectedSiteTag", - "body": "*" - } - } - ] - }, - "DeleteConnectedSiteTag": { - "requestType": "DeleteConnectedSiteTagRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).post": "/v1alpha/properties:deleteConnectedSiteTag", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1alpha/properties:deleteConnectedSiteTag", - "body": "*" - } - } - ] - }, - "ListConnectedSiteTags": { - "requestType": "ListConnectedSiteTagsRequest", - "responseType": "ListConnectedSiteTagsResponse", - "options": { - "(google.api.http).post": "/v1alpha/properties:listConnectedSiteTags", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1alpha/properties:listConnectedSiteTags", - "body": "*" - } - } - ] - }, - "FetchConnectedGa4Property": { - "requestType": "FetchConnectedGa4PropertyRequest", - "responseType": "FetchConnectedGa4PropertyResponse", - "options": { - "(google.api.http).get": "/v1alpha/properties:fetchConnectedGa4Property" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1alpha/properties:fetchConnectedGa4Property" - } - } - ] - }, "GetAdSenseLink": { "requestType": "GetAdSenseLinkRequest", "responseType": "AdSenseLink", @@ -3348,6 +3254,24 @@ "(google.api.method_signature)": "name" } ] + }, + "GetReportingIdentitySettings": { + "requestType": "GetReportingIdentitySettingsRequest", + "responseType": "ReportingIdentitySettings", + "options": { + "(google.api.http).get": "/v1alpha/{name=properties/*/reportingIdentitySettings}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/{name=properties/*/reportingIdentitySettings}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] } } }, @@ -5536,43 +5460,6 @@ } } }, - "SetAutomatedGa4ConfigurationOptOutRequest": { - "fields": { - "property": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "optOut": { - "type": "bool", - "id": 2 - } - } - }, - "SetAutomatedGa4ConfigurationOptOutResponse": { - "fields": {} - }, - "FetchAutomatedGa4ConfigurationOptOutRequest": { - "fields": { - "property": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "FetchAutomatedGa4ConfigurationOptOutResponse": { - "fields": { - "optOut": { - "type": "bool", - "id": 1 - } - } - }, "CreateBigQueryLinkRequest": { "fields": { "parent": { @@ -5727,53 +5614,6 @@ } } }, - "CreateConnectedSiteTagRequest": { - "fields": { - "property": { - "type": "string", - "id": 1 - }, - "connectedSiteTag": { - "type": "ConnectedSiteTag", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "CreateConnectedSiteTagResponse": { - "fields": {} - }, - "DeleteConnectedSiteTagRequest": { - "fields": { - "property": { - "type": "string", - "id": 1 - }, - "tagId": { - "type": "string", - "id": 2 - } - } - }, - "ListConnectedSiteTagsRequest": { - "fields": { - "property": { - "type": "string", - "id": 1 - } - } - }, - "ListConnectedSiteTagsResponse": { - "fields": { - "connectedSiteTags": { - "rule": "repeated", - "type": "ConnectedSiteTag", - "id": 1 - } - } - }, "CreateAdSenseLinkRequest": { "fields": { "parent": { @@ -5850,29 +5690,6 @@ } } }, - "FetchConnectedGa4PropertyRequest": { - "fields": { - "property": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "analyticsadmin.googleapis.com/Property" - } - } - } - }, - "FetchConnectedGa4PropertyResponse": { - "fields": { - "property": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "analyticsadmin.googleapis.com/Property" - } - } - } - }, "CreateEventCreateRuleRequest": { "fields": { "parent": { @@ -6560,6 +6377,18 @@ } } }, + "GetReportingIdentitySettingsRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "analyticsadmin.googleapis.com/ReportingIdentitySettings" + } + } + } + }, "AudienceFilterScope": { "values": { "AUDIENCE_FILTER_SCOPE_UNSPECIFIED": 0, @@ -7617,7 +7446,8 @@ "KEY_EVENT": 30, "CALCULATED_METRIC": 31, "REPORTING_DATA_ANNOTATION": 32, - "SUBPROPERTY_SYNC_CONFIG": 33 + "SUBPROPERTY_SYNC_CONFIG": 33, + "REPORTING_IDENTITY_SETTINGS": 34 } }, "GoogleSignalsState": { @@ -8395,7 +8225,8 @@ "keyEvent", "calculatedMetric", "reportingDataAnnotation", - "subpropertySyncConfig" + "subpropertySyncConfig", + "reportingIdentitySettings" ] } }, @@ -8511,6 +8342,10 @@ "subpropertySyncConfig": { "type": "SubpropertySyncConfig", "id": 33 + }, + "reportingIdentitySettings": { + "type": "ReportingIdentitySettings", + "id": 34 } } } @@ -9430,24 +9265,6 @@ } } }, - "ConnectedSiteTag": { - "fields": { - "displayName": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "tagId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, "DataRedactionSettings": { "options": { "(google.api.resource).type": "analyticsadmin.googleapis.com/DataRedactionSettings", @@ -9655,6 +9472,37 @@ } } }, + "ReportingIdentitySettings": { + "options": { + "(google.api.resource).type": "analyticsadmin.googleapis.com/ReportingIdentitySettings", + "(google.api.resource).pattern": "properties/{property}/reportingIdentitySettings", + "(google.api.resource).plural": "reportingIdentitySettings", + "(google.api.resource).singular": "reportingIdentitySettings" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "reportingIdentity": { + "type": "ReportingIdentity", + "id": 2 + } + }, + "nested": { + "ReportingIdentity": { + "values": { + "IDENTITY_BLENDING_STRATEGY_UNSPECIFIED": 0, + "BLENDED": 1, + "OBSERVED": 2, + "DEVICE_BASED": 3 + } + } + } + }, "SubpropertyEventFilterCondition": { "oneofs": { "oneFilter": { @@ -13401,8 +13249,7 @@ "java_multiple_files": true, "java_outer_classname": "LaunchStageProto", "java_package": "com.google.api", - "objc_class_prefix": "GAPI", - "cc_enable_arenas": true + "objc_class_prefix": "GAPI" }, "nested": { "fieldBehavior": { @@ -13625,6 +13472,10 @@ "rule": "repeated", "type": "ClientLibraryDestination", "id": 2 + }, + "selectiveGapicGeneration": { + "type": "SelectiveGapicGeneration", + "id": 3 } } }, @@ -13765,6 +13616,28 @@ "common": { "type": "CommonLanguageSettings", "id": 1 + }, + "experimentalFeatures": { + "type": "ExperimentalFeatures", + "id": 2 + } + }, + "nested": { + "ExperimentalFeatures": { + "fields": { + "restAsyncIoEnabled": { + "type": "bool", + "id": 1 + }, + "protobufPythonicTypesEnabled": { + "type": "bool", + "id": 2 + }, + "unversionedPackageDisabled": { + "type": "bool", + "id": 3 + } + } } } }, @@ -13822,6 +13695,11 @@ "common": { "type": "CommonLanguageSettings", "id": 1 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 } } }, @@ -13883,6 +13761,19 @@ "PACKAGE_MANAGER": 20 } }, + "SelectiveGapicGeneration": { + "fields": { + "methods": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "generateOmittedAsInternal": { + "type": "bool", + "id": 2 + } + } + }, "LaunchStage": { "values": { "LAUNCH_STAGE_UNSPECIFIED": 0, @@ -13916,12 +13807,19 @@ "type": "FileDescriptorProto", "id": 1 } - } + }, + "extensions": [ + [ + 536000000, + 536000000 + ] + ] }, "Edition": { "edition": "proto2", "values": { "EDITION_UNKNOWN": 0, + "EDITION_LEGACY": 900, "EDITION_PROTO2": 998, "EDITION_PROTO3": 999, "EDITION_2023": 1000, @@ -13960,6 +13858,11 @@ "type": "int32", "id": 11 }, + "optionDependency": { + "rule": "repeated", + "type": "string", + "id": 15 + }, "messageType": { "rule": "repeated", "type": "DescriptorProto", @@ -14048,6 +13951,10 @@ "rule": "repeated", "type": "string", "id": 10 + }, + "visibility": { + "type": "SymbolVisibility", + "id": 11 } }, "nested": { @@ -14273,6 +14180,10 @@ "rule": "repeated", "type": "string", "id": 5 + }, + "visibility": { + "type": "SymbolVisibility", + "id": 6 } }, "nested": { @@ -14487,6 +14398,7 @@ 42, 42 ], + "php_generic_services", [ 38, 38 @@ -14622,7 +14534,8 @@ "type": "bool", "id": 10, "options": { - "default": false + "default": false, + "deprecated": true } }, "debugRedact": { @@ -14650,6 +14563,10 @@ "type": "FeatureSet", "id": 21 }, + "featureSupport": { + "type": "FeatureSupport", + "id": 22 + }, "uninterpretedOption": { "rule": "repeated", "type": "UninterpretedOption", @@ -14719,6 +14636,26 @@ "id": 2 } } + }, + "FeatureSupport": { + "fields": { + "editionIntroduced": { + "type": "Edition", + "id": 1 + }, + "editionDeprecated": { + "type": "Edition", + "id": 2 + }, + "deprecationWarning": { + "type": "string", + "id": 3 + }, + "editionRemoved": { + "type": "Edition", + "id": 4 + } + } } } }, @@ -14807,6 +14744,10 @@ "default": false } }, + "featureSupport": { + "type": "FieldOptions.FeatureSupport", + "id": 4 + }, "uninterpretedOption": { "rule": "repeated", "type": "UninterpretedOption", @@ -14949,6 +14890,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_2023", "edition_defaults.value": "EXPLICIT" } @@ -14959,6 +14901,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "OPEN" } @@ -14969,6 +14912,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "PACKED" } @@ -14979,6 +14923,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "VERIFY" } @@ -14989,7 +14934,8 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO2", + "feature_support.edition_introduced": "EDITION_2023", + "edition_defaults.edition": "EDITION_LEGACY", "edition_defaults.value": "LENGTH_PREFIXED" } }, @@ -14999,27 +14945,38 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "ALLOW" } + }, + "enforceNamingStyle": { + "type": "EnforceNamingStyle", + "id": 7, + "options": { + "retention": "RETENTION_SOURCE", + "targets": "TARGET_TYPE_METHOD", + "feature_support.edition_introduced": "EDITION_2024", + "edition_defaults.edition": "EDITION_2024", + "edition_defaults.value": "STYLE2024" + } + }, + "defaultSymbolVisibility": { + "type": "VisibilityFeature.DefaultSymbolVisibility", + "id": 8, + "options": { + "retention": "RETENTION_SOURCE", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2024", + "edition_defaults.edition": "EDITION_2024", + "edition_defaults.value": "EXPORT_TOP_LEVEL" + } } }, "extensions": [ [ 1000, - 1000 - ], - [ - 1001, - 1001 - ], - [ - 1002, - 1002 - ], - [ - 9990, - 9990 + 9994 ], [ 9995, @@ -15064,7 +15021,13 @@ "UTF8_VALIDATION_UNKNOWN": 0, "VERIFY": 2, "NONE": 3 - } + }, + "reserved": [ + [ + 1, + 1 + ] + ] }, "MessageEncoding": { "values": { @@ -15079,6 +15042,33 @@ "ALLOW": 1, "LEGACY_BEST_EFFORT": 2 } + }, + "EnforceNamingStyle": { + "values": { + "ENFORCE_NAMING_STYLE_UNKNOWN": 0, + "STYLE2024": 1, + "STYLE_LEGACY": 2 + } + }, + "VisibilityFeature": { + "fields": {}, + "reserved": [ + [ + 1, + 536870911 + ] + ], + "nested": { + "DefaultSymbolVisibility": { + "values": { + "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN": 0, + "EXPORT_ALL": 1, + "EXPORT_TOP_LEVEL": 2, + "LOCAL_ALL": 3, + "STRICT": 4 + } + } + } } } }, @@ -15106,11 +15096,26 @@ "type": "Edition", "id": 3 }, - "features": { + "overridableFeatures": { "type": "FeatureSet", - "id": 2 + "id": 4 + }, + "fixedFeatures": { + "type": "FeatureSet", + "id": 5 } - } + }, + "reserved": [ + [ + 1, + 1 + ], + [ + 2, + 2 + ], + "features" + ] } } }, @@ -15123,6 +15128,12 @@ "id": 1 } }, + "extensions": [ + [ + 536000000, + 536000000 + ] + ], "nested": { "Location": { "fields": { @@ -15208,6 +15219,14 @@ } } }, + "SymbolVisibility": { + "edition": "proto2", + "values": { + "VISIBILITY_UNSET": 0, + "VISIBILITY_LOCAL": 1, + "VISIBILITY_EXPORT": 2 + } + }, "Duration": { "fields": { "seconds": { diff --git a/packages/google-analytics-admin/samples/README.md b/packages/google-analytics-admin/samples/README.md index 4985f22631d..c65ad226c56 100644 --- a/packages/google-analytics-admin/samples/README.md +++ b/packages/google-analytics-admin/samples/README.md @@ -116,6 +116,7 @@ * [Analytics_admin_service.get_measurement_protocol_secret](#analytics_admin_service.get_measurement_protocol_secret) * [Analytics_admin_service.get_property](#analytics_admin_service.get_property) * [Analytics_admin_service.get_reporting_data_annotation](#analytics_admin_service.get_reporting_data_annotation) + * [Analytics_admin_service.get_reporting_identity_settings](#analytics_admin_service.get_reporting_identity_settings) * [Analytics_admin_service.get_rollup_property_source_link](#analytics_admin_service.get_rollup_property_source_link) * [Analytics_admin_service.get_s_k_ad_network_conversion_value_schema](#analytics_admin_service.get_s_k_ad_network_conversion_value_schema) * [Analytics_admin_service.get_search_ads360_link](#analytics_admin_service.get_search_ads360_link) @@ -2034,6 +2035,23 @@ __Usage:__ +### Analytics_admin_service.get_reporting_identity_settings + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_reporting_identity_settings.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_reporting_identity_settings.js,samples/README.md) + +__Usage:__ + + +`node packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_reporting_identity_settings.js` + + +----- + + + + ### Analytics_admin_service.get_rollup_property_source_link View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_rollup_property_source_link.js). diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_reporting_identity_settings.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_reporting_identity_settings.js new file mode 100644 index 00000000000..a40feb32b23 --- /dev/null +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_reporting_identity_settings.js @@ -0,0 +1,64 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetReportingIdentitySettings_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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the settings to lookup. + * Format: + * properties/{property}/reportingIdentitySettings + * Example: "properties/1000/reportingIdentitySettings" + */ + // const name = 'abc123' + + // Imports the Admin library + const {AnalyticsAdminServiceClient} = require('@google-analytics/admin').v1alpha; + + // Instantiates a client + const adminClient = new AnalyticsAdminServiceClient(); + + async function callGetReportingIdentitySettings() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await adminClient.getReportingIdentitySettings(request); + console.log(response); + } + + callGetReportingIdentitySettings(); + // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetReportingIdentitySettings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.submit_user_deletion.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.submit_user_deletion.js index 6ba548304ae..99564da0f9b 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.submit_user_deletion.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.submit_user_deletion.js @@ -44,8 +44,16 @@ function main(name) { */ // const appInstanceId = 'abc123' /** - * The un-hashed, unencrypted, user-provided - * data (https://support.google.com/analytics/answer/14077171). + * User-provided + * data (https://support.google.com/analytics/answer/14077171). May contain + * either one email address or one phone number. + * Email addresses should be normalized as such: + * * lowercase + * * remove periods before @ for gmail.com/googlemail.com addresses + * * remove all spaces + * Phone numbers should be normalized as such: + * * remove all non digit characters + * * add + prefix */ // const userProvidedData = 'abc123' /** diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_subproperty_sync_config.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_subproperty_sync_config.js index 8c7a1752eea..5fa61cd1217 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_subproperty_sync_config.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_subproperty_sync_config.js @@ -29,7 +29,7 @@ function main(subpropertySyncConfig) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The SubpropertySyncConfig to update. + * Required. The `SubpropertySyncConfig` to update. */ // const subpropertySyncConfig = {} /** diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/snippet_metadata.google.analytics.admin.v1alpha.json b/packages/google-analytics-admin/samples/generated/v1alpha/snippet_metadata.google.analytics.admin.v1alpha.json index 37befaf4c12..ca1938ed565 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/snippet_metadata.google.analytics.admin.v1alpha.json +++ b/packages/google-analytics-admin/samples/generated/v1alpha/snippet_metadata.google.analytics.admin.v1alpha.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-admin", - "version": "8.3.0", + "version": "9.0.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/snippet_metadata_google.analytics.admin.v1alpha.json b/packages/google-analytics-admin/samples/generated/v1alpha/snippet_metadata_google.analytics.admin.v1alpha.json index 7655d43d628..5ff2da581f0 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/snippet_metadata_google.analytics.admin.v1alpha.json +++ b/packages/google-analytics-admin/samples/generated/v1alpha/snippet_metadata_google.analytics.admin.v1alpha.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-admin", - "version": "8.3.0", + "version": "9.0.0", "language": "TYPESCRIPT", "apis": [ { @@ -4563,90 +4563,6 @@ } } }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_SetAutomatedGa4ConfigurationOptOut_async", - "title": "AnalyticsAdminService setAutomatedGa4ConfigurationOptOut Sample", - "origin": "API_DEFINITION", - "description": " Sets the opt out status for the automated GA4 setup process for a UA property. Note: this has no effect on GA4 property.", - "canonical": true, - "file": "analytics_admin_service.set_automated_ga4_configuration_opt_out.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 60, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetAutomatedGa4ConfigurationOptOut", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.SetAutomatedGa4ConfigurationOptOut", - "async": true, - "parameters": [ - { - "name": "property", - "type": "TYPE_STRING" - }, - { - "name": "opt_out", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutResponse", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "SetAutomatedGa4ConfigurationOptOut", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.SetAutomatedGa4ConfigurationOptOut", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_FetchAutomatedGa4ConfigurationOptOut_async", - "title": "AnalyticsAdminService fetchAutomatedGa4ConfigurationOptOut Sample", - "origin": "API_DEFINITION", - "description": " Fetches the opt out status for the automated GA4 setup process for a UA property. Note: this has no effect on GA4 property.", - "canonical": true, - "file": "analytics_admin_service.fetch_automated_ga4_configuration_opt_out.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "FetchAutomatedGa4ConfigurationOptOut", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.FetchAutomatedGa4ConfigurationOptOut", - "async": true, - "parameters": [ - { - "name": "property", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutResponse", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "FetchAutomatedGa4ConfigurationOptOut", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.FetchAutomatedGa4ConfigurationOptOut", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, { "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateBigQueryLink_async", "title": "AnalyticsAdminService createBigQueryLink Sample", @@ -4947,174 +4863,6 @@ } } }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateConnectedSiteTag_async", - "title": "AnalyticsAdminService createConnectedSiteTag Sample", - "origin": "API_DEFINITION", - "description": " Creates a connected site tag for a Universal Analytics property. You can create a maximum of 20 connected site tags per property. Note: This API cannot be used on GA4 properties.", - "canonical": true, - "file": "analytics_admin_service.create_connected_site_tag.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 60, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateConnectedSiteTag", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateConnectedSiteTag", - "async": true, - "parameters": [ - { - "name": "property", - "type": "TYPE_STRING" - }, - { - "name": "connected_site_tag", - "type": ".google.analytics.admin.v1alpha.ConnectedSiteTag" - } - ], - "resultType": ".google.analytics.admin.v1alpha.CreateConnectedSiteTagResponse", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "CreateConnectedSiteTag", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.CreateConnectedSiteTag", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteConnectedSiteTag_async", - "title": "AnalyticsAdminService deleteConnectedSiteTag Sample", - "origin": "API_DEFINITION", - "description": " Deletes a connected site tag for a Universal Analytics property. Note: this has no effect on GA4 properties.", - "canonical": true, - "file": "analytics_admin_service.delete_connected_site_tag.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 60, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteConnectedSiteTag", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteConnectedSiteTag", - "async": true, - "parameters": [ - { - "name": "property", - "type": "TYPE_STRING" - }, - { - "name": "tag_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "DeleteConnectedSiteTag", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.DeleteConnectedSiteTag", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListConnectedSiteTags_async", - "title": "AnalyticsAdminService listConnectedSiteTags Sample", - "origin": "API_DEFINITION", - "description": " Lists the connected site tags for a Universal Analytics property. A maximum of 20 connected site tags will be returned. Note: this has no effect on GA4 property.", - "canonical": true, - "file": "analytics_admin_service.list_connected_site_tags.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListConnectedSiteTags", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListConnectedSiteTags", - "async": true, - "parameters": [ - { - "name": "property", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1alpha.ListConnectedSiteTagsResponse", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "ListConnectedSiteTags", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListConnectedSiteTags", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, - { - "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_FetchConnectedGa4Property_async", - "title": "AnalyticsAdminService fetchConnectedGa4Property Sample", - "origin": "API_DEFINITION", - "description": " Given a specified UA property, looks up the GA4 property connected to it. Note: this cannot be used with GA4 properties.", - "canonical": true, - "file": "analytics_admin_service.fetch_connected_ga4_property.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 57, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "FetchConnectedGa4Property", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.FetchConnectedGa4Property", - "async": true, - "parameters": [ - { - "name": "property", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.analytics.admin.v1alpha.FetchConnectedGa4PropertyResponse", - "client": { - "shortName": "AnalyticsAdminServiceClient", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" - }, - "method": { - "shortName": "FetchConnectedGa4Property", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.FetchConnectedGa4Property", - "service": { - "shortName": "AnalyticsAdminService", - "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" - } - } - } - }, { "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetAdSenseLink_async", "title": "AnalyticsAdminService getAdSenseLink Sample", @@ -6778,7 +6526,7 @@ "segments": [ { "start": 25, - "end": 73, + "end": 81, "type": "FULL" } ], @@ -6827,7 +6575,7 @@ "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListSubpropertySyncConfigs_async", "title": "AnalyticsAdminService listSubpropertySyncConfigs Sample", "origin": "API_DEFINITION", - "description": " List all Subproperty Sync Configs on a property.", + "description": " List all `SubpropertySyncConfig` resources for a property.", "canonical": true, "file": "analytics_admin_service.list_subproperty_sync_configs.js", "language": "JAVASCRIPT", @@ -6875,7 +6623,7 @@ "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateSubpropertySyncConfig_async", "title": "AnalyticsAdminService updateSubpropertySyncConfig Sample", "origin": "API_DEFINITION", - "description": " Updates a Subproperty Sync Config.", + "description": " Updates a `SubpropertySyncConfig`.", "canonical": true, "file": "analytics_admin_service.update_subproperty_sync_config.js", "language": "JAVASCRIPT", @@ -6919,7 +6667,7 @@ "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetSubpropertySyncConfig_async", "title": "AnalyticsAdminService getSubpropertySyncConfig Sample", "origin": "API_DEFINITION", - "description": " Lookup for a single Subproperty Sync Config.", + "description": " Lookup for a single `SubpropertySyncConfig`.", "canonical": true, "file": "analytics_admin_service.get_subproperty_sync_config.js", "language": "JAVASCRIPT", @@ -6954,6 +6702,46 @@ } } } + }, + { + "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetReportingIdentitySettings_async", + "title": "AnalyticsAdminService getReportingIdentitySettings Sample", + "origin": "API_DEFINITION", + "description": " Returns the singleton data retention settings for this property.", + "canonical": true, + "file": "analytics_admin_service.get_reporting_identity_settings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetReportingIdentitySettings", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetReportingIdentitySettings", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.analytics.admin.v1alpha.ReportingIdentitySettings", + "client": { + "shortName": "AnalyticsAdminServiceClient", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminServiceClient" + }, + "method": { + "shortName": "GetReportingIdentitySettings", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService.GetReportingIdentitySettings", + "service": { + "shortName": "AnalyticsAdminService", + "fullName": "google.analytics.admin.v1alpha.AnalyticsAdminService" + } + } + } } ] } \ No newline at end of file diff --git a/packages/google-analytics-admin/samples/generated/v1beta/snippet_metadata.google.analytics.admin.v1beta.json b/packages/google-analytics-admin/samples/generated/v1beta/snippet_metadata.google.analytics.admin.v1beta.json index d7dda735240..130b5f683c9 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/snippet_metadata.google.analytics.admin.v1beta.json +++ b/packages/google-analytics-admin/samples/generated/v1beta/snippet_metadata.google.analytics.admin.v1beta.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-admin", - "version": "8.3.0", + "version": "9.0.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-analytics-admin/samples/generated/v1beta/snippet_metadata_google.analytics.admin.v1beta.json b/packages/google-analytics-admin/samples/generated/v1beta/snippet_metadata_google.analytics.admin.v1beta.json index 71baefef647..78458fa1580 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/snippet_metadata_google.analytics.admin.v1beta.json +++ b/packages/google-analytics-admin/samples/generated/v1beta/snippet_metadata_google.analytics.admin.v1beta.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-admin", - "version": "8.3.0", + "version": "9.0.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-analytics-admin/samples/package.json b/packages/google-analytics-admin/samples/package.json index 1ab0b748ba8..843f827990e 100644 --- a/packages/google-analytics-admin/samples/package.json +++ b/packages/google-analytics-admin/samples/package.json @@ -14,7 +14,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-analytics/admin": "^8.3.0", + "@google-analytics/admin": "^9.0.0", "google-auth-library": "^10.0.0", "google-gax": "^5.0.0", "http": "0.0.1-security", diff --git a/packages/google-analytics-admin/src/v1alpha/analytics_admin_service_client.ts b/packages/google-analytics-admin/src/v1alpha/analytics_admin_service_client.ts index 1a337a6f3cf..2f593e058e3 100644 --- a/packages/google-analytics-admin/src/v1alpha/analytics_admin_service_client.ts +++ b/packages/google-analytics-admin/src/v1alpha/analytics_admin_service_client.ts @@ -270,6 +270,9 @@ export class AnalyticsAdminServiceClient { reportingDataAnnotationPathTemplate: new this._gaxModule.PathTemplate( 'properties/{property}/reportingDataAnnotations/{reporting_data_annotation}' ), + reportingIdentitySettingsPathTemplate: new this._gaxModule.PathTemplate( + 'properties/{property}/reportingIdentitySettings' + ), rollupPropertySourceLinkPathTemplate: new this._gaxModule.PathTemplate( 'properties/{property}/rollupPropertySourceLinks/{rollup_property_source_link}' ), @@ -394,7 +397,7 @@ export class AnalyticsAdminServiceClient { // Iterate over each of the methods that the service provides // and create an API call method for each. const analyticsAdminServiceStubMethods = - ['getAccount', 'listAccounts', 'deleteAccount', 'updateAccount', 'provisionAccountTicket', 'listAccountSummaries', 'getProperty', 'listProperties', 'createProperty', 'deleteProperty', 'updateProperty', 'createFirebaseLink', 'deleteFirebaseLink', 'listFirebaseLinks', 'getGlobalSiteTag', 'createGoogleAdsLink', 'updateGoogleAdsLink', 'deleteGoogleAdsLink', 'listGoogleAdsLinks', 'getDataSharingSettings', 'getMeasurementProtocolSecret', 'listMeasurementProtocolSecrets', 'createMeasurementProtocolSecret', 'deleteMeasurementProtocolSecret', 'updateMeasurementProtocolSecret', 'acknowledgeUserDataCollection', 'getSkAdNetworkConversionValueSchema', 'createSkAdNetworkConversionValueSchema', 'deleteSkAdNetworkConversionValueSchema', 'updateSkAdNetworkConversionValueSchema', 'listSkAdNetworkConversionValueSchemas', 'searchChangeHistoryEvents', 'getGoogleSignalsSettings', 'updateGoogleSignalsSettings', 'createConversionEvent', 'updateConversionEvent', 'getConversionEvent', 'deleteConversionEvent', 'listConversionEvents', 'createKeyEvent', 'updateKeyEvent', 'getKeyEvent', 'deleteKeyEvent', 'listKeyEvents', 'getDisplayVideo360AdvertiserLink', 'listDisplayVideo360AdvertiserLinks', 'createDisplayVideo360AdvertiserLink', 'deleteDisplayVideo360AdvertiserLink', 'updateDisplayVideo360AdvertiserLink', 'getDisplayVideo360AdvertiserLinkProposal', 'listDisplayVideo360AdvertiserLinkProposals', 'createDisplayVideo360AdvertiserLinkProposal', 'deleteDisplayVideo360AdvertiserLinkProposal', 'approveDisplayVideo360AdvertiserLinkProposal', 'cancelDisplayVideo360AdvertiserLinkProposal', 'createCustomDimension', 'updateCustomDimension', 'listCustomDimensions', 'archiveCustomDimension', 'getCustomDimension', 'createCustomMetric', 'updateCustomMetric', 'listCustomMetrics', 'archiveCustomMetric', 'getCustomMetric', 'getDataRetentionSettings', 'updateDataRetentionSettings', 'createDataStream', 'deleteDataStream', 'updateDataStream', 'listDataStreams', 'getDataStream', 'getAudience', 'listAudiences', 'createAudience', 'updateAudience', 'archiveAudience', 'getSearchAds360Link', 'listSearchAds360Links', 'createSearchAds360Link', 'deleteSearchAds360Link', 'updateSearchAds360Link', 'getAttributionSettings', 'updateAttributionSettings', 'runAccessReport', 'createAccessBinding', 'getAccessBinding', 'updateAccessBinding', 'deleteAccessBinding', 'listAccessBindings', 'batchCreateAccessBindings', 'batchGetAccessBindings', 'batchUpdateAccessBindings', 'batchDeleteAccessBindings', 'getExpandedDataSet', 'listExpandedDataSets', 'createExpandedDataSet', 'updateExpandedDataSet', 'deleteExpandedDataSet', 'getChannelGroup', 'listChannelGroups', 'createChannelGroup', 'updateChannelGroup', 'deleteChannelGroup', 'setAutomatedGa4ConfigurationOptOut', 'fetchAutomatedGa4ConfigurationOptOut', 'createBigQueryLink', 'getBigQueryLink', 'listBigQueryLinks', 'deleteBigQueryLink', 'updateBigQueryLink', 'getEnhancedMeasurementSettings', 'updateEnhancedMeasurementSettings', 'createConnectedSiteTag', 'deleteConnectedSiteTag', 'listConnectedSiteTags', 'fetchConnectedGa4Property', 'getAdSenseLink', 'createAdSenseLink', 'deleteAdSenseLink', 'listAdSenseLinks', 'getEventCreateRule', 'listEventCreateRules', 'createEventCreateRule', 'updateEventCreateRule', 'deleteEventCreateRule', 'getEventEditRule', 'listEventEditRules', 'createEventEditRule', 'updateEventEditRule', 'deleteEventEditRule', 'reorderEventEditRules', 'updateDataRedactionSettings', 'getDataRedactionSettings', 'getCalculatedMetric', 'createCalculatedMetric', 'listCalculatedMetrics', 'updateCalculatedMetric', 'deleteCalculatedMetric', 'createRollupProperty', 'getRollupPropertySourceLink', 'listRollupPropertySourceLinks', 'createRollupPropertySourceLink', 'deleteRollupPropertySourceLink', 'provisionSubproperty', 'createSubpropertyEventFilter', 'getSubpropertyEventFilter', 'listSubpropertyEventFilters', 'updateSubpropertyEventFilter', 'deleteSubpropertyEventFilter', 'createReportingDataAnnotation', 'getReportingDataAnnotation', 'listReportingDataAnnotations', 'updateReportingDataAnnotation', 'deleteReportingDataAnnotation', 'submitUserDeletion', 'listSubpropertySyncConfigs', 'updateSubpropertySyncConfig', 'getSubpropertySyncConfig']; + ['getAccount', 'listAccounts', 'deleteAccount', 'updateAccount', 'provisionAccountTicket', 'listAccountSummaries', 'getProperty', 'listProperties', 'createProperty', 'deleteProperty', 'updateProperty', 'createFirebaseLink', 'deleteFirebaseLink', 'listFirebaseLinks', 'getGlobalSiteTag', 'createGoogleAdsLink', 'updateGoogleAdsLink', 'deleteGoogleAdsLink', 'listGoogleAdsLinks', 'getDataSharingSettings', 'getMeasurementProtocolSecret', 'listMeasurementProtocolSecrets', 'createMeasurementProtocolSecret', 'deleteMeasurementProtocolSecret', 'updateMeasurementProtocolSecret', 'acknowledgeUserDataCollection', 'getSkAdNetworkConversionValueSchema', 'createSkAdNetworkConversionValueSchema', 'deleteSkAdNetworkConversionValueSchema', 'updateSkAdNetworkConversionValueSchema', 'listSkAdNetworkConversionValueSchemas', 'searchChangeHistoryEvents', 'getGoogleSignalsSettings', 'updateGoogleSignalsSettings', 'createConversionEvent', 'updateConversionEvent', 'getConversionEvent', 'deleteConversionEvent', 'listConversionEvents', 'createKeyEvent', 'updateKeyEvent', 'getKeyEvent', 'deleteKeyEvent', 'listKeyEvents', 'getDisplayVideo360AdvertiserLink', 'listDisplayVideo360AdvertiserLinks', 'createDisplayVideo360AdvertiserLink', 'deleteDisplayVideo360AdvertiserLink', 'updateDisplayVideo360AdvertiserLink', 'getDisplayVideo360AdvertiserLinkProposal', 'listDisplayVideo360AdvertiserLinkProposals', 'createDisplayVideo360AdvertiserLinkProposal', 'deleteDisplayVideo360AdvertiserLinkProposal', 'approveDisplayVideo360AdvertiserLinkProposal', 'cancelDisplayVideo360AdvertiserLinkProposal', 'createCustomDimension', 'updateCustomDimension', 'listCustomDimensions', 'archiveCustomDimension', 'getCustomDimension', 'createCustomMetric', 'updateCustomMetric', 'listCustomMetrics', 'archiveCustomMetric', 'getCustomMetric', 'getDataRetentionSettings', 'updateDataRetentionSettings', 'createDataStream', 'deleteDataStream', 'updateDataStream', 'listDataStreams', 'getDataStream', 'getAudience', 'listAudiences', 'createAudience', 'updateAudience', 'archiveAudience', 'getSearchAds360Link', 'listSearchAds360Links', 'createSearchAds360Link', 'deleteSearchAds360Link', 'updateSearchAds360Link', 'getAttributionSettings', 'updateAttributionSettings', 'runAccessReport', 'createAccessBinding', 'getAccessBinding', 'updateAccessBinding', 'deleteAccessBinding', 'listAccessBindings', 'batchCreateAccessBindings', 'batchGetAccessBindings', 'batchUpdateAccessBindings', 'batchDeleteAccessBindings', 'getExpandedDataSet', 'listExpandedDataSets', 'createExpandedDataSet', 'updateExpandedDataSet', 'deleteExpandedDataSet', 'getChannelGroup', 'listChannelGroups', 'createChannelGroup', 'updateChannelGroup', 'deleteChannelGroup', 'createBigQueryLink', 'getBigQueryLink', 'listBigQueryLinks', 'deleteBigQueryLink', 'updateBigQueryLink', 'getEnhancedMeasurementSettings', 'updateEnhancedMeasurementSettings', 'getAdSenseLink', 'createAdSenseLink', 'deleteAdSenseLink', 'listAdSenseLinks', 'getEventCreateRule', 'listEventCreateRules', 'createEventCreateRule', 'updateEventCreateRule', 'deleteEventCreateRule', 'getEventEditRule', 'listEventEditRules', 'createEventEditRule', 'updateEventEditRule', 'deleteEventEditRule', 'reorderEventEditRules', 'updateDataRedactionSettings', 'getDataRedactionSettings', 'getCalculatedMetric', 'createCalculatedMetric', 'listCalculatedMetrics', 'updateCalculatedMetric', 'deleteCalculatedMetric', 'createRollupProperty', 'getRollupPropertySourceLink', 'listRollupPropertySourceLinks', 'createRollupPropertySourceLink', 'deleteRollupPropertySourceLink', 'provisionSubproperty', 'createSubpropertyEventFilter', 'getSubpropertyEventFilter', 'listSubpropertyEventFilters', 'updateSubpropertyEventFilter', 'deleteSubpropertyEventFilter', 'createReportingDataAnnotation', 'getReportingDataAnnotation', 'listReportingDataAnnotations', 'updateReportingDataAnnotation', 'deleteReportingDataAnnotation', 'submitUserDeletion', 'listSubpropertySyncConfigs', 'updateSubpropertySyncConfig', 'getSubpropertySyncConfig', 'getReportingIdentitySettings']; for (const methodName of analyticsAdminServiceStubMethods) { const callPromise = this.analyticsAdminServiceStub.then( stub => (...args: Array<{}>) => { @@ -8780,196 +8783,6 @@ export class AnalyticsAdminServiceClient { throw error; }); } -/** - * Sets the opt out status for the automated GA4 setup process for a UA - * property. - * Note: this has no effect on GA4 property. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.property - * Required. The UA property to set the opt out status. Note this request uses - * the internal property ID, not the tracking ID of the form UA-XXXXXX-YY. - * Format: properties/{internalWebPropertyId} - * Example: properties/1234 - * @param {boolean} request.optOut - * The status to set. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutResponse|SetAutomatedGa4ConfigurationOptOutResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/analytics_admin_service.set_automated_ga4_configuration_opt_out.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_SetAutomatedGa4ConfigurationOptOut_async - */ - setAutomatedGa4ConfigurationOptOut( - request?: protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutResponse, - protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutRequest|undefined, {}|undefined - ]>; - setAutomatedGa4ConfigurationOptOut( - request: protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutResponse, - protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutRequest|null|undefined, - {}|null|undefined>): void; - setAutomatedGa4ConfigurationOptOut( - request: protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutResponse, - protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutRequest|null|undefined, - {}|null|undefined>): void; - setAutomatedGa4ConfigurationOptOut( - request?: protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutResponse, - protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutResponse, - protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutResponse, - protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - this.initialize().catch(err => {throw err}); - this._log.info('setAutomatedGa4ConfigurationOptOut request %j', request); - const wrappedCallback: Callback< - protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutResponse, - protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('setAutomatedGa4ConfigurationOptOut response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.setAutomatedGa4ConfigurationOptOut(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutResponse, - protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutRequest|undefined, - {}|undefined - ]) => { - this._log.info('setAutomatedGa4ConfigurationOptOut response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Fetches the opt out status for the automated GA4 setup process for a UA - * property. - * Note: this has no effect on GA4 property. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.property - * Required. The UA property to get the opt out status. Note this request uses - * the internal property ID, not the tracking ID of the form UA-XXXXXX-YY. - * Format: properties/{internalWebPropertyId} - * Example: properties/1234 - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutResponse|FetchAutomatedGa4ConfigurationOptOutResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/analytics_admin_service.fetch_automated_ga4_configuration_opt_out.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_FetchAutomatedGa4ConfigurationOptOut_async - */ - fetchAutomatedGa4ConfigurationOptOut( - request?: protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutResponse, - protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutRequest|undefined, {}|undefined - ]>; - fetchAutomatedGa4ConfigurationOptOut( - request: protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutResponse, - protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutRequest|null|undefined, - {}|null|undefined>): void; - fetchAutomatedGa4ConfigurationOptOut( - request: protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutResponse, - protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutRequest|null|undefined, - {}|null|undefined>): void; - fetchAutomatedGa4ConfigurationOptOut( - request?: protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutResponse, - protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutResponse, - protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutResponse, - protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - this.initialize().catch(err => {throw err}); - this._log.info('fetchAutomatedGa4ConfigurationOptOut request %j', request); - const wrappedCallback: Callback< - protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutResponse, - protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('fetchAutomatedGa4ConfigurationOptOut response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.fetchAutomatedGa4ConfigurationOptOut(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutResponse, - protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutRequest|undefined, - {}|undefined - ]) => { - this._log.info('fetchAutomatedGa4ConfigurationOptOut response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } /** * Creates a BigQueryLink. * @@ -9558,386 +9371,6 @@ export class AnalyticsAdminServiceClient { throw error; }); } -/** - * Creates a connected site tag for a Universal Analytics property. You can - * create a maximum of 20 connected site tags per property. - * Note: This API cannot be used on GA4 properties. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.property - * The Universal Analytics property to create connected site tags for. - * This API does not support GA4 properties. - * Format: properties/{universalAnalyticsPropertyId} - * Example: properties/1234 - * @param {google.analytics.admin.v1alpha.ConnectedSiteTag} request.connectedSiteTag - * Required. The tag to add to the Universal Analytics property - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.analytics.admin.v1alpha.CreateConnectedSiteTagResponse|CreateConnectedSiteTagResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/analytics_admin_service.create_connected_site_tag.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateConnectedSiteTag_async - */ - createConnectedSiteTag( - request?: protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagResponse, - protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagRequest|undefined, {}|undefined - ]>; - createConnectedSiteTag( - request: protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagResponse, - protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagRequest|null|undefined, - {}|null|undefined>): void; - createConnectedSiteTag( - request: protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagResponse, - protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagRequest|null|undefined, - {}|null|undefined>): void; - createConnectedSiteTag( - request?: protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagResponse, - protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagResponse, - protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagResponse, - protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - this.initialize().catch(err => {throw err}); - this._log.info('createConnectedSiteTag request %j', request); - const wrappedCallback: Callback< - protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagResponse, - protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('createConnectedSiteTag response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.createConnectedSiteTag(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagResponse, - protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagRequest|undefined, - {}|undefined - ]) => { - this._log.info('createConnectedSiteTag response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Deletes a connected site tag for a Universal Analytics property. - * Note: this has no effect on GA4 properties. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.property - * The Universal Analytics property to delete connected site tags for. - * This API does not support GA4 properties. - * Format: properties/{universalAnalyticsPropertyId} - * Example: properties/1234 - * @param {string} request.tagId - * Tag ID to forward events to. Also known as the Measurement ID, or the - * "G-ID" (For example: G-12345). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/analytics_admin_service.delete_connected_site_tag.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteConnectedSiteTag_async - */ - deleteConnectedSiteTag( - request?: protos.google.analytics.admin.v1alpha.IDeleteConnectedSiteTagRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteConnectedSiteTagRequest|undefined, {}|undefined - ]>; - deleteConnectedSiteTag( - request: protos.google.analytics.admin.v1alpha.IDeleteConnectedSiteTagRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteConnectedSiteTagRequest|null|undefined, - {}|null|undefined>): void; - deleteConnectedSiteTag( - request: protos.google.analytics.admin.v1alpha.IDeleteConnectedSiteTagRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteConnectedSiteTagRequest|null|undefined, - {}|null|undefined>): void; - deleteConnectedSiteTag( - request?: protos.google.analytics.admin.v1alpha.IDeleteConnectedSiteTagRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteConnectedSiteTagRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteConnectedSiteTagRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteConnectedSiteTagRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - this.initialize().catch(err => {throw err}); - this._log.info('deleteConnectedSiteTag request %j', request); - const wrappedCallback: Callback< - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteConnectedSiteTagRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('deleteConnectedSiteTag response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.deleteConnectedSiteTag(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.protobuf.IEmpty, - protos.google.analytics.admin.v1alpha.IDeleteConnectedSiteTagRequest|undefined, - {}|undefined - ]) => { - this._log.info('deleteConnectedSiteTag response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Lists the connected site tags for a Universal Analytics property. A maximum - * of 20 connected site tags will be returned. Note: this has no effect on GA4 - * property. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.property - * The Universal Analytics property to fetch connected site tags for. - * This does not work on GA4 properties. A maximum of 20 connected site tags - * will be returned. - * Example Format: `properties/1234` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.analytics.admin.v1alpha.ListConnectedSiteTagsResponse|ListConnectedSiteTagsResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/analytics_admin_service.list_connected_site_tags.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListConnectedSiteTags_async - */ - listConnectedSiteTags( - request?: protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsResponse, - protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsRequest|undefined, {}|undefined - ]>; - listConnectedSiteTags( - request: protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsResponse, - protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsRequest|null|undefined, - {}|null|undefined>): void; - listConnectedSiteTags( - request: protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsResponse, - protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsRequest|null|undefined, - {}|null|undefined>): void; - listConnectedSiteTags( - request?: protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsResponse, - protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsResponse, - protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsResponse, - protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - this.initialize().catch(err => {throw err}); - this._log.info('listConnectedSiteTags request %j', request); - const wrappedCallback: Callback< - protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsResponse, - protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('listConnectedSiteTags response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.listConnectedSiteTags(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsResponse, - protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsRequest|undefined, - {}|undefined - ]) => { - this._log.info('listConnectedSiteTags response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Given a specified UA property, looks up the GA4 property connected to it. - * Note: this cannot be used with GA4 properties. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.property - * Required. The UA property for which to look up the connected GA4 property. - * Note this request uses the - * internal property ID, not the tracking ID of the form UA-XXXXXX-YY. - * Format: properties/{internal_web_property_id} - * Example: properties/1234 - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.analytics.admin.v1alpha.FetchConnectedGa4PropertyResponse|FetchConnectedGa4PropertyResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/analytics_admin_service.fetch_connected_ga4_property.js - * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_FetchConnectedGa4Property_async - */ - fetchConnectedGa4Property( - request?: protos.google.analytics.admin.v1alpha.IFetchConnectedGa4PropertyRequest, - options?: CallOptions): - Promise<[ - protos.google.analytics.admin.v1alpha.IFetchConnectedGa4PropertyResponse, - protos.google.analytics.admin.v1alpha.IFetchConnectedGa4PropertyRequest|undefined, {}|undefined - ]>; - fetchConnectedGa4Property( - request: protos.google.analytics.admin.v1alpha.IFetchConnectedGa4PropertyRequest, - options: CallOptions, - callback: Callback< - protos.google.analytics.admin.v1alpha.IFetchConnectedGa4PropertyResponse, - protos.google.analytics.admin.v1alpha.IFetchConnectedGa4PropertyRequest|null|undefined, - {}|null|undefined>): void; - fetchConnectedGa4Property( - request: protos.google.analytics.admin.v1alpha.IFetchConnectedGa4PropertyRequest, - callback: Callback< - protos.google.analytics.admin.v1alpha.IFetchConnectedGa4PropertyResponse, - protos.google.analytics.admin.v1alpha.IFetchConnectedGa4PropertyRequest|null|undefined, - {}|null|undefined>): void; - fetchConnectedGa4Property( - request?: protos.google.analytics.admin.v1alpha.IFetchConnectedGa4PropertyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.analytics.admin.v1alpha.IFetchConnectedGa4PropertyResponse, - protos.google.analytics.admin.v1alpha.IFetchConnectedGa4PropertyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.analytics.admin.v1alpha.IFetchConnectedGa4PropertyResponse, - protos.google.analytics.admin.v1alpha.IFetchConnectedGa4PropertyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.analytics.admin.v1alpha.IFetchConnectedGa4PropertyResponse, - protos.google.analytics.admin.v1alpha.IFetchConnectedGa4PropertyRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - this.initialize().catch(err => {throw err}); - this._log.info('fetchConnectedGa4Property request %j', request); - const wrappedCallback: Callback< - protos.google.analytics.admin.v1alpha.IFetchConnectedGa4PropertyResponse, - protos.google.analytics.admin.v1alpha.IFetchConnectedGa4PropertyRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('fetchConnectedGa4Property response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.fetchConnectedGa4Property(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.analytics.admin.v1alpha.IFetchConnectedGa4PropertyResponse, - protos.google.analytics.admin.v1alpha.IFetchConnectedGa4PropertyRequest|undefined, - {}|undefined - ]) => { - this._log.info('fetchConnectedGa4Property response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } /** * Looks up a single AdSenseLink. * @@ -12971,8 +12404,20 @@ export class AnalyticsAdminServiceClient { * Firebase [application instance * ID](https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics.html#getAppInstanceId). * @param {string} request.userProvidedData - * The un-hashed, unencrypted, [user-provided - * data](https://support.google.com/analytics/answer/14077171). + * [User-provided + * data](https://support.google.com/analytics/answer/14077171). May contain + * either one email address or one phone number. + * + * Email addresses should be normalized as such: + * + * * lowercase + * * remove periods before @ for gmail.com/googlemail.com addresses + * * remove all spaces + * + * Phone numbers should be normalized as such: + * + * * remove all non digit characters + * * add + prefix * @param {string} request.name * Required. The name of the property to submit user deletion for. * @param {object} [options] @@ -13063,12 +12508,12 @@ export class AnalyticsAdminServiceClient { }); } /** - * Updates a Subproperty Sync Config. + * Updates a `SubpropertySyncConfig`. * * @param {Object} request * The request object that will be sent. * @param {google.analytics.admin.v1alpha.SubpropertySyncConfig} request.subpropertySyncConfig - * Required. The SubpropertySyncConfig to update. + * Required. The `SubpropertySyncConfig` to update. * @param {google.protobuf.FieldMask} [request.updateMask] * Optional. The list of fields to update. Field names must be in snake case * (for example, "field_to_update"). Omitted fields will not be updated. To @@ -13162,7 +12607,7 @@ export class AnalyticsAdminServiceClient { }); } /** - * Lookup for a single Subproperty Sync Config. + * Lookup for a single `SubpropertySyncConfig`. * * @param {Object} request * The request object that will be sent. @@ -13258,6 +12703,103 @@ export class AnalyticsAdminServiceClient { throw error; }); } +/** + * Returns the singleton data retention settings for this property. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the settings to lookup. + * Format: + * properties/{property}/reportingIdentitySettings + * Example: "properties/1000/reportingIdentitySettings" + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.analytics.admin.v1alpha.ReportingIdentitySettings|ReportingIdentitySettings}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/analytics_admin_service.get_reporting_identity_settings.js + * region_tag:analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetReportingIdentitySettings_async + */ + getReportingIdentitySettings( + request?: protos.google.analytics.admin.v1alpha.IGetReportingIdentitySettingsRequest, + options?: CallOptions): + Promise<[ + protos.google.analytics.admin.v1alpha.IReportingIdentitySettings, + protos.google.analytics.admin.v1alpha.IGetReportingIdentitySettingsRequest|undefined, {}|undefined + ]>; + getReportingIdentitySettings( + request: protos.google.analytics.admin.v1alpha.IGetReportingIdentitySettingsRequest, + options: CallOptions, + callback: Callback< + protos.google.analytics.admin.v1alpha.IReportingIdentitySettings, + protos.google.analytics.admin.v1alpha.IGetReportingIdentitySettingsRequest|null|undefined, + {}|null|undefined>): void; + getReportingIdentitySettings( + request: protos.google.analytics.admin.v1alpha.IGetReportingIdentitySettingsRequest, + callback: Callback< + protos.google.analytics.admin.v1alpha.IReportingIdentitySettings, + protos.google.analytics.admin.v1alpha.IGetReportingIdentitySettingsRequest|null|undefined, + {}|null|undefined>): void; + getReportingIdentitySettings( + request?: protos.google.analytics.admin.v1alpha.IGetReportingIdentitySettingsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.analytics.admin.v1alpha.IReportingIdentitySettings, + protos.google.analytics.admin.v1alpha.IGetReportingIdentitySettingsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.analytics.admin.v1alpha.IReportingIdentitySettings, + protos.google.analytics.admin.v1alpha.IGetReportingIdentitySettingsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.analytics.admin.v1alpha.IReportingIdentitySettings, + protos.google.analytics.admin.v1alpha.IGetReportingIdentitySettingsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getReportingIdentitySettings request %j', request); + const wrappedCallback: Callback< + protos.google.analytics.admin.v1alpha.IReportingIdentitySettings, + protos.google.analytics.admin.v1alpha.IGetReportingIdentitySettingsRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getReportingIdentitySettings response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getReportingIdentitySettings(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IReportingIdentitySettings, + protos.google.analytics.admin.v1alpha.IGetReportingIdentitySettingsRequest|undefined, + {}|undefined + ]) => { + this._log.info('getReportingIdentitySettings response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } /** * Returns all accounts accessible by the caller. @@ -19450,7 +18992,7 @@ export class AnalyticsAdminServiceClient { ) as AsyncIterable; } /** - * List all Subproperty Sync Configs on a property. + * List all `SubpropertySyncConfig` resources for a property. * * @param {Object} request * The request object that will be sent. @@ -20709,6 +20251,29 @@ export class AnalyticsAdminServiceClient { return this.pathTemplates.reportingDataAnnotationPathTemplate.match(reportingDataAnnotationName).reporting_data_annotation; } + /** + * Return a fully-qualified reportingIdentitySettings resource name string. + * + * @param {string} property + * @returns {string} Resource name string. + */ + reportingIdentitySettingsPath(property:string) { + return this.pathTemplates.reportingIdentitySettingsPathTemplate.render({ + property: property, + }); + } + + /** + * Parse the property from ReportingIdentitySettings resource. + * + * @param {string} reportingIdentitySettingsName + * A fully-qualified path representing ReportingIdentitySettings resource. + * @returns {string} A string representing the property. + */ + matchPropertyFromReportingIdentitySettingsName(reportingIdentitySettingsName: string) { + return this.pathTemplates.reportingIdentitySettingsPathTemplate.match(reportingIdentitySettingsName).property; + } + /** * Return a fully-qualified rollupPropertySourceLink resource name string. * diff --git a/packages/google-analytics-admin/src/v1alpha/analytics_admin_service_client_config.json b/packages/google-analytics-admin/src/v1alpha/analytics_admin_service_client_config.json index 1b354ff2471..477029173bb 100644 --- a/packages/google-analytics-admin/src/v1alpha/analytics_admin_service_client_config.json +++ b/packages/google-analytics-admin/src/v1alpha/analytics_admin_service_client_config.json @@ -553,16 +553,6 @@ "retry_codes_name": "unknown_unavailable", "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" }, - "SetAutomatedGa4ConfigurationOptOut": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "FetchAutomatedGa4ConfigurationOptOut": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, "CreateBigQueryLink": { "timeout_millis": 60000, "retry_codes_name": "unknown_unavailable", @@ -598,26 +588,6 @@ "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, - "CreateConnectedSiteTag": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "DeleteConnectedSiteTag": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "ListConnectedSiteTags": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "FetchConnectedGa4Property": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, "GetAdSenseLink": { "timeout_millis": 60000, "retry_codes_name": "unknown_unavailable", @@ -827,6 +797,11 @@ "timeout_millis": 60000, "retry_codes_name": "unknown_unavailable", "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetReportingIdentitySettings": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" } } } diff --git a/packages/google-analytics-admin/src/v1alpha/gapic_metadata.json b/packages/google-analytics-admin/src/v1alpha/gapic_metadata.json index 0590693c33d..2bc9d93be76 100644 --- a/packages/google-analytics-admin/src/v1alpha/gapic_metadata.json +++ b/packages/google-analytics-admin/src/v1alpha/gapic_metadata.json @@ -430,16 +430,6 @@ "deleteChannelGroup" ] }, - "SetAutomatedGa4ConfigurationOptOut": { - "methods": [ - "setAutomatedGa4ConfigurationOptOut" - ] - }, - "FetchAutomatedGa4ConfigurationOptOut": { - "methods": [ - "fetchAutomatedGa4ConfigurationOptOut" - ] - }, "CreateBigQueryLink": { "methods": [ "createBigQueryLink" @@ -470,26 +460,6 @@ "updateEnhancedMeasurementSettings" ] }, - "CreateConnectedSiteTag": { - "methods": [ - "createConnectedSiteTag" - ] - }, - "DeleteConnectedSiteTag": { - "methods": [ - "deleteConnectedSiteTag" - ] - }, - "ListConnectedSiteTags": { - "methods": [ - "listConnectedSiteTags" - ] - }, - "FetchConnectedGa4Property": { - "methods": [ - "fetchConnectedGa4Property" - ] - }, "GetAdSenseLink": { "methods": [ "getAdSenseLink" @@ -660,6 +630,11 @@ "getSubpropertySyncConfig" ] }, + "GetReportingIdentitySettings": { + "methods": [ + "getReportingIdentitySettings" + ] + }, "ListAccounts": { "methods": [ "listAccounts", @@ -1288,16 +1263,6 @@ "deleteChannelGroup" ] }, - "SetAutomatedGa4ConfigurationOptOut": { - "methods": [ - "setAutomatedGa4ConfigurationOptOut" - ] - }, - "FetchAutomatedGa4ConfigurationOptOut": { - "methods": [ - "fetchAutomatedGa4ConfigurationOptOut" - ] - }, "CreateBigQueryLink": { "methods": [ "createBigQueryLink" @@ -1328,26 +1293,6 @@ "updateEnhancedMeasurementSettings" ] }, - "CreateConnectedSiteTag": { - "methods": [ - "createConnectedSiteTag" - ] - }, - "DeleteConnectedSiteTag": { - "methods": [ - "deleteConnectedSiteTag" - ] - }, - "ListConnectedSiteTags": { - "methods": [ - "listConnectedSiteTags" - ] - }, - "FetchConnectedGa4Property": { - "methods": [ - "fetchConnectedGa4Property" - ] - }, "GetAdSenseLink": { "methods": [ "getAdSenseLink" @@ -1518,6 +1463,11 @@ "getSubpropertySyncConfig" ] }, + "GetReportingIdentitySettings": { + "methods": [ + "getReportingIdentitySettings" + ] + }, "ListAccounts": { "methods": [ "listAccounts", diff --git a/packages/google-analytics-admin/test/gapic_analytics_admin_service_v1alpha.ts b/packages/google-analytics-admin/test/gapic_analytics_admin_service_v1alpha.ts index ec81d0d2452..9afdcef1be7 100644 --- a/packages/google-analytics-admin/test/gapic_analytics_admin_service_v1alpha.ts +++ b/packages/google-analytics-admin/test/gapic_analytics_admin_service_v1alpha.ts @@ -9373,156 +9373,6 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { }); }); - describe('setAutomatedGa4ConfigurationOptOut', () => { - it('invokes setAutomatedGa4ConfigurationOptOut without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutResponse() - ); - client.innerApiCalls.setAutomatedGa4ConfigurationOptOut = stubSimpleCall(expectedResponse); - const [response] = await client.setAutomatedGa4ConfigurationOptOut(request); - assert.deepStrictEqual(response, expectedResponse); - }); - - it('invokes setAutomatedGa4ConfigurationOptOut without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutResponse() - ); - client.innerApiCalls.setAutomatedGa4ConfigurationOptOut = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setAutomatedGa4ConfigurationOptOut( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - }); - - it('invokes setAutomatedGa4ConfigurationOptOut with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutRequest() - ); - const expectedError = new Error('expected'); - client.innerApiCalls.setAutomatedGa4ConfigurationOptOut = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setAutomatedGa4ConfigurationOptOut(request), expectedError); - }); - - it('invokes setAutomatedGa4ConfigurationOptOut with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.SetAutomatedGa4ConfigurationOptOutRequest() - ); - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.setAutomatedGa4ConfigurationOptOut(request), expectedError); - }); - }); - - describe('fetchAutomatedGa4ConfigurationOptOut', () => { - it('invokes fetchAutomatedGa4ConfigurationOptOut without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutResponse() - ); - client.innerApiCalls.fetchAutomatedGa4ConfigurationOptOut = stubSimpleCall(expectedResponse); - const [response] = await client.fetchAutomatedGa4ConfigurationOptOut(request); - assert.deepStrictEqual(response, expectedResponse); - }); - - it('invokes fetchAutomatedGa4ConfigurationOptOut without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutResponse() - ); - client.innerApiCalls.fetchAutomatedGa4ConfigurationOptOut = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.fetchAutomatedGa4ConfigurationOptOut( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - }); - - it('invokes fetchAutomatedGa4ConfigurationOptOut with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutRequest() - ); - const expectedError = new Error('expected'); - client.innerApiCalls.fetchAutomatedGa4ConfigurationOptOut = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.fetchAutomatedGa4ConfigurationOptOut(request), expectedError); - }); - - it('invokes fetchAutomatedGa4ConfigurationOptOut with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.FetchAutomatedGa4ConfigurationOptOutRequest() - ); - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.fetchAutomatedGa4ConfigurationOptOut(request), expectedError); - }); - }); - describe('createBigQueryLink', () => { it('invokes createBigQueryLink without error', async () => { const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ @@ -10179,306 +10029,6 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { }); }); - describe('createConnectedSiteTag', () => { - it('invokes createConnectedSiteTag without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.CreateConnectedSiteTagRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.CreateConnectedSiteTagResponse() - ); - client.innerApiCalls.createConnectedSiteTag = stubSimpleCall(expectedResponse); - const [response] = await client.createConnectedSiteTag(request); - assert.deepStrictEqual(response, expectedResponse); - }); - - it('invokes createConnectedSiteTag without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.CreateConnectedSiteTagRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.CreateConnectedSiteTagResponse() - ); - client.innerApiCalls.createConnectedSiteTag = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createConnectedSiteTag( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - }); - - it('invokes createConnectedSiteTag with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.CreateConnectedSiteTagRequest() - ); - const expectedError = new Error('expected'); - client.innerApiCalls.createConnectedSiteTag = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createConnectedSiteTag(request), expectedError); - }); - - it('invokes createConnectedSiteTag with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.CreateConnectedSiteTagRequest() - ); - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.createConnectedSiteTag(request), expectedError); - }); - }); - - describe('deleteConnectedSiteTag', () => { - it('invokes deleteConnectedSiteTag without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.DeleteConnectedSiteTagRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteConnectedSiteTag = stubSimpleCall(expectedResponse); - const [response] = await client.deleteConnectedSiteTag(request); - assert.deepStrictEqual(response, expectedResponse); - }); - - it('invokes deleteConnectedSiteTag without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.DeleteConnectedSiteTagRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteConnectedSiteTag = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteConnectedSiteTag( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - }); - - it('invokes deleteConnectedSiteTag with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.DeleteConnectedSiteTagRequest() - ); - const expectedError = new Error('expected'); - client.innerApiCalls.deleteConnectedSiteTag = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteConnectedSiteTag(request), expectedError); - }); - - it('invokes deleteConnectedSiteTag with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.DeleteConnectedSiteTagRequest() - ); - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.deleteConnectedSiteTag(request), expectedError); - }); - }); - - describe('listConnectedSiteTags', () => { - it('invokes listConnectedSiteTags without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.ListConnectedSiteTagsRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.ListConnectedSiteTagsResponse() - ); - client.innerApiCalls.listConnectedSiteTags = stubSimpleCall(expectedResponse); - const [response] = await client.listConnectedSiteTags(request); - assert.deepStrictEqual(response, expectedResponse); - }); - - it('invokes listConnectedSiteTags without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.ListConnectedSiteTagsRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.ListConnectedSiteTagsResponse() - ); - client.innerApiCalls.listConnectedSiteTags = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listConnectedSiteTags( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - }); - - it('invokes listConnectedSiteTags with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.ListConnectedSiteTagsRequest() - ); - const expectedError = new Error('expected'); - client.innerApiCalls.listConnectedSiteTags = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listConnectedSiteTags(request), expectedError); - }); - - it('invokes listConnectedSiteTags with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.ListConnectedSiteTagsRequest() - ); - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.listConnectedSiteTags(request), expectedError); - }); - }); - - describe('fetchConnectedGa4Property', () => { - it('invokes fetchConnectedGa4Property without error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.FetchConnectedGa4PropertyRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.FetchConnectedGa4PropertyResponse() - ); - client.innerApiCalls.fetchConnectedGa4Property = stubSimpleCall(expectedResponse); - const [response] = await client.fetchConnectedGa4Property(request); - assert.deepStrictEqual(response, expectedResponse); - }); - - it('invokes fetchConnectedGa4Property without error using callback', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.FetchConnectedGa4PropertyRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.FetchConnectedGa4PropertyResponse() - ); - client.innerApiCalls.fetchConnectedGa4Property = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.fetchConnectedGa4Property( - request, - (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IFetchConnectedGa4PropertyResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - }); - - it('invokes fetchConnectedGa4Property with error', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.FetchConnectedGa4PropertyRequest() - ); - const expectedError = new Error('expected'); - client.innerApiCalls.fetchConnectedGa4Property = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.fetchConnectedGa4Property(request), expectedError); - }); - - it('invokes fetchConnectedGa4Property with closed client', async () => { - const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.analytics.admin.v1alpha.FetchConnectedGa4PropertyRequest() - ); - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.fetchConnectedGa4Property(request), expectedError); - }); - }); - describe('getAdSenseLink', () => { it('invokes getAdSenseLink without error', async () => { const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ @@ -14113,6 +13663,114 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { }); }); + describe('getReportingIdentitySettings', () => { + it('invokes getReportingIdentitySettings without error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.GetReportingIdentitySettingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetReportingIdentitySettingsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.ReportingIdentitySettings() + ); + client.innerApiCalls.getReportingIdentitySettings = stubSimpleCall(expectedResponse); + const [response] = await client.getReportingIdentitySettings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getReportingIdentitySettings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getReportingIdentitySettings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getReportingIdentitySettings without error using callback', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.GetReportingIdentitySettingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetReportingIdentitySettingsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.ReportingIdentitySettings() + ); + client.innerApiCalls.getReportingIdentitySettings = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getReportingIdentitySettings( + request, + (err?: Error|null, result?: protos.google.analytics.admin.v1alpha.IReportingIdentitySettings|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getReportingIdentitySettings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getReportingIdentitySettings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getReportingIdentitySettings with error', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.GetReportingIdentitySettingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetReportingIdentitySettingsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getReportingIdentitySettings = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getReportingIdentitySettings(request), expectedError); + const actualRequest = (client.innerApiCalls.getReportingIdentitySettings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getReportingIdentitySettings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getReportingIdentitySettings with closed client', async () => { + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.analytics.admin.v1alpha.GetReportingIdentitySettingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.analytics.admin.v1alpha.GetReportingIdentitySettingsRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getReportingIdentitySettings(request), expectedError); + }); + }); + describe('listAccounts', () => { it('invokes listAccounts without error', async () => { const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ @@ -22154,6 +21812,36 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { }); }); + describe('reportingIdentitySettings', async () => { + const fakePath = "/rendered/path/reportingIdentitySettings"; + const expectedParameters = { + property: "propertyValue", + }; + const client = new analyticsadminserviceModule.v1alpha.AnalyticsAdminServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.reportingIdentitySettingsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.reportingIdentitySettingsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('reportingIdentitySettingsPath', () => { + const result = client.reportingIdentitySettingsPath("propertyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.reportingIdentitySettingsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchPropertyFromReportingIdentitySettingsName', () => { + const result = client.matchPropertyFromReportingIdentitySettingsName(fakePath); + assert.strictEqual(result, "propertyValue"); + assert((client.pathTemplates.reportingIdentitySettingsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('rollupPropertySourceLink', async () => { const fakePath = "/rendered/path/rollupPropertySourceLink"; const expectedParameters = { diff --git a/packages/google-analytics-data/protos/protos.d.ts b/packages/google-analytics-data/protos/protos.d.ts index 804ae71c01a..42b5e898305 100644 --- a/packages/google-analytics-data/protos/protos.d.ts +++ b/packages/google-analytics-data/protos/protos.d.ts @@ -223,6 +223,7 @@ export namespace google { /** Edition enum. */ enum Edition { EDITION_UNKNOWN = 0, + EDITION_LEGACY = 900, EDITION_PROTO2 = 998, EDITION_PROTO3 = 999, EDITION_2023 = 1000, @@ -253,6 +254,9 @@ export namespace google { /** FileDescriptorProto weakDependency */ weakDependency?: (number[]|null); + /** FileDescriptorProto optionDependency */ + optionDependency?: (string[]|null); + /** FileDescriptorProto messageType */ messageType?: (google.protobuf.IDescriptorProto[]|null); @@ -302,6 +306,9 @@ export namespace google { /** FileDescriptorProto weakDependency. */ public weakDependency: number[]; + /** FileDescriptorProto optionDependency. */ + public optionDependency: string[]; + /** FileDescriptorProto messageType. */ public messageType: google.protobuf.IDescriptorProto[]; @@ -436,6 +443,9 @@ export namespace google { /** DescriptorProto reservedName */ reservedName?: (string[]|null); + + /** DescriptorProto visibility */ + visibility?: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility|null); } /** Represents a DescriptorProto. */ @@ -477,6 +487,9 @@ export namespace google { /** DescriptorProto reservedName. */ public reservedName: string[]; + /** DescriptorProto visibility. */ + public visibility: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility); + /** * Creates a new DescriptorProto instance using the specified properties. * @param [properties] Properties to set @@ -1324,6 +1337,9 @@ export namespace google { /** EnumDescriptorProto reservedName */ reservedName?: (string[]|null); + + /** EnumDescriptorProto visibility */ + visibility?: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility|null); } /** Represents an EnumDescriptorProto. */ @@ -1350,6 +1366,9 @@ export namespace google { /** EnumDescriptorProto reservedName. */ public reservedName: string[]; + /** EnumDescriptorProto visibility. */ + public visibility: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility); + /** * Creates a new EnumDescriptorProto instance using the specified properties. * @param [properties] Properties to set @@ -2284,6 +2303,9 @@ export namespace google { /** FieldOptions features */ features?: (google.protobuf.IFeatureSet|null); + /** FieldOptions featureSupport */ + featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** FieldOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); @@ -2339,6 +2361,9 @@ export namespace google { /** FieldOptions features. */ public features?: (google.protobuf.IFeatureSet|null); + /** FieldOptions featureSupport. */ + public featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** FieldOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; @@ -2559,6 +2584,121 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** Properties of a FeatureSupport. */ + interface IFeatureSupport { + + /** FeatureSupport editionIntroduced */ + editionIntroduced?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSupport editionDeprecated */ + editionDeprecated?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSupport deprecationWarning */ + deprecationWarning?: (string|null); + + /** FeatureSupport editionRemoved */ + editionRemoved?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSupport. */ + class FeatureSupport implements IFeatureSupport { + + /** + * Constructs a new FeatureSupport. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IFeatureSupport); + + /** FeatureSupport editionIntroduced. */ + public editionIntroduced: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSupport editionDeprecated. */ + public editionDeprecated: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSupport deprecationWarning. */ + public deprecationWarning: string; + + /** FeatureSupport editionRemoved. */ + public editionRemoved: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSupport instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSupport instance + */ + public static create(properties?: google.protobuf.FieldOptions.IFeatureSupport): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Encodes the specified FeatureSupport message. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @param message FeatureSupport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IFeatureSupport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSupport message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @param message FeatureSupport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IFeatureSupport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Verifies a FeatureSupport message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSupport message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSupport + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Creates a plain object from a FeatureSupport message. Also converts values to other types if specified. + * @param message FeatureSupport + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.FeatureSupport, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSupport to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSupport + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } /** Properties of an OneofOptions. */ @@ -2797,6 +2937,9 @@ export namespace google { /** EnumValueOptions debugRedact */ debugRedact?: (boolean|null); + /** EnumValueOptions featureSupport */ + featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** EnumValueOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); } @@ -2819,6 +2962,9 @@ export namespace google { /** EnumValueOptions debugRedact. */ public debugRedact: boolean; + /** EnumValueOptions featureSupport. */ + public featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** EnumValueOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; @@ -3411,6 +3557,12 @@ export namespace google { /** FeatureSet jsonFormat */ jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); + + /** FeatureSet enforceNamingStyle */ + enforceNamingStyle?: (google.protobuf.FeatureSet.EnforceNamingStyle|keyof typeof google.protobuf.FeatureSet.EnforceNamingStyle|null); + + /** FeatureSet defaultSymbolVisibility */ + defaultSymbolVisibility?: (google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|keyof typeof google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|null); } /** Represents a FeatureSet. */ @@ -3440,6 +3592,12 @@ export namespace google { /** FeatureSet jsonFormat. */ public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); + /** FeatureSet enforceNamingStyle. */ + public enforceNamingStyle: (google.protobuf.FeatureSet.EnforceNamingStyle|keyof typeof google.protobuf.FeatureSet.EnforceNamingStyle); + + /** FeatureSet defaultSymbolVisibility. */ + public defaultSymbolVisibility: (google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|keyof typeof google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility); + /** * Creates a new FeatureSet instance using the specified properties. * @param [properties] Properties to set @@ -3562,6 +3720,116 @@ export namespace google { ALLOW = 1, LEGACY_BEST_EFFORT = 2 } + + /** EnforceNamingStyle enum. */ + enum EnforceNamingStyle { + ENFORCE_NAMING_STYLE_UNKNOWN = 0, + STYLE2024 = 1, + STYLE_LEGACY = 2 + } + + /** Properties of a VisibilityFeature. */ + interface IVisibilityFeature { + } + + /** Represents a VisibilityFeature. */ + class VisibilityFeature implements IVisibilityFeature { + + /** + * Constructs a new VisibilityFeature. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSet.IVisibilityFeature); + + /** + * Creates a new VisibilityFeature instance using the specified properties. + * @param [properties] Properties to set + * @returns VisibilityFeature instance + */ + public static create(properties?: google.protobuf.FeatureSet.IVisibilityFeature): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Encodes the specified VisibilityFeature message. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @param message VisibilityFeature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSet.IVisibilityFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VisibilityFeature message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @param message VisibilityFeature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSet.IVisibilityFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Verifies a VisibilityFeature message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VisibilityFeature message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VisibilityFeature + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Creates a plain object from a VisibilityFeature message. Also converts values to other types if specified. + * @param message VisibilityFeature + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet.VisibilityFeature, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VisibilityFeature to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VisibilityFeature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace VisibilityFeature { + + /** DefaultSymbolVisibility enum. */ + enum DefaultSymbolVisibility { + DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0, + EXPORT_ALL = 1, + EXPORT_TOP_LEVEL = 2, + LOCAL_ALL = 3, + STRICT = 4 + } + } } /** Properties of a FeatureSetDefaults. */ @@ -3681,8 +3949,11 @@ export namespace google { /** FeatureSetEditionDefault edition */ edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - /** FeatureSetEditionDefault features */ - features?: (google.protobuf.IFeatureSet|null); + /** FeatureSetEditionDefault overridableFeatures */ + overridableFeatures?: (google.protobuf.IFeatureSet|null); + + /** FeatureSetEditionDefault fixedFeatures */ + fixedFeatures?: (google.protobuf.IFeatureSet|null); } /** Represents a FeatureSetEditionDefault. */ @@ -3697,8 +3968,11 @@ export namespace google { /** FeatureSetEditionDefault edition. */ public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - /** FeatureSetEditionDefault features. */ - public features?: (google.protobuf.IFeatureSet|null); + /** FeatureSetEditionDefault overridableFeatures. */ + public overridableFeatures?: (google.protobuf.IFeatureSet|null); + + /** FeatureSetEditionDefault fixedFeatures. */ + public fixedFeatures?: (google.protobuf.IFeatureSet|null); /** * Creates a new FeatureSetEditionDefault instance using the specified properties. @@ -4231,6 +4505,13 @@ export namespace google { } } + /** SymbolVisibility enum. */ + enum SymbolVisibility { + VISIBILITY_UNSET = 0, + VISIBILITY_LOCAL = 1, + VISIBILITY_EXPORT = 2 + } + /** Properties of an Any. */ interface IAny { @@ -24760,6 +25041,9 @@ export namespace google { /** CommonLanguageSettings destinations */ destinations?: (google.api.ClientLibraryDestination[]|null); + + /** CommonLanguageSettings selectiveGapicGeneration */ + selectiveGapicGeneration?: (google.api.ISelectiveGapicGeneration|null); } /** Represents a CommonLanguageSettings. */ @@ -24777,6 +25061,9 @@ export namespace google { /** CommonLanguageSettings destinations. */ public destinations: google.api.ClientLibraryDestination[]; + /** CommonLanguageSettings selectiveGapicGeneration. */ + public selectiveGapicGeneration?: (google.api.ISelectiveGapicGeneration|null); + /** * Creates a new CommonLanguageSettings instance using the specified properties. * @param [properties] Properties to set @@ -25477,6 +25764,9 @@ export namespace google { /** PythonSettings common */ common?: (google.api.ICommonLanguageSettings|null); + + /** PythonSettings experimentalFeatures */ + experimentalFeatures?: (google.api.PythonSettings.IExperimentalFeatures|null); } /** Represents a PythonSettings. */ @@ -25491,6 +25781,9 @@ export namespace google { /** PythonSettings common. */ public common?: (google.api.ICommonLanguageSettings|null); + /** PythonSettings experimentalFeatures. */ + public experimentalFeatures?: (google.api.PythonSettings.IExperimentalFeatures|null); + /** * Creates a new PythonSettings instance using the specified properties. * @param [properties] Properties to set @@ -25569,6 +25862,118 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + namespace PythonSettings { + + /** Properties of an ExperimentalFeatures. */ + interface IExperimentalFeatures { + + /** ExperimentalFeatures restAsyncIoEnabled */ + restAsyncIoEnabled?: (boolean|null); + + /** ExperimentalFeatures protobufPythonicTypesEnabled */ + protobufPythonicTypesEnabled?: (boolean|null); + + /** ExperimentalFeatures unversionedPackageDisabled */ + unversionedPackageDisabled?: (boolean|null); + } + + /** Represents an ExperimentalFeatures. */ + class ExperimentalFeatures implements IExperimentalFeatures { + + /** + * Constructs a new ExperimentalFeatures. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.PythonSettings.IExperimentalFeatures); + + /** ExperimentalFeatures restAsyncIoEnabled. */ + public restAsyncIoEnabled: boolean; + + /** ExperimentalFeatures protobufPythonicTypesEnabled. */ + public protobufPythonicTypesEnabled: boolean; + + /** ExperimentalFeatures unversionedPackageDisabled. */ + public unversionedPackageDisabled: boolean; + + /** + * Creates a new ExperimentalFeatures instance using the specified properties. + * @param [properties] Properties to set + * @returns ExperimentalFeatures instance + */ + public static create(properties?: google.api.PythonSettings.IExperimentalFeatures): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Encodes the specified ExperimentalFeatures message. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @param message ExperimentalFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.PythonSettings.IExperimentalFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExperimentalFeatures message, length delimited. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @param message ExperimentalFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.PythonSettings.IExperimentalFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Verifies an ExperimentalFeatures message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExperimentalFeatures message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExperimentalFeatures + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Creates a plain object from an ExperimentalFeatures message. Also converts values to other types if specified. + * @param message ExperimentalFeatures + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings.ExperimentalFeatures, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExperimentalFeatures to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExperimentalFeatures + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + /** Properties of a NodeSettings. */ interface INodeSettings { @@ -25895,6 +26300,9 @@ export namespace google { /** GoSettings common */ common?: (google.api.ICommonLanguageSettings|null); + + /** GoSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|null); } /** Represents a GoSettings. */ @@ -25909,6 +26317,9 @@ export namespace google { /** GoSettings common. */ public common?: (google.api.ICommonLanguageSettings|null); + /** GoSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + /** * Creates a new GoSettings instance using the specified properties. * @param [properties] Properties to set @@ -26233,6 +26644,109 @@ export namespace google { PACKAGE_MANAGER = 20 } + /** Properties of a SelectiveGapicGeneration. */ + interface ISelectiveGapicGeneration { + + /** SelectiveGapicGeneration methods */ + methods?: (string[]|null); + + /** SelectiveGapicGeneration generateOmittedAsInternal */ + generateOmittedAsInternal?: (boolean|null); + } + + /** Represents a SelectiveGapicGeneration. */ + class SelectiveGapicGeneration implements ISelectiveGapicGeneration { + + /** + * Constructs a new SelectiveGapicGeneration. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ISelectiveGapicGeneration); + + /** SelectiveGapicGeneration methods. */ + public methods: string[]; + + /** SelectiveGapicGeneration generateOmittedAsInternal. */ + public generateOmittedAsInternal: boolean; + + /** + * Creates a new SelectiveGapicGeneration instance using the specified properties. + * @param [properties] Properties to set + * @returns SelectiveGapicGeneration instance + */ + public static create(properties?: google.api.ISelectiveGapicGeneration): google.api.SelectiveGapicGeneration; + + /** + * Encodes the specified SelectiveGapicGeneration message. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @param message SelectiveGapicGeneration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ISelectiveGapicGeneration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SelectiveGapicGeneration message, length delimited. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @param message SelectiveGapicGeneration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ISelectiveGapicGeneration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.SelectiveGapicGeneration; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.SelectiveGapicGeneration; + + /** + * Verifies a SelectiveGapicGeneration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SelectiveGapicGeneration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SelectiveGapicGeneration + */ + public static fromObject(object: { [k: string]: any }): google.api.SelectiveGapicGeneration; + + /** + * Creates a plain object from a SelectiveGapicGeneration message. Also converts values to other types if specified. + * @param message SelectiveGapicGeneration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.SelectiveGapicGeneration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SelectiveGapicGeneration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SelectiveGapicGeneration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** LaunchStage enum. */ enum LaunchStage { LAUNCH_STAGE_UNSPECIFIED = 0, diff --git a/packages/google-analytics-data/protos/protos.js b/packages/google-analytics-data/protos/protos.js index 26a9a1489a9..e66f0dfcf3c 100644 --- a/packages/google-analytics-data/protos/protos.js +++ b/packages/google-analytics-data/protos/protos.js @@ -522,6 +522,7 @@ * @name google.protobuf.Edition * @enum {number} * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value + * @property {number} EDITION_LEGACY=900 EDITION_LEGACY value * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value * @property {number} EDITION_2023=1000 EDITION_2023 value @@ -536,6 +537,7 @@ protobuf.Edition = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "EDITION_UNKNOWN"] = 0; + values[valuesById[900] = "EDITION_LEGACY"] = 900; values[valuesById[998] = "EDITION_PROTO2"] = 998; values[valuesById[999] = "EDITION_PROTO3"] = 999; values[valuesById[1000] = "EDITION_2023"] = 1000; @@ -560,6 +562,7 @@ * @property {Array.|null} [dependency] FileDescriptorProto dependency * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [optionDependency] FileDescriptorProto optionDependency * @property {Array.|null} [messageType] FileDescriptorProto messageType * @property {Array.|null} [enumType] FileDescriptorProto enumType * @property {Array.|null} [service] FileDescriptorProto service @@ -582,6 +585,7 @@ this.dependency = []; this.publicDependency = []; this.weakDependency = []; + this.optionDependency = []; this.messageType = []; this.enumType = []; this.service = []; @@ -632,6 +636,14 @@ */ FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + /** + * FileDescriptorProto optionDependency. + * @member {Array.} optionDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.optionDependency = $util.emptyArray; + /** * FileDescriptorProto messageType. * @member {Array.} messageType @@ -753,6 +765,9 @@ writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); + if (message.optionDependency != null && message.optionDependency.length) + for (var i = 0; i < message.optionDependency.length; ++i) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.optionDependency[i]); return writer; }; @@ -825,6 +840,12 @@ message.weakDependency.push(reader.int32()); break; } + case 15: { + if (!(message.optionDependency && message.optionDependency.length)) + message.optionDependency = []; + message.optionDependency.push(reader.string()); + break; + } case 4: { if (!(message.messageType && message.messageType.length)) message.messageType = []; @@ -927,6 +948,13 @@ if (!$util.isInteger(message.weakDependency[i])) return "weakDependency: integer[] expected"; } + if (message.optionDependency != null && message.hasOwnProperty("optionDependency")) { + if (!Array.isArray(message.optionDependency)) + return "optionDependency: array expected"; + for (var i = 0; i < message.optionDependency.length; ++i) + if (!$util.isString(message.optionDependency[i])) + return "optionDependency: string[] expected"; + } if (message.messageType != null && message.hasOwnProperty("messageType")) { if (!Array.isArray(message.messageType)) return "messageType: array expected"; @@ -981,6 +1009,7 @@ default: return "edition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -1033,6 +1062,13 @@ for (var i = 0; i < object.weakDependency.length; ++i) message.weakDependency[i] = object.weakDependency[i] | 0; } + if (object.optionDependency) { + if (!Array.isArray(object.optionDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.optionDependency: array expected"); + message.optionDependency = []; + for (var i = 0; i < object.optionDependency.length; ++i) + message.optionDependency[i] = String(object.optionDependency[i]); + } if (object.messageType) { if (!Array.isArray(object.messageType)) throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); @@ -1096,6 +1132,10 @@ case 0: message.edition = 0; break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; case "EDITION_PROTO2": case 998: message.edition = 998; @@ -1161,6 +1201,7 @@ object.extension = []; object.publicDependency = []; object.weakDependency = []; + object.optionDependency = []; } if (options.defaults) { object.name = ""; @@ -1217,6 +1258,11 @@ object.syntax = message.syntax; if (message.edition != null && message.hasOwnProperty("edition")) object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + if (message.optionDependency && message.optionDependency.length) { + object.optionDependency = []; + for (var j = 0; j < message.optionDependency.length; ++j) + object.optionDependency[j] = message.optionDependency[j]; + } return object; }; @@ -1265,6 +1311,7 @@ * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options * @property {Array.|null} [reservedRange] DescriptorProto reservedRange * @property {Array.|null} [reservedName] DescriptorProto reservedName + * @property {google.protobuf.SymbolVisibility|null} [visibility] DescriptorProto visibility */ /** @@ -1370,6 +1417,14 @@ */ DescriptorProto.prototype.reservedName = $util.emptyArray; + /** + * DescriptorProto visibility. + * @member {google.protobuf.SymbolVisibility} visibility + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.visibility = 0; + /** * Creates a new DescriptorProto instance using the specified properties. * @function create @@ -1422,6 +1477,8 @@ if (message.reservedName != null && message.reservedName.length) for (var i = 0; i < message.reservedName.length; ++i) writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.visibility); return writer; }; @@ -1514,6 +1571,10 @@ message.reservedName.push(reader.string()); break; } + case 11: { + message.visibility = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -1627,6 +1688,15 @@ if (!$util.isString(message.reservedName[i])) return "reservedName: string[] expected"; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + switch (message.visibility) { + default: + return "visibility: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; @@ -1726,6 +1796,26 @@ for (var i = 0; i < object.reservedName.length; ++i) message.reservedName[i] = String(object.reservedName[i]); } + switch (object.visibility) { + default: + if (typeof object.visibility === "number") { + message.visibility = object.visibility; + break; + } + break; + case "VISIBILITY_UNSET": + case 0: + message.visibility = 0; + break; + case "VISIBILITY_LOCAL": + case 1: + message.visibility = 1; + break; + case "VISIBILITY_EXPORT": + case 2: + message.visibility = 2; + break; + } return message; }; @@ -1755,6 +1845,7 @@ if (options.defaults) { object.name = ""; object.options = null; + object.visibility = options.enums === String ? "VISIBILITY_UNSET" : 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -1800,6 +1891,8 @@ for (var j = 0; j < message.reservedName.length; ++j) object.reservedName[j] = message.reservedName[j]; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + object.visibility = options.enums === String ? $root.google.protobuf.SymbolVisibility[message.visibility] === undefined ? message.visibility : $root.google.protobuf.SymbolVisibility[message.visibility] : message.visibility; return object; }; @@ -3844,6 +3937,7 @@ * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + * @property {google.protobuf.SymbolVisibility|null} [visibility] EnumDescriptorProto visibility */ /** @@ -3904,6 +3998,14 @@ */ EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + /** + * EnumDescriptorProto visibility. + * @member {google.protobuf.SymbolVisibility} visibility + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.visibility = 0; + /** * Creates a new EnumDescriptorProto instance using the specified properties. * @function create @@ -3941,6 +4043,8 @@ if (message.reservedName != null && message.reservedName.length) for (var i = 0; i < message.reservedName.length; ++i) writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.visibility); return writer; }; @@ -4003,6 +4107,10 @@ message.reservedName.push(reader.string()); break; } + case 6: { + message.visibility = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -4071,6 +4179,15 @@ if (!$util.isString(message.reservedName[i])) return "reservedName: string[] expected"; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + switch (message.visibility) { + default: + return "visibility: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; @@ -4120,6 +4237,26 @@ for (var i = 0; i < object.reservedName.length; ++i) message.reservedName[i] = String(object.reservedName[i]); } + switch (object.visibility) { + default: + if (typeof object.visibility === "number") { + message.visibility = object.visibility; + break; + } + break; + case "VISIBILITY_UNSET": + case 0: + message.visibility = 0; + break; + case "VISIBILITY_LOCAL": + case 1: + message.visibility = 1; + break; + case "VISIBILITY_EXPORT": + case 2: + message.visibility = 2; + break; + } return message; }; @@ -4144,6 +4281,7 @@ if (options.defaults) { object.name = ""; object.options = null; + object.visibility = options.enums === String ? "VISIBILITY_UNSET" : 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -4164,6 +4302,8 @@ for (var j = 0; j < message.reservedName.length; ++j) object.reservedName[j] = message.reservedName[j]; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + object.visibility = options.enums === String ? $root.google.protobuf.SymbolVisibility[message.visibility] === undefined ? message.visibility : $root.google.protobuf.SymbolVisibility[message.visibility] : message.visibility; return object; }; @@ -6482,6 +6622,7 @@ * @property {Array.|null} [targets] FieldOptions targets * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features + * @property {google.protobuf.FieldOptions.IFeatureSupport|null} [featureSupport] FieldOptions featureSupport * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference @@ -6602,6 +6743,14 @@ */ FieldOptions.prototype.features = null; + /** + * FieldOptions featureSupport. + * @member {google.protobuf.FieldOptions.IFeatureSupport|null|undefined} featureSupport + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.featureSupport = null; + /** * FieldOptions uninterpretedOption. * @member {Array.} uninterpretedOption @@ -6676,6 +6825,8 @@ $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); if (message.features != null && Object.hasOwnProperty.call(message, "features")) $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) + $root.google.protobuf.FieldOptions.FeatureSupport.encode(message.featureSupport, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); @@ -6777,6 +6928,10 @@ message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); break; } + case 22: { + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.decode(reader, reader.uint32()); + break; + } case 999: { if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; @@ -6912,6 +7067,11 @@ if (error) return "features." + error; } + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) { + var error = $root.google.protobuf.FieldOptions.FeatureSupport.verify(message.featureSupport); + if (error) + return "featureSupport." + error; + } if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; @@ -7100,6 +7260,11 @@ throw TypeError(".google.protobuf.FieldOptions.features: object expected"); message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); } + if (object.featureSupport != null) { + if (typeof object.featureSupport !== "object") + throw TypeError(".google.protobuf.FieldOptions.featureSupport: object expected"); + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.fromObject(object.featureSupport); + } if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); @@ -7197,6 +7362,7 @@ object.debugRedact = false; object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; object.features = null; + object.featureSupport = null; object[".google.api.resourceReference"] = null; } if (message.ctype != null && message.hasOwnProperty("ctype")) @@ -7229,6 +7395,8 @@ } if (message.features != null && message.hasOwnProperty("features")) object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) + object.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.toObject(message.featureSupport, options); if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) @@ -7501,6 +7669,7 @@ default: return "edition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -7542,6 +7711,10 @@ case 0: message.edition = 0; break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; case "EDITION_PROTO2": case 998: message.edition = 998; @@ -7641,6 +7814,488 @@ return EditionDefault; })(); + FieldOptions.FeatureSupport = (function() { + + /** + * Properties of a FeatureSupport. + * @memberof google.protobuf.FieldOptions + * @interface IFeatureSupport + * @property {google.protobuf.Edition|null} [editionIntroduced] FeatureSupport editionIntroduced + * @property {google.protobuf.Edition|null} [editionDeprecated] FeatureSupport editionDeprecated + * @property {string|null} [deprecationWarning] FeatureSupport deprecationWarning + * @property {google.protobuf.Edition|null} [editionRemoved] FeatureSupport editionRemoved + */ + + /** + * Constructs a new FeatureSupport. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents a FeatureSupport. + * @implements IFeatureSupport + * @constructor + * @param {google.protobuf.FieldOptions.IFeatureSupport=} [properties] Properties to set + */ + function FeatureSupport(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSupport editionIntroduced. + * @member {google.protobuf.Edition} editionIntroduced + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionIntroduced = 0; + + /** + * FeatureSupport editionDeprecated. + * @member {google.protobuf.Edition} editionDeprecated + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionDeprecated = 0; + + /** + * FeatureSupport deprecationWarning. + * @member {string} deprecationWarning + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.deprecationWarning = ""; + + /** + * FeatureSupport editionRemoved. + * @member {google.protobuf.Edition} editionRemoved + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionRemoved = 0; + + /** + * Creates a new FeatureSupport instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport instance + */ + FeatureSupport.create = function create(properties) { + return new FeatureSupport(properties); + }; + + /** + * Encodes the specified FeatureSupport message. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport} message FeatureSupport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSupport.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.editionIntroduced != null && Object.hasOwnProperty.call(message, "editionIntroduced")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.editionIntroduced); + if (message.editionDeprecated != null && Object.hasOwnProperty.call(message, "editionDeprecated")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.editionDeprecated); + if (message.deprecationWarning != null && Object.hasOwnProperty.call(message, "deprecationWarning")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.deprecationWarning); + if (message.editionRemoved != null && Object.hasOwnProperty.call(message, "editionRemoved")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.editionRemoved); + return writer; + }; + + /** + * Encodes the specified FeatureSupport message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport} message FeatureSupport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSupport.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSupport.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.FeatureSupport(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.editionIntroduced = reader.int32(); + break; + } + case 2: { + message.editionDeprecated = reader.int32(); + break; + } + case 3: { + message.deprecationWarning = reader.string(); + break; + } + case 4: { + message.editionRemoved = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSupport.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSupport message. + * @function verify + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSupport.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.editionIntroduced != null && message.hasOwnProperty("editionIntroduced")) + switch (message.editionIntroduced) { + default: + return "editionIntroduced: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.editionDeprecated != null && message.hasOwnProperty("editionDeprecated")) + switch (message.editionDeprecated) { + default: + return "editionDeprecated: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.deprecationWarning != null && message.hasOwnProperty("deprecationWarning")) + if (!$util.isString(message.deprecationWarning)) + return "deprecationWarning: string expected"; + if (message.editionRemoved != null && message.hasOwnProperty("editionRemoved")) + switch (message.editionRemoved) { + default: + return "editionRemoved: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FeatureSupport message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + */ + FeatureSupport.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions.FeatureSupport) + return object; + var message = new $root.google.protobuf.FieldOptions.FeatureSupport(); + switch (object.editionIntroduced) { + default: + if (typeof object.editionIntroduced === "number") { + message.editionIntroduced = object.editionIntroduced; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionIntroduced = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionIntroduced = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionIntroduced = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionIntroduced = 999; + break; + case "EDITION_2023": + case 1000: + message.editionIntroduced = 1000; + break; + case "EDITION_2024": + case 1001: + message.editionIntroduced = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.editionIntroduced = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.editionIntroduced = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.editionIntroduced = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.editionIntroduced = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.editionIntroduced = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.editionIntroduced = 2147483647; + break; + } + switch (object.editionDeprecated) { + default: + if (typeof object.editionDeprecated === "number") { + message.editionDeprecated = object.editionDeprecated; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionDeprecated = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionDeprecated = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionDeprecated = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionDeprecated = 999; + break; + case "EDITION_2023": + case 1000: + message.editionDeprecated = 1000; + break; + case "EDITION_2024": + case 1001: + message.editionDeprecated = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.editionDeprecated = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.editionDeprecated = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.editionDeprecated = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.editionDeprecated = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.editionDeprecated = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.editionDeprecated = 2147483647; + break; + } + if (object.deprecationWarning != null) + message.deprecationWarning = String(object.deprecationWarning); + switch (object.editionRemoved) { + default: + if (typeof object.editionRemoved === "number") { + message.editionRemoved = object.editionRemoved; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionRemoved = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionRemoved = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionRemoved = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionRemoved = 999; + break; + case "EDITION_2023": + case 1000: + message.editionRemoved = 1000; + break; + case "EDITION_2024": + case 1001: + message.editionRemoved = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.editionRemoved = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.editionRemoved = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.editionRemoved = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.editionRemoved = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.editionRemoved = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.editionRemoved = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSupport message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.FeatureSupport} message FeatureSupport + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSupport.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.editionIntroduced = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.editionDeprecated = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.deprecationWarning = ""; + object.editionRemoved = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.editionIntroduced != null && message.hasOwnProperty("editionIntroduced")) + object.editionIntroduced = options.enums === String ? $root.google.protobuf.Edition[message.editionIntroduced] === undefined ? message.editionIntroduced : $root.google.protobuf.Edition[message.editionIntroduced] : message.editionIntroduced; + if (message.editionDeprecated != null && message.hasOwnProperty("editionDeprecated")) + object.editionDeprecated = options.enums === String ? $root.google.protobuf.Edition[message.editionDeprecated] === undefined ? message.editionDeprecated : $root.google.protobuf.Edition[message.editionDeprecated] : message.editionDeprecated; + if (message.deprecationWarning != null && message.hasOwnProperty("deprecationWarning")) + object.deprecationWarning = message.deprecationWarning; + if (message.editionRemoved != null && message.hasOwnProperty("editionRemoved")) + object.editionRemoved = options.enums === String ? $root.google.protobuf.Edition[message.editionRemoved] === undefined ? message.editionRemoved : $root.google.protobuf.Edition[message.editionRemoved] : message.editionRemoved; + return object; + }; + + /** + * Converts this FeatureSupport to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + * @returns {Object.} JSON object + */ + FeatureSupport.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSupport + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSupport.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.FeatureSupport"; + }; + + return FeatureSupport; + })(); + return FieldOptions; })(); @@ -8233,6 +8888,7 @@ * @property {boolean|null} [deprecated] EnumValueOptions deprecated * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact + * @property {google.protobuf.FieldOptions.IFeatureSupport|null} [featureSupport] EnumValueOptions featureSupport * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption */ @@ -8276,6 +8932,14 @@ */ EnumValueOptions.prototype.debugRedact = false; + /** + * EnumValueOptions featureSupport. + * @member {google.protobuf.FieldOptions.IFeatureSupport|null|undefined} featureSupport + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.featureSupport = null; + /** * EnumValueOptions uninterpretedOption. * @member {Array.} uninterpretedOption @@ -8314,6 +8978,8 @@ $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); + if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) + $root.google.protobuf.FieldOptions.FeatureSupport.encode(message.featureSupport, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); @@ -8365,6 +9031,10 @@ message.debugRedact = reader.bool(); break; } + case 4: { + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.decode(reader, reader.uint32()); + break; + } case 999: { if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; @@ -8417,6 +9087,11 @@ if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) if (typeof message.debugRedact !== "boolean") return "debugRedact: boolean expected"; + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) { + var error = $root.google.protobuf.FieldOptions.FeatureSupport.verify(message.featureSupport); + if (error) + return "featureSupport." + error; + } if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; @@ -8450,6 +9125,11 @@ } if (object.debugRedact != null) message.debugRedact = Boolean(object.debugRedact); + if (object.featureSupport != null) { + if (typeof object.featureSupport !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.featureSupport: object expected"); + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.fromObject(object.featureSupport); + } if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); @@ -8482,6 +9162,7 @@ object.deprecated = false; object.features = null; object.debugRedact = false; + object.featureSupport = null; } if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; @@ -8489,6 +9170,8 @@ object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) object.debugRedact = message.debugRedact; + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) + object.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.toObject(message.featureSupport, options); if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) @@ -9956,6 +10639,8 @@ * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat + * @property {google.protobuf.FeatureSet.EnforceNamingStyle|null} [enforceNamingStyle] FeatureSet enforceNamingStyle + * @property {google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|null} [defaultSymbolVisibility] FeatureSet defaultSymbolVisibility */ /** @@ -10021,6 +10706,22 @@ */ FeatureSet.prototype.jsonFormat = 0; + /** + * FeatureSet enforceNamingStyle. + * @member {google.protobuf.FeatureSet.EnforceNamingStyle} enforceNamingStyle + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enforceNamingStyle = 0; + + /** + * FeatureSet defaultSymbolVisibility. + * @member {google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility} defaultSymbolVisibility + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.defaultSymbolVisibility = 0; + /** * Creates a new FeatureSet instance using the specified properties. * @function create @@ -10057,6 +10758,10 @@ writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); + if (message.enforceNamingStyle != null && Object.hasOwnProperty.call(message, "enforceNamingStyle")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.enforceNamingStyle); + if (message.defaultSymbolVisibility != null && Object.hasOwnProperty.call(message, "defaultSymbolVisibility")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.defaultSymbolVisibility); return writer; }; @@ -10117,6 +10822,14 @@ message.jsonFormat = reader.int32(); break; } + case 7: { + message.enforceNamingStyle = reader.int32(); + break; + } + case 8: { + message.defaultSymbolVisibility = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -10207,6 +10920,26 @@ case 2: break; } + if (message.enforceNamingStyle != null && message.hasOwnProperty("enforceNamingStyle")) + switch (message.enforceNamingStyle) { + default: + return "enforceNamingStyle: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.defaultSymbolVisibility != null && message.hasOwnProperty("defaultSymbolVisibility")) + switch (message.defaultSymbolVisibility) { + default: + return "defaultSymbolVisibility: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } return null; }; @@ -10346,6 +11079,54 @@ message.jsonFormat = 2; break; } + switch (object.enforceNamingStyle) { + default: + if (typeof object.enforceNamingStyle === "number") { + message.enforceNamingStyle = object.enforceNamingStyle; + break; + } + break; + case "ENFORCE_NAMING_STYLE_UNKNOWN": + case 0: + message.enforceNamingStyle = 0; + break; + case "STYLE2024": + case 1: + message.enforceNamingStyle = 1; + break; + case "STYLE_LEGACY": + case 2: + message.enforceNamingStyle = 2; + break; + } + switch (object.defaultSymbolVisibility) { + default: + if (typeof object.defaultSymbolVisibility === "number") { + message.defaultSymbolVisibility = object.defaultSymbolVisibility; + break; + } + break; + case "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN": + case 0: + message.defaultSymbolVisibility = 0; + break; + case "EXPORT_ALL": + case 1: + message.defaultSymbolVisibility = 1; + break; + case "EXPORT_TOP_LEVEL": + case 2: + message.defaultSymbolVisibility = 2; + break; + case "LOCAL_ALL": + case 3: + message.defaultSymbolVisibility = 3; + break; + case "STRICT": + case 4: + message.defaultSymbolVisibility = 4; + break; + } return message; }; @@ -10369,6 +11150,8 @@ object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; + object.enforceNamingStyle = options.enums === String ? "ENFORCE_NAMING_STYLE_UNKNOWN" : 0; + object.defaultSymbolVisibility = options.enums === String ? "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN" : 0; } if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; @@ -10382,6 +11165,10 @@ object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; + if (message.enforceNamingStyle != null && message.hasOwnProperty("enforceNamingStyle")) + object.enforceNamingStyle = options.enums === String ? $root.google.protobuf.FeatureSet.EnforceNamingStyle[message.enforceNamingStyle] === undefined ? message.enforceNamingStyle : $root.google.protobuf.FeatureSet.EnforceNamingStyle[message.enforceNamingStyle] : message.enforceNamingStyle; + if (message.defaultSymbolVisibility != null && message.hasOwnProperty("defaultSymbolVisibility")) + object.defaultSymbolVisibility = options.enums === String ? $root.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility[message.defaultSymbolVisibility] === undefined ? message.defaultSymbolVisibility : $root.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility[message.defaultSymbolVisibility] : message.defaultSymbolVisibility; return object; }; @@ -10509,6 +11296,219 @@ return values; })(); + /** + * EnforceNamingStyle enum. + * @name google.protobuf.FeatureSet.EnforceNamingStyle + * @enum {number} + * @property {number} ENFORCE_NAMING_STYLE_UNKNOWN=0 ENFORCE_NAMING_STYLE_UNKNOWN value + * @property {number} STYLE2024=1 STYLE2024 value + * @property {number} STYLE_LEGACY=2 STYLE_LEGACY value + */ + FeatureSet.EnforceNamingStyle = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENFORCE_NAMING_STYLE_UNKNOWN"] = 0; + values[valuesById[1] = "STYLE2024"] = 1; + values[valuesById[2] = "STYLE_LEGACY"] = 2; + return values; + })(); + + FeatureSet.VisibilityFeature = (function() { + + /** + * Properties of a VisibilityFeature. + * @memberof google.protobuf.FeatureSet + * @interface IVisibilityFeature + */ + + /** + * Constructs a new VisibilityFeature. + * @memberof google.protobuf.FeatureSet + * @classdesc Represents a VisibilityFeature. + * @implements IVisibilityFeature + * @constructor + * @param {google.protobuf.FeatureSet.IVisibilityFeature=} [properties] Properties to set + */ + function VisibilityFeature(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new VisibilityFeature instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature instance + */ + VisibilityFeature.create = function create(properties) { + return new VisibilityFeature(properties); + }; + + /** + * Encodes the specified VisibilityFeature message. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature} message VisibilityFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VisibilityFeature.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified VisibilityFeature message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature} message VisibilityFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VisibilityFeature.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VisibilityFeature.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet.VisibilityFeature(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VisibilityFeature.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VisibilityFeature message. + * @function verify + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VisibilityFeature.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a VisibilityFeature message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + */ + VisibilityFeature.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSet.VisibilityFeature) + return object; + return new $root.google.protobuf.FeatureSet.VisibilityFeature(); + }; + + /** + * Creates a plain object from a VisibilityFeature message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.VisibilityFeature} message VisibilityFeature + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VisibilityFeature.toObject = function toObject() { + return {}; + }; + + /** + * Converts this VisibilityFeature to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @instance + * @returns {Object.} JSON object + */ + VisibilityFeature.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VisibilityFeature + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VisibilityFeature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet.VisibilityFeature"; + }; + + /** + * DefaultSymbolVisibility enum. + * @name google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility + * @enum {number} + * @property {number} DEFAULT_SYMBOL_VISIBILITY_UNKNOWN=0 DEFAULT_SYMBOL_VISIBILITY_UNKNOWN value + * @property {number} EXPORT_ALL=1 EXPORT_ALL value + * @property {number} EXPORT_TOP_LEVEL=2 EXPORT_TOP_LEVEL value + * @property {number} LOCAL_ALL=3 LOCAL_ALL value + * @property {number} STRICT=4 STRICT value + */ + VisibilityFeature.DefaultSymbolVisibility = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN"] = 0; + values[valuesById[1] = "EXPORT_ALL"] = 1; + values[valuesById[2] = "EXPORT_TOP_LEVEL"] = 2; + values[valuesById[3] = "LOCAL_ALL"] = 3; + values[valuesById[4] = "STRICT"] = 4; + return values; + })(); + + return VisibilityFeature; + })(); + return FeatureSet; })(); @@ -10693,6 +11693,7 @@ default: return "minimumEdition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -10710,6 +11711,7 @@ default: return "maximumEdition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -10758,6 +11760,10 @@ case 0: message.minimumEdition = 0; break; + case "EDITION_LEGACY": + case 900: + message.minimumEdition = 900; + break; case "EDITION_PROTO2": case 998: message.minimumEdition = 998; @@ -10810,6 +11816,10 @@ case 0: message.maximumEdition = 0; break; + case "EDITION_LEGACY": + case 900: + message.maximumEdition = 900; + break; case "EDITION_PROTO2": case 998: message.maximumEdition = 998; @@ -10918,7 +11928,8 @@ * @memberof google.protobuf.FeatureSetDefaults * @interface IFeatureSetEditionDefault * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition - * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features + * @property {google.protobuf.IFeatureSet|null} [overridableFeatures] FeatureSetEditionDefault overridableFeatures + * @property {google.protobuf.IFeatureSet|null} [fixedFeatures] FeatureSetEditionDefault fixedFeatures */ /** @@ -10945,12 +11956,20 @@ FeatureSetEditionDefault.prototype.edition = 0; /** - * FeatureSetEditionDefault features. - * @member {google.protobuf.IFeatureSet|null|undefined} features + * FeatureSetEditionDefault overridableFeatures. + * @member {google.protobuf.IFeatureSet|null|undefined} overridableFeatures + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.overridableFeatures = null; + + /** + * FeatureSetEditionDefault fixedFeatures. + * @member {google.protobuf.IFeatureSet|null|undefined} fixedFeatures * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault * @instance */ - FeatureSetEditionDefault.prototype.features = null; + FeatureSetEditionDefault.prototype.fixedFeatures = null; /** * Creates a new FeatureSetEditionDefault instance using the specified properties. @@ -10976,10 +11995,12 @@ FeatureSetEditionDefault.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + if (message.overridableFeatures != null && Object.hasOwnProperty.call(message, "overridableFeatures")) + $root.google.protobuf.FeatureSet.encode(message.overridableFeatures, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.fixedFeatures != null && Object.hasOwnProperty.call(message, "fixedFeatures")) + $root.google.protobuf.FeatureSet.encode(message.fixedFeatures, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -11020,8 +12041,12 @@ message.edition = reader.int32(); break; } - case 2: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + case 4: { + message.overridableFeatures = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 5: { + message.fixedFeatures = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); break; } default: @@ -11064,6 +12089,7 @@ default: return "edition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -11076,10 +12102,15 @@ case 2147483647: break; } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (message.overridableFeatures != null && message.hasOwnProperty("overridableFeatures")) { + var error = $root.google.protobuf.FeatureSet.verify(message.overridableFeatures); + if (error) + return "overridableFeatures." + error; + } + if (message.fixedFeatures != null && message.hasOwnProperty("fixedFeatures")) { + var error = $root.google.protobuf.FeatureSet.verify(message.fixedFeatures); if (error) - return "features." + error; + return "fixedFeatures." + error; } return null; }; @@ -11107,6 +12138,10 @@ case 0: message.edition = 0; break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; case "EDITION_PROTO2": case 998: message.edition = 998; @@ -11148,10 +12183,15 @@ message.edition = 2147483647; break; } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + if (object.overridableFeatures != null) { + if (typeof object.overridableFeatures !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.overridableFeatures: object expected"); + message.overridableFeatures = $root.google.protobuf.FeatureSet.fromObject(object.overridableFeatures); + } + if (object.fixedFeatures != null) { + if (typeof object.fixedFeatures !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fixedFeatures: object expected"); + message.fixedFeatures = $root.google.protobuf.FeatureSet.fromObject(object.fixedFeatures); } return message; }; @@ -11170,13 +12210,16 @@ options = {}; var object = {}; if (options.defaults) { - object.features = null; object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.overridableFeatures = null; + object.fixedFeatures = null; } - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); if (message.edition != null && message.hasOwnProperty("edition")) object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + if (message.overridableFeatures != null && message.hasOwnProperty("overridableFeatures")) + object.overridableFeatures = $root.google.protobuf.FeatureSet.toObject(message.overridableFeatures, options); + if (message.fixedFeatures != null && message.hasOwnProperty("fixedFeatures")) + object.fixedFeatures = $root.google.protobuf.FeatureSet.toObject(message.fixedFeatures, options); return object; }; @@ -12391,6 +13434,22 @@ return GeneratedCodeInfo; })(); + /** + * SymbolVisibility enum. + * @name google.protobuf.SymbolVisibility + * @enum {number} + * @property {number} VISIBILITY_UNSET=0 VISIBILITY_UNSET value + * @property {number} VISIBILITY_LOCAL=1 VISIBILITY_LOCAL value + * @property {number} VISIBILITY_EXPORT=2 VISIBILITY_EXPORT value + */ + protobuf.SymbolVisibility = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VISIBILITY_UNSET"] = 0; + values[valuesById[1] = "VISIBILITY_LOCAL"] = 1; + values[valuesById[2] = "VISIBILITY_EXPORT"] = 2; + return values; + })(); + protobuf.Any = (function() { /** @@ -65331,6 +66390,7 @@ * @interface ICommonLanguageSettings * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri * @property {Array.|null} [destinations] CommonLanguageSettings destinations + * @property {google.api.ISelectiveGapicGeneration|null} [selectiveGapicGeneration] CommonLanguageSettings selectiveGapicGeneration */ /** @@ -65365,6 +66425,14 @@ */ CommonLanguageSettings.prototype.destinations = $util.emptyArray; + /** + * CommonLanguageSettings selectiveGapicGeneration. + * @member {google.api.ISelectiveGapicGeneration|null|undefined} selectiveGapicGeneration + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.selectiveGapicGeneration = null; + /** * Creates a new CommonLanguageSettings instance using the specified properties. * @function create @@ -65397,6 +66465,8 @@ writer.int32(message.destinations[i]); writer.ldelim(); } + if (message.selectiveGapicGeneration != null && Object.hasOwnProperty.call(message, "selectiveGapicGeneration")) + $root.google.api.SelectiveGapicGeneration.encode(message.selectiveGapicGeneration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -65448,6 +66518,10 @@ message.destinations.push(reader.int32()); break; } + case 3: { + message.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -65499,6 +66573,11 @@ break; } } + if (message.selectiveGapicGeneration != null && message.hasOwnProperty("selectiveGapicGeneration")) { + var error = $root.google.api.SelectiveGapicGeneration.verify(message.selectiveGapicGeneration); + if (error) + return "selectiveGapicGeneration." + error; + } return null; }; @@ -65541,6 +66620,11 @@ break; } } + if (object.selectiveGapicGeneration != null) { + if (typeof object.selectiveGapicGeneration !== "object") + throw TypeError(".google.api.CommonLanguageSettings.selectiveGapicGeneration: object expected"); + message.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.fromObject(object.selectiveGapicGeneration); + } return message; }; @@ -65559,8 +66643,10 @@ var object = {}; if (options.arrays || options.defaults) object.destinations = []; - if (options.defaults) + if (options.defaults) { object.referenceDocsUri = ""; + object.selectiveGapicGeneration = null; + } if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) object.referenceDocsUri = message.referenceDocsUri; if (message.destinations && message.destinations.length) { @@ -65568,6 +66654,8 @@ for (var j = 0; j < message.destinations.length; ++j) object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; } + if (message.selectiveGapicGeneration != null && message.hasOwnProperty("selectiveGapicGeneration")) + object.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.toObject(message.selectiveGapicGeneration, options); return object; }; @@ -67390,6 +68478,7 @@ * @memberof google.api * @interface IPythonSettings * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common + * @property {google.api.PythonSettings.IExperimentalFeatures|null} [experimentalFeatures] PythonSettings experimentalFeatures */ /** @@ -67415,6 +68504,14 @@ */ PythonSettings.prototype.common = null; + /** + * PythonSettings experimentalFeatures. + * @member {google.api.PythonSettings.IExperimentalFeatures|null|undefined} experimentalFeatures + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.experimentalFeatures = null; + /** * Creates a new PythonSettings instance using the specified properties. * @function create @@ -67441,6 +68538,8 @@ writer = $Writer.create(); if (message.common != null && Object.hasOwnProperty.call(message, "common")) $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.experimentalFeatures != null && Object.hasOwnProperty.call(message, "experimentalFeatures")) + $root.google.api.PythonSettings.ExperimentalFeatures.encode(message.experimentalFeatures, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -67481,6 +68580,10 @@ message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); break; } + case 2: { + message.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -67521,6 +68624,11 @@ if (error) return "common." + error; } + if (message.experimentalFeatures != null && message.hasOwnProperty("experimentalFeatures")) { + var error = $root.google.api.PythonSettings.ExperimentalFeatures.verify(message.experimentalFeatures); + if (error) + return "experimentalFeatures." + error; + } return null; }; @@ -67541,6 +68649,11 @@ throw TypeError(".google.api.PythonSettings.common: object expected"); message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); } + if (object.experimentalFeatures != null) { + if (typeof object.experimentalFeatures !== "object") + throw TypeError(".google.api.PythonSettings.experimentalFeatures: object expected"); + message.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.fromObject(object.experimentalFeatures); + } return message; }; @@ -67557,10 +68670,14 @@ if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.common = null; + object.experimentalFeatures = null; + } if (message.common != null && message.hasOwnProperty("common")) object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + if (message.experimentalFeatures != null && message.hasOwnProperty("experimentalFeatures")) + object.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.toObject(message.experimentalFeatures, options); return object; }; @@ -67590,6 +68707,258 @@ return typeUrlPrefix + "/google.api.PythonSettings"; }; + PythonSettings.ExperimentalFeatures = (function() { + + /** + * Properties of an ExperimentalFeatures. + * @memberof google.api.PythonSettings + * @interface IExperimentalFeatures + * @property {boolean|null} [restAsyncIoEnabled] ExperimentalFeatures restAsyncIoEnabled + * @property {boolean|null} [protobufPythonicTypesEnabled] ExperimentalFeatures protobufPythonicTypesEnabled + * @property {boolean|null} [unversionedPackageDisabled] ExperimentalFeatures unversionedPackageDisabled + */ + + /** + * Constructs a new ExperimentalFeatures. + * @memberof google.api.PythonSettings + * @classdesc Represents an ExperimentalFeatures. + * @implements IExperimentalFeatures + * @constructor + * @param {google.api.PythonSettings.IExperimentalFeatures=} [properties] Properties to set + */ + function ExperimentalFeatures(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExperimentalFeatures restAsyncIoEnabled. + * @member {boolean} restAsyncIoEnabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.restAsyncIoEnabled = false; + + /** + * ExperimentalFeatures protobufPythonicTypesEnabled. + * @member {boolean} protobufPythonicTypesEnabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.protobufPythonicTypesEnabled = false; + + /** + * ExperimentalFeatures unversionedPackageDisabled. + * @member {boolean} unversionedPackageDisabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.unversionedPackageDisabled = false; + + /** + * Creates a new ExperimentalFeatures instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures=} [properties] Properties to set + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures instance + */ + ExperimentalFeatures.create = function create(properties) { + return new ExperimentalFeatures(properties); + }; + + /** + * Encodes the specified ExperimentalFeatures message. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures} message ExperimentalFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExperimentalFeatures.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.restAsyncIoEnabled != null && Object.hasOwnProperty.call(message, "restAsyncIoEnabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.restAsyncIoEnabled); + if (message.protobufPythonicTypesEnabled != null && Object.hasOwnProperty.call(message, "protobufPythonicTypesEnabled")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.protobufPythonicTypesEnabled); + if (message.unversionedPackageDisabled != null && Object.hasOwnProperty.call(message, "unversionedPackageDisabled")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.unversionedPackageDisabled); + return writer; + }; + + /** + * Encodes the specified ExperimentalFeatures message, length delimited. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures} message ExperimentalFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExperimentalFeatures.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExperimentalFeatures.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings.ExperimentalFeatures(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.restAsyncIoEnabled = reader.bool(); + break; + } + case 2: { + message.protobufPythonicTypesEnabled = reader.bool(); + break; + } + case 3: { + message.unversionedPackageDisabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExperimentalFeatures.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExperimentalFeatures message. + * @function verify + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExperimentalFeatures.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.restAsyncIoEnabled != null && message.hasOwnProperty("restAsyncIoEnabled")) + if (typeof message.restAsyncIoEnabled !== "boolean") + return "restAsyncIoEnabled: boolean expected"; + if (message.protobufPythonicTypesEnabled != null && message.hasOwnProperty("protobufPythonicTypesEnabled")) + if (typeof message.protobufPythonicTypesEnabled !== "boolean") + return "protobufPythonicTypesEnabled: boolean expected"; + if (message.unversionedPackageDisabled != null && message.hasOwnProperty("unversionedPackageDisabled")) + if (typeof message.unversionedPackageDisabled !== "boolean") + return "unversionedPackageDisabled: boolean expected"; + return null; + }; + + /** + * Creates an ExperimentalFeatures message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + */ + ExperimentalFeatures.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PythonSettings.ExperimentalFeatures) + return object; + var message = new $root.google.api.PythonSettings.ExperimentalFeatures(); + if (object.restAsyncIoEnabled != null) + message.restAsyncIoEnabled = Boolean(object.restAsyncIoEnabled); + if (object.protobufPythonicTypesEnabled != null) + message.protobufPythonicTypesEnabled = Boolean(object.protobufPythonicTypesEnabled); + if (object.unversionedPackageDisabled != null) + message.unversionedPackageDisabled = Boolean(object.unversionedPackageDisabled); + return message; + }; + + /** + * Creates a plain object from an ExperimentalFeatures message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.ExperimentalFeatures} message ExperimentalFeatures + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExperimentalFeatures.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.restAsyncIoEnabled = false; + object.protobufPythonicTypesEnabled = false; + object.unversionedPackageDisabled = false; + } + if (message.restAsyncIoEnabled != null && message.hasOwnProperty("restAsyncIoEnabled")) + object.restAsyncIoEnabled = message.restAsyncIoEnabled; + if (message.protobufPythonicTypesEnabled != null && message.hasOwnProperty("protobufPythonicTypesEnabled")) + object.protobufPythonicTypesEnabled = message.protobufPythonicTypesEnabled; + if (message.unversionedPackageDisabled != null && message.hasOwnProperty("unversionedPackageDisabled")) + object.unversionedPackageDisabled = message.unversionedPackageDisabled; + return object; + }; + + /** + * Converts this ExperimentalFeatures to JSON. + * @function toJSON + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + * @returns {Object.} JSON object + */ + ExperimentalFeatures.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExperimentalFeatures + * @function getTypeUrl + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExperimentalFeatures.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings.ExperimentalFeatures"; + }; + + return ExperimentalFeatures; + })(); + return PythonSettings; })(); @@ -68466,6 +69835,7 @@ * @memberof google.api * @interface IGoSettings * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common + * @property {Object.|null} [renamedServices] GoSettings renamedServices */ /** @@ -68477,6 +69847,7 @@ * @param {google.api.IGoSettings=} [properties] Properties to set */ function GoSettings(properties) { + this.renamedServices = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -68491,6 +69862,14 @@ */ GoSettings.prototype.common = null; + /** + * GoSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.renamedServices = $util.emptyObject; + /** * Creates a new GoSettings instance using the specified properties. * @function create @@ -68517,6 +69896,9 @@ writer = $Writer.create(); if (message.common != null && Object.hasOwnProperty.call(message, "common")) $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); return writer; }; @@ -68547,7 +69929,7 @@ GoSettings.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(), key, value; while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) @@ -68557,6 +69939,29 @@ message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); break; } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedServices[key] = value; + break; + } default: reader.skipType(tag & 7); break; @@ -68597,6 +70002,14 @@ if (error) return "common." + error; } + if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } return null; }; @@ -68617,6 +70030,13 @@ throw TypeError(".google.api.GoSettings.common: object expected"); message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); } + if (object.renamedServices) { + if (typeof object.renamedServices !== "object") + throw TypeError(".google.api.GoSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } return message; }; @@ -68633,10 +70053,18 @@ if (!options) options = {}; var object = {}; + if (options.objects || options.defaults) + object.renamedServices = {}; if (options.defaults) object.common = null; if (message.common != null && message.hasOwnProperty("common")) object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } return object; }; @@ -69275,6 +70703,251 @@ return values; })(); + api.SelectiveGapicGeneration = (function() { + + /** + * Properties of a SelectiveGapicGeneration. + * @memberof google.api + * @interface ISelectiveGapicGeneration + * @property {Array.|null} [methods] SelectiveGapicGeneration methods + * @property {boolean|null} [generateOmittedAsInternal] SelectiveGapicGeneration generateOmittedAsInternal + */ + + /** + * Constructs a new SelectiveGapicGeneration. + * @memberof google.api + * @classdesc Represents a SelectiveGapicGeneration. + * @implements ISelectiveGapicGeneration + * @constructor + * @param {google.api.ISelectiveGapicGeneration=} [properties] Properties to set + */ + function SelectiveGapicGeneration(properties) { + this.methods = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SelectiveGapicGeneration methods. + * @member {Array.} methods + * @memberof google.api.SelectiveGapicGeneration + * @instance + */ + SelectiveGapicGeneration.prototype.methods = $util.emptyArray; + + /** + * SelectiveGapicGeneration generateOmittedAsInternal. + * @member {boolean} generateOmittedAsInternal + * @memberof google.api.SelectiveGapicGeneration + * @instance + */ + SelectiveGapicGeneration.prototype.generateOmittedAsInternal = false; + + /** + * Creates a new SelectiveGapicGeneration instance using the specified properties. + * @function create + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration=} [properties] Properties to set + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration instance + */ + SelectiveGapicGeneration.create = function create(properties) { + return new SelectiveGapicGeneration(properties); + }; + + /** + * Encodes the specified SelectiveGapicGeneration message. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @function encode + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration} message SelectiveGapicGeneration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelectiveGapicGeneration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.methods != null && message.methods.length) + for (var i = 0; i < message.methods.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.methods[i]); + if (message.generateOmittedAsInternal != null && Object.hasOwnProperty.call(message, "generateOmittedAsInternal")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.generateOmittedAsInternal); + return writer; + }; + + /** + * Encodes the specified SelectiveGapicGeneration message, length delimited. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration} message SelectiveGapicGeneration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelectiveGapicGeneration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer. + * @function decode + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelectiveGapicGeneration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.SelectiveGapicGeneration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.methods && message.methods.length)) + message.methods = []; + message.methods.push(reader.string()); + break; + } + case 2: { + message.generateOmittedAsInternal = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelectiveGapicGeneration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SelectiveGapicGeneration message. + * @function verify + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SelectiveGapicGeneration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.methods != null && message.hasOwnProperty("methods")) { + if (!Array.isArray(message.methods)) + return "methods: array expected"; + for (var i = 0; i < message.methods.length; ++i) + if (!$util.isString(message.methods[i])) + return "methods: string[] expected"; + } + if (message.generateOmittedAsInternal != null && message.hasOwnProperty("generateOmittedAsInternal")) + if (typeof message.generateOmittedAsInternal !== "boolean") + return "generateOmittedAsInternal: boolean expected"; + return null; + }; + + /** + * Creates a SelectiveGapicGeneration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {Object.} object Plain object + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + */ + SelectiveGapicGeneration.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.SelectiveGapicGeneration) + return object; + var message = new $root.google.api.SelectiveGapicGeneration(); + if (object.methods) { + if (!Array.isArray(object.methods)) + throw TypeError(".google.api.SelectiveGapicGeneration.methods: array expected"); + message.methods = []; + for (var i = 0; i < object.methods.length; ++i) + message.methods[i] = String(object.methods[i]); + } + if (object.generateOmittedAsInternal != null) + message.generateOmittedAsInternal = Boolean(object.generateOmittedAsInternal); + return message; + }; + + /** + * Creates a plain object from a SelectiveGapicGeneration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.SelectiveGapicGeneration} message SelectiveGapicGeneration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SelectiveGapicGeneration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.methods = []; + if (options.defaults) + object.generateOmittedAsInternal = false; + if (message.methods && message.methods.length) { + object.methods = []; + for (var j = 0; j < message.methods.length; ++j) + object.methods[j] = message.methods[j]; + } + if (message.generateOmittedAsInternal != null && message.hasOwnProperty("generateOmittedAsInternal")) + object.generateOmittedAsInternal = message.generateOmittedAsInternal; + return object; + }; + + /** + * Converts this SelectiveGapicGeneration to JSON. + * @function toJSON + * @memberof google.api.SelectiveGapicGeneration + * @instance + * @returns {Object.} JSON object + */ + SelectiveGapicGeneration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SelectiveGapicGeneration + * @function getTypeUrl + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SelectiveGapicGeneration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.SelectiveGapicGeneration"; + }; + + return SelectiveGapicGeneration; + })(); + /** * LaunchStage enum. * @name google.api.LaunchStage diff --git a/packages/google-analytics-data/protos/protos.json b/packages/google-analytics-data/protos/protos.json index adcb9024f55..cc0def9258c 100644 --- a/packages/google-analytics-data/protos/protos.json +++ b/packages/google-analytics-data/protos/protos.json @@ -33,12 +33,19 @@ "type": "FileDescriptorProto", "id": 1 } - } + }, + "extensions": [ + [ + 536000000, + 536000000 + ] + ] }, "Edition": { "edition": "proto2", "values": { "EDITION_UNKNOWN": 0, + "EDITION_LEGACY": 900, "EDITION_PROTO2": 998, "EDITION_PROTO3": 999, "EDITION_2023": 1000, @@ -77,6 +84,11 @@ "type": "int32", "id": 11 }, + "optionDependency": { + "rule": "repeated", + "type": "string", + "id": 15 + }, "messageType": { "rule": "repeated", "type": "DescriptorProto", @@ -165,6 +177,10 @@ "rule": "repeated", "type": "string", "id": 10 + }, + "visibility": { + "type": "SymbolVisibility", + "id": 11 } }, "nested": { @@ -390,6 +406,10 @@ "rule": "repeated", "type": "string", "id": 5 + }, + "visibility": { + "type": "SymbolVisibility", + "id": 6 } }, "nested": { @@ -604,6 +624,7 @@ 42, 42 ], + "php_generic_services", [ 38, 38 @@ -739,7 +760,8 @@ "type": "bool", "id": 10, "options": { - "default": false + "default": false, + "deprecated": true } }, "debugRedact": { @@ -767,6 +789,10 @@ "type": "FeatureSet", "id": 21 }, + "featureSupport": { + "type": "FeatureSupport", + "id": 22 + }, "uninterpretedOption": { "rule": "repeated", "type": "UninterpretedOption", @@ -836,6 +862,26 @@ "id": 2 } } + }, + "FeatureSupport": { + "fields": { + "editionIntroduced": { + "type": "Edition", + "id": 1 + }, + "editionDeprecated": { + "type": "Edition", + "id": 2 + }, + "deprecationWarning": { + "type": "string", + "id": 3 + }, + "editionRemoved": { + "type": "Edition", + "id": 4 + } + } } } }, @@ -924,6 +970,10 @@ "default": false } }, + "featureSupport": { + "type": "FieldOptions.FeatureSupport", + "id": 4 + }, "uninterpretedOption": { "rule": "repeated", "type": "UninterpretedOption", @@ -1066,6 +1116,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_2023", "edition_defaults.value": "EXPLICIT" } @@ -1076,6 +1127,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "OPEN" } @@ -1086,6 +1138,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "PACKED" } @@ -1096,6 +1149,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "VERIFY" } @@ -1106,7 +1160,8 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO2", + "feature_support.edition_introduced": "EDITION_2023", + "edition_defaults.edition": "EDITION_LEGACY", "edition_defaults.value": "LENGTH_PREFIXED" } }, @@ -1116,27 +1171,38 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "ALLOW" } + }, + "enforceNamingStyle": { + "type": "EnforceNamingStyle", + "id": 7, + "options": { + "retention": "RETENTION_SOURCE", + "targets": "TARGET_TYPE_METHOD", + "feature_support.edition_introduced": "EDITION_2024", + "edition_defaults.edition": "EDITION_2024", + "edition_defaults.value": "STYLE2024" + } + }, + "defaultSymbolVisibility": { + "type": "VisibilityFeature.DefaultSymbolVisibility", + "id": 8, + "options": { + "retention": "RETENTION_SOURCE", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2024", + "edition_defaults.edition": "EDITION_2024", + "edition_defaults.value": "EXPORT_TOP_LEVEL" + } } }, "extensions": [ [ 1000, - 1000 - ], - [ - 1001, - 1001 - ], - [ - 1002, - 1002 - ], - [ - 9990, - 9990 + 9994 ], [ 9995, @@ -1181,7 +1247,13 @@ "UTF8_VALIDATION_UNKNOWN": 0, "VERIFY": 2, "NONE": 3 - } + }, + "reserved": [ + [ + 1, + 1 + ] + ] }, "MessageEncoding": { "values": { @@ -1196,6 +1268,33 @@ "ALLOW": 1, "LEGACY_BEST_EFFORT": 2 } + }, + "EnforceNamingStyle": { + "values": { + "ENFORCE_NAMING_STYLE_UNKNOWN": 0, + "STYLE2024": 1, + "STYLE_LEGACY": 2 + } + }, + "VisibilityFeature": { + "fields": {}, + "reserved": [ + [ + 1, + 536870911 + ] + ], + "nested": { + "DefaultSymbolVisibility": { + "values": { + "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN": 0, + "EXPORT_ALL": 1, + "EXPORT_TOP_LEVEL": 2, + "LOCAL_ALL": 3, + "STRICT": 4 + } + } + } } } }, @@ -1223,11 +1322,26 @@ "type": "Edition", "id": 3 }, - "features": { + "overridableFeatures": { "type": "FeatureSet", - "id": 2 + "id": 4 + }, + "fixedFeatures": { + "type": "FeatureSet", + "id": 5 } - } + }, + "reserved": [ + [ + 1, + 1 + ], + [ + 2, + 2 + ], + "features" + ] } } }, @@ -1240,6 +1354,12 @@ "id": 1 } }, + "extensions": [ + [ + 536000000, + 536000000 + ] + ], "nested": { "Location": { "fields": { @@ -1325,6 +1445,14 @@ } } }, + "SymbolVisibility": { + "edition": "proto2", + "values": { + "VISIBILITY_UNSET": 0, + "VISIBILITY_LOCAL": 1, + "VISIBILITY_EXPORT": 2 + } + }, "Any": { "fields": { "type_url": { @@ -6192,8 +6320,7 @@ "java_multiple_files": true, "java_outer_classname": "ResourceProto", "java_package": "com.google.api", - "objc_class_prefix": "GAPI", - "cc_enable_arenas": true + "objc_class_prefix": "GAPI" }, "nested": { "http": { @@ -6317,6 +6444,10 @@ "rule": "repeated", "type": "ClientLibraryDestination", "id": 2 + }, + "selectiveGapicGeneration": { + "type": "SelectiveGapicGeneration", + "id": 3 } } }, @@ -6457,6 +6588,28 @@ "common": { "type": "CommonLanguageSettings", "id": 1 + }, + "experimentalFeatures": { + "type": "ExperimentalFeatures", + "id": 2 + } + }, + "nested": { + "ExperimentalFeatures": { + "fields": { + "restAsyncIoEnabled": { + "type": "bool", + "id": 1 + }, + "protobufPythonicTypesEnabled": { + "type": "bool", + "id": 2 + }, + "unversionedPackageDisabled": { + "type": "bool", + "id": 3 + } + } } } }, @@ -6514,6 +6667,11 @@ "common": { "type": "CommonLanguageSettings", "id": 1 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 } } }, @@ -6575,6 +6733,19 @@ "PACKAGE_MANAGER": 20 } }, + "SelectiveGapicGeneration": { + "fields": { + "methods": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "generateOmittedAsInternal": { + "type": "bool", + "id": 2 + } + } + }, "LaunchStage": { "values": { "LAUNCH_STAGE_UNSPECIFIED": 0, @@ -6696,6 +6867,7 @@ "java_multiple_files": true, "java_outer_classname": "OperationsProto", "java_package": "com.google.longrunning", + "objc_class_prefix": "GLRUN", "php_namespace": "Google\\LongRunning" }, "nested": { diff --git a/packages/google-api-apikeys/protos/protos.d.ts b/packages/google-api-apikeys/protos/protos.d.ts index fc1b04d83cf..512debabd27 100644 --- a/packages/google-api-apikeys/protos/protos.d.ts +++ b/packages/google-api-apikeys/protos/protos.d.ts @@ -2843,6 +2843,9 @@ export namespace google { /** CommonLanguageSettings destinations */ destinations?: (google.api.ClientLibraryDestination[]|null); + + /** CommonLanguageSettings selectiveGapicGeneration */ + selectiveGapicGeneration?: (google.api.ISelectiveGapicGeneration|null); } /** Represents a CommonLanguageSettings. */ @@ -2860,6 +2863,9 @@ export namespace google { /** CommonLanguageSettings destinations. */ public destinations: google.api.ClientLibraryDestination[]; + /** CommonLanguageSettings selectiveGapicGeneration. */ + public selectiveGapicGeneration?: (google.api.ISelectiveGapicGeneration|null); + /** * Creates a new CommonLanguageSettings instance using the specified properties. * @param [properties] Properties to set @@ -3560,6 +3566,9 @@ export namespace google { /** PythonSettings common */ common?: (google.api.ICommonLanguageSettings|null); + + /** PythonSettings experimentalFeatures */ + experimentalFeatures?: (google.api.PythonSettings.IExperimentalFeatures|null); } /** Represents a PythonSettings. */ @@ -3574,6 +3583,9 @@ export namespace google { /** PythonSettings common. */ public common?: (google.api.ICommonLanguageSettings|null); + /** PythonSettings experimentalFeatures. */ + public experimentalFeatures?: (google.api.PythonSettings.IExperimentalFeatures|null); + /** * Creates a new PythonSettings instance using the specified properties. * @param [properties] Properties to set @@ -3652,6 +3664,118 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + namespace PythonSettings { + + /** Properties of an ExperimentalFeatures. */ + interface IExperimentalFeatures { + + /** ExperimentalFeatures restAsyncIoEnabled */ + restAsyncIoEnabled?: (boolean|null); + + /** ExperimentalFeatures protobufPythonicTypesEnabled */ + protobufPythonicTypesEnabled?: (boolean|null); + + /** ExperimentalFeatures unversionedPackageDisabled */ + unversionedPackageDisabled?: (boolean|null); + } + + /** Represents an ExperimentalFeatures. */ + class ExperimentalFeatures implements IExperimentalFeatures { + + /** + * Constructs a new ExperimentalFeatures. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.PythonSettings.IExperimentalFeatures); + + /** ExperimentalFeatures restAsyncIoEnabled. */ + public restAsyncIoEnabled: boolean; + + /** ExperimentalFeatures protobufPythonicTypesEnabled. */ + public protobufPythonicTypesEnabled: boolean; + + /** ExperimentalFeatures unversionedPackageDisabled. */ + public unversionedPackageDisabled: boolean; + + /** + * Creates a new ExperimentalFeatures instance using the specified properties. + * @param [properties] Properties to set + * @returns ExperimentalFeatures instance + */ + public static create(properties?: google.api.PythonSettings.IExperimentalFeatures): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Encodes the specified ExperimentalFeatures message. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @param message ExperimentalFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.PythonSettings.IExperimentalFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExperimentalFeatures message, length delimited. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @param message ExperimentalFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.PythonSettings.IExperimentalFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Verifies an ExperimentalFeatures message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExperimentalFeatures message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExperimentalFeatures + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Creates a plain object from an ExperimentalFeatures message. Also converts values to other types if specified. + * @param message ExperimentalFeatures + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings.ExperimentalFeatures, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExperimentalFeatures to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExperimentalFeatures + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + /** Properties of a NodeSettings. */ interface INodeSettings { @@ -3978,6 +4102,9 @@ export namespace google { /** GoSettings common */ common?: (google.api.ICommonLanguageSettings|null); + + /** GoSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|null); } /** Represents a GoSettings. */ @@ -3992,6 +4119,9 @@ export namespace google { /** GoSettings common. */ public common?: (google.api.ICommonLanguageSettings|null); + /** GoSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + /** * Creates a new GoSettings instance using the specified properties. * @param [properties] Properties to set @@ -4316,6 +4446,109 @@ export namespace google { PACKAGE_MANAGER = 20 } + /** Properties of a SelectiveGapicGeneration. */ + interface ISelectiveGapicGeneration { + + /** SelectiveGapicGeneration methods */ + methods?: (string[]|null); + + /** SelectiveGapicGeneration generateOmittedAsInternal */ + generateOmittedAsInternal?: (boolean|null); + } + + /** Represents a SelectiveGapicGeneration. */ + class SelectiveGapicGeneration implements ISelectiveGapicGeneration { + + /** + * Constructs a new SelectiveGapicGeneration. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ISelectiveGapicGeneration); + + /** SelectiveGapicGeneration methods. */ + public methods: string[]; + + /** SelectiveGapicGeneration generateOmittedAsInternal. */ + public generateOmittedAsInternal: boolean; + + /** + * Creates a new SelectiveGapicGeneration instance using the specified properties. + * @param [properties] Properties to set + * @returns SelectiveGapicGeneration instance + */ + public static create(properties?: google.api.ISelectiveGapicGeneration): google.api.SelectiveGapicGeneration; + + /** + * Encodes the specified SelectiveGapicGeneration message. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @param message SelectiveGapicGeneration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ISelectiveGapicGeneration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SelectiveGapicGeneration message, length delimited. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @param message SelectiveGapicGeneration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ISelectiveGapicGeneration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.SelectiveGapicGeneration; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.SelectiveGapicGeneration; + + /** + * Verifies a SelectiveGapicGeneration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SelectiveGapicGeneration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SelectiveGapicGeneration + */ + public static fromObject(object: { [k: string]: any }): google.api.SelectiveGapicGeneration; + + /** + * Creates a plain object from a SelectiveGapicGeneration message. Also converts values to other types if specified. + * @param message SelectiveGapicGeneration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.SelectiveGapicGeneration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SelectiveGapicGeneration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SelectiveGapicGeneration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** LaunchStage enum. */ enum LaunchStage { LAUNCH_STAGE_UNSPECIFIED = 0, @@ -4432,6 +4665,7 @@ export namespace google { /** Edition enum. */ enum Edition { EDITION_UNKNOWN = 0, + EDITION_LEGACY = 900, EDITION_PROTO2 = 998, EDITION_PROTO3 = 999, EDITION_2023 = 1000, @@ -4462,6 +4696,9 @@ export namespace google { /** FileDescriptorProto weakDependency */ weakDependency?: (number[]|null); + /** FileDescriptorProto optionDependency */ + optionDependency?: (string[]|null); + /** FileDescriptorProto messageType */ messageType?: (google.protobuf.IDescriptorProto[]|null); @@ -4511,6 +4748,9 @@ export namespace google { /** FileDescriptorProto weakDependency. */ public weakDependency: number[]; + /** FileDescriptorProto optionDependency. */ + public optionDependency: string[]; + /** FileDescriptorProto messageType. */ public messageType: google.protobuf.IDescriptorProto[]; @@ -4645,6 +4885,9 @@ export namespace google { /** DescriptorProto reservedName */ reservedName?: (string[]|null); + + /** DescriptorProto visibility */ + visibility?: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility|null); } /** Represents a DescriptorProto. */ @@ -4686,6 +4929,9 @@ export namespace google { /** DescriptorProto reservedName. */ public reservedName: string[]; + /** DescriptorProto visibility. */ + public visibility: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility); + /** * Creates a new DescriptorProto instance using the specified properties. * @param [properties] Properties to set @@ -5533,6 +5779,9 @@ export namespace google { /** EnumDescriptorProto reservedName */ reservedName?: (string[]|null); + + /** EnumDescriptorProto visibility */ + visibility?: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility|null); } /** Represents an EnumDescriptorProto. */ @@ -5559,6 +5808,9 @@ export namespace google { /** EnumDescriptorProto reservedName. */ public reservedName: string[]; + /** EnumDescriptorProto visibility. */ + public visibility: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility); + /** * Creates a new EnumDescriptorProto instance using the specified properties. * @param [properties] Properties to set @@ -6493,6 +6745,9 @@ export namespace google { /** FieldOptions features */ features?: (google.protobuf.IFeatureSet|null); + /** FieldOptions featureSupport */ + featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** FieldOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); @@ -6548,6 +6803,9 @@ export namespace google { /** FieldOptions features. */ public features?: (google.protobuf.IFeatureSet|null); + /** FieldOptions featureSupport. */ + public featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** FieldOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; @@ -6768,6 +7026,121 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** Properties of a FeatureSupport. */ + interface IFeatureSupport { + + /** FeatureSupport editionIntroduced */ + editionIntroduced?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSupport editionDeprecated */ + editionDeprecated?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSupport deprecationWarning */ + deprecationWarning?: (string|null); + + /** FeatureSupport editionRemoved */ + editionRemoved?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSupport. */ + class FeatureSupport implements IFeatureSupport { + + /** + * Constructs a new FeatureSupport. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IFeatureSupport); + + /** FeatureSupport editionIntroduced. */ + public editionIntroduced: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSupport editionDeprecated. */ + public editionDeprecated: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSupport deprecationWarning. */ + public deprecationWarning: string; + + /** FeatureSupport editionRemoved. */ + public editionRemoved: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSupport instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSupport instance + */ + public static create(properties?: google.protobuf.FieldOptions.IFeatureSupport): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Encodes the specified FeatureSupport message. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @param message FeatureSupport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IFeatureSupport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSupport message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @param message FeatureSupport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IFeatureSupport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Verifies a FeatureSupport message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSupport message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSupport + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Creates a plain object from a FeatureSupport message. Also converts values to other types if specified. + * @param message FeatureSupport + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.FeatureSupport, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSupport to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSupport + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } /** Properties of an OneofOptions. */ @@ -7006,6 +7379,9 @@ export namespace google { /** EnumValueOptions debugRedact */ debugRedact?: (boolean|null); + /** EnumValueOptions featureSupport */ + featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** EnumValueOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); } @@ -7028,6 +7404,9 @@ export namespace google { /** EnumValueOptions debugRedact. */ public debugRedact: boolean; + /** EnumValueOptions featureSupport. */ + public featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** EnumValueOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; @@ -7620,6 +7999,12 @@ export namespace google { /** FeatureSet jsonFormat */ jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); + + /** FeatureSet enforceNamingStyle */ + enforceNamingStyle?: (google.protobuf.FeatureSet.EnforceNamingStyle|keyof typeof google.protobuf.FeatureSet.EnforceNamingStyle|null); + + /** FeatureSet defaultSymbolVisibility */ + defaultSymbolVisibility?: (google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|keyof typeof google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|null); } /** Represents a FeatureSet. */ @@ -7649,6 +8034,12 @@ export namespace google { /** FeatureSet jsonFormat. */ public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); + /** FeatureSet enforceNamingStyle. */ + public enforceNamingStyle: (google.protobuf.FeatureSet.EnforceNamingStyle|keyof typeof google.protobuf.FeatureSet.EnforceNamingStyle); + + /** FeatureSet defaultSymbolVisibility. */ + public defaultSymbolVisibility: (google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|keyof typeof google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility); + /** * Creates a new FeatureSet instance using the specified properties. * @param [properties] Properties to set @@ -7771,6 +8162,116 @@ export namespace google { ALLOW = 1, LEGACY_BEST_EFFORT = 2 } + + /** EnforceNamingStyle enum. */ + enum EnforceNamingStyle { + ENFORCE_NAMING_STYLE_UNKNOWN = 0, + STYLE2024 = 1, + STYLE_LEGACY = 2 + } + + /** Properties of a VisibilityFeature. */ + interface IVisibilityFeature { + } + + /** Represents a VisibilityFeature. */ + class VisibilityFeature implements IVisibilityFeature { + + /** + * Constructs a new VisibilityFeature. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSet.IVisibilityFeature); + + /** + * Creates a new VisibilityFeature instance using the specified properties. + * @param [properties] Properties to set + * @returns VisibilityFeature instance + */ + public static create(properties?: google.protobuf.FeatureSet.IVisibilityFeature): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Encodes the specified VisibilityFeature message. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @param message VisibilityFeature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSet.IVisibilityFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VisibilityFeature message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @param message VisibilityFeature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSet.IVisibilityFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Verifies a VisibilityFeature message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VisibilityFeature message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VisibilityFeature + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Creates a plain object from a VisibilityFeature message. Also converts values to other types if specified. + * @param message VisibilityFeature + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet.VisibilityFeature, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VisibilityFeature to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VisibilityFeature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace VisibilityFeature { + + /** DefaultSymbolVisibility enum. */ + enum DefaultSymbolVisibility { + DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0, + EXPORT_ALL = 1, + EXPORT_TOP_LEVEL = 2, + LOCAL_ALL = 3, + STRICT = 4 + } + } } /** Properties of a FeatureSetDefaults. */ @@ -7890,8 +8391,11 @@ export namespace google { /** FeatureSetEditionDefault edition */ edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - /** FeatureSetEditionDefault features */ - features?: (google.protobuf.IFeatureSet|null); + /** FeatureSetEditionDefault overridableFeatures */ + overridableFeatures?: (google.protobuf.IFeatureSet|null); + + /** FeatureSetEditionDefault fixedFeatures */ + fixedFeatures?: (google.protobuf.IFeatureSet|null); } /** Represents a FeatureSetEditionDefault. */ @@ -7906,8 +8410,11 @@ export namespace google { /** FeatureSetEditionDefault edition. */ public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - /** FeatureSetEditionDefault features. */ - public features?: (google.protobuf.IFeatureSet|null); + /** FeatureSetEditionDefault overridableFeatures. */ + public overridableFeatures?: (google.protobuf.IFeatureSet|null); + + /** FeatureSetEditionDefault fixedFeatures. */ + public fixedFeatures?: (google.protobuf.IFeatureSet|null); /** * Creates a new FeatureSetEditionDefault instance using the specified properties. @@ -8440,6 +8947,13 @@ export namespace google { } } + /** SymbolVisibility enum. */ + enum SymbolVisibility { + VISIBILITY_UNSET = 0, + VISIBILITY_LOCAL = 1, + VISIBILITY_EXPORT = 2 + } + /** Properties of a Timestamp. */ interface ITimestamp { diff --git a/packages/google-api-apikeys/protos/protos.js b/packages/google-api-apikeys/protos/protos.js index 99ec6c79eab..b5c3a8b4bd8 100644 --- a/packages/google-api-apikeys/protos/protos.js +++ b/packages/google-api-apikeys/protos/protos.js @@ -6779,6 +6779,7 @@ * @interface ICommonLanguageSettings * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri * @property {Array.|null} [destinations] CommonLanguageSettings destinations + * @property {google.api.ISelectiveGapicGeneration|null} [selectiveGapicGeneration] CommonLanguageSettings selectiveGapicGeneration */ /** @@ -6813,6 +6814,14 @@ */ CommonLanguageSettings.prototype.destinations = $util.emptyArray; + /** + * CommonLanguageSettings selectiveGapicGeneration. + * @member {google.api.ISelectiveGapicGeneration|null|undefined} selectiveGapicGeneration + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.selectiveGapicGeneration = null; + /** * Creates a new CommonLanguageSettings instance using the specified properties. * @function create @@ -6845,6 +6854,8 @@ writer.int32(message.destinations[i]); writer.ldelim(); } + if (message.selectiveGapicGeneration != null && Object.hasOwnProperty.call(message, "selectiveGapicGeneration")) + $root.google.api.SelectiveGapicGeneration.encode(message.selectiveGapicGeneration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -6896,6 +6907,10 @@ message.destinations.push(reader.int32()); break; } + case 3: { + message.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -6947,6 +6962,11 @@ break; } } + if (message.selectiveGapicGeneration != null && message.hasOwnProperty("selectiveGapicGeneration")) { + var error = $root.google.api.SelectiveGapicGeneration.verify(message.selectiveGapicGeneration); + if (error) + return "selectiveGapicGeneration." + error; + } return null; }; @@ -6989,6 +7009,11 @@ break; } } + if (object.selectiveGapicGeneration != null) { + if (typeof object.selectiveGapicGeneration !== "object") + throw TypeError(".google.api.CommonLanguageSettings.selectiveGapicGeneration: object expected"); + message.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.fromObject(object.selectiveGapicGeneration); + } return message; }; @@ -7007,8 +7032,10 @@ var object = {}; if (options.arrays || options.defaults) object.destinations = []; - if (options.defaults) + if (options.defaults) { object.referenceDocsUri = ""; + object.selectiveGapicGeneration = null; + } if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) object.referenceDocsUri = message.referenceDocsUri; if (message.destinations && message.destinations.length) { @@ -7016,6 +7043,8 @@ for (var j = 0; j < message.destinations.length; ++j) object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; } + if (message.selectiveGapicGeneration != null && message.hasOwnProperty("selectiveGapicGeneration")) + object.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.toObject(message.selectiveGapicGeneration, options); return object; }; @@ -8838,6 +8867,7 @@ * @memberof google.api * @interface IPythonSettings * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common + * @property {google.api.PythonSettings.IExperimentalFeatures|null} [experimentalFeatures] PythonSettings experimentalFeatures */ /** @@ -8863,6 +8893,14 @@ */ PythonSettings.prototype.common = null; + /** + * PythonSettings experimentalFeatures. + * @member {google.api.PythonSettings.IExperimentalFeatures|null|undefined} experimentalFeatures + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.experimentalFeatures = null; + /** * Creates a new PythonSettings instance using the specified properties. * @function create @@ -8889,6 +8927,8 @@ writer = $Writer.create(); if (message.common != null && Object.hasOwnProperty.call(message, "common")) $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.experimentalFeatures != null && Object.hasOwnProperty.call(message, "experimentalFeatures")) + $root.google.api.PythonSettings.ExperimentalFeatures.encode(message.experimentalFeatures, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -8929,6 +8969,10 @@ message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); break; } + case 2: { + message.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -8969,6 +9013,11 @@ if (error) return "common." + error; } + if (message.experimentalFeatures != null && message.hasOwnProperty("experimentalFeatures")) { + var error = $root.google.api.PythonSettings.ExperimentalFeatures.verify(message.experimentalFeatures); + if (error) + return "experimentalFeatures." + error; + } return null; }; @@ -8989,6 +9038,11 @@ throw TypeError(".google.api.PythonSettings.common: object expected"); message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); } + if (object.experimentalFeatures != null) { + if (typeof object.experimentalFeatures !== "object") + throw TypeError(".google.api.PythonSettings.experimentalFeatures: object expected"); + message.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.fromObject(object.experimentalFeatures); + } return message; }; @@ -9005,10 +9059,14 @@ if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.common = null; + object.experimentalFeatures = null; + } if (message.common != null && message.hasOwnProperty("common")) object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + if (message.experimentalFeatures != null && message.hasOwnProperty("experimentalFeatures")) + object.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.toObject(message.experimentalFeatures, options); return object; }; @@ -9038,6 +9096,258 @@ return typeUrlPrefix + "/google.api.PythonSettings"; }; + PythonSettings.ExperimentalFeatures = (function() { + + /** + * Properties of an ExperimentalFeatures. + * @memberof google.api.PythonSettings + * @interface IExperimentalFeatures + * @property {boolean|null} [restAsyncIoEnabled] ExperimentalFeatures restAsyncIoEnabled + * @property {boolean|null} [protobufPythonicTypesEnabled] ExperimentalFeatures protobufPythonicTypesEnabled + * @property {boolean|null} [unversionedPackageDisabled] ExperimentalFeatures unversionedPackageDisabled + */ + + /** + * Constructs a new ExperimentalFeatures. + * @memberof google.api.PythonSettings + * @classdesc Represents an ExperimentalFeatures. + * @implements IExperimentalFeatures + * @constructor + * @param {google.api.PythonSettings.IExperimentalFeatures=} [properties] Properties to set + */ + function ExperimentalFeatures(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExperimentalFeatures restAsyncIoEnabled. + * @member {boolean} restAsyncIoEnabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.restAsyncIoEnabled = false; + + /** + * ExperimentalFeatures protobufPythonicTypesEnabled. + * @member {boolean} protobufPythonicTypesEnabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.protobufPythonicTypesEnabled = false; + + /** + * ExperimentalFeatures unversionedPackageDisabled. + * @member {boolean} unversionedPackageDisabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.unversionedPackageDisabled = false; + + /** + * Creates a new ExperimentalFeatures instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures=} [properties] Properties to set + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures instance + */ + ExperimentalFeatures.create = function create(properties) { + return new ExperimentalFeatures(properties); + }; + + /** + * Encodes the specified ExperimentalFeatures message. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures} message ExperimentalFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExperimentalFeatures.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.restAsyncIoEnabled != null && Object.hasOwnProperty.call(message, "restAsyncIoEnabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.restAsyncIoEnabled); + if (message.protobufPythonicTypesEnabled != null && Object.hasOwnProperty.call(message, "protobufPythonicTypesEnabled")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.protobufPythonicTypesEnabled); + if (message.unversionedPackageDisabled != null && Object.hasOwnProperty.call(message, "unversionedPackageDisabled")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.unversionedPackageDisabled); + return writer; + }; + + /** + * Encodes the specified ExperimentalFeatures message, length delimited. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures} message ExperimentalFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExperimentalFeatures.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExperimentalFeatures.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings.ExperimentalFeatures(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.restAsyncIoEnabled = reader.bool(); + break; + } + case 2: { + message.protobufPythonicTypesEnabled = reader.bool(); + break; + } + case 3: { + message.unversionedPackageDisabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExperimentalFeatures.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExperimentalFeatures message. + * @function verify + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExperimentalFeatures.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.restAsyncIoEnabled != null && message.hasOwnProperty("restAsyncIoEnabled")) + if (typeof message.restAsyncIoEnabled !== "boolean") + return "restAsyncIoEnabled: boolean expected"; + if (message.protobufPythonicTypesEnabled != null && message.hasOwnProperty("protobufPythonicTypesEnabled")) + if (typeof message.protobufPythonicTypesEnabled !== "boolean") + return "protobufPythonicTypesEnabled: boolean expected"; + if (message.unversionedPackageDisabled != null && message.hasOwnProperty("unversionedPackageDisabled")) + if (typeof message.unversionedPackageDisabled !== "boolean") + return "unversionedPackageDisabled: boolean expected"; + return null; + }; + + /** + * Creates an ExperimentalFeatures message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + */ + ExperimentalFeatures.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PythonSettings.ExperimentalFeatures) + return object; + var message = new $root.google.api.PythonSettings.ExperimentalFeatures(); + if (object.restAsyncIoEnabled != null) + message.restAsyncIoEnabled = Boolean(object.restAsyncIoEnabled); + if (object.protobufPythonicTypesEnabled != null) + message.protobufPythonicTypesEnabled = Boolean(object.protobufPythonicTypesEnabled); + if (object.unversionedPackageDisabled != null) + message.unversionedPackageDisabled = Boolean(object.unversionedPackageDisabled); + return message; + }; + + /** + * Creates a plain object from an ExperimentalFeatures message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.ExperimentalFeatures} message ExperimentalFeatures + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExperimentalFeatures.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.restAsyncIoEnabled = false; + object.protobufPythonicTypesEnabled = false; + object.unversionedPackageDisabled = false; + } + if (message.restAsyncIoEnabled != null && message.hasOwnProperty("restAsyncIoEnabled")) + object.restAsyncIoEnabled = message.restAsyncIoEnabled; + if (message.protobufPythonicTypesEnabled != null && message.hasOwnProperty("protobufPythonicTypesEnabled")) + object.protobufPythonicTypesEnabled = message.protobufPythonicTypesEnabled; + if (message.unversionedPackageDisabled != null && message.hasOwnProperty("unversionedPackageDisabled")) + object.unversionedPackageDisabled = message.unversionedPackageDisabled; + return object; + }; + + /** + * Converts this ExperimentalFeatures to JSON. + * @function toJSON + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + * @returns {Object.} JSON object + */ + ExperimentalFeatures.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExperimentalFeatures + * @function getTypeUrl + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExperimentalFeatures.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings.ExperimentalFeatures"; + }; + + return ExperimentalFeatures; + })(); + return PythonSettings; })(); @@ -9914,6 +10224,7 @@ * @memberof google.api * @interface IGoSettings * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common + * @property {Object.|null} [renamedServices] GoSettings renamedServices */ /** @@ -9925,6 +10236,7 @@ * @param {google.api.IGoSettings=} [properties] Properties to set */ function GoSettings(properties) { + this.renamedServices = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9939,6 +10251,14 @@ */ GoSettings.prototype.common = null; + /** + * GoSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.renamedServices = $util.emptyObject; + /** * Creates a new GoSettings instance using the specified properties. * @function create @@ -9965,6 +10285,9 @@ writer = $Writer.create(); if (message.common != null && Object.hasOwnProperty.call(message, "common")) $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); return writer; }; @@ -9995,7 +10318,7 @@ GoSettings.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(), key, value; while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) @@ -10005,6 +10328,29 @@ message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); break; } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedServices[key] = value; + break; + } default: reader.skipType(tag & 7); break; @@ -10045,6 +10391,14 @@ if (error) return "common." + error; } + if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } return null; }; @@ -10065,6 +10419,13 @@ throw TypeError(".google.api.GoSettings.common: object expected"); message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); } + if (object.renamedServices) { + if (typeof object.renamedServices !== "object") + throw TypeError(".google.api.GoSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } return message; }; @@ -10081,10 +10442,18 @@ if (!options) options = {}; var object = {}; + if (options.objects || options.defaults) + object.renamedServices = {}; if (options.defaults) object.common = null; if (message.common != null && message.hasOwnProperty("common")) object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } return object; }; @@ -10723,29 +11092,274 @@ return values; })(); - /** - * LaunchStage enum. - * @name google.api.LaunchStage - * @enum {number} - * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value - * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value - * @property {number} PRELAUNCH=7 PRELAUNCH value - * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value - * @property {number} ALPHA=2 ALPHA value - * @property {number} BETA=3 BETA value - * @property {number} GA=4 GA value - * @property {number} DEPRECATED=5 DEPRECATED value - */ - api.LaunchStage = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; - values[valuesById[6] = "UNIMPLEMENTED"] = 6; - values[valuesById[7] = "PRELAUNCH"] = 7; - values[valuesById[1] = "EARLY_ACCESS"] = 1; - values[valuesById[2] = "ALPHA"] = 2; - values[valuesById[3] = "BETA"] = 3; - values[valuesById[4] = "GA"] = 4; - values[valuesById[5] = "DEPRECATED"] = 5; + api.SelectiveGapicGeneration = (function() { + + /** + * Properties of a SelectiveGapicGeneration. + * @memberof google.api + * @interface ISelectiveGapicGeneration + * @property {Array.|null} [methods] SelectiveGapicGeneration methods + * @property {boolean|null} [generateOmittedAsInternal] SelectiveGapicGeneration generateOmittedAsInternal + */ + + /** + * Constructs a new SelectiveGapicGeneration. + * @memberof google.api + * @classdesc Represents a SelectiveGapicGeneration. + * @implements ISelectiveGapicGeneration + * @constructor + * @param {google.api.ISelectiveGapicGeneration=} [properties] Properties to set + */ + function SelectiveGapicGeneration(properties) { + this.methods = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SelectiveGapicGeneration methods. + * @member {Array.} methods + * @memberof google.api.SelectiveGapicGeneration + * @instance + */ + SelectiveGapicGeneration.prototype.methods = $util.emptyArray; + + /** + * SelectiveGapicGeneration generateOmittedAsInternal. + * @member {boolean} generateOmittedAsInternal + * @memberof google.api.SelectiveGapicGeneration + * @instance + */ + SelectiveGapicGeneration.prototype.generateOmittedAsInternal = false; + + /** + * Creates a new SelectiveGapicGeneration instance using the specified properties. + * @function create + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration=} [properties] Properties to set + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration instance + */ + SelectiveGapicGeneration.create = function create(properties) { + return new SelectiveGapicGeneration(properties); + }; + + /** + * Encodes the specified SelectiveGapicGeneration message. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @function encode + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration} message SelectiveGapicGeneration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelectiveGapicGeneration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.methods != null && message.methods.length) + for (var i = 0; i < message.methods.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.methods[i]); + if (message.generateOmittedAsInternal != null && Object.hasOwnProperty.call(message, "generateOmittedAsInternal")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.generateOmittedAsInternal); + return writer; + }; + + /** + * Encodes the specified SelectiveGapicGeneration message, length delimited. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration} message SelectiveGapicGeneration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelectiveGapicGeneration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer. + * @function decode + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelectiveGapicGeneration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.SelectiveGapicGeneration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.methods && message.methods.length)) + message.methods = []; + message.methods.push(reader.string()); + break; + } + case 2: { + message.generateOmittedAsInternal = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelectiveGapicGeneration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SelectiveGapicGeneration message. + * @function verify + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SelectiveGapicGeneration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.methods != null && message.hasOwnProperty("methods")) { + if (!Array.isArray(message.methods)) + return "methods: array expected"; + for (var i = 0; i < message.methods.length; ++i) + if (!$util.isString(message.methods[i])) + return "methods: string[] expected"; + } + if (message.generateOmittedAsInternal != null && message.hasOwnProperty("generateOmittedAsInternal")) + if (typeof message.generateOmittedAsInternal !== "boolean") + return "generateOmittedAsInternal: boolean expected"; + return null; + }; + + /** + * Creates a SelectiveGapicGeneration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {Object.} object Plain object + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + */ + SelectiveGapicGeneration.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.SelectiveGapicGeneration) + return object; + var message = new $root.google.api.SelectiveGapicGeneration(); + if (object.methods) { + if (!Array.isArray(object.methods)) + throw TypeError(".google.api.SelectiveGapicGeneration.methods: array expected"); + message.methods = []; + for (var i = 0; i < object.methods.length; ++i) + message.methods[i] = String(object.methods[i]); + } + if (object.generateOmittedAsInternal != null) + message.generateOmittedAsInternal = Boolean(object.generateOmittedAsInternal); + return message; + }; + + /** + * Creates a plain object from a SelectiveGapicGeneration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.SelectiveGapicGeneration} message SelectiveGapicGeneration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SelectiveGapicGeneration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.methods = []; + if (options.defaults) + object.generateOmittedAsInternal = false; + if (message.methods && message.methods.length) { + object.methods = []; + for (var j = 0; j < message.methods.length; ++j) + object.methods[j] = message.methods[j]; + } + if (message.generateOmittedAsInternal != null && message.hasOwnProperty("generateOmittedAsInternal")) + object.generateOmittedAsInternal = message.generateOmittedAsInternal; + return object; + }; + + /** + * Converts this SelectiveGapicGeneration to JSON. + * @function toJSON + * @memberof google.api.SelectiveGapicGeneration + * @instance + * @returns {Object.} JSON object + */ + SelectiveGapicGeneration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SelectiveGapicGeneration + * @function getTypeUrl + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SelectiveGapicGeneration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.SelectiveGapicGeneration"; + }; + + return SelectiveGapicGeneration; + })(); + + /** + * LaunchStage enum. + * @name google.api.LaunchStage + * @enum {number} + * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value + * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value + * @property {number} PRELAUNCH=7 PRELAUNCH value + * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value + * @property {number} ALPHA=2 ALPHA value + * @property {number} BETA=3 BETA value + * @property {number} GA=4 GA value + * @property {number} DEPRECATED=5 DEPRECATED value + */ + api.LaunchStage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; + values[valuesById[6] = "UNIMPLEMENTED"] = 6; + values[valuesById[7] = "PRELAUNCH"] = 7; + values[valuesById[1] = "EARLY_ACCESS"] = 1; + values[valuesById[2] = "ALPHA"] = 2; + values[valuesById[3] = "BETA"] = 3; + values[valuesById[4] = "GA"] = 4; + values[valuesById[5] = "DEPRECATED"] = 5; return values; })(); @@ -10992,6 +11606,7 @@ * @name google.protobuf.Edition * @enum {number} * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value + * @property {number} EDITION_LEGACY=900 EDITION_LEGACY value * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value * @property {number} EDITION_2023=1000 EDITION_2023 value @@ -11006,6 +11621,7 @@ protobuf.Edition = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "EDITION_UNKNOWN"] = 0; + values[valuesById[900] = "EDITION_LEGACY"] = 900; values[valuesById[998] = "EDITION_PROTO2"] = 998; values[valuesById[999] = "EDITION_PROTO3"] = 999; values[valuesById[1000] = "EDITION_2023"] = 1000; @@ -11030,6 +11646,7 @@ * @property {Array.|null} [dependency] FileDescriptorProto dependency * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [optionDependency] FileDescriptorProto optionDependency * @property {Array.|null} [messageType] FileDescriptorProto messageType * @property {Array.|null} [enumType] FileDescriptorProto enumType * @property {Array.|null} [service] FileDescriptorProto service @@ -11052,6 +11669,7 @@ this.dependency = []; this.publicDependency = []; this.weakDependency = []; + this.optionDependency = []; this.messageType = []; this.enumType = []; this.service = []; @@ -11102,6 +11720,14 @@ */ FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + /** + * FileDescriptorProto optionDependency. + * @member {Array.} optionDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.optionDependency = $util.emptyArray; + /** * FileDescriptorProto messageType. * @member {Array.} messageType @@ -11223,6 +11849,9 @@ writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); + if (message.optionDependency != null && message.optionDependency.length) + for (var i = 0; i < message.optionDependency.length; ++i) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.optionDependency[i]); return writer; }; @@ -11295,6 +11924,12 @@ message.weakDependency.push(reader.int32()); break; } + case 15: { + if (!(message.optionDependency && message.optionDependency.length)) + message.optionDependency = []; + message.optionDependency.push(reader.string()); + break; + } case 4: { if (!(message.messageType && message.messageType.length)) message.messageType = []; @@ -11397,6 +12032,13 @@ if (!$util.isInteger(message.weakDependency[i])) return "weakDependency: integer[] expected"; } + if (message.optionDependency != null && message.hasOwnProperty("optionDependency")) { + if (!Array.isArray(message.optionDependency)) + return "optionDependency: array expected"; + for (var i = 0; i < message.optionDependency.length; ++i) + if (!$util.isString(message.optionDependency[i])) + return "optionDependency: string[] expected"; + } if (message.messageType != null && message.hasOwnProperty("messageType")) { if (!Array.isArray(message.messageType)) return "messageType: array expected"; @@ -11451,6 +12093,7 @@ default: return "edition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -11503,6 +12146,13 @@ for (var i = 0; i < object.weakDependency.length; ++i) message.weakDependency[i] = object.weakDependency[i] | 0; } + if (object.optionDependency) { + if (!Array.isArray(object.optionDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.optionDependency: array expected"); + message.optionDependency = []; + for (var i = 0; i < object.optionDependency.length; ++i) + message.optionDependency[i] = String(object.optionDependency[i]); + } if (object.messageType) { if (!Array.isArray(object.messageType)) throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); @@ -11566,6 +12216,10 @@ case 0: message.edition = 0; break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; case "EDITION_PROTO2": case 998: message.edition = 998; @@ -11631,6 +12285,7 @@ object.extension = []; object.publicDependency = []; object.weakDependency = []; + object.optionDependency = []; } if (options.defaults) { object.name = ""; @@ -11687,6 +12342,11 @@ object.syntax = message.syntax; if (message.edition != null && message.hasOwnProperty("edition")) object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + if (message.optionDependency && message.optionDependency.length) { + object.optionDependency = []; + for (var j = 0; j < message.optionDependency.length; ++j) + object.optionDependency[j] = message.optionDependency[j]; + } return object; }; @@ -11735,6 +12395,7 @@ * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options * @property {Array.|null} [reservedRange] DescriptorProto reservedRange * @property {Array.|null} [reservedName] DescriptorProto reservedName + * @property {google.protobuf.SymbolVisibility|null} [visibility] DescriptorProto visibility */ /** @@ -11840,6 +12501,14 @@ */ DescriptorProto.prototype.reservedName = $util.emptyArray; + /** + * DescriptorProto visibility. + * @member {google.protobuf.SymbolVisibility} visibility + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.visibility = 0; + /** * Creates a new DescriptorProto instance using the specified properties. * @function create @@ -11892,6 +12561,8 @@ if (message.reservedName != null && message.reservedName.length) for (var i = 0; i < message.reservedName.length; ++i) writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.visibility); return writer; }; @@ -11984,6 +12655,10 @@ message.reservedName.push(reader.string()); break; } + case 11: { + message.visibility = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -12097,6 +12772,15 @@ if (!$util.isString(message.reservedName[i])) return "reservedName: string[] expected"; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + switch (message.visibility) { + default: + return "visibility: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; @@ -12196,6 +12880,26 @@ for (var i = 0; i < object.reservedName.length; ++i) message.reservedName[i] = String(object.reservedName[i]); } + switch (object.visibility) { + default: + if (typeof object.visibility === "number") { + message.visibility = object.visibility; + break; + } + break; + case "VISIBILITY_UNSET": + case 0: + message.visibility = 0; + break; + case "VISIBILITY_LOCAL": + case 1: + message.visibility = 1; + break; + case "VISIBILITY_EXPORT": + case 2: + message.visibility = 2; + break; + } return message; }; @@ -12225,6 +12929,7 @@ if (options.defaults) { object.name = ""; object.options = null; + object.visibility = options.enums === String ? "VISIBILITY_UNSET" : 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -12270,6 +12975,8 @@ for (var j = 0; j < message.reservedName.length; ++j) object.reservedName[j] = message.reservedName[j]; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + object.visibility = options.enums === String ? $root.google.protobuf.SymbolVisibility[message.visibility] === undefined ? message.visibility : $root.google.protobuf.SymbolVisibility[message.visibility] : message.visibility; return object; }; @@ -14314,6 +15021,7 @@ * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + * @property {google.protobuf.SymbolVisibility|null} [visibility] EnumDescriptorProto visibility */ /** @@ -14374,6 +15082,14 @@ */ EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + /** + * EnumDescriptorProto visibility. + * @member {google.protobuf.SymbolVisibility} visibility + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.visibility = 0; + /** * Creates a new EnumDescriptorProto instance using the specified properties. * @function create @@ -14411,6 +15127,8 @@ if (message.reservedName != null && message.reservedName.length) for (var i = 0; i < message.reservedName.length; ++i) writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.visibility); return writer; }; @@ -14473,6 +15191,10 @@ message.reservedName.push(reader.string()); break; } + case 6: { + message.visibility = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -14541,6 +15263,15 @@ if (!$util.isString(message.reservedName[i])) return "reservedName: string[] expected"; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + switch (message.visibility) { + default: + return "visibility: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; @@ -14590,6 +15321,26 @@ for (var i = 0; i < object.reservedName.length; ++i) message.reservedName[i] = String(object.reservedName[i]); } + switch (object.visibility) { + default: + if (typeof object.visibility === "number") { + message.visibility = object.visibility; + break; + } + break; + case "VISIBILITY_UNSET": + case 0: + message.visibility = 0; + break; + case "VISIBILITY_LOCAL": + case 1: + message.visibility = 1; + break; + case "VISIBILITY_EXPORT": + case 2: + message.visibility = 2; + break; + } return message; }; @@ -14614,6 +15365,7 @@ if (options.defaults) { object.name = ""; object.options = null; + object.visibility = options.enums === String ? "VISIBILITY_UNSET" : 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -14634,6 +15386,8 @@ for (var j = 0; j < message.reservedName.length; ++j) object.reservedName[j] = message.reservedName[j]; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + object.visibility = options.enums === String ? $root.google.protobuf.SymbolVisibility[message.visibility] === undefined ? message.visibility : $root.google.protobuf.SymbolVisibility[message.visibility] : message.visibility; return object; }; @@ -16952,6 +17706,7 @@ * @property {Array.|null} [targets] FieldOptions targets * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features + * @property {google.protobuf.FieldOptions.IFeatureSupport|null} [featureSupport] FieldOptions featureSupport * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference @@ -17072,6 +17827,14 @@ */ FieldOptions.prototype.features = null; + /** + * FieldOptions featureSupport. + * @member {google.protobuf.FieldOptions.IFeatureSupport|null|undefined} featureSupport + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.featureSupport = null; + /** * FieldOptions uninterpretedOption. * @member {Array.} uninterpretedOption @@ -17146,6 +17909,8 @@ $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); if (message.features != null && Object.hasOwnProperty.call(message, "features")) $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) + $root.google.protobuf.FieldOptions.FeatureSupport.encode(message.featureSupport, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); @@ -17247,6 +18012,10 @@ message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); break; } + case 22: { + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.decode(reader, reader.uint32()); + break; + } case 999: { if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; @@ -17382,6 +18151,11 @@ if (error) return "features." + error; } + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) { + var error = $root.google.protobuf.FieldOptions.FeatureSupport.verify(message.featureSupport); + if (error) + return "featureSupport." + error; + } if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; @@ -17570,6 +18344,11 @@ throw TypeError(".google.protobuf.FieldOptions.features: object expected"); message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); } + if (object.featureSupport != null) { + if (typeof object.featureSupport !== "object") + throw TypeError(".google.protobuf.FieldOptions.featureSupport: object expected"); + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.fromObject(object.featureSupport); + } if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); @@ -17667,6 +18446,7 @@ object.debugRedact = false; object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; object.features = null; + object.featureSupport = null; object[".google.api.resourceReference"] = null; } if (message.ctype != null && message.hasOwnProperty("ctype")) @@ -17699,6 +18479,8 @@ } if (message.features != null && message.hasOwnProperty("features")) object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) + object.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.toObject(message.featureSupport, options); if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) @@ -17971,6 +18753,7 @@ default: return "edition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -18012,103 +18795,589 @@ case 0: message.edition = 0; break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this EditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + * @returns {Object.} JSON object + */ + EditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; + }; + + return EditionDefault; + })(); + + FieldOptions.FeatureSupport = (function() { + + /** + * Properties of a FeatureSupport. + * @memberof google.protobuf.FieldOptions + * @interface IFeatureSupport + * @property {google.protobuf.Edition|null} [editionIntroduced] FeatureSupport editionIntroduced + * @property {google.protobuf.Edition|null} [editionDeprecated] FeatureSupport editionDeprecated + * @property {string|null} [deprecationWarning] FeatureSupport deprecationWarning + * @property {google.protobuf.Edition|null} [editionRemoved] FeatureSupport editionRemoved + */ + + /** + * Constructs a new FeatureSupport. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents a FeatureSupport. + * @implements IFeatureSupport + * @constructor + * @param {google.protobuf.FieldOptions.IFeatureSupport=} [properties] Properties to set + */ + function FeatureSupport(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSupport editionIntroduced. + * @member {google.protobuf.Edition} editionIntroduced + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionIntroduced = 0; + + /** + * FeatureSupport editionDeprecated. + * @member {google.protobuf.Edition} editionDeprecated + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionDeprecated = 0; + + /** + * FeatureSupport deprecationWarning. + * @member {string} deprecationWarning + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.deprecationWarning = ""; + + /** + * FeatureSupport editionRemoved. + * @member {google.protobuf.Edition} editionRemoved + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionRemoved = 0; + + /** + * Creates a new FeatureSupport instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport instance + */ + FeatureSupport.create = function create(properties) { + return new FeatureSupport(properties); + }; + + /** + * Encodes the specified FeatureSupport message. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport} message FeatureSupport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSupport.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.editionIntroduced != null && Object.hasOwnProperty.call(message, "editionIntroduced")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.editionIntroduced); + if (message.editionDeprecated != null && Object.hasOwnProperty.call(message, "editionDeprecated")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.editionDeprecated); + if (message.deprecationWarning != null && Object.hasOwnProperty.call(message, "deprecationWarning")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.deprecationWarning); + if (message.editionRemoved != null && Object.hasOwnProperty.call(message, "editionRemoved")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.editionRemoved); + return writer; + }; + + /** + * Encodes the specified FeatureSupport message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport} message FeatureSupport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSupport.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSupport.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.FeatureSupport(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.editionIntroduced = reader.int32(); + break; + } + case 2: { + message.editionDeprecated = reader.int32(); + break; + } + case 3: { + message.deprecationWarning = reader.string(); + break; + } + case 4: { + message.editionRemoved = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSupport.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSupport message. + * @function verify + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSupport.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.editionIntroduced != null && message.hasOwnProperty("editionIntroduced")) + switch (message.editionIntroduced) { + default: + return "editionIntroduced: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.editionDeprecated != null && message.hasOwnProperty("editionDeprecated")) + switch (message.editionDeprecated) { + default: + return "editionDeprecated: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.deprecationWarning != null && message.hasOwnProperty("deprecationWarning")) + if (!$util.isString(message.deprecationWarning)) + return "deprecationWarning: string expected"; + if (message.editionRemoved != null && message.hasOwnProperty("editionRemoved")) + switch (message.editionRemoved) { + default: + return "editionRemoved: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FeatureSupport message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + */ + FeatureSupport.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions.FeatureSupport) + return object; + var message = new $root.google.protobuf.FieldOptions.FeatureSupport(); + switch (object.editionIntroduced) { + default: + if (typeof object.editionIntroduced === "number") { + message.editionIntroduced = object.editionIntroduced; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionIntroduced = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionIntroduced = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionIntroduced = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionIntroduced = 999; + break; + case "EDITION_2023": + case 1000: + message.editionIntroduced = 1000; + break; + case "EDITION_2024": + case 1001: + message.editionIntroduced = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.editionIntroduced = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.editionIntroduced = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.editionIntroduced = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.editionIntroduced = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.editionIntroduced = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.editionIntroduced = 2147483647; + break; + } + switch (object.editionDeprecated) { + default: + if (typeof object.editionDeprecated === "number") { + message.editionDeprecated = object.editionDeprecated; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionDeprecated = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionDeprecated = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionDeprecated = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionDeprecated = 999; + break; + case "EDITION_2023": + case 1000: + message.editionDeprecated = 1000; + break; + case "EDITION_2024": + case 1001: + message.editionDeprecated = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.editionDeprecated = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.editionDeprecated = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.editionDeprecated = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.editionDeprecated = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.editionDeprecated = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.editionDeprecated = 2147483647; + break; + } + if (object.deprecationWarning != null) + message.deprecationWarning = String(object.deprecationWarning); + switch (object.editionRemoved) { + default: + if (typeof object.editionRemoved === "number") { + message.editionRemoved = object.editionRemoved; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionRemoved = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionRemoved = 900; + break; case "EDITION_PROTO2": case 998: - message.edition = 998; + message.editionRemoved = 998; break; case "EDITION_PROTO3": case 999: - message.edition = 999; + message.editionRemoved = 999; break; case "EDITION_2023": case 1000: - message.edition = 1000; + message.editionRemoved = 1000; break; case "EDITION_2024": case 1001: - message.edition = 1001; + message.editionRemoved = 1001; break; case "EDITION_1_TEST_ONLY": case 1: - message.edition = 1; + message.editionRemoved = 1; break; case "EDITION_2_TEST_ONLY": case 2: - message.edition = 2; + message.editionRemoved = 2; break; case "EDITION_99997_TEST_ONLY": case 99997: - message.edition = 99997; + message.editionRemoved = 99997; break; case "EDITION_99998_TEST_ONLY": case 99998: - message.edition = 99998; + message.editionRemoved = 99998; break; case "EDITION_99999_TEST_ONLY": case 99999: - message.edition = 99999; + message.editionRemoved = 99999; break; case "EDITION_MAX": case 2147483647: - message.edition = 2147483647; + message.editionRemoved = 2147483647; break; } - if (object.value != null) - message.value = String(object.value); return message; }; /** - * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * Creates a plain object from a FeatureSupport message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.FieldOptions.EditionDefault + * @memberof google.protobuf.FieldOptions.FeatureSupport * @static - * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault + * @param {google.protobuf.FieldOptions.FeatureSupport} message FeatureSupport * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EditionDefault.toObject = function toObject(message, options) { + FeatureSupport.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.value = ""; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.editionIntroduced = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.editionDeprecated = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.deprecationWarning = ""; + object.editionRemoved = options.enums === String ? "EDITION_UNKNOWN" : 0; } - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + if (message.editionIntroduced != null && message.hasOwnProperty("editionIntroduced")) + object.editionIntroduced = options.enums === String ? $root.google.protobuf.Edition[message.editionIntroduced] === undefined ? message.editionIntroduced : $root.google.protobuf.Edition[message.editionIntroduced] : message.editionIntroduced; + if (message.editionDeprecated != null && message.hasOwnProperty("editionDeprecated")) + object.editionDeprecated = options.enums === String ? $root.google.protobuf.Edition[message.editionDeprecated] === undefined ? message.editionDeprecated : $root.google.protobuf.Edition[message.editionDeprecated] : message.editionDeprecated; + if (message.deprecationWarning != null && message.hasOwnProperty("deprecationWarning")) + object.deprecationWarning = message.deprecationWarning; + if (message.editionRemoved != null && message.hasOwnProperty("editionRemoved")) + object.editionRemoved = options.enums === String ? $root.google.protobuf.Edition[message.editionRemoved] === undefined ? message.editionRemoved : $root.google.protobuf.Edition[message.editionRemoved] : message.editionRemoved; return object; }; /** - * Converts this EditionDefault to JSON. + * Converts this FeatureSupport to JSON. * @function toJSON - * @memberof google.protobuf.FieldOptions.EditionDefault + * @memberof google.protobuf.FieldOptions.FeatureSupport * @instance * @returns {Object.} JSON object */ - EditionDefault.prototype.toJSON = function toJSON() { + FeatureSupport.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for EditionDefault + * Gets the default type url for FeatureSupport * @function getTypeUrl - * @memberof google.protobuf.FieldOptions.EditionDefault + * @memberof google.protobuf.FieldOptions.FeatureSupport * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + FeatureSupport.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; + return typeUrlPrefix + "/google.protobuf.FieldOptions.FeatureSupport"; }; - return EditionDefault; + return FeatureSupport; })(); return FieldOptions; @@ -18703,6 +19972,7 @@ * @property {boolean|null} [deprecated] EnumValueOptions deprecated * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact + * @property {google.protobuf.FieldOptions.IFeatureSupport|null} [featureSupport] EnumValueOptions featureSupport * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption */ @@ -18746,6 +20016,14 @@ */ EnumValueOptions.prototype.debugRedact = false; + /** + * EnumValueOptions featureSupport. + * @member {google.protobuf.FieldOptions.IFeatureSupport|null|undefined} featureSupport + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.featureSupport = null; + /** * EnumValueOptions uninterpretedOption. * @member {Array.} uninterpretedOption @@ -18784,6 +20062,8 @@ $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); + if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) + $root.google.protobuf.FieldOptions.FeatureSupport.encode(message.featureSupport, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); @@ -18835,6 +20115,10 @@ message.debugRedact = reader.bool(); break; } + case 4: { + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.decode(reader, reader.uint32()); + break; + } case 999: { if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; @@ -18887,6 +20171,11 @@ if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) if (typeof message.debugRedact !== "boolean") return "debugRedact: boolean expected"; + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) { + var error = $root.google.protobuf.FieldOptions.FeatureSupport.verify(message.featureSupport); + if (error) + return "featureSupport." + error; + } if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; @@ -18920,6 +20209,11 @@ } if (object.debugRedact != null) message.debugRedact = Boolean(object.debugRedact); + if (object.featureSupport != null) { + if (typeof object.featureSupport !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.featureSupport: object expected"); + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.fromObject(object.featureSupport); + } if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); @@ -18952,6 +20246,7 @@ object.deprecated = false; object.features = null; object.debugRedact = false; + object.featureSupport = null; } if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; @@ -18959,6 +20254,8 @@ object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) object.debugRedact = message.debugRedact; + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) + object.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.toObject(message.featureSupport, options); if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) @@ -20426,6 +21723,8 @@ * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat + * @property {google.protobuf.FeatureSet.EnforceNamingStyle|null} [enforceNamingStyle] FeatureSet enforceNamingStyle + * @property {google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|null} [defaultSymbolVisibility] FeatureSet defaultSymbolVisibility */ /** @@ -20491,6 +21790,22 @@ */ FeatureSet.prototype.jsonFormat = 0; + /** + * FeatureSet enforceNamingStyle. + * @member {google.protobuf.FeatureSet.EnforceNamingStyle} enforceNamingStyle + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enforceNamingStyle = 0; + + /** + * FeatureSet defaultSymbolVisibility. + * @member {google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility} defaultSymbolVisibility + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.defaultSymbolVisibility = 0; + /** * Creates a new FeatureSet instance using the specified properties. * @function create @@ -20527,6 +21842,10 @@ writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); + if (message.enforceNamingStyle != null && Object.hasOwnProperty.call(message, "enforceNamingStyle")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.enforceNamingStyle); + if (message.defaultSymbolVisibility != null && Object.hasOwnProperty.call(message, "defaultSymbolVisibility")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.defaultSymbolVisibility); return writer; }; @@ -20587,6 +21906,14 @@ message.jsonFormat = reader.int32(); break; } + case 7: { + message.enforceNamingStyle = reader.int32(); + break; + } + case 8: { + message.defaultSymbolVisibility = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -20677,6 +22004,26 @@ case 2: break; } + if (message.enforceNamingStyle != null && message.hasOwnProperty("enforceNamingStyle")) + switch (message.enforceNamingStyle) { + default: + return "enforceNamingStyle: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.defaultSymbolVisibility != null && message.hasOwnProperty("defaultSymbolVisibility")) + switch (message.defaultSymbolVisibility) { + default: + return "defaultSymbolVisibility: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } return null; }; @@ -20816,6 +22163,54 @@ message.jsonFormat = 2; break; } + switch (object.enforceNamingStyle) { + default: + if (typeof object.enforceNamingStyle === "number") { + message.enforceNamingStyle = object.enforceNamingStyle; + break; + } + break; + case "ENFORCE_NAMING_STYLE_UNKNOWN": + case 0: + message.enforceNamingStyle = 0; + break; + case "STYLE2024": + case 1: + message.enforceNamingStyle = 1; + break; + case "STYLE_LEGACY": + case 2: + message.enforceNamingStyle = 2; + break; + } + switch (object.defaultSymbolVisibility) { + default: + if (typeof object.defaultSymbolVisibility === "number") { + message.defaultSymbolVisibility = object.defaultSymbolVisibility; + break; + } + break; + case "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN": + case 0: + message.defaultSymbolVisibility = 0; + break; + case "EXPORT_ALL": + case 1: + message.defaultSymbolVisibility = 1; + break; + case "EXPORT_TOP_LEVEL": + case 2: + message.defaultSymbolVisibility = 2; + break; + case "LOCAL_ALL": + case 3: + message.defaultSymbolVisibility = 3; + break; + case "STRICT": + case 4: + message.defaultSymbolVisibility = 4; + break; + } return message; }; @@ -20839,6 +22234,8 @@ object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; + object.enforceNamingStyle = options.enums === String ? "ENFORCE_NAMING_STYLE_UNKNOWN" : 0; + object.defaultSymbolVisibility = options.enums === String ? "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN" : 0; } if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; @@ -20852,6 +22249,10 @@ object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; + if (message.enforceNamingStyle != null && message.hasOwnProperty("enforceNamingStyle")) + object.enforceNamingStyle = options.enums === String ? $root.google.protobuf.FeatureSet.EnforceNamingStyle[message.enforceNamingStyle] === undefined ? message.enforceNamingStyle : $root.google.protobuf.FeatureSet.EnforceNamingStyle[message.enforceNamingStyle] : message.enforceNamingStyle; + if (message.defaultSymbolVisibility != null && message.hasOwnProperty("defaultSymbolVisibility")) + object.defaultSymbolVisibility = options.enums === String ? $root.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility[message.defaultSymbolVisibility] === undefined ? message.defaultSymbolVisibility : $root.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility[message.defaultSymbolVisibility] : message.defaultSymbolVisibility; return object; }; @@ -20979,6 +22380,219 @@ return values; })(); + /** + * EnforceNamingStyle enum. + * @name google.protobuf.FeatureSet.EnforceNamingStyle + * @enum {number} + * @property {number} ENFORCE_NAMING_STYLE_UNKNOWN=0 ENFORCE_NAMING_STYLE_UNKNOWN value + * @property {number} STYLE2024=1 STYLE2024 value + * @property {number} STYLE_LEGACY=2 STYLE_LEGACY value + */ + FeatureSet.EnforceNamingStyle = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENFORCE_NAMING_STYLE_UNKNOWN"] = 0; + values[valuesById[1] = "STYLE2024"] = 1; + values[valuesById[2] = "STYLE_LEGACY"] = 2; + return values; + })(); + + FeatureSet.VisibilityFeature = (function() { + + /** + * Properties of a VisibilityFeature. + * @memberof google.protobuf.FeatureSet + * @interface IVisibilityFeature + */ + + /** + * Constructs a new VisibilityFeature. + * @memberof google.protobuf.FeatureSet + * @classdesc Represents a VisibilityFeature. + * @implements IVisibilityFeature + * @constructor + * @param {google.protobuf.FeatureSet.IVisibilityFeature=} [properties] Properties to set + */ + function VisibilityFeature(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new VisibilityFeature instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature instance + */ + VisibilityFeature.create = function create(properties) { + return new VisibilityFeature(properties); + }; + + /** + * Encodes the specified VisibilityFeature message. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature} message VisibilityFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VisibilityFeature.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified VisibilityFeature message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature} message VisibilityFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VisibilityFeature.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VisibilityFeature.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet.VisibilityFeature(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VisibilityFeature.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VisibilityFeature message. + * @function verify + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VisibilityFeature.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a VisibilityFeature message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + */ + VisibilityFeature.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSet.VisibilityFeature) + return object; + return new $root.google.protobuf.FeatureSet.VisibilityFeature(); + }; + + /** + * Creates a plain object from a VisibilityFeature message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.VisibilityFeature} message VisibilityFeature + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VisibilityFeature.toObject = function toObject() { + return {}; + }; + + /** + * Converts this VisibilityFeature to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @instance + * @returns {Object.} JSON object + */ + VisibilityFeature.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VisibilityFeature + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VisibilityFeature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet.VisibilityFeature"; + }; + + /** + * DefaultSymbolVisibility enum. + * @name google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility + * @enum {number} + * @property {number} DEFAULT_SYMBOL_VISIBILITY_UNKNOWN=0 DEFAULT_SYMBOL_VISIBILITY_UNKNOWN value + * @property {number} EXPORT_ALL=1 EXPORT_ALL value + * @property {number} EXPORT_TOP_LEVEL=2 EXPORT_TOP_LEVEL value + * @property {number} LOCAL_ALL=3 LOCAL_ALL value + * @property {number} STRICT=4 STRICT value + */ + VisibilityFeature.DefaultSymbolVisibility = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN"] = 0; + values[valuesById[1] = "EXPORT_ALL"] = 1; + values[valuesById[2] = "EXPORT_TOP_LEVEL"] = 2; + values[valuesById[3] = "LOCAL_ALL"] = 3; + values[valuesById[4] = "STRICT"] = 4; + return values; + })(); + + return VisibilityFeature; + })(); + return FeatureSet; })(); @@ -21163,6 +22777,7 @@ default: return "minimumEdition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -21180,6 +22795,7 @@ default: return "maximumEdition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -21228,6 +22844,10 @@ case 0: message.minimumEdition = 0; break; + case "EDITION_LEGACY": + case 900: + message.minimumEdition = 900; + break; case "EDITION_PROTO2": case 998: message.minimumEdition = 998; @@ -21280,6 +22900,10 @@ case 0: message.maximumEdition = 0; break; + case "EDITION_LEGACY": + case 900: + message.maximumEdition = 900; + break; case "EDITION_PROTO2": case 998: message.maximumEdition = 998; @@ -21388,7 +23012,8 @@ * @memberof google.protobuf.FeatureSetDefaults * @interface IFeatureSetEditionDefault * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition - * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features + * @property {google.protobuf.IFeatureSet|null} [overridableFeatures] FeatureSetEditionDefault overridableFeatures + * @property {google.protobuf.IFeatureSet|null} [fixedFeatures] FeatureSetEditionDefault fixedFeatures */ /** @@ -21415,12 +23040,20 @@ FeatureSetEditionDefault.prototype.edition = 0; /** - * FeatureSetEditionDefault features. - * @member {google.protobuf.IFeatureSet|null|undefined} features + * FeatureSetEditionDefault overridableFeatures. + * @member {google.protobuf.IFeatureSet|null|undefined} overridableFeatures + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.overridableFeatures = null; + + /** + * FeatureSetEditionDefault fixedFeatures. + * @member {google.protobuf.IFeatureSet|null|undefined} fixedFeatures * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault * @instance */ - FeatureSetEditionDefault.prototype.features = null; + FeatureSetEditionDefault.prototype.fixedFeatures = null; /** * Creates a new FeatureSetEditionDefault instance using the specified properties. @@ -21446,10 +23079,12 @@ FeatureSetEditionDefault.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + if (message.overridableFeatures != null && Object.hasOwnProperty.call(message, "overridableFeatures")) + $root.google.protobuf.FeatureSet.encode(message.overridableFeatures, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.fixedFeatures != null && Object.hasOwnProperty.call(message, "fixedFeatures")) + $root.google.protobuf.FeatureSet.encode(message.fixedFeatures, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -21490,8 +23125,12 @@ message.edition = reader.int32(); break; } - case 2: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + case 4: { + message.overridableFeatures = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 5: { + message.fixedFeatures = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); break; } default: @@ -21534,6 +23173,7 @@ default: return "edition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -21546,10 +23186,15 @@ case 2147483647: break; } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (message.overridableFeatures != null && message.hasOwnProperty("overridableFeatures")) { + var error = $root.google.protobuf.FeatureSet.verify(message.overridableFeatures); + if (error) + return "overridableFeatures." + error; + } + if (message.fixedFeatures != null && message.hasOwnProperty("fixedFeatures")) { + var error = $root.google.protobuf.FeatureSet.verify(message.fixedFeatures); if (error) - return "features." + error; + return "fixedFeatures." + error; } return null; }; @@ -21577,6 +23222,10 @@ case 0: message.edition = 0; break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; case "EDITION_PROTO2": case 998: message.edition = 998; @@ -21618,10 +23267,15 @@ message.edition = 2147483647; break; } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + if (object.overridableFeatures != null) { + if (typeof object.overridableFeatures !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.overridableFeatures: object expected"); + message.overridableFeatures = $root.google.protobuf.FeatureSet.fromObject(object.overridableFeatures); + } + if (object.fixedFeatures != null) { + if (typeof object.fixedFeatures !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fixedFeatures: object expected"); + message.fixedFeatures = $root.google.protobuf.FeatureSet.fromObject(object.fixedFeatures); } return message; }; @@ -21640,13 +23294,16 @@ options = {}; var object = {}; if (options.defaults) { - object.features = null; object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.overridableFeatures = null; + object.fixedFeatures = null; } - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); if (message.edition != null && message.hasOwnProperty("edition")) object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + if (message.overridableFeatures != null && message.hasOwnProperty("overridableFeatures")) + object.overridableFeatures = $root.google.protobuf.FeatureSet.toObject(message.overridableFeatures, options); + if (message.fixedFeatures != null && message.hasOwnProperty("fixedFeatures")) + object.fixedFeatures = $root.google.protobuf.FeatureSet.toObject(message.fixedFeatures, options); return object; }; @@ -22861,6 +24518,22 @@ return GeneratedCodeInfo; })(); + /** + * SymbolVisibility enum. + * @name google.protobuf.SymbolVisibility + * @enum {number} + * @property {number} VISIBILITY_UNSET=0 VISIBILITY_UNSET value + * @property {number} VISIBILITY_LOCAL=1 VISIBILITY_LOCAL value + * @property {number} VISIBILITY_EXPORT=2 VISIBILITY_EXPORT value + */ + protobuf.SymbolVisibility = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VISIBILITY_UNSET"] = 0; + values[valuesById[1] = "VISIBILITY_LOCAL"] = 1; + values[valuesById[2] = "VISIBILITY_EXPORT"] = 2; + return values; + })(); + protobuf.Timestamp = (function() { /** diff --git a/packages/google-api-apikeys/protos/protos.json b/packages/google-api-apikeys/protos/protos.json index a0d4bc39a29..951a9172330 100644 --- a/packages/google-api-apikeys/protos/protos.json +++ b/packages/google-api-apikeys/protos/protos.json @@ -8,8 +8,7 @@ "java_multiple_files": true, "java_outer_classname": "LaunchStageProto", "java_package": "com.google.api", - "objc_class_prefix": "GAPI", - "cc_enable_arenas": true + "objc_class_prefix": "GAPI" }, "nested": { "apikeys": { @@ -773,6 +772,10 @@ "rule": "repeated", "type": "ClientLibraryDestination", "id": 2 + }, + "selectiveGapicGeneration": { + "type": "SelectiveGapicGeneration", + "id": 3 } } }, @@ -913,6 +916,28 @@ "common": { "type": "CommonLanguageSettings", "id": 1 + }, + "experimentalFeatures": { + "type": "ExperimentalFeatures", + "id": 2 + } + }, + "nested": { + "ExperimentalFeatures": { + "fields": { + "restAsyncIoEnabled": { + "type": "bool", + "id": 1 + }, + "protobufPythonicTypesEnabled": { + "type": "bool", + "id": 2 + }, + "unversionedPackageDisabled": { + "type": "bool", + "id": 3 + } + } } } }, @@ -970,6 +995,11 @@ "common": { "type": "CommonLanguageSettings", "id": 1 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 } } }, @@ -1031,6 +1061,19 @@ "PACKAGE_MANAGER": 20 } }, + "SelectiveGapicGeneration": { + "fields": { + "methods": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "generateOmittedAsInternal": { + "type": "bool", + "id": 2 + } + } + }, "LaunchStage": { "values": { "LAUNCH_STAGE_UNSPECIFIED": 0, @@ -1064,12 +1107,19 @@ "type": "FileDescriptorProto", "id": 1 } - } + }, + "extensions": [ + [ + 536000000, + 536000000 + ] + ] }, "Edition": { "edition": "proto2", "values": { "EDITION_UNKNOWN": 0, + "EDITION_LEGACY": 900, "EDITION_PROTO2": 998, "EDITION_PROTO3": 999, "EDITION_2023": 1000, @@ -1108,6 +1158,11 @@ "type": "int32", "id": 11 }, + "optionDependency": { + "rule": "repeated", + "type": "string", + "id": 15 + }, "messageType": { "rule": "repeated", "type": "DescriptorProto", @@ -1196,6 +1251,10 @@ "rule": "repeated", "type": "string", "id": 10 + }, + "visibility": { + "type": "SymbolVisibility", + "id": 11 } }, "nested": { @@ -1421,6 +1480,10 @@ "rule": "repeated", "type": "string", "id": 5 + }, + "visibility": { + "type": "SymbolVisibility", + "id": 6 } }, "nested": { @@ -1635,6 +1698,7 @@ 42, 42 ], + "php_generic_services", [ 38, 38 @@ -1770,7 +1834,8 @@ "type": "bool", "id": 10, "options": { - "default": false + "default": false, + "deprecated": true } }, "debugRedact": { @@ -1798,6 +1863,10 @@ "type": "FeatureSet", "id": 21 }, + "featureSupport": { + "type": "FeatureSupport", + "id": 22 + }, "uninterpretedOption": { "rule": "repeated", "type": "UninterpretedOption", @@ -1867,6 +1936,26 @@ "id": 2 } } + }, + "FeatureSupport": { + "fields": { + "editionIntroduced": { + "type": "Edition", + "id": 1 + }, + "editionDeprecated": { + "type": "Edition", + "id": 2 + }, + "deprecationWarning": { + "type": "string", + "id": 3 + }, + "editionRemoved": { + "type": "Edition", + "id": 4 + } + } } } }, @@ -1955,6 +2044,10 @@ "default": false } }, + "featureSupport": { + "type": "FieldOptions.FeatureSupport", + "id": 4 + }, "uninterpretedOption": { "rule": "repeated", "type": "UninterpretedOption", @@ -2097,6 +2190,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_2023", "edition_defaults.value": "EXPLICIT" } @@ -2107,6 +2201,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "OPEN" } @@ -2117,6 +2212,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "PACKED" } @@ -2127,6 +2223,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "VERIFY" } @@ -2137,7 +2234,8 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO2", + "feature_support.edition_introduced": "EDITION_2023", + "edition_defaults.edition": "EDITION_LEGACY", "edition_defaults.value": "LENGTH_PREFIXED" } }, @@ -2147,27 +2245,38 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "ALLOW" } + }, + "enforceNamingStyle": { + "type": "EnforceNamingStyle", + "id": 7, + "options": { + "retention": "RETENTION_SOURCE", + "targets": "TARGET_TYPE_METHOD", + "feature_support.edition_introduced": "EDITION_2024", + "edition_defaults.edition": "EDITION_2024", + "edition_defaults.value": "STYLE2024" + } + }, + "defaultSymbolVisibility": { + "type": "VisibilityFeature.DefaultSymbolVisibility", + "id": 8, + "options": { + "retention": "RETENTION_SOURCE", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2024", + "edition_defaults.edition": "EDITION_2024", + "edition_defaults.value": "EXPORT_TOP_LEVEL" + } } }, "extensions": [ [ 1000, - 1000 - ], - [ - 1001, - 1001 - ], - [ - 1002, - 1002 - ], - [ - 9990, - 9990 + 9994 ], [ 9995, @@ -2212,7 +2321,13 @@ "UTF8_VALIDATION_UNKNOWN": 0, "VERIFY": 2, "NONE": 3 - } + }, + "reserved": [ + [ + 1, + 1 + ] + ] }, "MessageEncoding": { "values": { @@ -2227,6 +2342,33 @@ "ALLOW": 1, "LEGACY_BEST_EFFORT": 2 } + }, + "EnforceNamingStyle": { + "values": { + "ENFORCE_NAMING_STYLE_UNKNOWN": 0, + "STYLE2024": 1, + "STYLE_LEGACY": 2 + } + }, + "VisibilityFeature": { + "fields": {}, + "reserved": [ + [ + 1, + 536870911 + ] + ], + "nested": { + "DefaultSymbolVisibility": { + "values": { + "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN": 0, + "EXPORT_ALL": 1, + "EXPORT_TOP_LEVEL": 2, + "LOCAL_ALL": 3, + "STRICT": 4 + } + } + } } } }, @@ -2254,11 +2396,26 @@ "type": "Edition", "id": 3 }, - "features": { + "overridableFeatures": { "type": "FeatureSet", - "id": 2 + "id": 4 + }, + "fixedFeatures": { + "type": "FeatureSet", + "id": 5 } - } + }, + "reserved": [ + [ + 1, + 1 + ], + [ + 2, + 2 + ], + "features" + ] } } }, @@ -2271,6 +2428,12 @@ "id": 1 } }, + "extensions": [ + [ + 536000000, + 536000000 + ] + ], "nested": { "Location": { "fields": { @@ -2356,6 +2519,14 @@ } } }, + "SymbolVisibility": { + "edition": "proto2", + "values": { + "VISIBILITY_UNSET": 0, + "VISIBILITY_LOCAL": 1, + "VISIBILITY_EXPORT": 2 + } + }, "Timestamp": { "fields": { "seconds": { @@ -2414,6 +2585,7 @@ "java_multiple_files": true, "java_outer_classname": "OperationsProto", "java_package": "com.google.longrunning", + "objc_class_prefix": "GLRUN", "php_namespace": "Google\\LongRunning" }, "nested": { diff --git a/packages/google-api-cloudquotas/protos/protos.d.ts b/packages/google-api-cloudquotas/protos/protos.d.ts index c9129d56119..cae6ac796c9 100644 --- a/packages/google-api-cloudquotas/protos/protos.d.ts +++ b/packages/google-api-cloudquotas/protos/protos.d.ts @@ -4699,6 +4699,9 @@ export namespace google { /** CommonLanguageSettings destinations */ destinations?: (google.api.ClientLibraryDestination[]|null); + + /** CommonLanguageSettings selectiveGapicGeneration */ + selectiveGapicGeneration?: (google.api.ISelectiveGapicGeneration|null); } /** Represents a CommonLanguageSettings. */ @@ -4716,6 +4719,9 @@ export namespace google { /** CommonLanguageSettings destinations. */ public destinations: google.api.ClientLibraryDestination[]; + /** CommonLanguageSettings selectiveGapicGeneration. */ + public selectiveGapicGeneration?: (google.api.ISelectiveGapicGeneration|null); + /** * Creates a new CommonLanguageSettings instance using the specified properties. * @param [properties] Properties to set @@ -5416,6 +5422,9 @@ export namespace google { /** PythonSettings common */ common?: (google.api.ICommonLanguageSettings|null); + + /** PythonSettings experimentalFeatures */ + experimentalFeatures?: (google.api.PythonSettings.IExperimentalFeatures|null); } /** Represents a PythonSettings. */ @@ -5430,6 +5439,9 @@ export namespace google { /** PythonSettings common. */ public common?: (google.api.ICommonLanguageSettings|null); + /** PythonSettings experimentalFeatures. */ + public experimentalFeatures?: (google.api.PythonSettings.IExperimentalFeatures|null); + /** * Creates a new PythonSettings instance using the specified properties. * @param [properties] Properties to set @@ -5508,6 +5520,118 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + namespace PythonSettings { + + /** Properties of an ExperimentalFeatures. */ + interface IExperimentalFeatures { + + /** ExperimentalFeatures restAsyncIoEnabled */ + restAsyncIoEnabled?: (boolean|null); + + /** ExperimentalFeatures protobufPythonicTypesEnabled */ + protobufPythonicTypesEnabled?: (boolean|null); + + /** ExperimentalFeatures unversionedPackageDisabled */ + unversionedPackageDisabled?: (boolean|null); + } + + /** Represents an ExperimentalFeatures. */ + class ExperimentalFeatures implements IExperimentalFeatures { + + /** + * Constructs a new ExperimentalFeatures. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.PythonSettings.IExperimentalFeatures); + + /** ExperimentalFeatures restAsyncIoEnabled. */ + public restAsyncIoEnabled: boolean; + + /** ExperimentalFeatures protobufPythonicTypesEnabled. */ + public protobufPythonicTypesEnabled: boolean; + + /** ExperimentalFeatures unversionedPackageDisabled. */ + public unversionedPackageDisabled: boolean; + + /** + * Creates a new ExperimentalFeatures instance using the specified properties. + * @param [properties] Properties to set + * @returns ExperimentalFeatures instance + */ + public static create(properties?: google.api.PythonSettings.IExperimentalFeatures): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Encodes the specified ExperimentalFeatures message. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @param message ExperimentalFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.PythonSettings.IExperimentalFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExperimentalFeatures message, length delimited. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @param message ExperimentalFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.PythonSettings.IExperimentalFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Verifies an ExperimentalFeatures message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExperimentalFeatures message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExperimentalFeatures + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Creates a plain object from an ExperimentalFeatures message. Also converts values to other types if specified. + * @param message ExperimentalFeatures + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings.ExperimentalFeatures, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExperimentalFeatures to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExperimentalFeatures + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + /** Properties of a NodeSettings. */ interface INodeSettings { @@ -5834,6 +5958,9 @@ export namespace google { /** GoSettings common */ common?: (google.api.ICommonLanguageSettings|null); + + /** GoSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|null); } /** Represents a GoSettings. */ @@ -5848,6 +5975,9 @@ export namespace google { /** GoSettings common. */ public common?: (google.api.ICommonLanguageSettings|null); + /** GoSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + /** * Creates a new GoSettings instance using the specified properties. * @param [properties] Properties to set @@ -6172,6 +6302,109 @@ export namespace google { PACKAGE_MANAGER = 20 } + /** Properties of a SelectiveGapicGeneration. */ + interface ISelectiveGapicGeneration { + + /** SelectiveGapicGeneration methods */ + methods?: (string[]|null); + + /** SelectiveGapicGeneration generateOmittedAsInternal */ + generateOmittedAsInternal?: (boolean|null); + } + + /** Represents a SelectiveGapicGeneration. */ + class SelectiveGapicGeneration implements ISelectiveGapicGeneration { + + /** + * Constructs a new SelectiveGapicGeneration. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ISelectiveGapicGeneration); + + /** SelectiveGapicGeneration methods. */ + public methods: string[]; + + /** SelectiveGapicGeneration generateOmittedAsInternal. */ + public generateOmittedAsInternal: boolean; + + /** + * Creates a new SelectiveGapicGeneration instance using the specified properties. + * @param [properties] Properties to set + * @returns SelectiveGapicGeneration instance + */ + public static create(properties?: google.api.ISelectiveGapicGeneration): google.api.SelectiveGapicGeneration; + + /** + * Encodes the specified SelectiveGapicGeneration message. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @param message SelectiveGapicGeneration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ISelectiveGapicGeneration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SelectiveGapicGeneration message, length delimited. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @param message SelectiveGapicGeneration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ISelectiveGapicGeneration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.SelectiveGapicGeneration; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.SelectiveGapicGeneration; + + /** + * Verifies a SelectiveGapicGeneration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SelectiveGapicGeneration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SelectiveGapicGeneration + */ + public static fromObject(object: { [k: string]: any }): google.api.SelectiveGapicGeneration; + + /** + * Creates a plain object from a SelectiveGapicGeneration message. Also converts values to other types if specified. + * @param message SelectiveGapicGeneration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.SelectiveGapicGeneration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SelectiveGapicGeneration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SelectiveGapicGeneration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** LaunchStage enum. */ enum LaunchStage { LAUNCH_STAGE_UNSPECIFIED = 0, @@ -6553,6 +6786,7 @@ export namespace google { /** Edition enum. */ enum Edition { EDITION_UNKNOWN = 0, + EDITION_LEGACY = 900, EDITION_PROTO2 = 998, EDITION_PROTO3 = 999, EDITION_2023 = 1000, @@ -6583,6 +6817,9 @@ export namespace google { /** FileDescriptorProto weakDependency */ weakDependency?: (number[]|null); + /** FileDescriptorProto optionDependency */ + optionDependency?: (string[]|null); + /** FileDescriptorProto messageType */ messageType?: (google.protobuf.IDescriptorProto[]|null); @@ -6632,6 +6869,9 @@ export namespace google { /** FileDescriptorProto weakDependency. */ public weakDependency: number[]; + /** FileDescriptorProto optionDependency. */ + public optionDependency: string[]; + /** FileDescriptorProto messageType. */ public messageType: google.protobuf.IDescriptorProto[]; @@ -6766,6 +7006,9 @@ export namespace google { /** DescriptorProto reservedName */ reservedName?: (string[]|null); + + /** DescriptorProto visibility */ + visibility?: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility|null); } /** Represents a DescriptorProto. */ @@ -6807,6 +7050,9 @@ export namespace google { /** DescriptorProto reservedName. */ public reservedName: string[]; + /** DescriptorProto visibility. */ + public visibility: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility); + /** * Creates a new DescriptorProto instance using the specified properties. * @param [properties] Properties to set @@ -7654,6 +7900,9 @@ export namespace google { /** EnumDescriptorProto reservedName */ reservedName?: (string[]|null); + + /** EnumDescriptorProto visibility */ + visibility?: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility|null); } /** Represents an EnumDescriptorProto. */ @@ -7680,6 +7929,9 @@ export namespace google { /** EnumDescriptorProto reservedName. */ public reservedName: string[]; + /** EnumDescriptorProto visibility. */ + public visibility: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility); + /** * Creates a new EnumDescriptorProto instance using the specified properties. * @param [properties] Properties to set @@ -8614,6 +8866,9 @@ export namespace google { /** FieldOptions features */ features?: (google.protobuf.IFeatureSet|null); + /** FieldOptions featureSupport */ + featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** FieldOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); @@ -8669,6 +8924,9 @@ export namespace google { /** FieldOptions features. */ public features?: (google.protobuf.IFeatureSet|null); + /** FieldOptions featureSupport. */ + public featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** FieldOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; @@ -8889,6 +9147,121 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** Properties of a FeatureSupport. */ + interface IFeatureSupport { + + /** FeatureSupport editionIntroduced */ + editionIntroduced?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSupport editionDeprecated */ + editionDeprecated?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSupport deprecationWarning */ + deprecationWarning?: (string|null); + + /** FeatureSupport editionRemoved */ + editionRemoved?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSupport. */ + class FeatureSupport implements IFeatureSupport { + + /** + * Constructs a new FeatureSupport. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IFeatureSupport); + + /** FeatureSupport editionIntroduced. */ + public editionIntroduced: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSupport editionDeprecated. */ + public editionDeprecated: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSupport deprecationWarning. */ + public deprecationWarning: string; + + /** FeatureSupport editionRemoved. */ + public editionRemoved: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSupport instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSupport instance + */ + public static create(properties?: google.protobuf.FieldOptions.IFeatureSupport): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Encodes the specified FeatureSupport message. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @param message FeatureSupport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IFeatureSupport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSupport message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @param message FeatureSupport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IFeatureSupport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Verifies a FeatureSupport message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSupport message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSupport + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Creates a plain object from a FeatureSupport message. Also converts values to other types if specified. + * @param message FeatureSupport + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.FeatureSupport, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSupport to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSupport + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } /** Properties of an OneofOptions. */ @@ -9127,6 +9500,9 @@ export namespace google { /** EnumValueOptions debugRedact */ debugRedact?: (boolean|null); + /** EnumValueOptions featureSupport */ + featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** EnumValueOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); } @@ -9149,6 +9525,9 @@ export namespace google { /** EnumValueOptions debugRedact. */ public debugRedact: boolean; + /** EnumValueOptions featureSupport. */ + public featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** EnumValueOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; @@ -9738,6 +10117,12 @@ export namespace google { /** FeatureSet jsonFormat */ jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); + + /** FeatureSet enforceNamingStyle */ + enforceNamingStyle?: (google.protobuf.FeatureSet.EnforceNamingStyle|keyof typeof google.protobuf.FeatureSet.EnforceNamingStyle|null); + + /** FeatureSet defaultSymbolVisibility */ + defaultSymbolVisibility?: (google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|keyof typeof google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|null); } /** Represents a FeatureSet. */ @@ -9767,6 +10152,12 @@ export namespace google { /** FeatureSet jsonFormat. */ public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); + /** FeatureSet enforceNamingStyle. */ + public enforceNamingStyle: (google.protobuf.FeatureSet.EnforceNamingStyle|keyof typeof google.protobuf.FeatureSet.EnforceNamingStyle); + + /** FeatureSet defaultSymbolVisibility. */ + public defaultSymbolVisibility: (google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|keyof typeof google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility); + /** * Creates a new FeatureSet instance using the specified properties. * @param [properties] Properties to set @@ -9889,6 +10280,116 @@ export namespace google { ALLOW = 1, LEGACY_BEST_EFFORT = 2 } + + /** EnforceNamingStyle enum. */ + enum EnforceNamingStyle { + ENFORCE_NAMING_STYLE_UNKNOWN = 0, + STYLE2024 = 1, + STYLE_LEGACY = 2 + } + + /** Properties of a VisibilityFeature. */ + interface IVisibilityFeature { + } + + /** Represents a VisibilityFeature. */ + class VisibilityFeature implements IVisibilityFeature { + + /** + * Constructs a new VisibilityFeature. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSet.IVisibilityFeature); + + /** + * Creates a new VisibilityFeature instance using the specified properties. + * @param [properties] Properties to set + * @returns VisibilityFeature instance + */ + public static create(properties?: google.protobuf.FeatureSet.IVisibilityFeature): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Encodes the specified VisibilityFeature message. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @param message VisibilityFeature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSet.IVisibilityFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VisibilityFeature message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @param message VisibilityFeature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSet.IVisibilityFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Verifies a VisibilityFeature message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VisibilityFeature message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VisibilityFeature + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Creates a plain object from a VisibilityFeature message. Also converts values to other types if specified. + * @param message VisibilityFeature + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet.VisibilityFeature, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VisibilityFeature to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VisibilityFeature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace VisibilityFeature { + + /** DefaultSymbolVisibility enum. */ + enum DefaultSymbolVisibility { + DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0, + EXPORT_ALL = 1, + EXPORT_TOP_LEVEL = 2, + LOCAL_ALL = 3, + STRICT = 4 + } + } } /** Properties of a FeatureSetDefaults. */ @@ -10008,8 +10509,11 @@ export namespace google { /** FeatureSetEditionDefault edition */ edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - /** FeatureSetEditionDefault features */ - features?: (google.protobuf.IFeatureSet|null); + /** FeatureSetEditionDefault overridableFeatures */ + overridableFeatures?: (google.protobuf.IFeatureSet|null); + + /** FeatureSetEditionDefault fixedFeatures */ + fixedFeatures?: (google.protobuf.IFeatureSet|null); } /** Represents a FeatureSetEditionDefault. */ @@ -10024,8 +10528,11 @@ export namespace google { /** FeatureSetEditionDefault edition. */ public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - /** FeatureSetEditionDefault features. */ - public features?: (google.protobuf.IFeatureSet|null); + /** FeatureSetEditionDefault overridableFeatures. */ + public overridableFeatures?: (google.protobuf.IFeatureSet|null); + + /** FeatureSetEditionDefault fixedFeatures. */ + public fixedFeatures?: (google.protobuf.IFeatureSet|null); /** * Creates a new FeatureSetEditionDefault instance using the specified properties. @@ -10558,6 +11065,13 @@ export namespace google { } } + /** SymbolVisibility enum. */ + enum SymbolVisibility { + VISIBILITY_UNSET = 0, + VISIBILITY_LOCAL = 1, + VISIBILITY_EXPORT = 2 + } + /** Properties of a Duration. */ interface IDuration { diff --git a/packages/google-api-cloudquotas/protos/protos.js b/packages/google-api-cloudquotas/protos/protos.js index d5c7c089d33..dfa0146527d 100644 --- a/packages/google-api-cloudquotas/protos/protos.js +++ b/packages/google-api-cloudquotas/protos/protos.js @@ -12045,6 +12045,7 @@ * @interface ICommonLanguageSettings * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri * @property {Array.|null} [destinations] CommonLanguageSettings destinations + * @property {google.api.ISelectiveGapicGeneration|null} [selectiveGapicGeneration] CommonLanguageSettings selectiveGapicGeneration */ /** @@ -12079,6 +12080,14 @@ */ CommonLanguageSettings.prototype.destinations = $util.emptyArray; + /** + * CommonLanguageSettings selectiveGapicGeneration. + * @member {google.api.ISelectiveGapicGeneration|null|undefined} selectiveGapicGeneration + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.selectiveGapicGeneration = null; + /** * Creates a new CommonLanguageSettings instance using the specified properties. * @function create @@ -12111,6 +12120,8 @@ writer.int32(message.destinations[i]); writer.ldelim(); } + if (message.selectiveGapicGeneration != null && Object.hasOwnProperty.call(message, "selectiveGapicGeneration")) + $root.google.api.SelectiveGapicGeneration.encode(message.selectiveGapicGeneration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -12162,6 +12173,10 @@ message.destinations.push(reader.int32()); break; } + case 3: { + message.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -12213,6 +12228,11 @@ break; } } + if (message.selectiveGapicGeneration != null && message.hasOwnProperty("selectiveGapicGeneration")) { + var error = $root.google.api.SelectiveGapicGeneration.verify(message.selectiveGapicGeneration); + if (error) + return "selectiveGapicGeneration." + error; + } return null; }; @@ -12255,6 +12275,11 @@ break; } } + if (object.selectiveGapicGeneration != null) { + if (typeof object.selectiveGapicGeneration !== "object") + throw TypeError(".google.api.CommonLanguageSettings.selectiveGapicGeneration: object expected"); + message.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.fromObject(object.selectiveGapicGeneration); + } return message; }; @@ -12273,8 +12298,10 @@ var object = {}; if (options.arrays || options.defaults) object.destinations = []; - if (options.defaults) + if (options.defaults) { object.referenceDocsUri = ""; + object.selectiveGapicGeneration = null; + } if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) object.referenceDocsUri = message.referenceDocsUri; if (message.destinations && message.destinations.length) { @@ -12282,6 +12309,8 @@ for (var j = 0; j < message.destinations.length; ++j) object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; } + if (message.selectiveGapicGeneration != null && message.hasOwnProperty("selectiveGapicGeneration")) + object.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.toObject(message.selectiveGapicGeneration, options); return object; }; @@ -14104,6 +14133,7 @@ * @memberof google.api * @interface IPythonSettings * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common + * @property {google.api.PythonSettings.IExperimentalFeatures|null} [experimentalFeatures] PythonSettings experimentalFeatures */ /** @@ -14129,6 +14159,14 @@ */ PythonSettings.prototype.common = null; + /** + * PythonSettings experimentalFeatures. + * @member {google.api.PythonSettings.IExperimentalFeatures|null|undefined} experimentalFeatures + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.experimentalFeatures = null; + /** * Creates a new PythonSettings instance using the specified properties. * @function create @@ -14155,6 +14193,8 @@ writer = $Writer.create(); if (message.common != null && Object.hasOwnProperty.call(message, "common")) $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.experimentalFeatures != null && Object.hasOwnProperty.call(message, "experimentalFeatures")) + $root.google.api.PythonSettings.ExperimentalFeatures.encode(message.experimentalFeatures, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -14195,6 +14235,10 @@ message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); break; } + case 2: { + message.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -14235,6 +14279,11 @@ if (error) return "common." + error; } + if (message.experimentalFeatures != null && message.hasOwnProperty("experimentalFeatures")) { + var error = $root.google.api.PythonSettings.ExperimentalFeatures.verify(message.experimentalFeatures); + if (error) + return "experimentalFeatures." + error; + } return null; }; @@ -14255,6 +14304,11 @@ throw TypeError(".google.api.PythonSettings.common: object expected"); message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); } + if (object.experimentalFeatures != null) { + if (typeof object.experimentalFeatures !== "object") + throw TypeError(".google.api.PythonSettings.experimentalFeatures: object expected"); + message.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.fromObject(object.experimentalFeatures); + } return message; }; @@ -14271,10 +14325,14 @@ if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.common = null; + object.experimentalFeatures = null; + } if (message.common != null && message.hasOwnProperty("common")) object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + if (message.experimentalFeatures != null && message.hasOwnProperty("experimentalFeatures")) + object.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.toObject(message.experimentalFeatures, options); return object; }; @@ -14304,6 +14362,258 @@ return typeUrlPrefix + "/google.api.PythonSettings"; }; + PythonSettings.ExperimentalFeatures = (function() { + + /** + * Properties of an ExperimentalFeatures. + * @memberof google.api.PythonSettings + * @interface IExperimentalFeatures + * @property {boolean|null} [restAsyncIoEnabled] ExperimentalFeatures restAsyncIoEnabled + * @property {boolean|null} [protobufPythonicTypesEnabled] ExperimentalFeatures protobufPythonicTypesEnabled + * @property {boolean|null} [unversionedPackageDisabled] ExperimentalFeatures unversionedPackageDisabled + */ + + /** + * Constructs a new ExperimentalFeatures. + * @memberof google.api.PythonSettings + * @classdesc Represents an ExperimentalFeatures. + * @implements IExperimentalFeatures + * @constructor + * @param {google.api.PythonSettings.IExperimentalFeatures=} [properties] Properties to set + */ + function ExperimentalFeatures(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExperimentalFeatures restAsyncIoEnabled. + * @member {boolean} restAsyncIoEnabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.restAsyncIoEnabled = false; + + /** + * ExperimentalFeatures protobufPythonicTypesEnabled. + * @member {boolean} protobufPythonicTypesEnabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.protobufPythonicTypesEnabled = false; + + /** + * ExperimentalFeatures unversionedPackageDisabled. + * @member {boolean} unversionedPackageDisabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.unversionedPackageDisabled = false; + + /** + * Creates a new ExperimentalFeatures instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures=} [properties] Properties to set + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures instance + */ + ExperimentalFeatures.create = function create(properties) { + return new ExperimentalFeatures(properties); + }; + + /** + * Encodes the specified ExperimentalFeatures message. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures} message ExperimentalFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExperimentalFeatures.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.restAsyncIoEnabled != null && Object.hasOwnProperty.call(message, "restAsyncIoEnabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.restAsyncIoEnabled); + if (message.protobufPythonicTypesEnabled != null && Object.hasOwnProperty.call(message, "protobufPythonicTypesEnabled")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.protobufPythonicTypesEnabled); + if (message.unversionedPackageDisabled != null && Object.hasOwnProperty.call(message, "unversionedPackageDisabled")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.unversionedPackageDisabled); + return writer; + }; + + /** + * Encodes the specified ExperimentalFeatures message, length delimited. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures} message ExperimentalFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExperimentalFeatures.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExperimentalFeatures.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings.ExperimentalFeatures(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.restAsyncIoEnabled = reader.bool(); + break; + } + case 2: { + message.protobufPythonicTypesEnabled = reader.bool(); + break; + } + case 3: { + message.unversionedPackageDisabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExperimentalFeatures.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExperimentalFeatures message. + * @function verify + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExperimentalFeatures.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.restAsyncIoEnabled != null && message.hasOwnProperty("restAsyncIoEnabled")) + if (typeof message.restAsyncIoEnabled !== "boolean") + return "restAsyncIoEnabled: boolean expected"; + if (message.protobufPythonicTypesEnabled != null && message.hasOwnProperty("protobufPythonicTypesEnabled")) + if (typeof message.protobufPythonicTypesEnabled !== "boolean") + return "protobufPythonicTypesEnabled: boolean expected"; + if (message.unversionedPackageDisabled != null && message.hasOwnProperty("unversionedPackageDisabled")) + if (typeof message.unversionedPackageDisabled !== "boolean") + return "unversionedPackageDisabled: boolean expected"; + return null; + }; + + /** + * Creates an ExperimentalFeatures message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + */ + ExperimentalFeatures.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PythonSettings.ExperimentalFeatures) + return object; + var message = new $root.google.api.PythonSettings.ExperimentalFeatures(); + if (object.restAsyncIoEnabled != null) + message.restAsyncIoEnabled = Boolean(object.restAsyncIoEnabled); + if (object.protobufPythonicTypesEnabled != null) + message.protobufPythonicTypesEnabled = Boolean(object.protobufPythonicTypesEnabled); + if (object.unversionedPackageDisabled != null) + message.unversionedPackageDisabled = Boolean(object.unversionedPackageDisabled); + return message; + }; + + /** + * Creates a plain object from an ExperimentalFeatures message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.ExperimentalFeatures} message ExperimentalFeatures + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExperimentalFeatures.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.restAsyncIoEnabled = false; + object.protobufPythonicTypesEnabled = false; + object.unversionedPackageDisabled = false; + } + if (message.restAsyncIoEnabled != null && message.hasOwnProperty("restAsyncIoEnabled")) + object.restAsyncIoEnabled = message.restAsyncIoEnabled; + if (message.protobufPythonicTypesEnabled != null && message.hasOwnProperty("protobufPythonicTypesEnabled")) + object.protobufPythonicTypesEnabled = message.protobufPythonicTypesEnabled; + if (message.unversionedPackageDisabled != null && message.hasOwnProperty("unversionedPackageDisabled")) + object.unversionedPackageDisabled = message.unversionedPackageDisabled; + return object; + }; + + /** + * Converts this ExperimentalFeatures to JSON. + * @function toJSON + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + * @returns {Object.} JSON object + */ + ExperimentalFeatures.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExperimentalFeatures + * @function getTypeUrl + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExperimentalFeatures.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings.ExperimentalFeatures"; + }; + + return ExperimentalFeatures; + })(); + return PythonSettings; })(); @@ -15180,6 +15490,7 @@ * @memberof google.api * @interface IGoSettings * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common + * @property {Object.|null} [renamedServices] GoSettings renamedServices */ /** @@ -15191,6 +15502,7 @@ * @param {google.api.IGoSettings=} [properties] Properties to set */ function GoSettings(properties) { + this.renamedServices = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -15205,6 +15517,14 @@ */ GoSettings.prototype.common = null; + /** + * GoSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.renamedServices = $util.emptyObject; + /** * Creates a new GoSettings instance using the specified properties. * @function create @@ -15231,6 +15551,9 @@ writer = $Writer.create(); if (message.common != null && Object.hasOwnProperty.call(message, "common")) $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); return writer; }; @@ -15261,7 +15584,7 @@ GoSettings.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(), key, value; while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) @@ -15271,6 +15594,29 @@ message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); break; } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedServices[key] = value; + break; + } default: reader.skipType(tag & 7); break; @@ -15311,6 +15657,14 @@ if (error) return "common." + error; } + if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } return null; }; @@ -15331,6 +15685,13 @@ throw TypeError(".google.api.GoSettings.common: object expected"); message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); } + if (object.renamedServices) { + if (typeof object.renamedServices !== "object") + throw TypeError(".google.api.GoSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } return message; }; @@ -15347,10 +15708,18 @@ if (!options) options = {}; var object = {}; + if (options.objects || options.defaults) + object.renamedServices = {}; if (options.defaults) object.common = null; if (message.common != null && message.hasOwnProperty("common")) object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } return object; }; @@ -15989,30 +16358,275 @@ return values; })(); - /** - * LaunchStage enum. - * @name google.api.LaunchStage - * @enum {number} - * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value - * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value - * @property {number} PRELAUNCH=7 PRELAUNCH value - * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value - * @property {number} ALPHA=2 ALPHA value - * @property {number} BETA=3 BETA value - * @property {number} GA=4 GA value - * @property {number} DEPRECATED=5 DEPRECATED value - */ - api.LaunchStage = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; - values[valuesById[6] = "UNIMPLEMENTED"] = 6; - values[valuesById[7] = "PRELAUNCH"] = 7; - values[valuesById[1] = "EARLY_ACCESS"] = 1; - values[valuesById[2] = "ALPHA"] = 2; - values[valuesById[3] = "BETA"] = 3; - values[valuesById[4] = "GA"] = 4; - values[valuesById[5] = "DEPRECATED"] = 5; - return values; + api.SelectiveGapicGeneration = (function() { + + /** + * Properties of a SelectiveGapicGeneration. + * @memberof google.api + * @interface ISelectiveGapicGeneration + * @property {Array.|null} [methods] SelectiveGapicGeneration methods + * @property {boolean|null} [generateOmittedAsInternal] SelectiveGapicGeneration generateOmittedAsInternal + */ + + /** + * Constructs a new SelectiveGapicGeneration. + * @memberof google.api + * @classdesc Represents a SelectiveGapicGeneration. + * @implements ISelectiveGapicGeneration + * @constructor + * @param {google.api.ISelectiveGapicGeneration=} [properties] Properties to set + */ + function SelectiveGapicGeneration(properties) { + this.methods = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SelectiveGapicGeneration methods. + * @member {Array.} methods + * @memberof google.api.SelectiveGapicGeneration + * @instance + */ + SelectiveGapicGeneration.prototype.methods = $util.emptyArray; + + /** + * SelectiveGapicGeneration generateOmittedAsInternal. + * @member {boolean} generateOmittedAsInternal + * @memberof google.api.SelectiveGapicGeneration + * @instance + */ + SelectiveGapicGeneration.prototype.generateOmittedAsInternal = false; + + /** + * Creates a new SelectiveGapicGeneration instance using the specified properties. + * @function create + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration=} [properties] Properties to set + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration instance + */ + SelectiveGapicGeneration.create = function create(properties) { + return new SelectiveGapicGeneration(properties); + }; + + /** + * Encodes the specified SelectiveGapicGeneration message. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @function encode + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration} message SelectiveGapicGeneration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelectiveGapicGeneration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.methods != null && message.methods.length) + for (var i = 0; i < message.methods.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.methods[i]); + if (message.generateOmittedAsInternal != null && Object.hasOwnProperty.call(message, "generateOmittedAsInternal")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.generateOmittedAsInternal); + return writer; + }; + + /** + * Encodes the specified SelectiveGapicGeneration message, length delimited. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration} message SelectiveGapicGeneration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelectiveGapicGeneration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer. + * @function decode + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelectiveGapicGeneration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.SelectiveGapicGeneration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.methods && message.methods.length)) + message.methods = []; + message.methods.push(reader.string()); + break; + } + case 2: { + message.generateOmittedAsInternal = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelectiveGapicGeneration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SelectiveGapicGeneration message. + * @function verify + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SelectiveGapicGeneration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.methods != null && message.hasOwnProperty("methods")) { + if (!Array.isArray(message.methods)) + return "methods: array expected"; + for (var i = 0; i < message.methods.length; ++i) + if (!$util.isString(message.methods[i])) + return "methods: string[] expected"; + } + if (message.generateOmittedAsInternal != null && message.hasOwnProperty("generateOmittedAsInternal")) + if (typeof message.generateOmittedAsInternal !== "boolean") + return "generateOmittedAsInternal: boolean expected"; + return null; + }; + + /** + * Creates a SelectiveGapicGeneration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {Object.} object Plain object + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + */ + SelectiveGapicGeneration.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.SelectiveGapicGeneration) + return object; + var message = new $root.google.api.SelectiveGapicGeneration(); + if (object.methods) { + if (!Array.isArray(object.methods)) + throw TypeError(".google.api.SelectiveGapicGeneration.methods: array expected"); + message.methods = []; + for (var i = 0; i < object.methods.length; ++i) + message.methods[i] = String(object.methods[i]); + } + if (object.generateOmittedAsInternal != null) + message.generateOmittedAsInternal = Boolean(object.generateOmittedAsInternal); + return message; + }; + + /** + * Creates a plain object from a SelectiveGapicGeneration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.SelectiveGapicGeneration} message SelectiveGapicGeneration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SelectiveGapicGeneration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.methods = []; + if (options.defaults) + object.generateOmittedAsInternal = false; + if (message.methods && message.methods.length) { + object.methods = []; + for (var j = 0; j < message.methods.length; ++j) + object.methods[j] = message.methods[j]; + } + if (message.generateOmittedAsInternal != null && message.hasOwnProperty("generateOmittedAsInternal")) + object.generateOmittedAsInternal = message.generateOmittedAsInternal; + return object; + }; + + /** + * Converts this SelectiveGapicGeneration to JSON. + * @function toJSON + * @memberof google.api.SelectiveGapicGeneration + * @instance + * @returns {Object.} JSON object + */ + SelectiveGapicGeneration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SelectiveGapicGeneration + * @function getTypeUrl + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SelectiveGapicGeneration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.SelectiveGapicGeneration"; + }; + + return SelectiveGapicGeneration; + })(); + + /** + * LaunchStage enum. + * @name google.api.LaunchStage + * @enum {number} + * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value + * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value + * @property {number} PRELAUNCH=7 PRELAUNCH value + * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value + * @property {number} ALPHA=2 ALPHA value + * @property {number} BETA=3 BETA value + * @property {number} GA=4 GA value + * @property {number} DEPRECATED=5 DEPRECATED value + */ + api.LaunchStage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; + values[valuesById[6] = "UNIMPLEMENTED"] = 6; + values[valuesById[7] = "PRELAUNCH"] = 7; + values[valuesById[1] = "EARLY_ACCESS"] = 1; + values[valuesById[2] = "ALPHA"] = 2; + values[valuesById[3] = "BETA"] = 3; + values[valuesById[4] = "GA"] = 4; + values[valuesById[5] = "DEPRECATED"] = 5; + return values; })(); /** @@ -16974,6 +17588,7 @@ * @name google.protobuf.Edition * @enum {number} * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value + * @property {number} EDITION_LEGACY=900 EDITION_LEGACY value * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value * @property {number} EDITION_2023=1000 EDITION_2023 value @@ -16988,6 +17603,7 @@ protobuf.Edition = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "EDITION_UNKNOWN"] = 0; + values[valuesById[900] = "EDITION_LEGACY"] = 900; values[valuesById[998] = "EDITION_PROTO2"] = 998; values[valuesById[999] = "EDITION_PROTO3"] = 999; values[valuesById[1000] = "EDITION_2023"] = 1000; @@ -17012,6 +17628,7 @@ * @property {Array.|null} [dependency] FileDescriptorProto dependency * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [optionDependency] FileDescriptorProto optionDependency * @property {Array.|null} [messageType] FileDescriptorProto messageType * @property {Array.|null} [enumType] FileDescriptorProto enumType * @property {Array.|null} [service] FileDescriptorProto service @@ -17034,6 +17651,7 @@ this.dependency = []; this.publicDependency = []; this.weakDependency = []; + this.optionDependency = []; this.messageType = []; this.enumType = []; this.service = []; @@ -17084,6 +17702,14 @@ */ FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + /** + * FileDescriptorProto optionDependency. + * @member {Array.} optionDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.optionDependency = $util.emptyArray; + /** * FileDescriptorProto messageType. * @member {Array.} messageType @@ -17205,6 +17831,9 @@ writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); + if (message.optionDependency != null && message.optionDependency.length) + for (var i = 0; i < message.optionDependency.length; ++i) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.optionDependency[i]); return writer; }; @@ -17277,6 +17906,12 @@ message.weakDependency.push(reader.int32()); break; } + case 15: { + if (!(message.optionDependency && message.optionDependency.length)) + message.optionDependency = []; + message.optionDependency.push(reader.string()); + break; + } case 4: { if (!(message.messageType && message.messageType.length)) message.messageType = []; @@ -17379,6 +18014,13 @@ if (!$util.isInteger(message.weakDependency[i])) return "weakDependency: integer[] expected"; } + if (message.optionDependency != null && message.hasOwnProperty("optionDependency")) { + if (!Array.isArray(message.optionDependency)) + return "optionDependency: array expected"; + for (var i = 0; i < message.optionDependency.length; ++i) + if (!$util.isString(message.optionDependency[i])) + return "optionDependency: string[] expected"; + } if (message.messageType != null && message.hasOwnProperty("messageType")) { if (!Array.isArray(message.messageType)) return "messageType: array expected"; @@ -17433,6 +18075,7 @@ default: return "edition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -17485,6 +18128,13 @@ for (var i = 0; i < object.weakDependency.length; ++i) message.weakDependency[i] = object.weakDependency[i] | 0; } + if (object.optionDependency) { + if (!Array.isArray(object.optionDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.optionDependency: array expected"); + message.optionDependency = []; + for (var i = 0; i < object.optionDependency.length; ++i) + message.optionDependency[i] = String(object.optionDependency[i]); + } if (object.messageType) { if (!Array.isArray(object.messageType)) throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); @@ -17548,6 +18198,10 @@ case 0: message.edition = 0; break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; case "EDITION_PROTO2": case 998: message.edition = 998; @@ -17613,6 +18267,7 @@ object.extension = []; object.publicDependency = []; object.weakDependency = []; + object.optionDependency = []; } if (options.defaults) { object.name = ""; @@ -17669,6 +18324,11 @@ object.syntax = message.syntax; if (message.edition != null && message.hasOwnProperty("edition")) object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + if (message.optionDependency && message.optionDependency.length) { + object.optionDependency = []; + for (var j = 0; j < message.optionDependency.length; ++j) + object.optionDependency[j] = message.optionDependency[j]; + } return object; }; @@ -17717,6 +18377,7 @@ * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options * @property {Array.|null} [reservedRange] DescriptorProto reservedRange * @property {Array.|null} [reservedName] DescriptorProto reservedName + * @property {google.protobuf.SymbolVisibility|null} [visibility] DescriptorProto visibility */ /** @@ -17822,6 +18483,14 @@ */ DescriptorProto.prototype.reservedName = $util.emptyArray; + /** + * DescriptorProto visibility. + * @member {google.protobuf.SymbolVisibility} visibility + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.visibility = 0; + /** * Creates a new DescriptorProto instance using the specified properties. * @function create @@ -17874,6 +18543,8 @@ if (message.reservedName != null && message.reservedName.length) for (var i = 0; i < message.reservedName.length; ++i) writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.visibility); return writer; }; @@ -17966,6 +18637,10 @@ message.reservedName.push(reader.string()); break; } + case 11: { + message.visibility = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -18079,6 +18754,15 @@ if (!$util.isString(message.reservedName[i])) return "reservedName: string[] expected"; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + switch (message.visibility) { + default: + return "visibility: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; @@ -18178,6 +18862,26 @@ for (var i = 0; i < object.reservedName.length; ++i) message.reservedName[i] = String(object.reservedName[i]); } + switch (object.visibility) { + default: + if (typeof object.visibility === "number") { + message.visibility = object.visibility; + break; + } + break; + case "VISIBILITY_UNSET": + case 0: + message.visibility = 0; + break; + case "VISIBILITY_LOCAL": + case 1: + message.visibility = 1; + break; + case "VISIBILITY_EXPORT": + case 2: + message.visibility = 2; + break; + } return message; }; @@ -18207,6 +18911,7 @@ if (options.defaults) { object.name = ""; object.options = null; + object.visibility = options.enums === String ? "VISIBILITY_UNSET" : 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -18252,6 +18957,8 @@ for (var j = 0; j < message.reservedName.length; ++j) object.reservedName[j] = message.reservedName[j]; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + object.visibility = options.enums === String ? $root.google.protobuf.SymbolVisibility[message.visibility] === undefined ? message.visibility : $root.google.protobuf.SymbolVisibility[message.visibility] : message.visibility; return object; }; @@ -20296,6 +21003,7 @@ * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + * @property {google.protobuf.SymbolVisibility|null} [visibility] EnumDescriptorProto visibility */ /** @@ -20356,6 +21064,14 @@ */ EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + /** + * EnumDescriptorProto visibility. + * @member {google.protobuf.SymbolVisibility} visibility + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.visibility = 0; + /** * Creates a new EnumDescriptorProto instance using the specified properties. * @function create @@ -20393,6 +21109,8 @@ if (message.reservedName != null && message.reservedName.length) for (var i = 0; i < message.reservedName.length; ++i) writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.visibility); return writer; }; @@ -20455,6 +21173,10 @@ message.reservedName.push(reader.string()); break; } + case 6: { + message.visibility = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -20523,6 +21245,15 @@ if (!$util.isString(message.reservedName[i])) return "reservedName: string[] expected"; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + switch (message.visibility) { + default: + return "visibility: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; @@ -20572,6 +21303,26 @@ for (var i = 0; i < object.reservedName.length; ++i) message.reservedName[i] = String(object.reservedName[i]); } + switch (object.visibility) { + default: + if (typeof object.visibility === "number") { + message.visibility = object.visibility; + break; + } + break; + case "VISIBILITY_UNSET": + case 0: + message.visibility = 0; + break; + case "VISIBILITY_LOCAL": + case 1: + message.visibility = 1; + break; + case "VISIBILITY_EXPORT": + case 2: + message.visibility = 2; + break; + } return message; }; @@ -20596,6 +21347,7 @@ if (options.defaults) { object.name = ""; object.options = null; + object.visibility = options.enums === String ? "VISIBILITY_UNSET" : 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -20616,6 +21368,8 @@ for (var j = 0; j < message.reservedName.length; ++j) object.reservedName[j] = message.reservedName[j]; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + object.visibility = options.enums === String ? $root.google.protobuf.SymbolVisibility[message.visibility] === undefined ? message.visibility : $root.google.protobuf.SymbolVisibility[message.visibility] : message.visibility; return object; }; @@ -22934,6 +23688,7 @@ * @property {Array.|null} [targets] FieldOptions targets * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features + * @property {google.protobuf.FieldOptions.IFeatureSupport|null} [featureSupport] FieldOptions featureSupport * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference @@ -23054,6 +23809,14 @@ */ FieldOptions.prototype.features = null; + /** + * FieldOptions featureSupport. + * @member {google.protobuf.FieldOptions.IFeatureSupport|null|undefined} featureSupport + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.featureSupport = null; + /** * FieldOptions uninterpretedOption. * @member {Array.} uninterpretedOption @@ -23128,6 +23891,8 @@ $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); if (message.features != null && Object.hasOwnProperty.call(message, "features")) $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) + $root.google.protobuf.FieldOptions.FeatureSupport.encode(message.featureSupport, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); @@ -23229,6 +23994,10 @@ message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); break; } + case 22: { + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.decode(reader, reader.uint32()); + break; + } case 999: { if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; @@ -23364,6 +24133,11 @@ if (error) return "features." + error; } + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) { + var error = $root.google.protobuf.FieldOptions.FeatureSupport.verify(message.featureSupport); + if (error) + return "featureSupport." + error; + } if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; @@ -23552,6 +24326,11 @@ throw TypeError(".google.protobuf.FieldOptions.features: object expected"); message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); } + if (object.featureSupport != null) { + if (typeof object.featureSupport !== "object") + throw TypeError(".google.protobuf.FieldOptions.featureSupport: object expected"); + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.fromObject(object.featureSupport); + } if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); @@ -23649,6 +24428,7 @@ object.debugRedact = false; object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; object.features = null; + object.featureSupport = null; object[".google.api.resourceReference"] = null; } if (message.ctype != null && message.hasOwnProperty("ctype")) @@ -23681,6 +24461,8 @@ } if (message.features != null && message.hasOwnProperty("features")) object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) + object.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.toObject(message.featureSupport, options); if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) @@ -23953,6 +24735,7 @@ default: return "edition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -23994,103 +24777,589 @@ case 0: message.edition = 0; break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; case "EDITION_PROTO2": case 998: message.edition = 998; break; case "EDITION_PROTO3": case 999: - message.edition = 999; + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this EditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + * @returns {Object.} JSON object + */ + EditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; + }; + + return EditionDefault; + })(); + + FieldOptions.FeatureSupport = (function() { + + /** + * Properties of a FeatureSupport. + * @memberof google.protobuf.FieldOptions + * @interface IFeatureSupport + * @property {google.protobuf.Edition|null} [editionIntroduced] FeatureSupport editionIntroduced + * @property {google.protobuf.Edition|null} [editionDeprecated] FeatureSupport editionDeprecated + * @property {string|null} [deprecationWarning] FeatureSupport deprecationWarning + * @property {google.protobuf.Edition|null} [editionRemoved] FeatureSupport editionRemoved + */ + + /** + * Constructs a new FeatureSupport. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents a FeatureSupport. + * @implements IFeatureSupport + * @constructor + * @param {google.protobuf.FieldOptions.IFeatureSupport=} [properties] Properties to set + */ + function FeatureSupport(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSupport editionIntroduced. + * @member {google.protobuf.Edition} editionIntroduced + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionIntroduced = 0; + + /** + * FeatureSupport editionDeprecated. + * @member {google.protobuf.Edition} editionDeprecated + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionDeprecated = 0; + + /** + * FeatureSupport deprecationWarning. + * @member {string} deprecationWarning + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.deprecationWarning = ""; + + /** + * FeatureSupport editionRemoved. + * @member {google.protobuf.Edition} editionRemoved + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionRemoved = 0; + + /** + * Creates a new FeatureSupport instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport instance + */ + FeatureSupport.create = function create(properties) { + return new FeatureSupport(properties); + }; + + /** + * Encodes the specified FeatureSupport message. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport} message FeatureSupport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSupport.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.editionIntroduced != null && Object.hasOwnProperty.call(message, "editionIntroduced")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.editionIntroduced); + if (message.editionDeprecated != null && Object.hasOwnProperty.call(message, "editionDeprecated")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.editionDeprecated); + if (message.deprecationWarning != null && Object.hasOwnProperty.call(message, "deprecationWarning")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.deprecationWarning); + if (message.editionRemoved != null && Object.hasOwnProperty.call(message, "editionRemoved")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.editionRemoved); + return writer; + }; + + /** + * Encodes the specified FeatureSupport message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport} message FeatureSupport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSupport.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSupport.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.FeatureSupport(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.editionIntroduced = reader.int32(); + break; + } + case 2: { + message.editionDeprecated = reader.int32(); + break; + } + case 3: { + message.deprecationWarning = reader.string(); + break; + } + case 4: { + message.editionRemoved = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSupport.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSupport message. + * @function verify + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSupport.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.editionIntroduced != null && message.hasOwnProperty("editionIntroduced")) + switch (message.editionIntroduced) { + default: + return "editionIntroduced: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.editionDeprecated != null && message.hasOwnProperty("editionDeprecated")) + switch (message.editionDeprecated) { + default: + return "editionDeprecated: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.deprecationWarning != null && message.hasOwnProperty("deprecationWarning")) + if (!$util.isString(message.deprecationWarning)) + return "deprecationWarning: string expected"; + if (message.editionRemoved != null && message.hasOwnProperty("editionRemoved")) + switch (message.editionRemoved) { + default: + return "editionRemoved: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FeatureSupport message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + */ + FeatureSupport.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions.FeatureSupport) + return object; + var message = new $root.google.protobuf.FieldOptions.FeatureSupport(); + switch (object.editionIntroduced) { + default: + if (typeof object.editionIntroduced === "number") { + message.editionIntroduced = object.editionIntroduced; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionIntroduced = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionIntroduced = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionIntroduced = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionIntroduced = 999; + break; + case "EDITION_2023": + case 1000: + message.editionIntroduced = 1000; + break; + case "EDITION_2024": + case 1001: + message.editionIntroduced = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.editionIntroduced = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.editionIntroduced = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.editionIntroduced = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.editionIntroduced = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.editionIntroduced = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.editionIntroduced = 2147483647; + break; + } + switch (object.editionDeprecated) { + default: + if (typeof object.editionDeprecated === "number") { + message.editionDeprecated = object.editionDeprecated; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionDeprecated = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionDeprecated = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionDeprecated = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionDeprecated = 999; + break; + case "EDITION_2023": + case 1000: + message.editionDeprecated = 1000; + break; + case "EDITION_2024": + case 1001: + message.editionDeprecated = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.editionDeprecated = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.editionDeprecated = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.editionDeprecated = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.editionDeprecated = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.editionDeprecated = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.editionDeprecated = 2147483647; + break; + } + if (object.deprecationWarning != null) + message.deprecationWarning = String(object.deprecationWarning); + switch (object.editionRemoved) { + default: + if (typeof object.editionRemoved === "number") { + message.editionRemoved = object.editionRemoved; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionRemoved = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionRemoved = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionRemoved = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionRemoved = 999; break; case "EDITION_2023": case 1000: - message.edition = 1000; + message.editionRemoved = 1000; break; case "EDITION_2024": case 1001: - message.edition = 1001; + message.editionRemoved = 1001; break; case "EDITION_1_TEST_ONLY": case 1: - message.edition = 1; + message.editionRemoved = 1; break; case "EDITION_2_TEST_ONLY": case 2: - message.edition = 2; + message.editionRemoved = 2; break; case "EDITION_99997_TEST_ONLY": case 99997: - message.edition = 99997; + message.editionRemoved = 99997; break; case "EDITION_99998_TEST_ONLY": case 99998: - message.edition = 99998; + message.editionRemoved = 99998; break; case "EDITION_99999_TEST_ONLY": case 99999: - message.edition = 99999; + message.editionRemoved = 99999; break; case "EDITION_MAX": case 2147483647: - message.edition = 2147483647; + message.editionRemoved = 2147483647; break; } - if (object.value != null) - message.value = String(object.value); return message; }; /** - * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * Creates a plain object from a FeatureSupport message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.FieldOptions.EditionDefault + * @memberof google.protobuf.FieldOptions.FeatureSupport * @static - * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault + * @param {google.protobuf.FieldOptions.FeatureSupport} message FeatureSupport * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EditionDefault.toObject = function toObject(message, options) { + FeatureSupport.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.value = ""; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + object.editionIntroduced = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.editionDeprecated = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.deprecationWarning = ""; + object.editionRemoved = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.editionIntroduced != null && message.hasOwnProperty("editionIntroduced")) + object.editionIntroduced = options.enums === String ? $root.google.protobuf.Edition[message.editionIntroduced] === undefined ? message.editionIntroduced : $root.google.protobuf.Edition[message.editionIntroduced] : message.editionIntroduced; + if (message.editionDeprecated != null && message.hasOwnProperty("editionDeprecated")) + object.editionDeprecated = options.enums === String ? $root.google.protobuf.Edition[message.editionDeprecated] === undefined ? message.editionDeprecated : $root.google.protobuf.Edition[message.editionDeprecated] : message.editionDeprecated; + if (message.deprecationWarning != null && message.hasOwnProperty("deprecationWarning")) + object.deprecationWarning = message.deprecationWarning; + if (message.editionRemoved != null && message.hasOwnProperty("editionRemoved")) + object.editionRemoved = options.enums === String ? $root.google.protobuf.Edition[message.editionRemoved] === undefined ? message.editionRemoved : $root.google.protobuf.Edition[message.editionRemoved] : message.editionRemoved; return object; }; /** - * Converts this EditionDefault to JSON. + * Converts this FeatureSupport to JSON. * @function toJSON - * @memberof google.protobuf.FieldOptions.EditionDefault + * @memberof google.protobuf.FieldOptions.FeatureSupport * @instance * @returns {Object.} JSON object */ - EditionDefault.prototype.toJSON = function toJSON() { + FeatureSupport.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for EditionDefault + * Gets the default type url for FeatureSupport * @function getTypeUrl - * @memberof google.protobuf.FieldOptions.EditionDefault + * @memberof google.protobuf.FieldOptions.FeatureSupport * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + FeatureSupport.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; + return typeUrlPrefix + "/google.protobuf.FieldOptions.FeatureSupport"; }; - return EditionDefault; + return FeatureSupport; })(); return FieldOptions; @@ -24685,6 +25954,7 @@ * @property {boolean|null} [deprecated] EnumValueOptions deprecated * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact + * @property {google.protobuf.FieldOptions.IFeatureSupport|null} [featureSupport] EnumValueOptions featureSupport * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption */ @@ -24728,6 +25998,14 @@ */ EnumValueOptions.prototype.debugRedact = false; + /** + * EnumValueOptions featureSupport. + * @member {google.protobuf.FieldOptions.IFeatureSupport|null|undefined} featureSupport + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.featureSupport = null; + /** * EnumValueOptions uninterpretedOption. * @member {Array.} uninterpretedOption @@ -24766,6 +26044,8 @@ $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); + if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) + $root.google.protobuf.FieldOptions.FeatureSupport.encode(message.featureSupport, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); @@ -24817,6 +26097,10 @@ message.debugRedact = reader.bool(); break; } + case 4: { + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.decode(reader, reader.uint32()); + break; + } case 999: { if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; @@ -24869,6 +26153,11 @@ if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) if (typeof message.debugRedact !== "boolean") return "debugRedact: boolean expected"; + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) { + var error = $root.google.protobuf.FieldOptions.FeatureSupport.verify(message.featureSupport); + if (error) + return "featureSupport." + error; + } if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; @@ -24902,6 +26191,11 @@ } if (object.debugRedact != null) message.debugRedact = Boolean(object.debugRedact); + if (object.featureSupport != null) { + if (typeof object.featureSupport !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.featureSupport: object expected"); + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.fromObject(object.featureSupport); + } if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); @@ -24934,6 +26228,7 @@ object.deprecated = false; object.features = null; object.debugRedact = false; + object.featureSupport = null; } if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; @@ -24941,6 +26236,8 @@ object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) object.debugRedact = message.debugRedact; + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) + object.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.toObject(message.featureSupport, options); if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) @@ -26380,6 +27677,8 @@ * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat + * @property {google.protobuf.FeatureSet.EnforceNamingStyle|null} [enforceNamingStyle] FeatureSet enforceNamingStyle + * @property {google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|null} [defaultSymbolVisibility] FeatureSet defaultSymbolVisibility */ /** @@ -26445,6 +27744,22 @@ */ FeatureSet.prototype.jsonFormat = 0; + /** + * FeatureSet enforceNamingStyle. + * @member {google.protobuf.FeatureSet.EnforceNamingStyle} enforceNamingStyle + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enforceNamingStyle = 0; + + /** + * FeatureSet defaultSymbolVisibility. + * @member {google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility} defaultSymbolVisibility + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.defaultSymbolVisibility = 0; + /** * Creates a new FeatureSet instance using the specified properties. * @function create @@ -26481,6 +27796,10 @@ writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); + if (message.enforceNamingStyle != null && Object.hasOwnProperty.call(message, "enforceNamingStyle")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.enforceNamingStyle); + if (message.defaultSymbolVisibility != null && Object.hasOwnProperty.call(message, "defaultSymbolVisibility")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.defaultSymbolVisibility); return writer; }; @@ -26541,6 +27860,14 @@ message.jsonFormat = reader.int32(); break; } + case 7: { + message.enforceNamingStyle = reader.int32(); + break; + } + case 8: { + message.defaultSymbolVisibility = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -26631,6 +27958,26 @@ case 2: break; } + if (message.enforceNamingStyle != null && message.hasOwnProperty("enforceNamingStyle")) + switch (message.enforceNamingStyle) { + default: + return "enforceNamingStyle: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.defaultSymbolVisibility != null && message.hasOwnProperty("defaultSymbolVisibility")) + switch (message.defaultSymbolVisibility) { + default: + return "defaultSymbolVisibility: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } return null; }; @@ -26770,6 +28117,54 @@ message.jsonFormat = 2; break; } + switch (object.enforceNamingStyle) { + default: + if (typeof object.enforceNamingStyle === "number") { + message.enforceNamingStyle = object.enforceNamingStyle; + break; + } + break; + case "ENFORCE_NAMING_STYLE_UNKNOWN": + case 0: + message.enforceNamingStyle = 0; + break; + case "STYLE2024": + case 1: + message.enforceNamingStyle = 1; + break; + case "STYLE_LEGACY": + case 2: + message.enforceNamingStyle = 2; + break; + } + switch (object.defaultSymbolVisibility) { + default: + if (typeof object.defaultSymbolVisibility === "number") { + message.defaultSymbolVisibility = object.defaultSymbolVisibility; + break; + } + break; + case "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN": + case 0: + message.defaultSymbolVisibility = 0; + break; + case "EXPORT_ALL": + case 1: + message.defaultSymbolVisibility = 1; + break; + case "EXPORT_TOP_LEVEL": + case 2: + message.defaultSymbolVisibility = 2; + break; + case "LOCAL_ALL": + case 3: + message.defaultSymbolVisibility = 3; + break; + case "STRICT": + case 4: + message.defaultSymbolVisibility = 4; + break; + } return message; }; @@ -26793,6 +28188,8 @@ object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; + object.enforceNamingStyle = options.enums === String ? "ENFORCE_NAMING_STYLE_UNKNOWN" : 0; + object.defaultSymbolVisibility = options.enums === String ? "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN" : 0; } if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; @@ -26806,6 +28203,10 @@ object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; + if (message.enforceNamingStyle != null && message.hasOwnProperty("enforceNamingStyle")) + object.enforceNamingStyle = options.enums === String ? $root.google.protobuf.FeatureSet.EnforceNamingStyle[message.enforceNamingStyle] === undefined ? message.enforceNamingStyle : $root.google.protobuf.FeatureSet.EnforceNamingStyle[message.enforceNamingStyle] : message.enforceNamingStyle; + if (message.defaultSymbolVisibility != null && message.hasOwnProperty("defaultSymbolVisibility")) + object.defaultSymbolVisibility = options.enums === String ? $root.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility[message.defaultSymbolVisibility] === undefined ? message.defaultSymbolVisibility : $root.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility[message.defaultSymbolVisibility] : message.defaultSymbolVisibility; return object; }; @@ -26933,6 +28334,219 @@ return values; })(); + /** + * EnforceNamingStyle enum. + * @name google.protobuf.FeatureSet.EnforceNamingStyle + * @enum {number} + * @property {number} ENFORCE_NAMING_STYLE_UNKNOWN=0 ENFORCE_NAMING_STYLE_UNKNOWN value + * @property {number} STYLE2024=1 STYLE2024 value + * @property {number} STYLE_LEGACY=2 STYLE_LEGACY value + */ + FeatureSet.EnforceNamingStyle = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENFORCE_NAMING_STYLE_UNKNOWN"] = 0; + values[valuesById[1] = "STYLE2024"] = 1; + values[valuesById[2] = "STYLE_LEGACY"] = 2; + return values; + })(); + + FeatureSet.VisibilityFeature = (function() { + + /** + * Properties of a VisibilityFeature. + * @memberof google.protobuf.FeatureSet + * @interface IVisibilityFeature + */ + + /** + * Constructs a new VisibilityFeature. + * @memberof google.protobuf.FeatureSet + * @classdesc Represents a VisibilityFeature. + * @implements IVisibilityFeature + * @constructor + * @param {google.protobuf.FeatureSet.IVisibilityFeature=} [properties] Properties to set + */ + function VisibilityFeature(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new VisibilityFeature instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature instance + */ + VisibilityFeature.create = function create(properties) { + return new VisibilityFeature(properties); + }; + + /** + * Encodes the specified VisibilityFeature message. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature} message VisibilityFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VisibilityFeature.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified VisibilityFeature message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature} message VisibilityFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VisibilityFeature.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VisibilityFeature.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet.VisibilityFeature(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VisibilityFeature.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VisibilityFeature message. + * @function verify + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VisibilityFeature.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a VisibilityFeature message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + */ + VisibilityFeature.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSet.VisibilityFeature) + return object; + return new $root.google.protobuf.FeatureSet.VisibilityFeature(); + }; + + /** + * Creates a plain object from a VisibilityFeature message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.VisibilityFeature} message VisibilityFeature + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VisibilityFeature.toObject = function toObject() { + return {}; + }; + + /** + * Converts this VisibilityFeature to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @instance + * @returns {Object.} JSON object + */ + VisibilityFeature.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VisibilityFeature + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VisibilityFeature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet.VisibilityFeature"; + }; + + /** + * DefaultSymbolVisibility enum. + * @name google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility + * @enum {number} + * @property {number} DEFAULT_SYMBOL_VISIBILITY_UNKNOWN=0 DEFAULT_SYMBOL_VISIBILITY_UNKNOWN value + * @property {number} EXPORT_ALL=1 EXPORT_ALL value + * @property {number} EXPORT_TOP_LEVEL=2 EXPORT_TOP_LEVEL value + * @property {number} LOCAL_ALL=3 LOCAL_ALL value + * @property {number} STRICT=4 STRICT value + */ + VisibilityFeature.DefaultSymbolVisibility = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN"] = 0; + values[valuesById[1] = "EXPORT_ALL"] = 1; + values[valuesById[2] = "EXPORT_TOP_LEVEL"] = 2; + values[valuesById[3] = "LOCAL_ALL"] = 3; + values[valuesById[4] = "STRICT"] = 4; + return values; + })(); + + return VisibilityFeature; + })(); + return FeatureSet; })(); @@ -27117,6 +28731,7 @@ default: return "minimumEdition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -27134,6 +28749,7 @@ default: return "maximumEdition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -27182,6 +28798,10 @@ case 0: message.minimumEdition = 0; break; + case "EDITION_LEGACY": + case 900: + message.minimumEdition = 900; + break; case "EDITION_PROTO2": case 998: message.minimumEdition = 998; @@ -27234,6 +28854,10 @@ case 0: message.maximumEdition = 0; break; + case "EDITION_LEGACY": + case 900: + message.maximumEdition = 900; + break; case "EDITION_PROTO2": case 998: message.maximumEdition = 998; @@ -27342,7 +28966,8 @@ * @memberof google.protobuf.FeatureSetDefaults * @interface IFeatureSetEditionDefault * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition - * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features + * @property {google.protobuf.IFeatureSet|null} [overridableFeatures] FeatureSetEditionDefault overridableFeatures + * @property {google.protobuf.IFeatureSet|null} [fixedFeatures] FeatureSetEditionDefault fixedFeatures */ /** @@ -27369,12 +28994,20 @@ FeatureSetEditionDefault.prototype.edition = 0; /** - * FeatureSetEditionDefault features. - * @member {google.protobuf.IFeatureSet|null|undefined} features + * FeatureSetEditionDefault overridableFeatures. + * @member {google.protobuf.IFeatureSet|null|undefined} overridableFeatures + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.overridableFeatures = null; + + /** + * FeatureSetEditionDefault fixedFeatures. + * @member {google.protobuf.IFeatureSet|null|undefined} fixedFeatures * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault * @instance */ - FeatureSetEditionDefault.prototype.features = null; + FeatureSetEditionDefault.prototype.fixedFeatures = null; /** * Creates a new FeatureSetEditionDefault instance using the specified properties. @@ -27400,10 +29033,12 @@ FeatureSetEditionDefault.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + if (message.overridableFeatures != null && Object.hasOwnProperty.call(message, "overridableFeatures")) + $root.google.protobuf.FeatureSet.encode(message.overridableFeatures, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.fixedFeatures != null && Object.hasOwnProperty.call(message, "fixedFeatures")) + $root.google.protobuf.FeatureSet.encode(message.fixedFeatures, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -27444,8 +29079,12 @@ message.edition = reader.int32(); break; } - case 2: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + case 4: { + message.overridableFeatures = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 5: { + message.fixedFeatures = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); break; } default: @@ -27488,6 +29127,7 @@ default: return "edition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -27500,10 +29140,15 @@ case 2147483647: break; } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (message.overridableFeatures != null && message.hasOwnProperty("overridableFeatures")) { + var error = $root.google.protobuf.FeatureSet.verify(message.overridableFeatures); + if (error) + return "overridableFeatures." + error; + } + if (message.fixedFeatures != null && message.hasOwnProperty("fixedFeatures")) { + var error = $root.google.protobuf.FeatureSet.verify(message.fixedFeatures); if (error) - return "features." + error; + return "fixedFeatures." + error; } return null; }; @@ -27531,6 +29176,10 @@ case 0: message.edition = 0; break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; case "EDITION_PROTO2": case 998: message.edition = 998; @@ -27572,10 +29221,15 @@ message.edition = 2147483647; break; } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + if (object.overridableFeatures != null) { + if (typeof object.overridableFeatures !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.overridableFeatures: object expected"); + message.overridableFeatures = $root.google.protobuf.FeatureSet.fromObject(object.overridableFeatures); + } + if (object.fixedFeatures != null) { + if (typeof object.fixedFeatures !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fixedFeatures: object expected"); + message.fixedFeatures = $root.google.protobuf.FeatureSet.fromObject(object.fixedFeatures); } return message; }; @@ -27594,13 +29248,16 @@ options = {}; var object = {}; if (options.defaults) { - object.features = null; object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.overridableFeatures = null; + object.fixedFeatures = null; } - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); if (message.edition != null && message.hasOwnProperty("edition")) object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + if (message.overridableFeatures != null && message.hasOwnProperty("overridableFeatures")) + object.overridableFeatures = $root.google.protobuf.FeatureSet.toObject(message.overridableFeatures, options); + if (message.fixedFeatures != null && message.hasOwnProperty("fixedFeatures")) + object.fixedFeatures = $root.google.protobuf.FeatureSet.toObject(message.fixedFeatures, options); return object; }; @@ -28815,6 +30472,22 @@ return GeneratedCodeInfo; })(); + /** + * SymbolVisibility enum. + * @name google.protobuf.SymbolVisibility + * @enum {number} + * @property {number} VISIBILITY_UNSET=0 VISIBILITY_UNSET value + * @property {number} VISIBILITY_LOCAL=1 VISIBILITY_LOCAL value + * @property {number} VISIBILITY_EXPORT=2 VISIBILITY_EXPORT value + */ + protobuf.SymbolVisibility = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VISIBILITY_UNSET"] = 0; + values[valuesById[1] = "VISIBILITY_LOCAL"] = 1; + values[valuesById[2] = "VISIBILITY_EXPORT"] = 2; + return values; + })(); + protobuf.Duration = (function() { /** diff --git a/packages/google-api-cloudquotas/protos/protos.json b/packages/google-api-cloudquotas/protos/protos.json index 9dd841a8fb3..bcd94381b3e 100644 --- a/packages/google-api-cloudquotas/protos/protos.json +++ b/packages/google-api-cloudquotas/protos/protos.json @@ -8,8 +8,7 @@ "java_multiple_files": true, "java_outer_classname": "ResourceProto", "java_package": "com.google.api", - "objc_class_prefix": "GAPI", - "cc_enable_arenas": true + "objc_class_prefix": "GAPI" }, "nested": { "cloudquotas": { @@ -1653,6 +1652,10 @@ "rule": "repeated", "type": "ClientLibraryDestination", "id": 2 + }, + "selectiveGapicGeneration": { + "type": "SelectiveGapicGeneration", + "id": 3 } } }, @@ -1793,6 +1796,28 @@ "common": { "type": "CommonLanguageSettings", "id": 1 + }, + "experimentalFeatures": { + "type": "ExperimentalFeatures", + "id": 2 + } + }, + "nested": { + "ExperimentalFeatures": { + "fields": { + "restAsyncIoEnabled": { + "type": "bool", + "id": 1 + }, + "protobufPythonicTypesEnabled": { + "type": "bool", + "id": 2 + }, + "unversionedPackageDisabled": { + "type": "bool", + "id": 3 + } + } } } }, @@ -1850,6 +1875,11 @@ "common": { "type": "CommonLanguageSettings", "id": 1 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 } } }, @@ -1911,6 +1941,19 @@ "PACKAGE_MANAGER": 20 } }, + "SelectiveGapicGeneration": { + "fields": { + "methods": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "generateOmittedAsInternal": { + "type": "bool", + "id": 2 + } + } + }, "LaunchStage": { "values": { "LAUNCH_STAGE_UNSPECIFIED": 0, @@ -2043,12 +2086,19 @@ "type": "FileDescriptorProto", "id": 1 } - } + }, + "extensions": [ + [ + 536000000, + 536000000 + ] + ] }, "Edition": { "edition": "proto2", "values": { "EDITION_UNKNOWN": 0, + "EDITION_LEGACY": 900, "EDITION_PROTO2": 998, "EDITION_PROTO3": 999, "EDITION_2023": 1000, @@ -2087,6 +2137,11 @@ "type": "int32", "id": 11 }, + "optionDependency": { + "rule": "repeated", + "type": "string", + "id": 15 + }, "messageType": { "rule": "repeated", "type": "DescriptorProto", @@ -2175,6 +2230,10 @@ "rule": "repeated", "type": "string", "id": 10 + }, + "visibility": { + "type": "SymbolVisibility", + "id": 11 } }, "nested": { @@ -2400,6 +2459,10 @@ "rule": "repeated", "type": "string", "id": 5 + }, + "visibility": { + "type": "SymbolVisibility", + "id": 6 } }, "nested": { @@ -2614,6 +2677,7 @@ 42, 42 ], + "php_generic_services", [ 38, 38 @@ -2749,7 +2813,8 @@ "type": "bool", "id": 10, "options": { - "default": false + "default": false, + "deprecated": true } }, "debugRedact": { @@ -2777,6 +2842,10 @@ "type": "FeatureSet", "id": 21 }, + "featureSupport": { + "type": "FeatureSupport", + "id": 22 + }, "uninterpretedOption": { "rule": "repeated", "type": "UninterpretedOption", @@ -2846,6 +2915,26 @@ "id": 2 } } + }, + "FeatureSupport": { + "fields": { + "editionIntroduced": { + "type": "Edition", + "id": 1 + }, + "editionDeprecated": { + "type": "Edition", + "id": 2 + }, + "deprecationWarning": { + "type": "string", + "id": 3 + }, + "editionRemoved": { + "type": "Edition", + "id": 4 + } + } } } }, @@ -2934,6 +3023,10 @@ "default": false } }, + "featureSupport": { + "type": "FieldOptions.FeatureSupport", + "id": 4 + }, "uninterpretedOption": { "rule": "repeated", "type": "UninterpretedOption", @@ -3076,6 +3169,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_2023", "edition_defaults.value": "EXPLICIT" } @@ -3086,6 +3180,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "OPEN" } @@ -3096,6 +3191,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "PACKED" } @@ -3106,6 +3202,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "VERIFY" } @@ -3116,7 +3213,8 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO2", + "feature_support.edition_introduced": "EDITION_2023", + "edition_defaults.edition": "EDITION_LEGACY", "edition_defaults.value": "LENGTH_PREFIXED" } }, @@ -3126,27 +3224,38 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "ALLOW" } + }, + "enforceNamingStyle": { + "type": "EnforceNamingStyle", + "id": 7, + "options": { + "retention": "RETENTION_SOURCE", + "targets": "TARGET_TYPE_METHOD", + "feature_support.edition_introduced": "EDITION_2024", + "edition_defaults.edition": "EDITION_2024", + "edition_defaults.value": "STYLE2024" + } + }, + "defaultSymbolVisibility": { + "type": "VisibilityFeature.DefaultSymbolVisibility", + "id": 8, + "options": { + "retention": "RETENTION_SOURCE", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2024", + "edition_defaults.edition": "EDITION_2024", + "edition_defaults.value": "EXPORT_TOP_LEVEL" + } } }, "extensions": [ [ 1000, - 1000 - ], - [ - 1001, - 1001 - ], - [ - 1002, - 1002 - ], - [ - 9990, - 9990 + 9994 ], [ 9995, @@ -3191,7 +3300,13 @@ "UTF8_VALIDATION_UNKNOWN": 0, "VERIFY": 2, "NONE": 3 - } + }, + "reserved": [ + [ + 1, + 1 + ] + ] }, "MessageEncoding": { "values": { @@ -3206,6 +3321,33 @@ "ALLOW": 1, "LEGACY_BEST_EFFORT": 2 } + }, + "EnforceNamingStyle": { + "values": { + "ENFORCE_NAMING_STYLE_UNKNOWN": 0, + "STYLE2024": 1, + "STYLE_LEGACY": 2 + } + }, + "VisibilityFeature": { + "fields": {}, + "reserved": [ + [ + 1, + 536870911 + ] + ], + "nested": { + "DefaultSymbolVisibility": { + "values": { + "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN": 0, + "EXPORT_ALL": 1, + "EXPORT_TOP_LEVEL": 2, + "LOCAL_ALL": 3, + "STRICT": 4 + } + } + } } } }, @@ -3233,11 +3375,26 @@ "type": "Edition", "id": 3 }, - "features": { + "overridableFeatures": { "type": "FeatureSet", - "id": 2 + "id": 4 + }, + "fixedFeatures": { + "type": "FeatureSet", + "id": 5 } - } + }, + "reserved": [ + [ + 1, + 1 + ], + [ + 2, + 2 + ], + "features" + ] } } }, @@ -3250,6 +3407,12 @@ "id": 1 } }, + "extensions": [ + [ + 536000000, + 536000000 + ] + ], "nested": { "Location": { "fields": { @@ -3335,6 +3498,14 @@ } } }, + "SymbolVisibility": { + "edition": "proto2", + "values": { + "VISIBILITY_UNSET": 0, + "VISIBILITY_LOCAL": 1, + "VISIBILITY_EXPORT": 2 + } + }, "Duration": { "fields": { "seconds": { diff --git a/packages/google-api-servicecontrol/CHANGELOG.md b/packages/google-api-servicecontrol/CHANGELOG.md index cb80e04f43a..2f993d6f409 100644 --- a/packages/google-api-servicecontrol/CHANGELOG.md +++ b/packages/google-api-servicecontrol/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [4.3.0](https://github.com/googleapis/google-cloud-node/compare/service-control-v4.2.0...service-control-v4.3.0) (2025-07-22) + + +### Features + +* [servicecontrol] ServiceController V2 APIs are out of private preview ([#6513](https://github.com/googleapis/google-cloud-node/issues/6513)) ([ff41730](https://github.com/googleapis/google-cloud-node/commit/ff417302f401a0ef9af47f7e8c43cbc9a2f0d0ba)) + ## [4.2.0](https://github.com/googleapis/google-cloud-node/compare/service-control-v4.1.0...service-control-v4.2.0) (2025-07-09) diff --git a/packages/google-api-servicecontrol/package.json b/packages/google-api-servicecontrol/package.json index f24772a21d3..aeead633f2e 100644 --- a/packages/google-api-servicecontrol/package.json +++ b/packages/google-api-servicecontrol/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/service-control", - "version": "4.2.0", + "version": "4.3.0", "description": "Service control client for Node.js", "repository": { "type": "git", diff --git a/packages/google-api-servicecontrol/protos/google/api/servicecontrol/v2/service_controller.proto b/packages/google-api-servicecontrol/protos/google/api/servicecontrol/v2/service_controller.proto index e616c12394b..e179d1e61a1 100644 --- a/packages/google-api-servicecontrol/protos/google/api/servicecontrol/v2/service_controller.proto +++ b/packages/google-api-servicecontrol/protos/google/api/servicecontrol/v2/service_controller.proto @@ -21,21 +21,17 @@ import "google/api/client.proto"; import "google/rpc/context/attribute_context.proto"; import "google/rpc/status.proto"; -option cc_enable_arenas = true; option csharp_namespace = "Google.Cloud.ServiceControl.V2"; option go_package = "google.golang.org/genproto/googleapis/api/servicecontrol/v2;servicecontrol"; option java_multiple_files = true; option java_outer_classname = "ServiceControllerProto"; option java_package = "com.google.api.servicecontrol.v2"; -option objc_class_prefix = "GASC"; option php_namespace = "Google\\Cloud\\ServiceControl\\V2"; option ruby_package = "Google::Cloud::ServiceControl::V2"; // [Service Control API // v2](https://cloud.google.com/service-infrastructure/docs/service-control/access-control) // -// Private Preview. This feature is only available for approved services. -// // This API provides admission control and telemetry reporting for services // that are integrated with [Service // Infrastructure](https://cloud.google.com/service-infrastructure). @@ -45,8 +41,6 @@ service ServiceController { "https://www.googleapis.com/auth/cloud-platform," "https://www.googleapis.com/auth/servicecontrol"; - // Private Preview. This feature is only available for approved services. - // // This method provides admission control for services that are integrated // with [Service // Infrastructure](https://cloud.google.com/service-infrastructure). It checks @@ -74,8 +68,6 @@ service ServiceController { }; } - // Private Preview. This feature is only available for approved services. - // // This method provides telemetry reporting for services that are integrated // with [Service // Infrastructure](https://cloud.google.com/service-infrastructure). It @@ -84,9 +76,8 @@ service ServiceController { // [Telemetry // Reporting](https://cloud.google.com/service-infrastructure/docs/telemetry-reporting). // - // NOTE: The telemetry reporting has a hard limit of 1000 operations and 1MB - // per Report call. It is recommended to have no more than 100 operations per - // call. + // NOTE: The telemetry reporting has a hard limit of 100 operations and 1MB + // per Report call. // // This method requires the `servicemanagement.services.report` permission // on the specified service. For more information, see @@ -140,16 +131,15 @@ message ResourceInfo { // Optional. The identifier of the container of this resource. For Google // Cloud APIs, the resource container must be one of the following formats: // - `projects/` - // - `folders/` - // - `organizations/` - // For the policy enforcement on the container level (VPCSC and Location - // Policy check), this field takes precedence on the container extracted from - // name when presents. + // - `folders/` + // - `organizations/` + // Required for the policy enforcement on the container level (e.g. VPCSC, + // Location Policy check, Org Policy check). string container = 4; - // Optional. The location of the resource. The value must be a valid zone, - // region or multiregion. For example: "europe-west4" or - // "northamerica-northeast1-a" + // Optional. The location of the resource, it must be a valid zone, region or + // multiregion, for example: "europe-west4", "northamerica-northeast1-a". + // Required for location policy check. string location = 5; } diff --git a/packages/google-api-servicecontrol/protos/protos.d.ts b/packages/google-api-servicecontrol/protos/protos.d.ts index d11510611dc..0db23b49b25 100644 --- a/packages/google-api-servicecontrol/protos/protos.d.ts +++ b/packages/google-api-servicecontrol/protos/protos.d.ts @@ -758,6 +758,7 @@ export namespace google { /** Edition enum. */ enum Edition { EDITION_UNKNOWN = 0, + EDITION_LEGACY = 900, EDITION_PROTO2 = 998, EDITION_PROTO3 = 999, EDITION_2023 = 1000, @@ -788,6 +789,9 @@ export namespace google { /** FileDescriptorProto weakDependency */ weakDependency?: (number[]|null); + /** FileDescriptorProto optionDependency */ + optionDependency?: (string[]|null); + /** FileDescriptorProto messageType */ messageType?: (google.protobuf.IDescriptorProto[]|null); @@ -837,6 +841,9 @@ export namespace google { /** FileDescriptorProto weakDependency. */ public weakDependency: number[]; + /** FileDescriptorProto optionDependency. */ + public optionDependency: string[]; + /** FileDescriptorProto messageType. */ public messageType: google.protobuf.IDescriptorProto[]; @@ -971,6 +978,9 @@ export namespace google { /** DescriptorProto reservedName */ reservedName?: (string[]|null); + + /** DescriptorProto visibility */ + visibility?: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility|null); } /** Represents a DescriptorProto. */ @@ -1012,6 +1022,9 @@ export namespace google { /** DescriptorProto reservedName. */ public reservedName: string[]; + /** DescriptorProto visibility. */ + public visibility: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility); + /** * Creates a new DescriptorProto instance using the specified properties. * @param [properties] Properties to set @@ -1859,6 +1872,9 @@ export namespace google { /** EnumDescriptorProto reservedName */ reservedName?: (string[]|null); + + /** EnumDescriptorProto visibility */ + visibility?: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility|null); } /** Represents an EnumDescriptorProto. */ @@ -1885,6 +1901,9 @@ export namespace google { /** EnumDescriptorProto reservedName. */ public reservedName: string[]; + /** EnumDescriptorProto visibility. */ + public visibility: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility); + /** * Creates a new EnumDescriptorProto instance using the specified properties. * @param [properties] Properties to set @@ -2813,6 +2832,9 @@ export namespace google { /** FieldOptions features */ features?: (google.protobuf.IFeatureSet|null); + /** FieldOptions featureSupport */ + featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** FieldOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); } @@ -2862,6 +2884,9 @@ export namespace google { /** FieldOptions features. */ public features?: (google.protobuf.IFeatureSet|null); + /** FieldOptions featureSupport. */ + public featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** FieldOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; @@ -3082,6 +3107,121 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** Properties of a FeatureSupport. */ + interface IFeatureSupport { + + /** FeatureSupport editionIntroduced */ + editionIntroduced?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSupport editionDeprecated */ + editionDeprecated?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSupport deprecationWarning */ + deprecationWarning?: (string|null); + + /** FeatureSupport editionRemoved */ + editionRemoved?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSupport. */ + class FeatureSupport implements IFeatureSupport { + + /** + * Constructs a new FeatureSupport. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IFeatureSupport); + + /** FeatureSupport editionIntroduced. */ + public editionIntroduced: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSupport editionDeprecated. */ + public editionDeprecated: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSupport deprecationWarning. */ + public deprecationWarning: string; + + /** FeatureSupport editionRemoved. */ + public editionRemoved: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSupport instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSupport instance + */ + public static create(properties?: google.protobuf.FieldOptions.IFeatureSupport): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Encodes the specified FeatureSupport message. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @param message FeatureSupport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IFeatureSupport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSupport message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @param message FeatureSupport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IFeatureSupport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Verifies a FeatureSupport message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSupport message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSupport + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Creates a plain object from a FeatureSupport message. Also converts values to other types if specified. + * @param message FeatureSupport + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.FeatureSupport, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSupport to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSupport + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } /** Properties of an OneofOptions. */ @@ -3320,6 +3460,9 @@ export namespace google { /** EnumValueOptions debugRedact */ debugRedact?: (boolean|null); + /** EnumValueOptions featureSupport */ + featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** EnumValueOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); } @@ -3342,6 +3485,9 @@ export namespace google { /** EnumValueOptions debugRedact. */ public debugRedact: boolean; + /** EnumValueOptions featureSupport. */ + public featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** EnumValueOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; @@ -3931,6 +4077,12 @@ export namespace google { /** FeatureSet jsonFormat */ jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); + + /** FeatureSet enforceNamingStyle */ + enforceNamingStyle?: (google.protobuf.FeatureSet.EnforceNamingStyle|keyof typeof google.protobuf.FeatureSet.EnforceNamingStyle|null); + + /** FeatureSet defaultSymbolVisibility */ + defaultSymbolVisibility?: (google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|keyof typeof google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|null); } /** Represents a FeatureSet. */ @@ -3960,6 +4112,12 @@ export namespace google { /** FeatureSet jsonFormat. */ public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); + /** FeatureSet enforceNamingStyle. */ + public enforceNamingStyle: (google.protobuf.FeatureSet.EnforceNamingStyle|keyof typeof google.protobuf.FeatureSet.EnforceNamingStyle); + + /** FeatureSet defaultSymbolVisibility. */ + public defaultSymbolVisibility: (google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|keyof typeof google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility); + /** * Creates a new FeatureSet instance using the specified properties. * @param [properties] Properties to set @@ -4082,6 +4240,116 @@ export namespace google { ALLOW = 1, LEGACY_BEST_EFFORT = 2 } + + /** EnforceNamingStyle enum. */ + enum EnforceNamingStyle { + ENFORCE_NAMING_STYLE_UNKNOWN = 0, + STYLE2024 = 1, + STYLE_LEGACY = 2 + } + + /** Properties of a VisibilityFeature. */ + interface IVisibilityFeature { + } + + /** Represents a VisibilityFeature. */ + class VisibilityFeature implements IVisibilityFeature { + + /** + * Constructs a new VisibilityFeature. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSet.IVisibilityFeature); + + /** + * Creates a new VisibilityFeature instance using the specified properties. + * @param [properties] Properties to set + * @returns VisibilityFeature instance + */ + public static create(properties?: google.protobuf.FeatureSet.IVisibilityFeature): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Encodes the specified VisibilityFeature message. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @param message VisibilityFeature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSet.IVisibilityFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VisibilityFeature message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @param message VisibilityFeature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSet.IVisibilityFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Verifies a VisibilityFeature message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VisibilityFeature message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VisibilityFeature + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Creates a plain object from a VisibilityFeature message. Also converts values to other types if specified. + * @param message VisibilityFeature + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet.VisibilityFeature, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VisibilityFeature to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VisibilityFeature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace VisibilityFeature { + + /** DefaultSymbolVisibility enum. */ + enum DefaultSymbolVisibility { + DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0, + EXPORT_ALL = 1, + EXPORT_TOP_LEVEL = 2, + LOCAL_ALL = 3, + STRICT = 4 + } + } } /** Properties of a FeatureSetDefaults. */ @@ -4201,8 +4469,11 @@ export namespace google { /** FeatureSetEditionDefault edition */ edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - /** FeatureSetEditionDefault features */ - features?: (google.protobuf.IFeatureSet|null); + /** FeatureSetEditionDefault overridableFeatures */ + overridableFeatures?: (google.protobuf.IFeatureSet|null); + + /** FeatureSetEditionDefault fixedFeatures */ + fixedFeatures?: (google.protobuf.IFeatureSet|null); } /** Represents a FeatureSetEditionDefault. */ @@ -4217,8 +4488,11 @@ export namespace google { /** FeatureSetEditionDefault edition. */ public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - /** FeatureSetEditionDefault features. */ - public features?: (google.protobuf.IFeatureSet|null); + /** FeatureSetEditionDefault overridableFeatures. */ + public overridableFeatures?: (google.protobuf.IFeatureSet|null); + + /** FeatureSetEditionDefault fixedFeatures. */ + public fixedFeatures?: (google.protobuf.IFeatureSet|null); /** * Creates a new FeatureSetEditionDefault instance using the specified properties. @@ -4750,6 +5024,13 @@ export namespace google { } } } + + /** SymbolVisibility enum. */ + enum SymbolVisibility { + VISIBILITY_UNSET = 0, + VISIBILITY_LOCAL = 1, + VISIBILITY_EXPORT = 2 + } } /** Namespace api. */ @@ -9602,6 +9883,9 @@ export namespace google { /** CommonLanguageSettings destinations */ destinations?: (google.api.ClientLibraryDestination[]|null); + + /** CommonLanguageSettings selectiveGapicGeneration */ + selectiveGapicGeneration?: (google.api.ISelectiveGapicGeneration|null); } /** Represents a CommonLanguageSettings. */ @@ -9619,6 +9903,9 @@ export namespace google { /** CommonLanguageSettings destinations. */ public destinations: google.api.ClientLibraryDestination[]; + /** CommonLanguageSettings selectiveGapicGeneration. */ + public selectiveGapicGeneration?: (google.api.ISelectiveGapicGeneration|null); + /** * Creates a new CommonLanguageSettings instance using the specified properties. * @param [properties] Properties to set @@ -10319,6 +10606,9 @@ export namespace google { /** PythonSettings common */ common?: (google.api.ICommonLanguageSettings|null); + + /** PythonSettings experimentalFeatures */ + experimentalFeatures?: (google.api.PythonSettings.IExperimentalFeatures|null); } /** Represents a PythonSettings. */ @@ -10333,6 +10623,9 @@ export namespace google { /** PythonSettings common. */ public common?: (google.api.ICommonLanguageSettings|null); + /** PythonSettings experimentalFeatures. */ + public experimentalFeatures?: (google.api.PythonSettings.IExperimentalFeatures|null); + /** * Creates a new PythonSettings instance using the specified properties. * @param [properties] Properties to set @@ -10411,6 +10704,118 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + namespace PythonSettings { + + /** Properties of an ExperimentalFeatures. */ + interface IExperimentalFeatures { + + /** ExperimentalFeatures restAsyncIoEnabled */ + restAsyncIoEnabled?: (boolean|null); + + /** ExperimentalFeatures protobufPythonicTypesEnabled */ + protobufPythonicTypesEnabled?: (boolean|null); + + /** ExperimentalFeatures unversionedPackageDisabled */ + unversionedPackageDisabled?: (boolean|null); + } + + /** Represents an ExperimentalFeatures. */ + class ExperimentalFeatures implements IExperimentalFeatures { + + /** + * Constructs a new ExperimentalFeatures. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.PythonSettings.IExperimentalFeatures); + + /** ExperimentalFeatures restAsyncIoEnabled. */ + public restAsyncIoEnabled: boolean; + + /** ExperimentalFeatures protobufPythonicTypesEnabled. */ + public protobufPythonicTypesEnabled: boolean; + + /** ExperimentalFeatures unversionedPackageDisabled. */ + public unversionedPackageDisabled: boolean; + + /** + * Creates a new ExperimentalFeatures instance using the specified properties. + * @param [properties] Properties to set + * @returns ExperimentalFeatures instance + */ + public static create(properties?: google.api.PythonSettings.IExperimentalFeatures): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Encodes the specified ExperimentalFeatures message. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @param message ExperimentalFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.PythonSettings.IExperimentalFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExperimentalFeatures message, length delimited. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @param message ExperimentalFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.PythonSettings.IExperimentalFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Verifies an ExperimentalFeatures message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExperimentalFeatures message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExperimentalFeatures + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Creates a plain object from an ExperimentalFeatures message. Also converts values to other types if specified. + * @param message ExperimentalFeatures + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings.ExperimentalFeatures, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExperimentalFeatures to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExperimentalFeatures + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + /** Properties of a NodeSettings. */ interface INodeSettings { @@ -10737,6 +11142,9 @@ export namespace google { /** GoSettings common */ common?: (google.api.ICommonLanguageSettings|null); + + /** GoSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|null); } /** Represents a GoSettings. */ @@ -10751,6 +11159,9 @@ export namespace google { /** GoSettings common. */ public common?: (google.api.ICommonLanguageSettings|null); + /** GoSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + /** * Creates a new GoSettings instance using the specified properties. * @param [properties] Properties to set @@ -11075,6 +11486,109 @@ export namespace google { PACKAGE_MANAGER = 20 } + /** Properties of a SelectiveGapicGeneration. */ + interface ISelectiveGapicGeneration { + + /** SelectiveGapicGeneration methods */ + methods?: (string[]|null); + + /** SelectiveGapicGeneration generateOmittedAsInternal */ + generateOmittedAsInternal?: (boolean|null); + } + + /** Represents a SelectiveGapicGeneration. */ + class SelectiveGapicGeneration implements ISelectiveGapicGeneration { + + /** + * Constructs a new SelectiveGapicGeneration. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ISelectiveGapicGeneration); + + /** SelectiveGapicGeneration methods. */ + public methods: string[]; + + /** SelectiveGapicGeneration generateOmittedAsInternal. */ + public generateOmittedAsInternal: boolean; + + /** + * Creates a new SelectiveGapicGeneration instance using the specified properties. + * @param [properties] Properties to set + * @returns SelectiveGapicGeneration instance + */ + public static create(properties?: google.api.ISelectiveGapicGeneration): google.api.SelectiveGapicGeneration; + + /** + * Encodes the specified SelectiveGapicGeneration message. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @param message SelectiveGapicGeneration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ISelectiveGapicGeneration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SelectiveGapicGeneration message, length delimited. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @param message SelectiveGapicGeneration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ISelectiveGapicGeneration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.SelectiveGapicGeneration; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.SelectiveGapicGeneration; + + /** + * Verifies a SelectiveGapicGeneration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SelectiveGapicGeneration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SelectiveGapicGeneration + */ + public static fromObject(object: { [k: string]: any }): google.api.SelectiveGapicGeneration; + + /** + * Creates a plain object from a SelectiveGapicGeneration message. Also converts values to other types if specified. + * @param message SelectiveGapicGeneration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.SelectiveGapicGeneration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SelectiveGapicGeneration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SelectiveGapicGeneration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** LaunchStage enum. */ enum LaunchStage { LAUNCH_STAGE_UNSPECIFIED = 0, diff --git a/packages/google-api-servicecontrol/protos/protos.js b/packages/google-api-servicecontrol/protos/protos.js index ebaa0073f24..cf9702b27c3 100644 --- a/packages/google-api-servicecontrol/protos/protos.js +++ b/packages/google-api-servicecontrol/protos/protos.js @@ -1882,6 +1882,7 @@ * @name google.protobuf.Edition * @enum {number} * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value + * @property {number} EDITION_LEGACY=900 EDITION_LEGACY value * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value * @property {number} EDITION_2023=1000 EDITION_2023 value @@ -1896,6 +1897,7 @@ protobuf.Edition = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "EDITION_UNKNOWN"] = 0; + values[valuesById[900] = "EDITION_LEGACY"] = 900; values[valuesById[998] = "EDITION_PROTO2"] = 998; values[valuesById[999] = "EDITION_PROTO3"] = 999; values[valuesById[1000] = "EDITION_2023"] = 1000; @@ -1920,6 +1922,7 @@ * @property {Array.|null} [dependency] FileDescriptorProto dependency * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [optionDependency] FileDescriptorProto optionDependency * @property {Array.|null} [messageType] FileDescriptorProto messageType * @property {Array.|null} [enumType] FileDescriptorProto enumType * @property {Array.|null} [service] FileDescriptorProto service @@ -1942,6 +1945,7 @@ this.dependency = []; this.publicDependency = []; this.weakDependency = []; + this.optionDependency = []; this.messageType = []; this.enumType = []; this.service = []; @@ -1992,6 +1996,14 @@ */ FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + /** + * FileDescriptorProto optionDependency. + * @member {Array.} optionDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.optionDependency = $util.emptyArray; + /** * FileDescriptorProto messageType. * @member {Array.} messageType @@ -2113,6 +2125,9 @@ writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); + if (message.optionDependency != null && message.optionDependency.length) + for (var i = 0; i < message.optionDependency.length; ++i) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.optionDependency[i]); return writer; }; @@ -2185,6 +2200,12 @@ message.weakDependency.push(reader.int32()); break; } + case 15: { + if (!(message.optionDependency && message.optionDependency.length)) + message.optionDependency = []; + message.optionDependency.push(reader.string()); + break; + } case 4: { if (!(message.messageType && message.messageType.length)) message.messageType = []; @@ -2287,6 +2308,13 @@ if (!$util.isInteger(message.weakDependency[i])) return "weakDependency: integer[] expected"; } + if (message.optionDependency != null && message.hasOwnProperty("optionDependency")) { + if (!Array.isArray(message.optionDependency)) + return "optionDependency: array expected"; + for (var i = 0; i < message.optionDependency.length; ++i) + if (!$util.isString(message.optionDependency[i])) + return "optionDependency: string[] expected"; + } if (message.messageType != null && message.hasOwnProperty("messageType")) { if (!Array.isArray(message.messageType)) return "messageType: array expected"; @@ -2341,6 +2369,7 @@ default: return "edition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -2393,6 +2422,13 @@ for (var i = 0; i < object.weakDependency.length; ++i) message.weakDependency[i] = object.weakDependency[i] | 0; } + if (object.optionDependency) { + if (!Array.isArray(object.optionDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.optionDependency: array expected"); + message.optionDependency = []; + for (var i = 0; i < object.optionDependency.length; ++i) + message.optionDependency[i] = String(object.optionDependency[i]); + } if (object.messageType) { if (!Array.isArray(object.messageType)) throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); @@ -2456,6 +2492,10 @@ case 0: message.edition = 0; break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; case "EDITION_PROTO2": case 998: message.edition = 998; @@ -2521,6 +2561,7 @@ object.extension = []; object.publicDependency = []; object.weakDependency = []; + object.optionDependency = []; } if (options.defaults) { object.name = ""; @@ -2577,6 +2618,11 @@ object.syntax = message.syntax; if (message.edition != null && message.hasOwnProperty("edition")) object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + if (message.optionDependency && message.optionDependency.length) { + object.optionDependency = []; + for (var j = 0; j < message.optionDependency.length; ++j) + object.optionDependency[j] = message.optionDependency[j]; + } return object; }; @@ -2625,6 +2671,7 @@ * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options * @property {Array.|null} [reservedRange] DescriptorProto reservedRange * @property {Array.|null} [reservedName] DescriptorProto reservedName + * @property {google.protobuf.SymbolVisibility|null} [visibility] DescriptorProto visibility */ /** @@ -2730,6 +2777,14 @@ */ DescriptorProto.prototype.reservedName = $util.emptyArray; + /** + * DescriptorProto visibility. + * @member {google.protobuf.SymbolVisibility} visibility + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.visibility = 0; + /** * Creates a new DescriptorProto instance using the specified properties. * @function create @@ -2782,6 +2837,8 @@ if (message.reservedName != null && message.reservedName.length) for (var i = 0; i < message.reservedName.length; ++i) writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.visibility); return writer; }; @@ -2874,6 +2931,10 @@ message.reservedName.push(reader.string()); break; } + case 11: { + message.visibility = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -2987,6 +3048,15 @@ if (!$util.isString(message.reservedName[i])) return "reservedName: string[] expected"; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + switch (message.visibility) { + default: + return "visibility: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; @@ -3086,6 +3156,26 @@ for (var i = 0; i < object.reservedName.length; ++i) message.reservedName[i] = String(object.reservedName[i]); } + switch (object.visibility) { + default: + if (typeof object.visibility === "number") { + message.visibility = object.visibility; + break; + } + break; + case "VISIBILITY_UNSET": + case 0: + message.visibility = 0; + break; + case "VISIBILITY_LOCAL": + case 1: + message.visibility = 1; + break; + case "VISIBILITY_EXPORT": + case 2: + message.visibility = 2; + break; + } return message; }; @@ -3115,6 +3205,7 @@ if (options.defaults) { object.name = ""; object.options = null; + object.visibility = options.enums === String ? "VISIBILITY_UNSET" : 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -3160,6 +3251,8 @@ for (var j = 0; j < message.reservedName.length; ++j) object.reservedName[j] = message.reservedName[j]; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + object.visibility = options.enums === String ? $root.google.protobuf.SymbolVisibility[message.visibility] === undefined ? message.visibility : $root.google.protobuf.SymbolVisibility[message.visibility] : message.visibility; return object; }; @@ -5204,6 +5297,7 @@ * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + * @property {google.protobuf.SymbolVisibility|null} [visibility] EnumDescriptorProto visibility */ /** @@ -5264,6 +5358,14 @@ */ EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + /** + * EnumDescriptorProto visibility. + * @member {google.protobuf.SymbolVisibility} visibility + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.visibility = 0; + /** * Creates a new EnumDescriptorProto instance using the specified properties. * @function create @@ -5301,6 +5403,8 @@ if (message.reservedName != null && message.reservedName.length) for (var i = 0; i < message.reservedName.length; ++i) writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.visibility); return writer; }; @@ -5363,6 +5467,10 @@ message.reservedName.push(reader.string()); break; } + case 6: { + message.visibility = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -5431,6 +5539,15 @@ if (!$util.isString(message.reservedName[i])) return "reservedName: string[] expected"; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + switch (message.visibility) { + default: + return "visibility: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; @@ -5480,6 +5597,26 @@ for (var i = 0; i < object.reservedName.length; ++i) message.reservedName[i] = String(object.reservedName[i]); } + switch (object.visibility) { + default: + if (typeof object.visibility === "number") { + message.visibility = object.visibility; + break; + } + break; + case "VISIBILITY_UNSET": + case 0: + message.visibility = 0; + break; + case "VISIBILITY_LOCAL": + case 1: + message.visibility = 1; + break; + case "VISIBILITY_EXPORT": + case 2: + message.visibility = 2; + break; + } return message; }; @@ -5504,6 +5641,7 @@ if (options.defaults) { object.name = ""; object.options = null; + object.visibility = options.enums === String ? "VISIBILITY_UNSET" : 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -5524,6 +5662,8 @@ for (var j = 0; j < message.reservedName.length; ++j) object.reservedName[j] = message.reservedName[j]; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + object.visibility = options.enums === String ? $root.google.protobuf.SymbolVisibility[message.visibility] === undefined ? message.visibility : $root.google.protobuf.SymbolVisibility[message.visibility] : message.visibility; return object; }; @@ -7769,6 +7909,7 @@ * @property {Array.|null} [targets] FieldOptions targets * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features + * @property {google.protobuf.FieldOptions.IFeatureSupport|null} [featureSupport] FieldOptions featureSupport * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption */ @@ -7886,6 +8027,14 @@ */ FieldOptions.prototype.features = null; + /** + * FieldOptions featureSupport. + * @member {google.protobuf.FieldOptions.IFeatureSupport|null|undefined} featureSupport + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.featureSupport = null; + /** * FieldOptions uninterpretedOption. * @member {Array.} uninterpretedOption @@ -7944,6 +8093,8 @@ $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); if (message.features != null && Object.hasOwnProperty.call(message, "features")) $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) + $root.google.protobuf.FieldOptions.FeatureSupport.encode(message.featureSupport, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); @@ -8040,6 +8191,10 @@ message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); break; } + case 22: { + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.decode(reader, reader.uint32()); + break; + } case 999: { if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; @@ -8160,6 +8315,11 @@ if (error) return "features." + error; } + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) { + var error = $root.google.protobuf.FieldOptions.FeatureSupport.verify(message.featureSupport); + if (error) + return "featureSupport." + error; + } if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; @@ -8324,6 +8484,11 @@ throw TypeError(".google.protobuf.FieldOptions.features: object expected"); message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); } + if (object.featureSupport != null) { + if (typeof object.featureSupport !== "object") + throw TypeError(".google.protobuf.FieldOptions.featureSupport: object expected"); + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.fromObject(object.featureSupport); + } if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); @@ -8366,6 +8531,7 @@ object.debugRedact = false; object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; object.features = null; + object.featureSupport = null; } if (message.ctype != null && message.hasOwnProperty("ctype")) object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; @@ -8397,6 +8563,8 @@ } if (message.features != null && message.hasOwnProperty("features")) object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) + object.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.toObject(message.featureSupport, options); if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) @@ -8662,6 +8830,7 @@ default: return "edition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -8703,6 +8872,10 @@ case 0: message.edition = 0; break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; case "EDITION_PROTO2": case 998: message.edition = 998; @@ -8802,122 +8975,604 @@ return EditionDefault; })(); - return FieldOptions; - })(); + FieldOptions.FeatureSupport = (function() { - protobuf.OneofOptions = (function() { + /** + * Properties of a FeatureSupport. + * @memberof google.protobuf.FieldOptions + * @interface IFeatureSupport + * @property {google.protobuf.Edition|null} [editionIntroduced] FeatureSupport editionIntroduced + * @property {google.protobuf.Edition|null} [editionDeprecated] FeatureSupport editionDeprecated + * @property {string|null} [deprecationWarning] FeatureSupport deprecationWarning + * @property {google.protobuf.Edition|null} [editionRemoved] FeatureSupport editionRemoved + */ - /** - * Properties of an OneofOptions. - * @memberof google.protobuf - * @interface IOneofOptions - * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features - * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption - */ + /** + * Constructs a new FeatureSupport. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents a FeatureSupport. + * @implements IFeatureSupport + * @constructor + * @param {google.protobuf.FieldOptions.IFeatureSupport=} [properties] Properties to set + */ + function FeatureSupport(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Constructs a new OneofOptions. - * @memberof google.protobuf - * @classdesc Represents an OneofOptions. - * @implements IOneofOptions - * @constructor - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set - */ - function OneofOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * FeatureSupport editionIntroduced. + * @member {google.protobuf.Edition} editionIntroduced + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionIntroduced = 0; - /** - * OneofOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.OneofOptions - * @instance - */ - OneofOptions.prototype.features = null; + /** + * FeatureSupport editionDeprecated. + * @member {google.protobuf.Edition} editionDeprecated + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionDeprecated = 0; - /** - * OneofOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.OneofOptions - * @instance - */ - OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + /** + * FeatureSupport deprecationWarning. + * @member {string} deprecationWarning + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.deprecationWarning = ""; - /** - * Creates a new OneofOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set - * @returns {google.protobuf.OneofOptions} OneofOptions instance - */ - OneofOptions.create = function create(properties) { - return new OneofOptions(properties); - }; + /** + * FeatureSupport editionRemoved. + * @member {google.protobuf.Edition} editionRemoved + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionRemoved = 0; - /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; + /** + * Creates a new FeatureSupport instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport instance + */ + FeatureSupport.create = function create(properties) { + return new FeatureSupport(properties); + }; - /** - * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified FeatureSupport message. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport} message FeatureSupport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSupport.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.editionIntroduced != null && Object.hasOwnProperty.call(message, "editionIntroduced")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.editionIntroduced); + if (message.editionDeprecated != null && Object.hasOwnProperty.call(message, "editionDeprecated")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.editionDeprecated); + if (message.deprecationWarning != null && Object.hasOwnProperty.call(message, "deprecationWarning")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.deprecationWarning); + if (message.editionRemoved != null && Object.hasOwnProperty.call(message, "editionRemoved")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.editionRemoved); + return writer; + }; - /** - * Decodes an OneofOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.OneofOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofOptions} OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + /** + * Encodes the specified FeatureSupport message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport} message FeatureSupport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSupport.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSupport.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.FeatureSupport(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.editionIntroduced = reader.int32(); + break; + } + case 2: { + message.editionDeprecated = reader.int32(); + break; + } + case 3: { + message.deprecationWarning = reader.string(); + break; + } + case 4: { + message.editionRemoved = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); break; } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + } + return message; + }; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSupport.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSupport message. + * @function verify + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSupport.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.editionIntroduced != null && message.hasOwnProperty("editionIntroduced")) + switch (message.editionIntroduced) { + default: + return "editionIntroduced: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.editionDeprecated != null && message.hasOwnProperty("editionDeprecated")) + switch (message.editionDeprecated) { + default: + return "editionDeprecated: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.deprecationWarning != null && message.hasOwnProperty("deprecationWarning")) + if (!$util.isString(message.deprecationWarning)) + return "deprecationWarning: string expected"; + if (message.editionRemoved != null && message.hasOwnProperty("editionRemoved")) + switch (message.editionRemoved) { + default: + return "editionRemoved: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FeatureSupport message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + */ + FeatureSupport.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions.FeatureSupport) + return object; + var message = new $root.google.protobuf.FieldOptions.FeatureSupport(); + switch (object.editionIntroduced) { + default: + if (typeof object.editionIntroduced === "number") { + message.editionIntroduced = object.editionIntroduced; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionIntroduced = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionIntroduced = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionIntroduced = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionIntroduced = 999; + break; + case "EDITION_2023": + case 1000: + message.editionIntroduced = 1000; + break; + case "EDITION_2024": + case 1001: + message.editionIntroduced = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.editionIntroduced = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.editionIntroduced = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.editionIntroduced = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.editionIntroduced = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.editionIntroduced = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.editionIntroduced = 2147483647; + break; + } + switch (object.editionDeprecated) { + default: + if (typeof object.editionDeprecated === "number") { + message.editionDeprecated = object.editionDeprecated; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionDeprecated = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionDeprecated = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionDeprecated = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionDeprecated = 999; + break; + case "EDITION_2023": + case 1000: + message.editionDeprecated = 1000; + break; + case "EDITION_2024": + case 1001: + message.editionDeprecated = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.editionDeprecated = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.editionDeprecated = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.editionDeprecated = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.editionDeprecated = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.editionDeprecated = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.editionDeprecated = 2147483647; + break; + } + if (object.deprecationWarning != null) + message.deprecationWarning = String(object.deprecationWarning); + switch (object.editionRemoved) { + default: + if (typeof object.editionRemoved === "number") { + message.editionRemoved = object.editionRemoved; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionRemoved = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionRemoved = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionRemoved = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionRemoved = 999; + break; + case "EDITION_2023": + case 1000: + message.editionRemoved = 1000; + break; + case "EDITION_2024": + case 1001: + message.editionRemoved = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.editionRemoved = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.editionRemoved = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.editionRemoved = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.editionRemoved = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.editionRemoved = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.editionRemoved = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSupport message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.FeatureSupport} message FeatureSupport + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSupport.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.editionIntroduced = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.editionDeprecated = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.deprecationWarning = ""; + object.editionRemoved = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.editionIntroduced != null && message.hasOwnProperty("editionIntroduced")) + object.editionIntroduced = options.enums === String ? $root.google.protobuf.Edition[message.editionIntroduced] === undefined ? message.editionIntroduced : $root.google.protobuf.Edition[message.editionIntroduced] : message.editionIntroduced; + if (message.editionDeprecated != null && message.hasOwnProperty("editionDeprecated")) + object.editionDeprecated = options.enums === String ? $root.google.protobuf.Edition[message.editionDeprecated] === undefined ? message.editionDeprecated : $root.google.protobuf.Edition[message.editionDeprecated] : message.editionDeprecated; + if (message.deprecationWarning != null && message.hasOwnProperty("deprecationWarning")) + object.deprecationWarning = message.deprecationWarning; + if (message.editionRemoved != null && message.hasOwnProperty("editionRemoved")) + object.editionRemoved = options.enums === String ? $root.google.protobuf.Edition[message.editionRemoved] === undefined ? message.editionRemoved : $root.google.protobuf.Edition[message.editionRemoved] : message.editionRemoved; + return object; + }; + + /** + * Converts this FeatureSupport to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + * @returns {Object.} JSON object + */ + FeatureSupport.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSupport + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSupport.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.FeatureSupport"; + }; + + return FeatureSupport; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.features = null; + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; @@ -9394,6 +10049,7 @@ * @property {boolean|null} [deprecated] EnumValueOptions deprecated * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact + * @property {google.protobuf.FieldOptions.IFeatureSupport|null} [featureSupport] EnumValueOptions featureSupport * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption */ @@ -9437,6 +10093,14 @@ */ EnumValueOptions.prototype.debugRedact = false; + /** + * EnumValueOptions featureSupport. + * @member {google.protobuf.FieldOptions.IFeatureSupport|null|undefined} featureSupport + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.featureSupport = null; + /** * EnumValueOptions uninterpretedOption. * @member {Array.} uninterpretedOption @@ -9475,6 +10139,8 @@ $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); + if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) + $root.google.protobuf.FieldOptions.FeatureSupport.encode(message.featureSupport, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); @@ -9526,6 +10192,10 @@ message.debugRedact = reader.bool(); break; } + case 4: { + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.decode(reader, reader.uint32()); + break; + } case 999: { if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; @@ -9578,6 +10248,11 @@ if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) if (typeof message.debugRedact !== "boolean") return "debugRedact: boolean expected"; + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) { + var error = $root.google.protobuf.FieldOptions.FeatureSupport.verify(message.featureSupport); + if (error) + return "featureSupport." + error; + } if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; @@ -9611,6 +10286,11 @@ } if (object.debugRedact != null) message.debugRedact = Boolean(object.debugRedact); + if (object.featureSupport != null) { + if (typeof object.featureSupport !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.featureSupport: object expected"); + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.fromObject(object.featureSupport); + } if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); @@ -9643,6 +10323,7 @@ object.deprecated = false; object.features = null; object.debugRedact = false; + object.featureSupport = null; } if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; @@ -9650,6 +10331,8 @@ object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) object.debugRedact = message.debugRedact; + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) + object.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.toObject(message.featureSupport, options); if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) @@ -11089,6 +11772,8 @@ * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat + * @property {google.protobuf.FeatureSet.EnforceNamingStyle|null} [enforceNamingStyle] FeatureSet enforceNamingStyle + * @property {google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|null} [defaultSymbolVisibility] FeatureSet defaultSymbolVisibility */ /** @@ -11154,6 +11839,22 @@ */ FeatureSet.prototype.jsonFormat = 0; + /** + * FeatureSet enforceNamingStyle. + * @member {google.protobuf.FeatureSet.EnforceNamingStyle} enforceNamingStyle + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enforceNamingStyle = 0; + + /** + * FeatureSet defaultSymbolVisibility. + * @member {google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility} defaultSymbolVisibility + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.defaultSymbolVisibility = 0; + /** * Creates a new FeatureSet instance using the specified properties. * @function create @@ -11190,6 +11891,10 @@ writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); + if (message.enforceNamingStyle != null && Object.hasOwnProperty.call(message, "enforceNamingStyle")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.enforceNamingStyle); + if (message.defaultSymbolVisibility != null && Object.hasOwnProperty.call(message, "defaultSymbolVisibility")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.defaultSymbolVisibility); return writer; }; @@ -11250,6 +11955,14 @@ message.jsonFormat = reader.int32(); break; } + case 7: { + message.enforceNamingStyle = reader.int32(); + break; + } + case 8: { + message.defaultSymbolVisibility = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -11340,6 +12053,26 @@ case 2: break; } + if (message.enforceNamingStyle != null && message.hasOwnProperty("enforceNamingStyle")) + switch (message.enforceNamingStyle) { + default: + return "enforceNamingStyle: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.defaultSymbolVisibility != null && message.hasOwnProperty("defaultSymbolVisibility")) + switch (message.defaultSymbolVisibility) { + default: + return "defaultSymbolVisibility: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } return null; }; @@ -11479,6 +12212,54 @@ message.jsonFormat = 2; break; } + switch (object.enforceNamingStyle) { + default: + if (typeof object.enforceNamingStyle === "number") { + message.enforceNamingStyle = object.enforceNamingStyle; + break; + } + break; + case "ENFORCE_NAMING_STYLE_UNKNOWN": + case 0: + message.enforceNamingStyle = 0; + break; + case "STYLE2024": + case 1: + message.enforceNamingStyle = 1; + break; + case "STYLE_LEGACY": + case 2: + message.enforceNamingStyle = 2; + break; + } + switch (object.defaultSymbolVisibility) { + default: + if (typeof object.defaultSymbolVisibility === "number") { + message.defaultSymbolVisibility = object.defaultSymbolVisibility; + break; + } + break; + case "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN": + case 0: + message.defaultSymbolVisibility = 0; + break; + case "EXPORT_ALL": + case 1: + message.defaultSymbolVisibility = 1; + break; + case "EXPORT_TOP_LEVEL": + case 2: + message.defaultSymbolVisibility = 2; + break; + case "LOCAL_ALL": + case 3: + message.defaultSymbolVisibility = 3; + break; + case "STRICT": + case 4: + message.defaultSymbolVisibility = 4; + break; + } return message; }; @@ -11502,6 +12283,8 @@ object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; + object.enforceNamingStyle = options.enums === String ? "ENFORCE_NAMING_STYLE_UNKNOWN" : 0; + object.defaultSymbolVisibility = options.enums === String ? "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN" : 0; } if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; @@ -11515,6 +12298,10 @@ object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; + if (message.enforceNamingStyle != null && message.hasOwnProperty("enforceNamingStyle")) + object.enforceNamingStyle = options.enums === String ? $root.google.protobuf.FeatureSet.EnforceNamingStyle[message.enforceNamingStyle] === undefined ? message.enforceNamingStyle : $root.google.protobuf.FeatureSet.EnforceNamingStyle[message.enforceNamingStyle] : message.enforceNamingStyle; + if (message.defaultSymbolVisibility != null && message.hasOwnProperty("defaultSymbolVisibility")) + object.defaultSymbolVisibility = options.enums === String ? $root.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility[message.defaultSymbolVisibility] === undefined ? message.defaultSymbolVisibility : $root.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility[message.defaultSymbolVisibility] : message.defaultSymbolVisibility; return object; }; @@ -11594,52 +12381,265 @@ return values; })(); - /** - * Utf8Validation enum. - * @name google.protobuf.FeatureSet.Utf8Validation - * @enum {number} - * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value - * @property {number} VERIFY=2 VERIFY value - * @property {number} NONE=3 NONE value - */ - FeatureSet.Utf8Validation = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; - values[valuesById[2] = "VERIFY"] = 2; - values[valuesById[3] = "NONE"] = 3; - return values; - })(); + /** + * Utf8Validation enum. + * @name google.protobuf.FeatureSet.Utf8Validation + * @enum {number} + * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value + * @property {number} VERIFY=2 VERIFY value + * @property {number} NONE=3 NONE value + */ + FeatureSet.Utf8Validation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; + values[valuesById[2] = "VERIFY"] = 2; + values[valuesById[3] = "NONE"] = 3; + return values; + })(); + + /** + * MessageEncoding enum. + * @name google.protobuf.FeatureSet.MessageEncoding + * @enum {number} + * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value + * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value + * @property {number} DELIMITED=2 DELIMITED value + */ + FeatureSet.MessageEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "LENGTH_PREFIXED"] = 1; + values[valuesById[2] = "DELIMITED"] = 2; + return values; + })(); + + /** + * JsonFormat enum. + * @name google.protobuf.FeatureSet.JsonFormat + * @enum {number} + * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value + * @property {number} ALLOW=1 ALLOW value + * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value + */ + FeatureSet.JsonFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; + values[valuesById[1] = "ALLOW"] = 1; + values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; + return values; + })(); + + /** + * EnforceNamingStyle enum. + * @name google.protobuf.FeatureSet.EnforceNamingStyle + * @enum {number} + * @property {number} ENFORCE_NAMING_STYLE_UNKNOWN=0 ENFORCE_NAMING_STYLE_UNKNOWN value + * @property {number} STYLE2024=1 STYLE2024 value + * @property {number} STYLE_LEGACY=2 STYLE_LEGACY value + */ + FeatureSet.EnforceNamingStyle = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENFORCE_NAMING_STYLE_UNKNOWN"] = 0; + values[valuesById[1] = "STYLE2024"] = 1; + values[valuesById[2] = "STYLE_LEGACY"] = 2; + return values; + })(); + + FeatureSet.VisibilityFeature = (function() { + + /** + * Properties of a VisibilityFeature. + * @memberof google.protobuf.FeatureSet + * @interface IVisibilityFeature + */ + + /** + * Constructs a new VisibilityFeature. + * @memberof google.protobuf.FeatureSet + * @classdesc Represents a VisibilityFeature. + * @implements IVisibilityFeature + * @constructor + * @param {google.protobuf.FeatureSet.IVisibilityFeature=} [properties] Properties to set + */ + function VisibilityFeature(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new VisibilityFeature instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature instance + */ + VisibilityFeature.create = function create(properties) { + return new VisibilityFeature(properties); + }; + + /** + * Encodes the specified VisibilityFeature message. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature} message VisibilityFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VisibilityFeature.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified VisibilityFeature message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature} message VisibilityFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VisibilityFeature.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VisibilityFeature.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet.VisibilityFeature(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VisibilityFeature.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VisibilityFeature message. + * @function verify + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VisibilityFeature.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a VisibilityFeature message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + */ + VisibilityFeature.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSet.VisibilityFeature) + return object; + return new $root.google.protobuf.FeatureSet.VisibilityFeature(); + }; + + /** + * Creates a plain object from a VisibilityFeature message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.VisibilityFeature} message VisibilityFeature + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VisibilityFeature.toObject = function toObject() { + return {}; + }; + + /** + * Converts this VisibilityFeature to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @instance + * @returns {Object.} JSON object + */ + VisibilityFeature.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VisibilityFeature + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VisibilityFeature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet.VisibilityFeature"; + }; - /** - * MessageEncoding enum. - * @name google.protobuf.FeatureSet.MessageEncoding - * @enum {number} - * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value - * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value - * @property {number} DELIMITED=2 DELIMITED value - */ - FeatureSet.MessageEncoding = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; - values[valuesById[1] = "LENGTH_PREFIXED"] = 1; - values[valuesById[2] = "DELIMITED"] = 2; - return values; - })(); + /** + * DefaultSymbolVisibility enum. + * @name google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility + * @enum {number} + * @property {number} DEFAULT_SYMBOL_VISIBILITY_UNKNOWN=0 DEFAULT_SYMBOL_VISIBILITY_UNKNOWN value + * @property {number} EXPORT_ALL=1 EXPORT_ALL value + * @property {number} EXPORT_TOP_LEVEL=2 EXPORT_TOP_LEVEL value + * @property {number} LOCAL_ALL=3 LOCAL_ALL value + * @property {number} STRICT=4 STRICT value + */ + VisibilityFeature.DefaultSymbolVisibility = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN"] = 0; + values[valuesById[1] = "EXPORT_ALL"] = 1; + values[valuesById[2] = "EXPORT_TOP_LEVEL"] = 2; + values[valuesById[3] = "LOCAL_ALL"] = 3; + values[valuesById[4] = "STRICT"] = 4; + return values; + })(); - /** - * JsonFormat enum. - * @name google.protobuf.FeatureSet.JsonFormat - * @enum {number} - * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value - * @property {number} ALLOW=1 ALLOW value - * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value - */ - FeatureSet.JsonFormat = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; - values[valuesById[1] = "ALLOW"] = 1; - values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; - return values; + return VisibilityFeature; })(); return FeatureSet; @@ -11826,6 +12826,7 @@ default: return "minimumEdition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -11843,6 +12844,7 @@ default: return "maximumEdition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -11891,6 +12893,10 @@ case 0: message.minimumEdition = 0; break; + case "EDITION_LEGACY": + case 900: + message.minimumEdition = 900; + break; case "EDITION_PROTO2": case 998: message.minimumEdition = 998; @@ -11943,6 +12949,10 @@ case 0: message.maximumEdition = 0; break; + case "EDITION_LEGACY": + case 900: + message.maximumEdition = 900; + break; case "EDITION_PROTO2": case 998: message.maximumEdition = 998; @@ -12051,7 +13061,8 @@ * @memberof google.protobuf.FeatureSetDefaults * @interface IFeatureSetEditionDefault * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition - * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features + * @property {google.protobuf.IFeatureSet|null} [overridableFeatures] FeatureSetEditionDefault overridableFeatures + * @property {google.protobuf.IFeatureSet|null} [fixedFeatures] FeatureSetEditionDefault fixedFeatures */ /** @@ -12078,12 +13089,20 @@ FeatureSetEditionDefault.prototype.edition = 0; /** - * FeatureSetEditionDefault features. - * @member {google.protobuf.IFeatureSet|null|undefined} features + * FeatureSetEditionDefault overridableFeatures. + * @member {google.protobuf.IFeatureSet|null|undefined} overridableFeatures + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.overridableFeatures = null; + + /** + * FeatureSetEditionDefault fixedFeatures. + * @member {google.protobuf.IFeatureSet|null|undefined} fixedFeatures * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault * @instance */ - FeatureSetEditionDefault.prototype.features = null; + FeatureSetEditionDefault.prototype.fixedFeatures = null; /** * Creates a new FeatureSetEditionDefault instance using the specified properties. @@ -12109,10 +13128,12 @@ FeatureSetEditionDefault.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + if (message.overridableFeatures != null && Object.hasOwnProperty.call(message, "overridableFeatures")) + $root.google.protobuf.FeatureSet.encode(message.overridableFeatures, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.fixedFeatures != null && Object.hasOwnProperty.call(message, "fixedFeatures")) + $root.google.protobuf.FeatureSet.encode(message.fixedFeatures, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -12153,8 +13174,12 @@ message.edition = reader.int32(); break; } - case 2: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + case 4: { + message.overridableFeatures = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 5: { + message.fixedFeatures = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); break; } default: @@ -12197,6 +13222,7 @@ default: return "edition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -12209,10 +13235,15 @@ case 2147483647: break; } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (message.overridableFeatures != null && message.hasOwnProperty("overridableFeatures")) { + var error = $root.google.protobuf.FeatureSet.verify(message.overridableFeatures); if (error) - return "features." + error; + return "overridableFeatures." + error; + } + if (message.fixedFeatures != null && message.hasOwnProperty("fixedFeatures")) { + var error = $root.google.protobuf.FeatureSet.verify(message.fixedFeatures); + if (error) + return "fixedFeatures." + error; } return null; }; @@ -12240,6 +13271,10 @@ case 0: message.edition = 0; break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; case "EDITION_PROTO2": case 998: message.edition = 998; @@ -12281,10 +13316,15 @@ message.edition = 2147483647; break; } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + if (object.overridableFeatures != null) { + if (typeof object.overridableFeatures !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.overridableFeatures: object expected"); + message.overridableFeatures = $root.google.protobuf.FeatureSet.fromObject(object.overridableFeatures); + } + if (object.fixedFeatures != null) { + if (typeof object.fixedFeatures !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fixedFeatures: object expected"); + message.fixedFeatures = $root.google.protobuf.FeatureSet.fromObject(object.fixedFeatures); } return message; }; @@ -12303,13 +13343,16 @@ options = {}; var object = {}; if (options.defaults) { - object.features = null; object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.overridableFeatures = null; + object.fixedFeatures = null; } - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); if (message.edition != null && message.hasOwnProperty("edition")) object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + if (message.overridableFeatures != null && message.hasOwnProperty("overridableFeatures")) + object.overridableFeatures = $root.google.protobuf.FeatureSet.toObject(message.overridableFeatures, options); + if (message.fixedFeatures != null && message.hasOwnProperty("fixedFeatures")) + object.fixedFeatures = $root.google.protobuf.FeatureSet.toObject(message.fixedFeatures, options); return object; }; @@ -13524,6 +14567,22 @@ return GeneratedCodeInfo; })(); + /** + * SymbolVisibility enum. + * @name google.protobuf.SymbolVisibility + * @enum {number} + * @property {number} VISIBILITY_UNSET=0 VISIBILITY_UNSET value + * @property {number} VISIBILITY_LOCAL=1 VISIBILITY_LOCAL value + * @property {number} VISIBILITY_EXPORT=2 VISIBILITY_EXPORT value + */ + protobuf.SymbolVisibility = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VISIBILITY_UNSET"] = 0; + values[valuesById[1] = "VISIBILITY_LOCAL"] = 1; + values[valuesById[2] = "VISIBILITY_EXPORT"] = 2; + return values; + })(); + return protobuf; })(); @@ -26401,6 +27460,7 @@ * @interface ICommonLanguageSettings * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri * @property {Array.|null} [destinations] CommonLanguageSettings destinations + * @property {google.api.ISelectiveGapicGeneration|null} [selectiveGapicGeneration] CommonLanguageSettings selectiveGapicGeneration */ /** @@ -26435,6 +27495,14 @@ */ CommonLanguageSettings.prototype.destinations = $util.emptyArray; + /** + * CommonLanguageSettings selectiveGapicGeneration. + * @member {google.api.ISelectiveGapicGeneration|null|undefined} selectiveGapicGeneration + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.selectiveGapicGeneration = null; + /** * Creates a new CommonLanguageSettings instance using the specified properties. * @function create @@ -26467,6 +27535,8 @@ writer.int32(message.destinations[i]); writer.ldelim(); } + if (message.selectiveGapicGeneration != null && Object.hasOwnProperty.call(message, "selectiveGapicGeneration")) + $root.google.api.SelectiveGapicGeneration.encode(message.selectiveGapicGeneration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -26518,6 +27588,10 @@ message.destinations.push(reader.int32()); break; } + case 3: { + message.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -26569,6 +27643,11 @@ break; } } + if (message.selectiveGapicGeneration != null && message.hasOwnProperty("selectiveGapicGeneration")) { + var error = $root.google.api.SelectiveGapicGeneration.verify(message.selectiveGapicGeneration); + if (error) + return "selectiveGapicGeneration." + error; + } return null; }; @@ -26611,6 +27690,11 @@ break; } } + if (object.selectiveGapicGeneration != null) { + if (typeof object.selectiveGapicGeneration !== "object") + throw TypeError(".google.api.CommonLanguageSettings.selectiveGapicGeneration: object expected"); + message.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.fromObject(object.selectiveGapicGeneration); + } return message; }; @@ -26629,8 +27713,10 @@ var object = {}; if (options.arrays || options.defaults) object.destinations = []; - if (options.defaults) + if (options.defaults) { object.referenceDocsUri = ""; + object.selectiveGapicGeneration = null; + } if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) object.referenceDocsUri = message.referenceDocsUri; if (message.destinations && message.destinations.length) { @@ -26638,6 +27724,8 @@ for (var j = 0; j < message.destinations.length; ++j) object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; } + if (message.selectiveGapicGeneration != null && message.hasOwnProperty("selectiveGapicGeneration")) + object.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.toObject(message.selectiveGapicGeneration, options); return object; }; @@ -28460,6 +29548,7 @@ * @memberof google.api * @interface IPythonSettings * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common + * @property {google.api.PythonSettings.IExperimentalFeatures|null} [experimentalFeatures] PythonSettings experimentalFeatures */ /** @@ -28485,6 +29574,14 @@ */ PythonSettings.prototype.common = null; + /** + * PythonSettings experimentalFeatures. + * @member {google.api.PythonSettings.IExperimentalFeatures|null|undefined} experimentalFeatures + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.experimentalFeatures = null; + /** * Creates a new PythonSettings instance using the specified properties. * @function create @@ -28511,6 +29608,8 @@ writer = $Writer.create(); if (message.common != null && Object.hasOwnProperty.call(message, "common")) $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.experimentalFeatures != null && Object.hasOwnProperty.call(message, "experimentalFeatures")) + $root.google.api.PythonSettings.ExperimentalFeatures.encode(message.experimentalFeatures, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -28551,6 +29650,10 @@ message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); break; } + case 2: { + message.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -28591,6 +29694,11 @@ if (error) return "common." + error; } + if (message.experimentalFeatures != null && message.hasOwnProperty("experimentalFeatures")) { + var error = $root.google.api.PythonSettings.ExperimentalFeatures.verify(message.experimentalFeatures); + if (error) + return "experimentalFeatures." + error; + } return null; }; @@ -28611,6 +29719,11 @@ throw TypeError(".google.api.PythonSettings.common: object expected"); message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); } + if (object.experimentalFeatures != null) { + if (typeof object.experimentalFeatures !== "object") + throw TypeError(".google.api.PythonSettings.experimentalFeatures: object expected"); + message.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.fromObject(object.experimentalFeatures); + } return message; }; @@ -28627,38 +29740,294 @@ if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.common = null; + object.experimentalFeatures = null; + } if (message.common != null && message.hasOwnProperty("common")) object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + if (message.experimentalFeatures != null && message.hasOwnProperty("experimentalFeatures")) + object.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.toObject(message.experimentalFeatures, options); return object; }; - /** - * Converts this PythonSettings to JSON. - * @function toJSON - * @memberof google.api.PythonSettings - * @instance - * @returns {Object.} JSON object - */ - PythonSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Converts this PythonSettings to JSON. + * @function toJSON + * @memberof google.api.PythonSettings + * @instance + * @returns {Object.} JSON object + */ + PythonSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PythonSettings + * @function getTypeUrl + * @memberof google.api.PythonSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings"; + }; + + PythonSettings.ExperimentalFeatures = (function() { + + /** + * Properties of an ExperimentalFeatures. + * @memberof google.api.PythonSettings + * @interface IExperimentalFeatures + * @property {boolean|null} [restAsyncIoEnabled] ExperimentalFeatures restAsyncIoEnabled + * @property {boolean|null} [protobufPythonicTypesEnabled] ExperimentalFeatures protobufPythonicTypesEnabled + * @property {boolean|null} [unversionedPackageDisabled] ExperimentalFeatures unversionedPackageDisabled + */ + + /** + * Constructs a new ExperimentalFeatures. + * @memberof google.api.PythonSettings + * @classdesc Represents an ExperimentalFeatures. + * @implements IExperimentalFeatures + * @constructor + * @param {google.api.PythonSettings.IExperimentalFeatures=} [properties] Properties to set + */ + function ExperimentalFeatures(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExperimentalFeatures restAsyncIoEnabled. + * @member {boolean} restAsyncIoEnabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.restAsyncIoEnabled = false; + + /** + * ExperimentalFeatures protobufPythonicTypesEnabled. + * @member {boolean} protobufPythonicTypesEnabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.protobufPythonicTypesEnabled = false; + + /** + * ExperimentalFeatures unversionedPackageDisabled. + * @member {boolean} unversionedPackageDisabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.unversionedPackageDisabled = false; + + /** + * Creates a new ExperimentalFeatures instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures=} [properties] Properties to set + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures instance + */ + ExperimentalFeatures.create = function create(properties) { + return new ExperimentalFeatures(properties); + }; + + /** + * Encodes the specified ExperimentalFeatures message. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures} message ExperimentalFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExperimentalFeatures.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.restAsyncIoEnabled != null && Object.hasOwnProperty.call(message, "restAsyncIoEnabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.restAsyncIoEnabled); + if (message.protobufPythonicTypesEnabled != null && Object.hasOwnProperty.call(message, "protobufPythonicTypesEnabled")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.protobufPythonicTypesEnabled); + if (message.unversionedPackageDisabled != null && Object.hasOwnProperty.call(message, "unversionedPackageDisabled")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.unversionedPackageDisabled); + return writer; + }; + + /** + * Encodes the specified ExperimentalFeatures message, length delimited. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures} message ExperimentalFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExperimentalFeatures.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExperimentalFeatures.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings.ExperimentalFeatures(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.restAsyncIoEnabled = reader.bool(); + break; + } + case 2: { + message.protobufPythonicTypesEnabled = reader.bool(); + break; + } + case 3: { + message.unversionedPackageDisabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExperimentalFeatures.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExperimentalFeatures message. + * @function verify + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExperimentalFeatures.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.restAsyncIoEnabled != null && message.hasOwnProperty("restAsyncIoEnabled")) + if (typeof message.restAsyncIoEnabled !== "boolean") + return "restAsyncIoEnabled: boolean expected"; + if (message.protobufPythonicTypesEnabled != null && message.hasOwnProperty("protobufPythonicTypesEnabled")) + if (typeof message.protobufPythonicTypesEnabled !== "boolean") + return "protobufPythonicTypesEnabled: boolean expected"; + if (message.unversionedPackageDisabled != null && message.hasOwnProperty("unversionedPackageDisabled")) + if (typeof message.unversionedPackageDisabled !== "boolean") + return "unversionedPackageDisabled: boolean expected"; + return null; + }; + + /** + * Creates an ExperimentalFeatures message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + */ + ExperimentalFeatures.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PythonSettings.ExperimentalFeatures) + return object; + var message = new $root.google.api.PythonSettings.ExperimentalFeatures(); + if (object.restAsyncIoEnabled != null) + message.restAsyncIoEnabled = Boolean(object.restAsyncIoEnabled); + if (object.protobufPythonicTypesEnabled != null) + message.protobufPythonicTypesEnabled = Boolean(object.protobufPythonicTypesEnabled); + if (object.unversionedPackageDisabled != null) + message.unversionedPackageDisabled = Boolean(object.unversionedPackageDisabled); + return message; + }; + + /** + * Creates a plain object from an ExperimentalFeatures message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.ExperimentalFeatures} message ExperimentalFeatures + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExperimentalFeatures.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.restAsyncIoEnabled = false; + object.protobufPythonicTypesEnabled = false; + object.unversionedPackageDisabled = false; + } + if (message.restAsyncIoEnabled != null && message.hasOwnProperty("restAsyncIoEnabled")) + object.restAsyncIoEnabled = message.restAsyncIoEnabled; + if (message.protobufPythonicTypesEnabled != null && message.hasOwnProperty("protobufPythonicTypesEnabled")) + object.protobufPythonicTypesEnabled = message.protobufPythonicTypesEnabled; + if (message.unversionedPackageDisabled != null && message.hasOwnProperty("unversionedPackageDisabled")) + object.unversionedPackageDisabled = message.unversionedPackageDisabled; + return object; + }; - /** - * Gets the default type url for PythonSettings - * @function getTypeUrl - * @memberof google.api.PythonSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.PythonSettings"; - }; + /** + * Converts this ExperimentalFeatures to JSON. + * @function toJSON + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + * @returns {Object.} JSON object + */ + ExperimentalFeatures.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExperimentalFeatures + * @function getTypeUrl + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExperimentalFeatures.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings.ExperimentalFeatures"; + }; + + return ExperimentalFeatures; + })(); return PythonSettings; })(); @@ -29536,6 +30905,7 @@ * @memberof google.api * @interface IGoSettings * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common + * @property {Object.|null} [renamedServices] GoSettings renamedServices */ /** @@ -29547,6 +30917,7 @@ * @param {google.api.IGoSettings=} [properties] Properties to set */ function GoSettings(properties) { + this.renamedServices = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -29561,6 +30932,14 @@ */ GoSettings.prototype.common = null; + /** + * GoSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.renamedServices = $util.emptyObject; + /** * Creates a new GoSettings instance using the specified properties. * @function create @@ -29587,6 +30966,9 @@ writer = $Writer.create(); if (message.common != null && Object.hasOwnProperty.call(message, "common")) $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); return writer; }; @@ -29617,7 +30999,7 @@ GoSettings.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(), key, value; while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) @@ -29627,6 +31009,29 @@ message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); break; } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedServices[key] = value; + break; + } default: reader.skipType(tag & 7); break; @@ -29667,6 +31072,14 @@ if (error) return "common." + error; } + if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } return null; }; @@ -29687,6 +31100,13 @@ throw TypeError(".google.api.GoSettings.common: object expected"); message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); } + if (object.renamedServices) { + if (typeof object.renamedServices !== "object") + throw TypeError(".google.api.GoSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } return message; }; @@ -29703,10 +31123,18 @@ if (!options) options = {}; var object = {}; + if (options.objects || options.defaults) + object.renamedServices = {}; if (options.defaults) object.common = null; if (message.common != null && message.hasOwnProperty("common")) object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } return object; }; @@ -30345,6 +31773,251 @@ return values; })(); + api.SelectiveGapicGeneration = (function() { + + /** + * Properties of a SelectiveGapicGeneration. + * @memberof google.api + * @interface ISelectiveGapicGeneration + * @property {Array.|null} [methods] SelectiveGapicGeneration methods + * @property {boolean|null} [generateOmittedAsInternal] SelectiveGapicGeneration generateOmittedAsInternal + */ + + /** + * Constructs a new SelectiveGapicGeneration. + * @memberof google.api + * @classdesc Represents a SelectiveGapicGeneration. + * @implements ISelectiveGapicGeneration + * @constructor + * @param {google.api.ISelectiveGapicGeneration=} [properties] Properties to set + */ + function SelectiveGapicGeneration(properties) { + this.methods = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SelectiveGapicGeneration methods. + * @member {Array.} methods + * @memberof google.api.SelectiveGapicGeneration + * @instance + */ + SelectiveGapicGeneration.prototype.methods = $util.emptyArray; + + /** + * SelectiveGapicGeneration generateOmittedAsInternal. + * @member {boolean} generateOmittedAsInternal + * @memberof google.api.SelectiveGapicGeneration + * @instance + */ + SelectiveGapicGeneration.prototype.generateOmittedAsInternal = false; + + /** + * Creates a new SelectiveGapicGeneration instance using the specified properties. + * @function create + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration=} [properties] Properties to set + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration instance + */ + SelectiveGapicGeneration.create = function create(properties) { + return new SelectiveGapicGeneration(properties); + }; + + /** + * Encodes the specified SelectiveGapicGeneration message. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @function encode + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration} message SelectiveGapicGeneration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelectiveGapicGeneration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.methods != null && message.methods.length) + for (var i = 0; i < message.methods.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.methods[i]); + if (message.generateOmittedAsInternal != null && Object.hasOwnProperty.call(message, "generateOmittedAsInternal")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.generateOmittedAsInternal); + return writer; + }; + + /** + * Encodes the specified SelectiveGapicGeneration message, length delimited. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration} message SelectiveGapicGeneration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelectiveGapicGeneration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer. + * @function decode + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelectiveGapicGeneration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.SelectiveGapicGeneration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.methods && message.methods.length)) + message.methods = []; + message.methods.push(reader.string()); + break; + } + case 2: { + message.generateOmittedAsInternal = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelectiveGapicGeneration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SelectiveGapicGeneration message. + * @function verify + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SelectiveGapicGeneration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.methods != null && message.hasOwnProperty("methods")) { + if (!Array.isArray(message.methods)) + return "methods: array expected"; + for (var i = 0; i < message.methods.length; ++i) + if (!$util.isString(message.methods[i])) + return "methods: string[] expected"; + } + if (message.generateOmittedAsInternal != null && message.hasOwnProperty("generateOmittedAsInternal")) + if (typeof message.generateOmittedAsInternal !== "boolean") + return "generateOmittedAsInternal: boolean expected"; + return null; + }; + + /** + * Creates a SelectiveGapicGeneration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {Object.} object Plain object + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + */ + SelectiveGapicGeneration.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.SelectiveGapicGeneration) + return object; + var message = new $root.google.api.SelectiveGapicGeneration(); + if (object.methods) { + if (!Array.isArray(object.methods)) + throw TypeError(".google.api.SelectiveGapicGeneration.methods: array expected"); + message.methods = []; + for (var i = 0; i < object.methods.length; ++i) + message.methods[i] = String(object.methods[i]); + } + if (object.generateOmittedAsInternal != null) + message.generateOmittedAsInternal = Boolean(object.generateOmittedAsInternal); + return message; + }; + + /** + * Creates a plain object from a SelectiveGapicGeneration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.SelectiveGapicGeneration} message SelectiveGapicGeneration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SelectiveGapicGeneration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.methods = []; + if (options.defaults) + object.generateOmittedAsInternal = false; + if (message.methods && message.methods.length) { + object.methods = []; + for (var j = 0; j < message.methods.length; ++j) + object.methods[j] = message.methods[j]; + } + if (message.generateOmittedAsInternal != null && message.hasOwnProperty("generateOmittedAsInternal")) + object.generateOmittedAsInternal = message.generateOmittedAsInternal; + return object; + }; + + /** + * Converts this SelectiveGapicGeneration to JSON. + * @function toJSON + * @memberof google.api.SelectiveGapicGeneration + * @instance + * @returns {Object.} JSON object + */ + SelectiveGapicGeneration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SelectiveGapicGeneration + * @function getTypeUrl + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SelectiveGapicGeneration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.SelectiveGapicGeneration"; + }; + + return SelectiveGapicGeneration; + })(); + /** * LaunchStage enum. * @name google.api.LaunchStage diff --git a/packages/google-api-servicecontrol/protos/protos.json b/packages/google-api-servicecontrol/protos/protos.json index b55ae781626..f47d27a4a09 100644 --- a/packages/google-api-servicecontrol/protos/protos.json +++ b/packages/google-api-servicecontrol/protos/protos.json @@ -120,12 +120,19 @@ "type": "FileDescriptorProto", "id": 1 } - } + }, + "extensions": [ + [ + 536000000, + 536000000 + ] + ] }, "Edition": { "edition": "proto2", "values": { "EDITION_UNKNOWN": 0, + "EDITION_LEGACY": 900, "EDITION_PROTO2": 998, "EDITION_PROTO3": 999, "EDITION_2023": 1000, @@ -164,6 +171,11 @@ "type": "int32", "id": 11 }, + "optionDependency": { + "rule": "repeated", + "type": "string", + "id": 15 + }, "messageType": { "rule": "repeated", "type": "DescriptorProto", @@ -252,6 +264,10 @@ "rule": "repeated", "type": "string", "id": 10 + }, + "visibility": { + "type": "SymbolVisibility", + "id": 11 } }, "nested": { @@ -477,6 +493,10 @@ "rule": "repeated", "type": "string", "id": 5 + }, + "visibility": { + "type": "SymbolVisibility", + "id": 6 } }, "nested": { @@ -691,6 +711,7 @@ 42, 42 ], + "php_generic_services", [ 38, 38 @@ -826,7 +847,8 @@ "type": "bool", "id": 10, "options": { - "default": false + "default": false, + "deprecated": true } }, "debugRedact": { @@ -854,6 +876,10 @@ "type": "FeatureSet", "id": 21 }, + "featureSupport": { + "type": "FeatureSupport", + "id": 22 + }, "uninterpretedOption": { "rule": "repeated", "type": "UninterpretedOption", @@ -923,6 +949,26 @@ "id": 2 } } + }, + "FeatureSupport": { + "fields": { + "editionIntroduced": { + "type": "Edition", + "id": 1 + }, + "editionDeprecated": { + "type": "Edition", + "id": 2 + }, + "deprecationWarning": { + "type": "string", + "id": 3 + }, + "editionRemoved": { + "type": "Edition", + "id": 4 + } + } } } }, @@ -1011,6 +1057,10 @@ "default": false } }, + "featureSupport": { + "type": "FieldOptions.FeatureSupport", + "id": 4 + }, "uninterpretedOption": { "rule": "repeated", "type": "UninterpretedOption", @@ -1153,6 +1203,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_2023", "edition_defaults.value": "EXPLICIT" } @@ -1163,6 +1214,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "OPEN" } @@ -1173,6 +1225,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "PACKED" } @@ -1183,6 +1236,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "VERIFY" } @@ -1193,7 +1247,8 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO2", + "feature_support.edition_introduced": "EDITION_2023", + "edition_defaults.edition": "EDITION_LEGACY", "edition_defaults.value": "LENGTH_PREFIXED" } }, @@ -1203,27 +1258,38 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "ALLOW" } + }, + "enforceNamingStyle": { + "type": "EnforceNamingStyle", + "id": 7, + "options": { + "retention": "RETENTION_SOURCE", + "targets": "TARGET_TYPE_METHOD", + "feature_support.edition_introduced": "EDITION_2024", + "edition_defaults.edition": "EDITION_2024", + "edition_defaults.value": "STYLE2024" + } + }, + "defaultSymbolVisibility": { + "type": "VisibilityFeature.DefaultSymbolVisibility", + "id": 8, + "options": { + "retention": "RETENTION_SOURCE", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2024", + "edition_defaults.edition": "EDITION_2024", + "edition_defaults.value": "EXPORT_TOP_LEVEL" + } } }, "extensions": [ [ 1000, - 1000 - ], - [ - 1001, - 1001 - ], - [ - 1002, - 1002 - ], - [ - 9990, - 9990 + 9994 ], [ 9995, @@ -1268,7 +1334,13 @@ "UTF8_VALIDATION_UNKNOWN": 0, "VERIFY": 2, "NONE": 3 - } + }, + "reserved": [ + [ + 1, + 1 + ] + ] }, "MessageEncoding": { "values": { @@ -1283,6 +1355,33 @@ "ALLOW": 1, "LEGACY_BEST_EFFORT": 2 } + }, + "EnforceNamingStyle": { + "values": { + "ENFORCE_NAMING_STYLE_UNKNOWN": 0, + "STYLE2024": 1, + "STYLE_LEGACY": 2 + } + }, + "VisibilityFeature": { + "fields": {}, + "reserved": [ + [ + 1, + 536870911 + ] + ], + "nested": { + "DefaultSymbolVisibility": { + "values": { + "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN": 0, + "EXPORT_ALL": 1, + "EXPORT_TOP_LEVEL": 2, + "LOCAL_ALL": 3, + "STRICT": 4 + } + } + } } } }, @@ -1310,11 +1409,26 @@ "type": "Edition", "id": 3 }, - "features": { + "overridableFeatures": { "type": "FeatureSet", - "id": 2 + "id": 4 + }, + "fixedFeatures": { + "type": "FeatureSet", + "id": 5 } - } + }, + "reserved": [ + [ + 1, + 1 + ], + [ + 2, + 2 + ], + "features" + ] } } }, @@ -1327,6 +1441,12 @@ "id": 1 } }, + "extensions": [ + [ + 536000000, + 536000000 + ] + ], "nested": { "Location": { "fields": { @@ -1411,6 +1531,14 @@ } } } + }, + "SymbolVisibility": { + "edition": "proto2", + "values": { + "VISIBILITY_UNSET": 0, + "VISIBILITY_LOCAL": 1, + "VISIBILITY_EXPORT": 2 + } } } }, @@ -1420,8 +1548,7 @@ "java_multiple_files": true, "java_outer_classname": "LaunchStageProto", "java_package": "com.google.api", - "objc_class_prefix": "GAPI", - "cc_enable_arenas": true + "objc_class_prefix": "GAPI" }, "nested": { "servicecontrol": { @@ -2178,13 +2305,11 @@ }, "v2": { "options": { - "cc_enable_arenas": true, "csharp_namespace": "Google.Cloud.ServiceControl.V2", "go_package": "google.golang.org/genproto/googleapis/api/servicecontrol/v2;servicecontrol", "java_multiple_files": true, "java_outer_classname": "ServiceControllerProto", "java_package": "com.google.api.servicecontrol.v2", - "objc_class_prefix": "GASC", "php_namespace": "Google\\Cloud\\ServiceControl\\V2", "ruby_package": "Google::Cloud::ServiceControl::V2" }, @@ -2578,6 +2703,10 @@ "rule": "repeated", "type": "ClientLibraryDestination", "id": 2 + }, + "selectiveGapicGeneration": { + "type": "SelectiveGapicGeneration", + "id": 3 } } }, @@ -2718,6 +2847,28 @@ "common": { "type": "CommonLanguageSettings", "id": 1 + }, + "experimentalFeatures": { + "type": "ExperimentalFeatures", + "id": 2 + } + }, + "nested": { + "ExperimentalFeatures": { + "fields": { + "restAsyncIoEnabled": { + "type": "bool", + "id": 1 + }, + "protobufPythonicTypesEnabled": { + "type": "bool", + "id": 2 + }, + "unversionedPackageDisabled": { + "type": "bool", + "id": 3 + } + } } } }, @@ -2775,6 +2926,11 @@ "common": { "type": "CommonLanguageSettings", "id": 1 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 } } }, @@ -2836,6 +2992,19 @@ "PACKAGE_MANAGER": 20 } }, + "SelectiveGapicGeneration": { + "fields": { + "methods": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "generateOmittedAsInternal": { + "type": "bool", + "id": 2 + } + } + }, "LaunchStage": { "values": { "LAUNCH_STAGE_UNSPECIFIED": 0, diff --git a/packages/google-api-servicecontrol/samples/generated/v1/snippet_metadata.google.api.servicecontrol.v1.json b/packages/google-api-servicecontrol/samples/generated/v1/snippet_metadata.google.api.servicecontrol.v1.json index cf04317bb90..9791fdc5e5b 100644 --- a/packages/google-api-servicecontrol/samples/generated/v1/snippet_metadata.google.api.servicecontrol.v1.json +++ b/packages/google-api-servicecontrol/samples/generated/v1/snippet_metadata.google.api.servicecontrol.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-servicecontrol", - "version": "4.2.0", + "version": "4.3.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-api-servicecontrol/samples/generated/v1/snippet_metadata_google.api.servicecontrol.v1.json b/packages/google-api-servicecontrol/samples/generated/v1/snippet_metadata_google.api.servicecontrol.v1.json index cf04317bb90..9791fdc5e5b 100644 --- a/packages/google-api-servicecontrol/samples/generated/v1/snippet_metadata_google.api.servicecontrol.v1.json +++ b/packages/google-api-servicecontrol/samples/generated/v1/snippet_metadata_google.api.servicecontrol.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-servicecontrol", - "version": "4.2.0", + "version": "4.3.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-api-servicecontrol/samples/generated/v2/snippet_metadata.google.api.servicecontrol.v2.json b/packages/google-api-servicecontrol/samples/generated/v2/snippet_metadata.google.api.servicecontrol.v2.json index ca3229c309d..dccaa453b07 100644 --- a/packages/google-api-servicecontrol/samples/generated/v2/snippet_metadata.google.api.servicecontrol.v2.json +++ b/packages/google-api-servicecontrol/samples/generated/v2/snippet_metadata.google.api.servicecontrol.v2.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-servicecontrol", - "version": "4.2.0", + "version": "4.3.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-api-servicecontrol/samples/generated/v2/snippet_metadata_google.api.servicecontrol.v2.json b/packages/google-api-servicecontrol/samples/generated/v2/snippet_metadata_google.api.servicecontrol.v2.json index ca3229c309d..c369e9394b0 100644 --- a/packages/google-api-servicecontrol/samples/generated/v2/snippet_metadata_google.api.servicecontrol.v2.json +++ b/packages/google-api-servicecontrol/samples/generated/v2/snippet_metadata_google.api.servicecontrol.v2.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-servicecontrol", - "version": "4.2.0", + "version": "4.3.0", "language": "TYPESCRIPT", "apis": [ { @@ -15,7 +15,7 @@ "regionTag": "servicecontrol_v2_generated_ServiceController_Check_async", "title": "ServiceController check Sample", "origin": "API_DEFINITION", - "description": " Private Preview. This feature is only available for approved services. This method provides admission control for services that are integrated with [Service Infrastructure](https://cloud.google.com/service-infrastructure). It checks whether an operation should be allowed based on the service configuration and relevant policies. It must be called before the operation is executed. For more information, see [Admission Control](https://cloud.google.com/service-infrastructure/docs/admission-control). NOTE: The admission control has an expected policy propagation delay of 60s. The caller **must** not depend on the most recent policy changes. NOTE: The admission control has a hard limit of 1 referenced resources per call. If an operation refers to more than 1 resources, the caller must call the Check method multiple times. This method requires the `servicemanagement.services.check` permission on the specified service. For more information, see [Service Control API Access Control](https://cloud.google.com/service-infrastructure/docs/service-control/access-control).", + "description": " This method provides admission control for services that are integrated with [Service Infrastructure](https://cloud.google.com/service-infrastructure). It checks whether an operation should be allowed based on the service configuration and relevant policies. It must be called before the operation is executed. For more information, see [Admission Control](https://cloud.google.com/service-infrastructure/docs/admission-control). NOTE: The admission control has an expected policy propagation delay of 60s. The caller **must** not depend on the most recent policy changes. NOTE: The admission control has a hard limit of 1 referenced resources per call. If an operation refers to more than 1 resources, the caller must call the Check method multiple times. This method requires the `servicemanagement.services.check` permission on the specified service. For more information, see [Service Control API Access Control](https://cloud.google.com/service-infrastructure/docs/service-control/access-control).", "canonical": true, "file": "service_controller.check.js", "language": "JAVASCRIPT", @@ -71,7 +71,7 @@ "regionTag": "servicecontrol_v2_generated_ServiceController_Report_async", "title": "ServiceController report Sample", "origin": "API_DEFINITION", - "description": " Private Preview. This feature is only available for approved services. This method provides telemetry reporting for services that are integrated with [Service Infrastructure](https://cloud.google.com/service-infrastructure). It reports a list of operations that have occurred on a service. It must be called after the operations have been executed. For more information, see [Telemetry Reporting](https://cloud.google.com/service-infrastructure/docs/telemetry-reporting). NOTE: The telemetry reporting has a hard limit of 1000 operations and 1MB per Report call. It is recommended to have no more than 100 operations per call. This method requires the `servicemanagement.services.report` permission on the specified service. For more information, see [Service Control API Access Control](https://cloud.google.com/service-infrastructure/docs/service-control/access-control).", + "description": " This method provides telemetry reporting for services that are integrated with [Service Infrastructure](https://cloud.google.com/service-infrastructure). It reports a list of operations that have occurred on a service. It must be called after the operations have been executed. For more information, see [Telemetry Reporting](https://cloud.google.com/service-infrastructure/docs/telemetry-reporting). NOTE: The telemetry reporting has a hard limit of 100 operations and 1MB per Report call. This method requires the `servicemanagement.services.report` permission on the specified service. For more information, see [Service Control API Access Control](https://cloud.google.com/service-infrastructure/docs/service-control/access-control).", "canonical": true, "file": "service_controller.report.js", "language": "JAVASCRIPT", diff --git a/packages/google-api-servicecontrol/samples/package.json b/packages/google-api-servicecontrol/samples/package.json index 437ab1d321b..7bb3a299c74 100644 --- a/packages/google-api-servicecontrol/samples/package.json +++ b/packages/google-api-servicecontrol/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/service-control": "^4.2.0" + "@google-cloud/service-control": "^4.3.0" }, "devDependencies": { "c8": "^9.0.0", diff --git a/packages/google-api-servicecontrol/src/v2/service_controller_client.ts b/packages/google-api-servicecontrol/src/v2/service_controller_client.ts index c9af1803466..fccc707d71f 100644 --- a/packages/google-api-servicecontrol/src/v2/service_controller_client.ts +++ b/packages/google-api-servicecontrol/src/v2/service_controller_client.ts @@ -36,8 +36,6 @@ const version = require('../../../package.json').version; * [Service Control API * v2](https://cloud.google.com/service-infrastructure/docs/service-control/access-control) * - * Private Preview. This feature is only available for approved services. - * * This API provides admission control and telemetry reporting for services * that are integrated with [Service * Infrastructure](https://cloud.google.com/service-infrastructure). @@ -326,8 +324,6 @@ export class ServiceControllerClient { // -- Service calls -- // ------------------- /** - * Private Preview. This feature is only available for approved services. - * * This method provides admission control for services that are integrated * with [Service * Infrastructure](https://cloud.google.com/service-infrastructure). It checks @@ -456,8 +452,6 @@ export class ServiceControllerClient { }); } /** - * Private Preview. This feature is only available for approved services. - * * This method provides telemetry reporting for services that are integrated * with [Service * Infrastructure](https://cloud.google.com/service-infrastructure). It @@ -466,9 +460,8 @@ export class ServiceControllerClient { * [Telemetry * Reporting](https://cloud.google.com/service-infrastructure/docs/telemetry-reporting). * - * NOTE: The telemetry reporting has a hard limit of 1000 operations and 1MB - * per Report call. It is recommended to have no more than 100 operations per - * call. + * NOTE: The telemetry reporting has a hard limit of 100 operations and 1MB + * per Report call. * * This method requires the `servicemanagement.services.report` permission * on the specified service. For more information, see diff --git a/packages/google-api-servicemanagement/protos/protos.d.ts b/packages/google-api-servicemanagement/protos/protos.d.ts index d073f530ae4..c01dfca74d6 100644 --- a/packages/google-api-servicemanagement/protos/protos.d.ts +++ b/packages/google-api-servicemanagement/protos/protos.d.ts @@ -4216,6 +4216,9 @@ export namespace google { /** CommonLanguageSettings destinations */ destinations?: (google.api.ClientLibraryDestination[]|null); + + /** CommonLanguageSettings selectiveGapicGeneration */ + selectiveGapicGeneration?: (google.api.ISelectiveGapicGeneration|null); } /** Represents a CommonLanguageSettings. */ @@ -4233,6 +4236,9 @@ export namespace google { /** CommonLanguageSettings destinations. */ public destinations: google.api.ClientLibraryDestination[]; + /** CommonLanguageSettings selectiveGapicGeneration. */ + public selectiveGapicGeneration?: (google.api.ISelectiveGapicGeneration|null); + /** * Creates a new CommonLanguageSettings instance using the specified properties. * @param [properties] Properties to set @@ -4933,6 +4939,9 @@ export namespace google { /** PythonSettings common */ common?: (google.api.ICommonLanguageSettings|null); + + /** PythonSettings experimentalFeatures */ + experimentalFeatures?: (google.api.PythonSettings.IExperimentalFeatures|null); } /** Represents a PythonSettings. */ @@ -4947,6 +4956,9 @@ export namespace google { /** PythonSettings common. */ public common?: (google.api.ICommonLanguageSettings|null); + /** PythonSettings experimentalFeatures. */ + public experimentalFeatures?: (google.api.PythonSettings.IExperimentalFeatures|null); + /** * Creates a new PythonSettings instance using the specified properties. * @param [properties] Properties to set @@ -5025,6 +5037,118 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + namespace PythonSettings { + + /** Properties of an ExperimentalFeatures. */ + interface IExperimentalFeatures { + + /** ExperimentalFeatures restAsyncIoEnabled */ + restAsyncIoEnabled?: (boolean|null); + + /** ExperimentalFeatures protobufPythonicTypesEnabled */ + protobufPythonicTypesEnabled?: (boolean|null); + + /** ExperimentalFeatures unversionedPackageDisabled */ + unversionedPackageDisabled?: (boolean|null); + } + + /** Represents an ExperimentalFeatures. */ + class ExperimentalFeatures implements IExperimentalFeatures { + + /** + * Constructs a new ExperimentalFeatures. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.PythonSettings.IExperimentalFeatures); + + /** ExperimentalFeatures restAsyncIoEnabled. */ + public restAsyncIoEnabled: boolean; + + /** ExperimentalFeatures protobufPythonicTypesEnabled. */ + public protobufPythonicTypesEnabled: boolean; + + /** ExperimentalFeatures unversionedPackageDisabled. */ + public unversionedPackageDisabled: boolean; + + /** + * Creates a new ExperimentalFeatures instance using the specified properties. + * @param [properties] Properties to set + * @returns ExperimentalFeatures instance + */ + public static create(properties?: google.api.PythonSettings.IExperimentalFeatures): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Encodes the specified ExperimentalFeatures message. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @param message ExperimentalFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.PythonSettings.IExperimentalFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExperimentalFeatures message, length delimited. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @param message ExperimentalFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.PythonSettings.IExperimentalFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Verifies an ExperimentalFeatures message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExperimentalFeatures message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExperimentalFeatures + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Creates a plain object from an ExperimentalFeatures message. Also converts values to other types if specified. + * @param message ExperimentalFeatures + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings.ExperimentalFeatures, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExperimentalFeatures to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExperimentalFeatures + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + /** Properties of a NodeSettings. */ interface INodeSettings { @@ -5351,6 +5475,9 @@ export namespace google { /** GoSettings common */ common?: (google.api.ICommonLanguageSettings|null); + + /** GoSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|null); } /** Represents a GoSettings. */ @@ -5365,6 +5492,9 @@ export namespace google { /** GoSettings common. */ public common?: (google.api.ICommonLanguageSettings|null); + /** GoSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + /** * Creates a new GoSettings instance using the specified properties. * @param [properties] Properties to set @@ -5689,6 +5819,109 @@ export namespace google { PACKAGE_MANAGER = 20 } + /** Properties of a SelectiveGapicGeneration. */ + interface ISelectiveGapicGeneration { + + /** SelectiveGapicGeneration methods */ + methods?: (string[]|null); + + /** SelectiveGapicGeneration generateOmittedAsInternal */ + generateOmittedAsInternal?: (boolean|null); + } + + /** Represents a SelectiveGapicGeneration. */ + class SelectiveGapicGeneration implements ISelectiveGapicGeneration { + + /** + * Constructs a new SelectiveGapicGeneration. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ISelectiveGapicGeneration); + + /** SelectiveGapicGeneration methods. */ + public methods: string[]; + + /** SelectiveGapicGeneration generateOmittedAsInternal. */ + public generateOmittedAsInternal: boolean; + + /** + * Creates a new SelectiveGapicGeneration instance using the specified properties. + * @param [properties] Properties to set + * @returns SelectiveGapicGeneration instance + */ + public static create(properties?: google.api.ISelectiveGapicGeneration): google.api.SelectiveGapicGeneration; + + /** + * Encodes the specified SelectiveGapicGeneration message. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @param message SelectiveGapicGeneration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ISelectiveGapicGeneration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SelectiveGapicGeneration message, length delimited. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @param message SelectiveGapicGeneration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ISelectiveGapicGeneration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.SelectiveGapicGeneration; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.SelectiveGapicGeneration; + + /** + * Verifies a SelectiveGapicGeneration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SelectiveGapicGeneration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SelectiveGapicGeneration + */ + public static fromObject(object: { [k: string]: any }): google.api.SelectiveGapicGeneration; + + /** + * Creates a plain object from a SelectiveGapicGeneration message. Also converts values to other types if specified. + * @param message SelectiveGapicGeneration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.SelectiveGapicGeneration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SelectiveGapicGeneration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SelectiveGapicGeneration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** LaunchStage enum. */ enum LaunchStage { LAUNCH_STAGE_UNSPECIFIED = 0, @@ -8700,6 +8933,9 @@ export namespace google { /** MetricDescriptorMetadata ingestDelay */ ingestDelay?: (google.protobuf.IDuration|null); + + /** MetricDescriptorMetadata timeSeriesResourceHierarchyLevel */ + timeSeriesResourceHierarchyLevel?: (google.api.MetricDescriptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel[]|null); } /** Represents a MetricDescriptorMetadata. */ @@ -8720,6 +8956,9 @@ export namespace google { /** MetricDescriptorMetadata ingestDelay. */ public ingestDelay?: (google.protobuf.IDuration|null); + /** MetricDescriptorMetadata timeSeriesResourceHierarchyLevel. */ + public timeSeriesResourceHierarchyLevel: google.api.MetricDescriptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel[]; + /** * Creates a new MetricDescriptorMetadata instance using the specified properties. * @param [properties] Properties to set @@ -8797,6 +9036,17 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + namespace MetricDescriptorMetadata { + + /** TimeSeriesResourceHierarchyLevel enum. */ + enum TimeSeriesResourceHierarchyLevel { + TIME_SERIES_RESOURCE_HIERARCHY_LEVEL_UNSPECIFIED = 0, + PROJECT = 1, + ORGANIZATION = 2, + FOLDER = 3 + } + } } /** Properties of a Metric. */ @@ -10529,6 +10779,7 @@ export namespace google { /** Edition enum. */ enum Edition { EDITION_UNKNOWN = 0, + EDITION_LEGACY = 900, EDITION_PROTO2 = 998, EDITION_PROTO3 = 999, EDITION_2023 = 1000, @@ -10559,6 +10810,9 @@ export namespace google { /** FileDescriptorProto weakDependency */ weakDependency?: (number[]|null); + /** FileDescriptorProto optionDependency */ + optionDependency?: (string[]|null); + /** FileDescriptorProto messageType */ messageType?: (google.protobuf.IDescriptorProto[]|null); @@ -10608,6 +10862,9 @@ export namespace google { /** FileDescriptorProto weakDependency. */ public weakDependency: number[]; + /** FileDescriptorProto optionDependency. */ + public optionDependency: string[]; + /** FileDescriptorProto messageType. */ public messageType: google.protobuf.IDescriptorProto[]; @@ -10742,6 +10999,9 @@ export namespace google { /** DescriptorProto reservedName */ reservedName?: (string[]|null); + + /** DescriptorProto visibility */ + visibility?: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility|null); } /** Represents a DescriptorProto. */ @@ -10783,6 +11043,9 @@ export namespace google { /** DescriptorProto reservedName. */ public reservedName: string[]; + /** DescriptorProto visibility. */ + public visibility: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility); + /** * Creates a new DescriptorProto instance using the specified properties. * @param [properties] Properties to set @@ -11630,6 +11893,9 @@ export namespace google { /** EnumDescriptorProto reservedName */ reservedName?: (string[]|null); + + /** EnumDescriptorProto visibility */ + visibility?: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility|null); } /** Represents an EnumDescriptorProto. */ @@ -11656,6 +11922,9 @@ export namespace google { /** EnumDescriptorProto reservedName. */ public reservedName: string[]; + /** EnumDescriptorProto visibility. */ + public visibility: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility); + /** * Creates a new EnumDescriptorProto instance using the specified properties. * @param [properties] Properties to set @@ -12584,6 +12853,9 @@ export namespace google { /** FieldOptions features */ features?: (google.protobuf.IFeatureSet|null); + /** FieldOptions featureSupport */ + featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** FieldOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); @@ -12639,6 +12911,9 @@ export namespace google { /** FieldOptions features. */ public features?: (google.protobuf.IFeatureSet|null); + /** FieldOptions featureSupport. */ + public featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** FieldOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; @@ -12859,6 +13134,121 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** Properties of a FeatureSupport. */ + interface IFeatureSupport { + + /** FeatureSupport editionIntroduced */ + editionIntroduced?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSupport editionDeprecated */ + editionDeprecated?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSupport deprecationWarning */ + deprecationWarning?: (string|null); + + /** FeatureSupport editionRemoved */ + editionRemoved?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSupport. */ + class FeatureSupport implements IFeatureSupport { + + /** + * Constructs a new FeatureSupport. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IFeatureSupport); + + /** FeatureSupport editionIntroduced. */ + public editionIntroduced: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSupport editionDeprecated. */ + public editionDeprecated: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSupport deprecationWarning. */ + public deprecationWarning: string; + + /** FeatureSupport editionRemoved. */ + public editionRemoved: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSupport instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSupport instance + */ + public static create(properties?: google.protobuf.FieldOptions.IFeatureSupport): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Encodes the specified FeatureSupport message. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @param message FeatureSupport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IFeatureSupport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSupport message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @param message FeatureSupport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IFeatureSupport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Verifies a FeatureSupport message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSupport message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSupport + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Creates a plain object from a FeatureSupport message. Also converts values to other types if specified. + * @param message FeatureSupport + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.FeatureSupport, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSupport to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSupport + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } /** Properties of an OneofOptions. */ @@ -13097,6 +13487,9 @@ export namespace google { /** EnumValueOptions debugRedact */ debugRedact?: (boolean|null); + /** EnumValueOptions featureSupport */ + featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** EnumValueOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); } @@ -13119,6 +13512,9 @@ export namespace google { /** EnumValueOptions debugRedact. */ public debugRedact: boolean; + /** EnumValueOptions featureSupport. */ + public featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** EnumValueOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; @@ -13714,6 +14110,12 @@ export namespace google { /** FeatureSet jsonFormat */ jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); + + /** FeatureSet enforceNamingStyle */ + enforceNamingStyle?: (google.protobuf.FeatureSet.EnforceNamingStyle|keyof typeof google.protobuf.FeatureSet.EnforceNamingStyle|null); + + /** FeatureSet defaultSymbolVisibility */ + defaultSymbolVisibility?: (google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|keyof typeof google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|null); } /** Represents a FeatureSet. */ @@ -13743,6 +14145,12 @@ export namespace google { /** FeatureSet jsonFormat. */ public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); + /** FeatureSet enforceNamingStyle. */ + public enforceNamingStyle: (google.protobuf.FeatureSet.EnforceNamingStyle|keyof typeof google.protobuf.FeatureSet.EnforceNamingStyle); + + /** FeatureSet defaultSymbolVisibility. */ + public defaultSymbolVisibility: (google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|keyof typeof google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility); + /** * Creates a new FeatureSet instance using the specified properties. * @param [properties] Properties to set @@ -13865,6 +14273,116 @@ export namespace google { ALLOW = 1, LEGACY_BEST_EFFORT = 2 } + + /** EnforceNamingStyle enum. */ + enum EnforceNamingStyle { + ENFORCE_NAMING_STYLE_UNKNOWN = 0, + STYLE2024 = 1, + STYLE_LEGACY = 2 + } + + /** Properties of a VisibilityFeature. */ + interface IVisibilityFeature { + } + + /** Represents a VisibilityFeature. */ + class VisibilityFeature implements IVisibilityFeature { + + /** + * Constructs a new VisibilityFeature. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSet.IVisibilityFeature); + + /** + * Creates a new VisibilityFeature instance using the specified properties. + * @param [properties] Properties to set + * @returns VisibilityFeature instance + */ + public static create(properties?: google.protobuf.FeatureSet.IVisibilityFeature): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Encodes the specified VisibilityFeature message. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @param message VisibilityFeature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSet.IVisibilityFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VisibilityFeature message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @param message VisibilityFeature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSet.IVisibilityFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Verifies a VisibilityFeature message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VisibilityFeature message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VisibilityFeature + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Creates a plain object from a VisibilityFeature message. Also converts values to other types if specified. + * @param message VisibilityFeature + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet.VisibilityFeature, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VisibilityFeature to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VisibilityFeature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace VisibilityFeature { + + /** DefaultSymbolVisibility enum. */ + enum DefaultSymbolVisibility { + DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0, + EXPORT_ALL = 1, + EXPORT_TOP_LEVEL = 2, + LOCAL_ALL = 3, + STRICT = 4 + } + } } /** Properties of a FeatureSetDefaults. */ @@ -13984,8 +14502,11 @@ export namespace google { /** FeatureSetEditionDefault edition */ edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - /** FeatureSetEditionDefault features */ - features?: (google.protobuf.IFeatureSet|null); + /** FeatureSetEditionDefault overridableFeatures */ + overridableFeatures?: (google.protobuf.IFeatureSet|null); + + /** FeatureSetEditionDefault fixedFeatures */ + fixedFeatures?: (google.protobuf.IFeatureSet|null); } /** Represents a FeatureSetEditionDefault. */ @@ -14000,8 +14521,11 @@ export namespace google { /** FeatureSetEditionDefault edition. */ public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - /** FeatureSetEditionDefault features. */ - public features?: (google.protobuf.IFeatureSet|null); + /** FeatureSetEditionDefault overridableFeatures. */ + public overridableFeatures?: (google.protobuf.IFeatureSet|null); + + /** FeatureSetEditionDefault fixedFeatures. */ + public fixedFeatures?: (google.protobuf.IFeatureSet|null); /** * Creates a new FeatureSetEditionDefault instance using the specified properties. @@ -14534,6 +15058,13 @@ export namespace google { } } + /** SymbolVisibility enum. */ + enum SymbolVisibility { + VISIBILITY_UNSET = 0, + VISIBILITY_LOCAL = 1, + VISIBILITY_EXPORT = 2 + } + /** Properties of a Timestamp. */ interface ITimestamp { diff --git a/packages/google-api-servicemanagement/protos/protos.js b/packages/google-api-servicemanagement/protos/protos.js index bd574fde54c..2b39b996950 100644 --- a/packages/google-api-servicemanagement/protos/protos.js +++ b/packages/google-api-servicemanagement/protos/protos.js @@ -9881,6 +9881,7 @@ * @interface ICommonLanguageSettings * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri * @property {Array.|null} [destinations] CommonLanguageSettings destinations + * @property {google.api.ISelectiveGapicGeneration|null} [selectiveGapicGeneration] CommonLanguageSettings selectiveGapicGeneration */ /** @@ -9915,6 +9916,14 @@ */ CommonLanguageSettings.prototype.destinations = $util.emptyArray; + /** + * CommonLanguageSettings selectiveGapicGeneration. + * @member {google.api.ISelectiveGapicGeneration|null|undefined} selectiveGapicGeneration + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.selectiveGapicGeneration = null; + /** * Creates a new CommonLanguageSettings instance using the specified properties. * @function create @@ -9947,6 +9956,8 @@ writer.int32(message.destinations[i]); writer.ldelim(); } + if (message.selectiveGapicGeneration != null && Object.hasOwnProperty.call(message, "selectiveGapicGeneration")) + $root.google.api.SelectiveGapicGeneration.encode(message.selectiveGapicGeneration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -9998,6 +10009,10 @@ message.destinations.push(reader.int32()); break; } + case 3: { + message.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -10049,6 +10064,11 @@ break; } } + if (message.selectiveGapicGeneration != null && message.hasOwnProperty("selectiveGapicGeneration")) { + var error = $root.google.api.SelectiveGapicGeneration.verify(message.selectiveGapicGeneration); + if (error) + return "selectiveGapicGeneration." + error; + } return null; }; @@ -10091,6 +10111,11 @@ break; } } + if (object.selectiveGapicGeneration != null) { + if (typeof object.selectiveGapicGeneration !== "object") + throw TypeError(".google.api.CommonLanguageSettings.selectiveGapicGeneration: object expected"); + message.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.fromObject(object.selectiveGapicGeneration); + } return message; }; @@ -10109,8 +10134,10 @@ var object = {}; if (options.arrays || options.defaults) object.destinations = []; - if (options.defaults) + if (options.defaults) { object.referenceDocsUri = ""; + object.selectiveGapicGeneration = null; + } if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) object.referenceDocsUri = message.referenceDocsUri; if (message.destinations && message.destinations.length) { @@ -10118,6 +10145,8 @@ for (var j = 0; j < message.destinations.length; ++j) object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; } + if (message.selectiveGapicGeneration != null && message.hasOwnProperty("selectiveGapicGeneration")) + object.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.toObject(message.selectiveGapicGeneration, options); return object; }; @@ -11940,6 +11969,7 @@ * @memberof google.api * @interface IPythonSettings * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common + * @property {google.api.PythonSettings.IExperimentalFeatures|null} [experimentalFeatures] PythonSettings experimentalFeatures */ /** @@ -11965,6 +11995,14 @@ */ PythonSettings.prototype.common = null; + /** + * PythonSettings experimentalFeatures. + * @member {google.api.PythonSettings.IExperimentalFeatures|null|undefined} experimentalFeatures + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.experimentalFeatures = null; + /** * Creates a new PythonSettings instance using the specified properties. * @function create @@ -11991,6 +12029,8 @@ writer = $Writer.create(); if (message.common != null && Object.hasOwnProperty.call(message, "common")) $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.experimentalFeatures != null && Object.hasOwnProperty.call(message, "experimentalFeatures")) + $root.google.api.PythonSettings.ExperimentalFeatures.encode(message.experimentalFeatures, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -12031,6 +12071,10 @@ message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); break; } + case 2: { + message.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -12071,6 +12115,11 @@ if (error) return "common." + error; } + if (message.experimentalFeatures != null && message.hasOwnProperty("experimentalFeatures")) { + var error = $root.google.api.PythonSettings.ExperimentalFeatures.verify(message.experimentalFeatures); + if (error) + return "experimentalFeatures." + error; + } return null; }; @@ -12091,6 +12140,11 @@ throw TypeError(".google.api.PythonSettings.common: object expected"); message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); } + if (object.experimentalFeatures != null) { + if (typeof object.experimentalFeatures !== "object") + throw TypeError(".google.api.PythonSettings.experimentalFeatures: object expected"); + message.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.fromObject(object.experimentalFeatures); + } return message; }; @@ -12107,10 +12161,14 @@ if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.common = null; + object.experimentalFeatures = null; + } if (message.common != null && message.hasOwnProperty("common")) object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + if (message.experimentalFeatures != null && message.hasOwnProperty("experimentalFeatures")) + object.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.toObject(message.experimentalFeatures, options); return object; }; @@ -12140,6 +12198,258 @@ return typeUrlPrefix + "/google.api.PythonSettings"; }; + PythonSettings.ExperimentalFeatures = (function() { + + /** + * Properties of an ExperimentalFeatures. + * @memberof google.api.PythonSettings + * @interface IExperimentalFeatures + * @property {boolean|null} [restAsyncIoEnabled] ExperimentalFeatures restAsyncIoEnabled + * @property {boolean|null} [protobufPythonicTypesEnabled] ExperimentalFeatures protobufPythonicTypesEnabled + * @property {boolean|null} [unversionedPackageDisabled] ExperimentalFeatures unversionedPackageDisabled + */ + + /** + * Constructs a new ExperimentalFeatures. + * @memberof google.api.PythonSettings + * @classdesc Represents an ExperimentalFeatures. + * @implements IExperimentalFeatures + * @constructor + * @param {google.api.PythonSettings.IExperimentalFeatures=} [properties] Properties to set + */ + function ExperimentalFeatures(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExperimentalFeatures restAsyncIoEnabled. + * @member {boolean} restAsyncIoEnabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.restAsyncIoEnabled = false; + + /** + * ExperimentalFeatures protobufPythonicTypesEnabled. + * @member {boolean} protobufPythonicTypesEnabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.protobufPythonicTypesEnabled = false; + + /** + * ExperimentalFeatures unversionedPackageDisabled. + * @member {boolean} unversionedPackageDisabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.unversionedPackageDisabled = false; + + /** + * Creates a new ExperimentalFeatures instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures=} [properties] Properties to set + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures instance + */ + ExperimentalFeatures.create = function create(properties) { + return new ExperimentalFeatures(properties); + }; + + /** + * Encodes the specified ExperimentalFeatures message. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures} message ExperimentalFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExperimentalFeatures.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.restAsyncIoEnabled != null && Object.hasOwnProperty.call(message, "restAsyncIoEnabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.restAsyncIoEnabled); + if (message.protobufPythonicTypesEnabled != null && Object.hasOwnProperty.call(message, "protobufPythonicTypesEnabled")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.protobufPythonicTypesEnabled); + if (message.unversionedPackageDisabled != null && Object.hasOwnProperty.call(message, "unversionedPackageDisabled")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.unversionedPackageDisabled); + return writer; + }; + + /** + * Encodes the specified ExperimentalFeatures message, length delimited. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures} message ExperimentalFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExperimentalFeatures.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExperimentalFeatures.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings.ExperimentalFeatures(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.restAsyncIoEnabled = reader.bool(); + break; + } + case 2: { + message.protobufPythonicTypesEnabled = reader.bool(); + break; + } + case 3: { + message.unversionedPackageDisabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExperimentalFeatures.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExperimentalFeatures message. + * @function verify + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExperimentalFeatures.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.restAsyncIoEnabled != null && message.hasOwnProperty("restAsyncIoEnabled")) + if (typeof message.restAsyncIoEnabled !== "boolean") + return "restAsyncIoEnabled: boolean expected"; + if (message.protobufPythonicTypesEnabled != null && message.hasOwnProperty("protobufPythonicTypesEnabled")) + if (typeof message.protobufPythonicTypesEnabled !== "boolean") + return "protobufPythonicTypesEnabled: boolean expected"; + if (message.unversionedPackageDisabled != null && message.hasOwnProperty("unversionedPackageDisabled")) + if (typeof message.unversionedPackageDisabled !== "boolean") + return "unversionedPackageDisabled: boolean expected"; + return null; + }; + + /** + * Creates an ExperimentalFeatures message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + */ + ExperimentalFeatures.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PythonSettings.ExperimentalFeatures) + return object; + var message = new $root.google.api.PythonSettings.ExperimentalFeatures(); + if (object.restAsyncIoEnabled != null) + message.restAsyncIoEnabled = Boolean(object.restAsyncIoEnabled); + if (object.protobufPythonicTypesEnabled != null) + message.protobufPythonicTypesEnabled = Boolean(object.protobufPythonicTypesEnabled); + if (object.unversionedPackageDisabled != null) + message.unversionedPackageDisabled = Boolean(object.unversionedPackageDisabled); + return message; + }; + + /** + * Creates a plain object from an ExperimentalFeatures message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.ExperimentalFeatures} message ExperimentalFeatures + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExperimentalFeatures.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.restAsyncIoEnabled = false; + object.protobufPythonicTypesEnabled = false; + object.unversionedPackageDisabled = false; + } + if (message.restAsyncIoEnabled != null && message.hasOwnProperty("restAsyncIoEnabled")) + object.restAsyncIoEnabled = message.restAsyncIoEnabled; + if (message.protobufPythonicTypesEnabled != null && message.hasOwnProperty("protobufPythonicTypesEnabled")) + object.protobufPythonicTypesEnabled = message.protobufPythonicTypesEnabled; + if (message.unversionedPackageDisabled != null && message.hasOwnProperty("unversionedPackageDisabled")) + object.unversionedPackageDisabled = message.unversionedPackageDisabled; + return object; + }; + + /** + * Converts this ExperimentalFeatures to JSON. + * @function toJSON + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + * @returns {Object.} JSON object + */ + ExperimentalFeatures.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExperimentalFeatures + * @function getTypeUrl + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExperimentalFeatures.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings.ExperimentalFeatures"; + }; + + return ExperimentalFeatures; + })(); + return PythonSettings; })(); @@ -13016,6 +13326,7 @@ * @memberof google.api * @interface IGoSettings * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common + * @property {Object.|null} [renamedServices] GoSettings renamedServices */ /** @@ -13027,6 +13338,7 @@ * @param {google.api.IGoSettings=} [properties] Properties to set */ function GoSettings(properties) { + this.renamedServices = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13041,6 +13353,14 @@ */ GoSettings.prototype.common = null; + /** + * GoSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.renamedServices = $util.emptyObject; + /** * Creates a new GoSettings instance using the specified properties. * @function create @@ -13067,6 +13387,9 @@ writer = $Writer.create(); if (message.common != null && Object.hasOwnProperty.call(message, "common")) $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); return writer; }; @@ -13097,7 +13420,7 @@ GoSettings.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(), key, value; while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) @@ -13107,6 +13430,29 @@ message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); break; } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedServices[key] = value; + break; + } default: reader.skipType(tag & 7); break; @@ -13147,6 +13493,14 @@ if (error) return "common." + error; } + if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } return null; }; @@ -13167,6 +13521,13 @@ throw TypeError(".google.api.GoSettings.common: object expected"); message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); } + if (object.renamedServices) { + if (typeof object.renamedServices !== "object") + throw TypeError(".google.api.GoSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } return message; }; @@ -13183,10 +13544,18 @@ if (!options) options = {}; var object = {}; + if (options.objects || options.defaults) + object.renamedServices = {}; if (options.defaults) object.common = null; if (message.common != null && message.hasOwnProperty("common")) object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } return object; }; @@ -13825,30 +14194,275 @@ return values; })(); - /** - * LaunchStage enum. - * @name google.api.LaunchStage - * @enum {number} - * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value - * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value - * @property {number} PRELAUNCH=7 PRELAUNCH value - * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value - * @property {number} ALPHA=2 ALPHA value - * @property {number} BETA=3 BETA value - * @property {number} GA=4 GA value - * @property {number} DEPRECATED=5 DEPRECATED value - */ - api.LaunchStage = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; - values[valuesById[6] = "UNIMPLEMENTED"] = 6; - values[valuesById[7] = "PRELAUNCH"] = 7; - values[valuesById[1] = "EARLY_ACCESS"] = 1; - values[valuesById[2] = "ALPHA"] = 2; - values[valuesById[3] = "BETA"] = 3; - values[valuesById[4] = "GA"] = 4; - values[valuesById[5] = "DEPRECATED"] = 5; - return values; + api.SelectiveGapicGeneration = (function() { + + /** + * Properties of a SelectiveGapicGeneration. + * @memberof google.api + * @interface ISelectiveGapicGeneration + * @property {Array.|null} [methods] SelectiveGapicGeneration methods + * @property {boolean|null} [generateOmittedAsInternal] SelectiveGapicGeneration generateOmittedAsInternal + */ + + /** + * Constructs a new SelectiveGapicGeneration. + * @memberof google.api + * @classdesc Represents a SelectiveGapicGeneration. + * @implements ISelectiveGapicGeneration + * @constructor + * @param {google.api.ISelectiveGapicGeneration=} [properties] Properties to set + */ + function SelectiveGapicGeneration(properties) { + this.methods = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SelectiveGapicGeneration methods. + * @member {Array.} methods + * @memberof google.api.SelectiveGapicGeneration + * @instance + */ + SelectiveGapicGeneration.prototype.methods = $util.emptyArray; + + /** + * SelectiveGapicGeneration generateOmittedAsInternal. + * @member {boolean} generateOmittedAsInternal + * @memberof google.api.SelectiveGapicGeneration + * @instance + */ + SelectiveGapicGeneration.prototype.generateOmittedAsInternal = false; + + /** + * Creates a new SelectiveGapicGeneration instance using the specified properties. + * @function create + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration=} [properties] Properties to set + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration instance + */ + SelectiveGapicGeneration.create = function create(properties) { + return new SelectiveGapicGeneration(properties); + }; + + /** + * Encodes the specified SelectiveGapicGeneration message. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @function encode + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration} message SelectiveGapicGeneration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelectiveGapicGeneration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.methods != null && message.methods.length) + for (var i = 0; i < message.methods.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.methods[i]); + if (message.generateOmittedAsInternal != null && Object.hasOwnProperty.call(message, "generateOmittedAsInternal")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.generateOmittedAsInternal); + return writer; + }; + + /** + * Encodes the specified SelectiveGapicGeneration message, length delimited. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration} message SelectiveGapicGeneration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelectiveGapicGeneration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer. + * @function decode + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelectiveGapicGeneration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.SelectiveGapicGeneration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.methods && message.methods.length)) + message.methods = []; + message.methods.push(reader.string()); + break; + } + case 2: { + message.generateOmittedAsInternal = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelectiveGapicGeneration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SelectiveGapicGeneration message. + * @function verify + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SelectiveGapicGeneration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.methods != null && message.hasOwnProperty("methods")) { + if (!Array.isArray(message.methods)) + return "methods: array expected"; + for (var i = 0; i < message.methods.length; ++i) + if (!$util.isString(message.methods[i])) + return "methods: string[] expected"; + } + if (message.generateOmittedAsInternal != null && message.hasOwnProperty("generateOmittedAsInternal")) + if (typeof message.generateOmittedAsInternal !== "boolean") + return "generateOmittedAsInternal: boolean expected"; + return null; + }; + + /** + * Creates a SelectiveGapicGeneration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {Object.} object Plain object + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + */ + SelectiveGapicGeneration.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.SelectiveGapicGeneration) + return object; + var message = new $root.google.api.SelectiveGapicGeneration(); + if (object.methods) { + if (!Array.isArray(object.methods)) + throw TypeError(".google.api.SelectiveGapicGeneration.methods: array expected"); + message.methods = []; + for (var i = 0; i < object.methods.length; ++i) + message.methods[i] = String(object.methods[i]); + } + if (object.generateOmittedAsInternal != null) + message.generateOmittedAsInternal = Boolean(object.generateOmittedAsInternal); + return message; + }; + + /** + * Creates a plain object from a SelectiveGapicGeneration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.SelectiveGapicGeneration} message SelectiveGapicGeneration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SelectiveGapicGeneration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.methods = []; + if (options.defaults) + object.generateOmittedAsInternal = false; + if (message.methods && message.methods.length) { + object.methods = []; + for (var j = 0; j < message.methods.length; ++j) + object.methods[j] = message.methods[j]; + } + if (message.generateOmittedAsInternal != null && message.hasOwnProperty("generateOmittedAsInternal")) + object.generateOmittedAsInternal = message.generateOmittedAsInternal; + return object; + }; + + /** + * Converts this SelectiveGapicGeneration to JSON. + * @function toJSON + * @memberof google.api.SelectiveGapicGeneration + * @instance + * @returns {Object.} JSON object + */ + SelectiveGapicGeneration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SelectiveGapicGeneration + * @function getTypeUrl + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SelectiveGapicGeneration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.SelectiveGapicGeneration"; + }; + + return SelectiveGapicGeneration; + })(); + + /** + * LaunchStage enum. + * @name google.api.LaunchStage + * @enum {number} + * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value + * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value + * @property {number} PRELAUNCH=7 PRELAUNCH value + * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value + * @property {number} ALPHA=2 ALPHA value + * @property {number} BETA=3 BETA value + * @property {number} GA=4 GA value + * @property {number} DEPRECATED=5 DEPRECATED value + */ + api.LaunchStage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; + values[valuesById[6] = "UNIMPLEMENTED"] = 6; + values[valuesById[7] = "PRELAUNCH"] = 7; + values[valuesById[1] = "EARLY_ACCESS"] = 1; + values[valuesById[2] = "ALPHA"] = 2; + values[valuesById[3] = "BETA"] = 3; + values[valuesById[4] = "GA"] = 4; + values[valuesById[5] = "DEPRECATED"] = 5; + return values; })(); api.Service = (function() { @@ -22008,6 +22622,7 @@ * @property {google.api.LaunchStage|null} [launchStage] MetricDescriptorMetadata launchStage * @property {google.protobuf.IDuration|null} [samplePeriod] MetricDescriptorMetadata samplePeriod * @property {google.protobuf.IDuration|null} [ingestDelay] MetricDescriptorMetadata ingestDelay + * @property {Array.|null} [timeSeriesResourceHierarchyLevel] MetricDescriptorMetadata timeSeriesResourceHierarchyLevel */ /** @@ -22019,6 +22634,7 @@ * @param {google.api.MetricDescriptor.IMetricDescriptorMetadata=} [properties] Properties to set */ function MetricDescriptorMetadata(properties) { + this.timeSeriesResourceHierarchyLevel = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -22049,6 +22665,14 @@ */ MetricDescriptorMetadata.prototype.ingestDelay = null; + /** + * MetricDescriptorMetadata timeSeriesResourceHierarchyLevel. + * @member {Array.} timeSeriesResourceHierarchyLevel + * @memberof google.api.MetricDescriptor.MetricDescriptorMetadata + * @instance + */ + MetricDescriptorMetadata.prototype.timeSeriesResourceHierarchyLevel = $util.emptyArray; + /** * Creates a new MetricDescriptorMetadata instance using the specified properties. * @function create @@ -22079,6 +22703,12 @@ $root.google.protobuf.Duration.encode(message.samplePeriod, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.ingestDelay != null && Object.hasOwnProperty.call(message, "ingestDelay")) $root.google.protobuf.Duration.encode(message.ingestDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.timeSeriesResourceHierarchyLevel != null && message.timeSeriesResourceHierarchyLevel.length) { + writer.uint32(/* id 4, wireType 2 =*/34).fork(); + for (var i = 0; i < message.timeSeriesResourceHierarchyLevel.length; ++i) + writer.int32(message.timeSeriesResourceHierarchyLevel[i]); + writer.ldelim(); + } return writer; }; @@ -22127,6 +22757,17 @@ message.ingestDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); break; } + case 4: { + if (!(message.timeSeriesResourceHierarchyLevel && message.timeSeriesResourceHierarchyLevel.length)) + message.timeSeriesResourceHierarchyLevel = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.timeSeriesResourceHierarchyLevel.push(reader.int32()); + } else + message.timeSeriesResourceHierarchyLevel.push(reader.int32()); + break; + } default: reader.skipType(tag & 7); break; @@ -22186,6 +22827,20 @@ if (error) return "ingestDelay." + error; } + if (message.timeSeriesResourceHierarchyLevel != null && message.hasOwnProperty("timeSeriesResourceHierarchyLevel")) { + if (!Array.isArray(message.timeSeriesResourceHierarchyLevel)) + return "timeSeriesResourceHierarchyLevel: array expected"; + for (var i = 0; i < message.timeSeriesResourceHierarchyLevel.length; ++i) + switch (message.timeSeriesResourceHierarchyLevel[i]) { + default: + return "timeSeriesResourceHierarchyLevel: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } return null; }; @@ -22251,6 +22906,35 @@ throw TypeError(".google.api.MetricDescriptor.MetricDescriptorMetadata.ingestDelay: object expected"); message.ingestDelay = $root.google.protobuf.Duration.fromObject(object.ingestDelay); } + if (object.timeSeriesResourceHierarchyLevel) { + if (!Array.isArray(object.timeSeriesResourceHierarchyLevel)) + throw TypeError(".google.api.MetricDescriptor.MetricDescriptorMetadata.timeSeriesResourceHierarchyLevel: array expected"); + message.timeSeriesResourceHierarchyLevel = []; + for (var i = 0; i < object.timeSeriesResourceHierarchyLevel.length; ++i) + switch (object.timeSeriesResourceHierarchyLevel[i]) { + default: + if (typeof object.timeSeriesResourceHierarchyLevel[i] === "number") { + message.timeSeriesResourceHierarchyLevel[i] = object.timeSeriesResourceHierarchyLevel[i]; + break; + } + case "TIME_SERIES_RESOURCE_HIERARCHY_LEVEL_UNSPECIFIED": + case 0: + message.timeSeriesResourceHierarchyLevel[i] = 0; + break; + case "PROJECT": + case 1: + message.timeSeriesResourceHierarchyLevel[i] = 1; + break; + case "ORGANIZATION": + case 2: + message.timeSeriesResourceHierarchyLevel[i] = 2; + break; + case "FOLDER": + case 3: + message.timeSeriesResourceHierarchyLevel[i] = 3; + break; + } + } return message; }; @@ -22267,6 +22951,8 @@ if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.timeSeriesResourceHierarchyLevel = []; if (options.defaults) { object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; object.samplePeriod = null; @@ -22278,6 +22964,11 @@ object.samplePeriod = $root.google.protobuf.Duration.toObject(message.samplePeriod, options); if (message.ingestDelay != null && message.hasOwnProperty("ingestDelay")) object.ingestDelay = $root.google.protobuf.Duration.toObject(message.ingestDelay, options); + if (message.timeSeriesResourceHierarchyLevel && message.timeSeriesResourceHierarchyLevel.length) { + object.timeSeriesResourceHierarchyLevel = []; + for (var j = 0; j < message.timeSeriesResourceHierarchyLevel.length; ++j) + object.timeSeriesResourceHierarchyLevel[j] = options.enums === String ? $root.google.api.MetricDescriptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel[message.timeSeriesResourceHierarchyLevel[j]] === undefined ? message.timeSeriesResourceHierarchyLevel[j] : $root.google.api.MetricDescriptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel[message.timeSeriesResourceHierarchyLevel[j]] : message.timeSeriesResourceHierarchyLevel[j]; + } return object; }; @@ -22307,6 +22998,24 @@ return typeUrlPrefix + "/google.api.MetricDescriptor.MetricDescriptorMetadata"; }; + /** + * TimeSeriesResourceHierarchyLevel enum. + * @name google.api.MetricDescriptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel + * @enum {number} + * @property {number} TIME_SERIES_RESOURCE_HIERARCHY_LEVEL_UNSPECIFIED=0 TIME_SERIES_RESOURCE_HIERARCHY_LEVEL_UNSPECIFIED value + * @property {number} PROJECT=1 PROJECT value + * @property {number} ORGANIZATION=2 ORGANIZATION value + * @property {number} FOLDER=3 FOLDER value + */ + MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TIME_SERIES_RESOURCE_HIERARCHY_LEVEL_UNSPECIFIED"] = 0; + values[valuesById[1] = "PROJECT"] = 1; + values[valuesById[2] = "ORGANIZATION"] = 2; + values[valuesById[3] = "FOLDER"] = 3; + return values; + })(); + return MetricDescriptorMetadata; })(); @@ -26803,6 +27512,7 @@ * @name google.protobuf.Edition * @enum {number} * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value + * @property {number} EDITION_LEGACY=900 EDITION_LEGACY value * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value * @property {number} EDITION_2023=1000 EDITION_2023 value @@ -26817,6 +27527,7 @@ protobuf.Edition = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "EDITION_UNKNOWN"] = 0; + values[valuesById[900] = "EDITION_LEGACY"] = 900; values[valuesById[998] = "EDITION_PROTO2"] = 998; values[valuesById[999] = "EDITION_PROTO3"] = 999; values[valuesById[1000] = "EDITION_2023"] = 1000; @@ -26841,6 +27552,7 @@ * @property {Array.|null} [dependency] FileDescriptorProto dependency * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [optionDependency] FileDescriptorProto optionDependency * @property {Array.|null} [messageType] FileDescriptorProto messageType * @property {Array.|null} [enumType] FileDescriptorProto enumType * @property {Array.|null} [service] FileDescriptorProto service @@ -26863,6 +27575,7 @@ this.dependency = []; this.publicDependency = []; this.weakDependency = []; + this.optionDependency = []; this.messageType = []; this.enumType = []; this.service = []; @@ -26913,6 +27626,14 @@ */ FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + /** + * FileDescriptorProto optionDependency. + * @member {Array.} optionDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.optionDependency = $util.emptyArray; + /** * FileDescriptorProto messageType. * @member {Array.} messageType @@ -27034,6 +27755,9 @@ writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); + if (message.optionDependency != null && message.optionDependency.length) + for (var i = 0; i < message.optionDependency.length; ++i) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.optionDependency[i]); return writer; }; @@ -27106,6 +27830,12 @@ message.weakDependency.push(reader.int32()); break; } + case 15: { + if (!(message.optionDependency && message.optionDependency.length)) + message.optionDependency = []; + message.optionDependency.push(reader.string()); + break; + } case 4: { if (!(message.messageType && message.messageType.length)) message.messageType = []; @@ -27208,6 +27938,13 @@ if (!$util.isInteger(message.weakDependency[i])) return "weakDependency: integer[] expected"; } + if (message.optionDependency != null && message.hasOwnProperty("optionDependency")) { + if (!Array.isArray(message.optionDependency)) + return "optionDependency: array expected"; + for (var i = 0; i < message.optionDependency.length; ++i) + if (!$util.isString(message.optionDependency[i])) + return "optionDependency: string[] expected"; + } if (message.messageType != null && message.hasOwnProperty("messageType")) { if (!Array.isArray(message.messageType)) return "messageType: array expected"; @@ -27262,6 +27999,7 @@ default: return "edition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -27314,6 +28052,13 @@ for (var i = 0; i < object.weakDependency.length; ++i) message.weakDependency[i] = object.weakDependency[i] | 0; } + if (object.optionDependency) { + if (!Array.isArray(object.optionDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.optionDependency: array expected"); + message.optionDependency = []; + for (var i = 0; i < object.optionDependency.length; ++i) + message.optionDependency[i] = String(object.optionDependency[i]); + } if (object.messageType) { if (!Array.isArray(object.messageType)) throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); @@ -27377,6 +28122,10 @@ case 0: message.edition = 0; break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; case "EDITION_PROTO2": case 998: message.edition = 998; @@ -27442,6 +28191,7 @@ object.extension = []; object.publicDependency = []; object.weakDependency = []; + object.optionDependency = []; } if (options.defaults) { object.name = ""; @@ -27498,6 +28248,11 @@ object.syntax = message.syntax; if (message.edition != null && message.hasOwnProperty("edition")) object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + if (message.optionDependency && message.optionDependency.length) { + object.optionDependency = []; + for (var j = 0; j < message.optionDependency.length; ++j) + object.optionDependency[j] = message.optionDependency[j]; + } return object; }; @@ -27546,6 +28301,7 @@ * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options * @property {Array.|null} [reservedRange] DescriptorProto reservedRange * @property {Array.|null} [reservedName] DescriptorProto reservedName + * @property {google.protobuf.SymbolVisibility|null} [visibility] DescriptorProto visibility */ /** @@ -27651,6 +28407,14 @@ */ DescriptorProto.prototype.reservedName = $util.emptyArray; + /** + * DescriptorProto visibility. + * @member {google.protobuf.SymbolVisibility} visibility + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.visibility = 0; + /** * Creates a new DescriptorProto instance using the specified properties. * @function create @@ -27703,6 +28467,8 @@ if (message.reservedName != null && message.reservedName.length) for (var i = 0; i < message.reservedName.length; ++i) writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.visibility); return writer; }; @@ -27795,6 +28561,10 @@ message.reservedName.push(reader.string()); break; } + case 11: { + message.visibility = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -27908,10 +28678,19 @@ if (!$util.isString(message.reservedName[i])) return "reservedName: string[] expected"; } - return null; - }; - - /** + if (message.visibility != null && message.hasOwnProperty("visibility")) + switch (message.visibility) { + default: + return "visibility: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.DescriptorProto @@ -28007,6 +28786,26 @@ for (var i = 0; i < object.reservedName.length; ++i) message.reservedName[i] = String(object.reservedName[i]); } + switch (object.visibility) { + default: + if (typeof object.visibility === "number") { + message.visibility = object.visibility; + break; + } + break; + case "VISIBILITY_UNSET": + case 0: + message.visibility = 0; + break; + case "VISIBILITY_LOCAL": + case 1: + message.visibility = 1; + break; + case "VISIBILITY_EXPORT": + case 2: + message.visibility = 2; + break; + } return message; }; @@ -28036,6 +28835,7 @@ if (options.defaults) { object.name = ""; object.options = null; + object.visibility = options.enums === String ? "VISIBILITY_UNSET" : 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -28081,6 +28881,8 @@ for (var j = 0; j < message.reservedName.length; ++j) object.reservedName[j] = message.reservedName[j]; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + object.visibility = options.enums === String ? $root.google.protobuf.SymbolVisibility[message.visibility] === undefined ? message.visibility : $root.google.protobuf.SymbolVisibility[message.visibility] : message.visibility; return object; }; @@ -30125,6 +30927,7 @@ * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + * @property {google.protobuf.SymbolVisibility|null} [visibility] EnumDescriptorProto visibility */ /** @@ -30185,6 +30988,14 @@ */ EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + /** + * EnumDescriptorProto visibility. + * @member {google.protobuf.SymbolVisibility} visibility + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.visibility = 0; + /** * Creates a new EnumDescriptorProto instance using the specified properties. * @function create @@ -30222,6 +31033,8 @@ if (message.reservedName != null && message.reservedName.length) for (var i = 0; i < message.reservedName.length; ++i) writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.visibility); return writer; }; @@ -30284,6 +31097,10 @@ message.reservedName.push(reader.string()); break; } + case 6: { + message.visibility = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -30352,6 +31169,15 @@ if (!$util.isString(message.reservedName[i])) return "reservedName: string[] expected"; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + switch (message.visibility) { + default: + return "visibility: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; @@ -30401,6 +31227,26 @@ for (var i = 0; i < object.reservedName.length; ++i) message.reservedName[i] = String(object.reservedName[i]); } + switch (object.visibility) { + default: + if (typeof object.visibility === "number") { + message.visibility = object.visibility; + break; + } + break; + case "VISIBILITY_UNSET": + case 0: + message.visibility = 0; + break; + case "VISIBILITY_LOCAL": + case 1: + message.visibility = 1; + break; + case "VISIBILITY_EXPORT": + case 2: + message.visibility = 2; + break; + } return message; }; @@ -30425,6 +31271,7 @@ if (options.defaults) { object.name = ""; object.options = null; + object.visibility = options.enums === String ? "VISIBILITY_UNSET" : 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -30445,6 +31292,8 @@ for (var j = 0; j < message.reservedName.length; ++j) object.reservedName[j] = message.reservedName[j]; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + object.visibility = options.enums === String ? $root.google.protobuf.SymbolVisibility[message.visibility] === undefined ? message.visibility : $root.google.protobuf.SymbolVisibility[message.visibility] : message.visibility; return object; }; @@ -32690,6 +33539,7 @@ * @property {Array.|null} [targets] FieldOptions targets * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features + * @property {google.protobuf.FieldOptions.IFeatureSupport|null} [featureSupport] FieldOptions featureSupport * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior * @property {google.api.IFieldPolicy|null} [".google.api.fieldPolicy"] FieldOptions .google.api.fieldPolicy @@ -32810,6 +33660,14 @@ */ FieldOptions.prototype.features = null; + /** + * FieldOptions featureSupport. + * @member {google.protobuf.FieldOptions.IFeatureSupport|null|undefined} featureSupport + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.featureSupport = null; + /** * FieldOptions uninterpretedOption. * @member {Array.} uninterpretedOption @@ -32884,6 +33742,8 @@ $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); if (message.features != null && Object.hasOwnProperty.call(message, "features")) $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) + $root.google.protobuf.FieldOptions.FeatureSupport.encode(message.featureSupport, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); @@ -32985,6 +33845,10 @@ message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); break; } + case 22: { + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.decode(reader, reader.uint32()); + break; + } case 999: { if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; @@ -33120,6 +33984,11 @@ if (error) return "features." + error; } + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) { + var error = $root.google.protobuf.FieldOptions.FeatureSupport.verify(message.featureSupport); + if (error) + return "featureSupport." + error; + } if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; @@ -33308,6 +34177,11 @@ throw TypeError(".google.protobuf.FieldOptions.features: object expected"); message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); } + if (object.featureSupport != null) { + if (typeof object.featureSupport !== "object") + throw TypeError(".google.protobuf.FieldOptions.featureSupport: object expected"); + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.fromObject(object.featureSupport); + } if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); @@ -33405,6 +34279,7 @@ object.debugRedact = false; object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; object.features = null; + object.featureSupport = null; object[".google.api.fieldPolicy"] = null; } if (message.ctype != null && message.hasOwnProperty("ctype")) @@ -33437,6 +34312,8 @@ } if (message.features != null && message.hasOwnProperty("features")) object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) + object.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.toObject(message.featureSupport, options); if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) @@ -33709,6 +34586,7 @@ default: return "edition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -33750,103 +34628,589 @@ case 0: message.edition = 0; break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; case "EDITION_PROTO2": case 998: message.edition = 998; break; case "EDITION_PROTO3": case 999: - message.edition = 999; + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this EditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + * @returns {Object.} JSON object + */ + EditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; + }; + + return EditionDefault; + })(); + + FieldOptions.FeatureSupport = (function() { + + /** + * Properties of a FeatureSupport. + * @memberof google.protobuf.FieldOptions + * @interface IFeatureSupport + * @property {google.protobuf.Edition|null} [editionIntroduced] FeatureSupport editionIntroduced + * @property {google.protobuf.Edition|null} [editionDeprecated] FeatureSupport editionDeprecated + * @property {string|null} [deprecationWarning] FeatureSupport deprecationWarning + * @property {google.protobuf.Edition|null} [editionRemoved] FeatureSupport editionRemoved + */ + + /** + * Constructs a new FeatureSupport. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents a FeatureSupport. + * @implements IFeatureSupport + * @constructor + * @param {google.protobuf.FieldOptions.IFeatureSupport=} [properties] Properties to set + */ + function FeatureSupport(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSupport editionIntroduced. + * @member {google.protobuf.Edition} editionIntroduced + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionIntroduced = 0; + + /** + * FeatureSupport editionDeprecated. + * @member {google.protobuf.Edition} editionDeprecated + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionDeprecated = 0; + + /** + * FeatureSupport deprecationWarning. + * @member {string} deprecationWarning + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.deprecationWarning = ""; + + /** + * FeatureSupport editionRemoved. + * @member {google.protobuf.Edition} editionRemoved + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionRemoved = 0; + + /** + * Creates a new FeatureSupport instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport instance + */ + FeatureSupport.create = function create(properties) { + return new FeatureSupport(properties); + }; + + /** + * Encodes the specified FeatureSupport message. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport} message FeatureSupport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSupport.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.editionIntroduced != null && Object.hasOwnProperty.call(message, "editionIntroduced")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.editionIntroduced); + if (message.editionDeprecated != null && Object.hasOwnProperty.call(message, "editionDeprecated")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.editionDeprecated); + if (message.deprecationWarning != null && Object.hasOwnProperty.call(message, "deprecationWarning")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.deprecationWarning); + if (message.editionRemoved != null && Object.hasOwnProperty.call(message, "editionRemoved")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.editionRemoved); + return writer; + }; + + /** + * Encodes the specified FeatureSupport message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport} message FeatureSupport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSupport.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSupport.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.FeatureSupport(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.editionIntroduced = reader.int32(); + break; + } + case 2: { + message.editionDeprecated = reader.int32(); + break; + } + case 3: { + message.deprecationWarning = reader.string(); + break; + } + case 4: { + message.editionRemoved = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSupport.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSupport message. + * @function verify + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSupport.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.editionIntroduced != null && message.hasOwnProperty("editionIntroduced")) + switch (message.editionIntroduced) { + default: + return "editionIntroduced: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.editionDeprecated != null && message.hasOwnProperty("editionDeprecated")) + switch (message.editionDeprecated) { + default: + return "editionDeprecated: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.deprecationWarning != null && message.hasOwnProperty("deprecationWarning")) + if (!$util.isString(message.deprecationWarning)) + return "deprecationWarning: string expected"; + if (message.editionRemoved != null && message.hasOwnProperty("editionRemoved")) + switch (message.editionRemoved) { + default: + return "editionRemoved: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FeatureSupport message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + */ + FeatureSupport.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions.FeatureSupport) + return object; + var message = new $root.google.protobuf.FieldOptions.FeatureSupport(); + switch (object.editionIntroduced) { + default: + if (typeof object.editionIntroduced === "number") { + message.editionIntroduced = object.editionIntroduced; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionIntroduced = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionIntroduced = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionIntroduced = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionIntroduced = 999; + break; + case "EDITION_2023": + case 1000: + message.editionIntroduced = 1000; + break; + case "EDITION_2024": + case 1001: + message.editionIntroduced = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.editionIntroduced = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.editionIntroduced = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.editionIntroduced = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.editionIntroduced = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.editionIntroduced = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.editionIntroduced = 2147483647; + break; + } + switch (object.editionDeprecated) { + default: + if (typeof object.editionDeprecated === "number") { + message.editionDeprecated = object.editionDeprecated; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionDeprecated = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionDeprecated = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionDeprecated = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionDeprecated = 999; + break; + case "EDITION_2023": + case 1000: + message.editionDeprecated = 1000; + break; + case "EDITION_2024": + case 1001: + message.editionDeprecated = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.editionDeprecated = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.editionDeprecated = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.editionDeprecated = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.editionDeprecated = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.editionDeprecated = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.editionDeprecated = 2147483647; + break; + } + if (object.deprecationWarning != null) + message.deprecationWarning = String(object.deprecationWarning); + switch (object.editionRemoved) { + default: + if (typeof object.editionRemoved === "number") { + message.editionRemoved = object.editionRemoved; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionRemoved = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionRemoved = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionRemoved = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionRemoved = 999; break; case "EDITION_2023": case 1000: - message.edition = 1000; + message.editionRemoved = 1000; break; case "EDITION_2024": case 1001: - message.edition = 1001; + message.editionRemoved = 1001; break; case "EDITION_1_TEST_ONLY": case 1: - message.edition = 1; + message.editionRemoved = 1; break; case "EDITION_2_TEST_ONLY": case 2: - message.edition = 2; + message.editionRemoved = 2; break; case "EDITION_99997_TEST_ONLY": case 99997: - message.edition = 99997; + message.editionRemoved = 99997; break; case "EDITION_99998_TEST_ONLY": case 99998: - message.edition = 99998; + message.editionRemoved = 99998; break; case "EDITION_99999_TEST_ONLY": case 99999: - message.edition = 99999; + message.editionRemoved = 99999; break; case "EDITION_MAX": case 2147483647: - message.edition = 2147483647; + message.editionRemoved = 2147483647; break; } - if (object.value != null) - message.value = String(object.value); return message; }; /** - * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * Creates a plain object from a FeatureSupport message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.FieldOptions.EditionDefault + * @memberof google.protobuf.FieldOptions.FeatureSupport * @static - * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault + * @param {google.protobuf.FieldOptions.FeatureSupport} message FeatureSupport * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EditionDefault.toObject = function toObject(message, options) { + FeatureSupport.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.value = ""; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + object.editionIntroduced = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.editionDeprecated = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.deprecationWarning = ""; + object.editionRemoved = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.editionIntroduced != null && message.hasOwnProperty("editionIntroduced")) + object.editionIntroduced = options.enums === String ? $root.google.protobuf.Edition[message.editionIntroduced] === undefined ? message.editionIntroduced : $root.google.protobuf.Edition[message.editionIntroduced] : message.editionIntroduced; + if (message.editionDeprecated != null && message.hasOwnProperty("editionDeprecated")) + object.editionDeprecated = options.enums === String ? $root.google.protobuf.Edition[message.editionDeprecated] === undefined ? message.editionDeprecated : $root.google.protobuf.Edition[message.editionDeprecated] : message.editionDeprecated; + if (message.deprecationWarning != null && message.hasOwnProperty("deprecationWarning")) + object.deprecationWarning = message.deprecationWarning; + if (message.editionRemoved != null && message.hasOwnProperty("editionRemoved")) + object.editionRemoved = options.enums === String ? $root.google.protobuf.Edition[message.editionRemoved] === undefined ? message.editionRemoved : $root.google.protobuf.Edition[message.editionRemoved] : message.editionRemoved; return object; }; /** - * Converts this EditionDefault to JSON. + * Converts this FeatureSupport to JSON. * @function toJSON - * @memberof google.protobuf.FieldOptions.EditionDefault + * @memberof google.protobuf.FieldOptions.FeatureSupport * @instance * @returns {Object.} JSON object */ - EditionDefault.prototype.toJSON = function toJSON() { + FeatureSupport.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for EditionDefault + * Gets the default type url for FeatureSupport * @function getTypeUrl - * @memberof google.protobuf.FieldOptions.EditionDefault + * @memberof google.protobuf.FieldOptions.FeatureSupport * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + FeatureSupport.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; + return typeUrlPrefix + "/google.protobuf.FieldOptions.FeatureSupport"; }; - return EditionDefault; + return FeatureSupport; })(); return FieldOptions; @@ -34441,6 +35805,7 @@ * @property {boolean|null} [deprecated] EnumValueOptions deprecated * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact + * @property {google.protobuf.FieldOptions.IFeatureSupport|null} [featureSupport] EnumValueOptions featureSupport * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption */ @@ -34484,6 +35849,14 @@ */ EnumValueOptions.prototype.debugRedact = false; + /** + * EnumValueOptions featureSupport. + * @member {google.protobuf.FieldOptions.IFeatureSupport|null|undefined} featureSupport + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.featureSupport = null; + /** * EnumValueOptions uninterpretedOption. * @member {Array.} uninterpretedOption @@ -34522,6 +35895,8 @@ $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); + if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) + $root.google.protobuf.FieldOptions.FeatureSupport.encode(message.featureSupport, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); @@ -34573,6 +35948,10 @@ message.debugRedact = reader.bool(); break; } + case 4: { + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.decode(reader, reader.uint32()); + break; + } case 999: { if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; @@ -34625,6 +36004,11 @@ if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) if (typeof message.debugRedact !== "boolean") return "debugRedact: boolean expected"; + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) { + var error = $root.google.protobuf.FieldOptions.FeatureSupport.verify(message.featureSupport); + if (error) + return "featureSupport." + error; + } if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; @@ -34658,6 +36042,11 @@ } if (object.debugRedact != null) message.debugRedact = Boolean(object.debugRedact); + if (object.featureSupport != null) { + if (typeof object.featureSupport !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.featureSupport: object expected"); + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.fromObject(object.featureSupport); + } if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); @@ -34690,6 +36079,7 @@ object.deprecated = false; object.features = null; object.debugRedact = false; + object.featureSupport = null; } if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; @@ -34697,6 +36087,8 @@ object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) object.debugRedact = message.debugRedact; + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) + object.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.toObject(message.featureSupport, options); if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) @@ -36192,6 +37584,8 @@ * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat + * @property {google.protobuf.FeatureSet.EnforceNamingStyle|null} [enforceNamingStyle] FeatureSet enforceNamingStyle + * @property {google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|null} [defaultSymbolVisibility] FeatureSet defaultSymbolVisibility */ /** @@ -36257,6 +37651,22 @@ */ FeatureSet.prototype.jsonFormat = 0; + /** + * FeatureSet enforceNamingStyle. + * @member {google.protobuf.FeatureSet.EnforceNamingStyle} enforceNamingStyle + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enforceNamingStyle = 0; + + /** + * FeatureSet defaultSymbolVisibility. + * @member {google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility} defaultSymbolVisibility + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.defaultSymbolVisibility = 0; + /** * Creates a new FeatureSet instance using the specified properties. * @function create @@ -36293,6 +37703,10 @@ writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); + if (message.enforceNamingStyle != null && Object.hasOwnProperty.call(message, "enforceNamingStyle")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.enforceNamingStyle); + if (message.defaultSymbolVisibility != null && Object.hasOwnProperty.call(message, "defaultSymbolVisibility")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.defaultSymbolVisibility); return writer; }; @@ -36353,6 +37767,14 @@ message.jsonFormat = reader.int32(); break; } + case 7: { + message.enforceNamingStyle = reader.int32(); + break; + } + case 8: { + message.defaultSymbolVisibility = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -36443,6 +37865,26 @@ case 2: break; } + if (message.enforceNamingStyle != null && message.hasOwnProperty("enforceNamingStyle")) + switch (message.enforceNamingStyle) { + default: + return "enforceNamingStyle: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.defaultSymbolVisibility != null && message.hasOwnProperty("defaultSymbolVisibility")) + switch (message.defaultSymbolVisibility) { + default: + return "defaultSymbolVisibility: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } return null; }; @@ -36582,6 +38024,54 @@ message.jsonFormat = 2; break; } + switch (object.enforceNamingStyle) { + default: + if (typeof object.enforceNamingStyle === "number") { + message.enforceNamingStyle = object.enforceNamingStyle; + break; + } + break; + case "ENFORCE_NAMING_STYLE_UNKNOWN": + case 0: + message.enforceNamingStyle = 0; + break; + case "STYLE2024": + case 1: + message.enforceNamingStyle = 1; + break; + case "STYLE_LEGACY": + case 2: + message.enforceNamingStyle = 2; + break; + } + switch (object.defaultSymbolVisibility) { + default: + if (typeof object.defaultSymbolVisibility === "number") { + message.defaultSymbolVisibility = object.defaultSymbolVisibility; + break; + } + break; + case "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN": + case 0: + message.defaultSymbolVisibility = 0; + break; + case "EXPORT_ALL": + case 1: + message.defaultSymbolVisibility = 1; + break; + case "EXPORT_TOP_LEVEL": + case 2: + message.defaultSymbolVisibility = 2; + break; + case "LOCAL_ALL": + case 3: + message.defaultSymbolVisibility = 3; + break; + case "STRICT": + case 4: + message.defaultSymbolVisibility = 4; + break; + } return message; }; @@ -36605,6 +38095,8 @@ object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; + object.enforceNamingStyle = options.enums === String ? "ENFORCE_NAMING_STYLE_UNKNOWN" : 0; + object.defaultSymbolVisibility = options.enums === String ? "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN" : 0; } if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; @@ -36618,6 +38110,10 @@ object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; + if (message.enforceNamingStyle != null && message.hasOwnProperty("enforceNamingStyle")) + object.enforceNamingStyle = options.enums === String ? $root.google.protobuf.FeatureSet.EnforceNamingStyle[message.enforceNamingStyle] === undefined ? message.enforceNamingStyle : $root.google.protobuf.FeatureSet.EnforceNamingStyle[message.enforceNamingStyle] : message.enforceNamingStyle; + if (message.defaultSymbolVisibility != null && message.hasOwnProperty("defaultSymbolVisibility")) + object.defaultSymbolVisibility = options.enums === String ? $root.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility[message.defaultSymbolVisibility] === undefined ? message.defaultSymbolVisibility : $root.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility[message.defaultSymbolVisibility] : message.defaultSymbolVisibility; return object; }; @@ -36745,6 +38241,219 @@ return values; })(); + /** + * EnforceNamingStyle enum. + * @name google.protobuf.FeatureSet.EnforceNamingStyle + * @enum {number} + * @property {number} ENFORCE_NAMING_STYLE_UNKNOWN=0 ENFORCE_NAMING_STYLE_UNKNOWN value + * @property {number} STYLE2024=1 STYLE2024 value + * @property {number} STYLE_LEGACY=2 STYLE_LEGACY value + */ + FeatureSet.EnforceNamingStyle = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENFORCE_NAMING_STYLE_UNKNOWN"] = 0; + values[valuesById[1] = "STYLE2024"] = 1; + values[valuesById[2] = "STYLE_LEGACY"] = 2; + return values; + })(); + + FeatureSet.VisibilityFeature = (function() { + + /** + * Properties of a VisibilityFeature. + * @memberof google.protobuf.FeatureSet + * @interface IVisibilityFeature + */ + + /** + * Constructs a new VisibilityFeature. + * @memberof google.protobuf.FeatureSet + * @classdesc Represents a VisibilityFeature. + * @implements IVisibilityFeature + * @constructor + * @param {google.protobuf.FeatureSet.IVisibilityFeature=} [properties] Properties to set + */ + function VisibilityFeature(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new VisibilityFeature instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature instance + */ + VisibilityFeature.create = function create(properties) { + return new VisibilityFeature(properties); + }; + + /** + * Encodes the specified VisibilityFeature message. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature} message VisibilityFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VisibilityFeature.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified VisibilityFeature message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature} message VisibilityFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VisibilityFeature.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VisibilityFeature.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet.VisibilityFeature(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VisibilityFeature.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VisibilityFeature message. + * @function verify + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VisibilityFeature.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a VisibilityFeature message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + */ + VisibilityFeature.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSet.VisibilityFeature) + return object; + return new $root.google.protobuf.FeatureSet.VisibilityFeature(); + }; + + /** + * Creates a plain object from a VisibilityFeature message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.VisibilityFeature} message VisibilityFeature + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VisibilityFeature.toObject = function toObject() { + return {}; + }; + + /** + * Converts this VisibilityFeature to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @instance + * @returns {Object.} JSON object + */ + VisibilityFeature.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VisibilityFeature + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VisibilityFeature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet.VisibilityFeature"; + }; + + /** + * DefaultSymbolVisibility enum. + * @name google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility + * @enum {number} + * @property {number} DEFAULT_SYMBOL_VISIBILITY_UNKNOWN=0 DEFAULT_SYMBOL_VISIBILITY_UNKNOWN value + * @property {number} EXPORT_ALL=1 EXPORT_ALL value + * @property {number} EXPORT_TOP_LEVEL=2 EXPORT_TOP_LEVEL value + * @property {number} LOCAL_ALL=3 LOCAL_ALL value + * @property {number} STRICT=4 STRICT value + */ + VisibilityFeature.DefaultSymbolVisibility = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN"] = 0; + values[valuesById[1] = "EXPORT_ALL"] = 1; + values[valuesById[2] = "EXPORT_TOP_LEVEL"] = 2; + values[valuesById[3] = "LOCAL_ALL"] = 3; + values[valuesById[4] = "STRICT"] = 4; + return values; + })(); + + return VisibilityFeature; + })(); + return FeatureSet; })(); @@ -36929,6 +38638,7 @@ default: return "minimumEdition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -36946,6 +38656,7 @@ default: return "maximumEdition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -36994,6 +38705,10 @@ case 0: message.minimumEdition = 0; break; + case "EDITION_LEGACY": + case 900: + message.minimumEdition = 900; + break; case "EDITION_PROTO2": case 998: message.minimumEdition = 998; @@ -37046,6 +38761,10 @@ case 0: message.maximumEdition = 0; break; + case "EDITION_LEGACY": + case 900: + message.maximumEdition = 900; + break; case "EDITION_PROTO2": case 998: message.maximumEdition = 998; @@ -37154,7 +38873,8 @@ * @memberof google.protobuf.FeatureSetDefaults * @interface IFeatureSetEditionDefault * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition - * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features + * @property {google.protobuf.IFeatureSet|null} [overridableFeatures] FeatureSetEditionDefault overridableFeatures + * @property {google.protobuf.IFeatureSet|null} [fixedFeatures] FeatureSetEditionDefault fixedFeatures */ /** @@ -37181,12 +38901,20 @@ FeatureSetEditionDefault.prototype.edition = 0; /** - * FeatureSetEditionDefault features. - * @member {google.protobuf.IFeatureSet|null|undefined} features + * FeatureSetEditionDefault overridableFeatures. + * @member {google.protobuf.IFeatureSet|null|undefined} overridableFeatures + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.overridableFeatures = null; + + /** + * FeatureSetEditionDefault fixedFeatures. + * @member {google.protobuf.IFeatureSet|null|undefined} fixedFeatures * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault * @instance */ - FeatureSetEditionDefault.prototype.features = null; + FeatureSetEditionDefault.prototype.fixedFeatures = null; /** * Creates a new FeatureSetEditionDefault instance using the specified properties. @@ -37212,10 +38940,12 @@ FeatureSetEditionDefault.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + if (message.overridableFeatures != null && Object.hasOwnProperty.call(message, "overridableFeatures")) + $root.google.protobuf.FeatureSet.encode(message.overridableFeatures, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.fixedFeatures != null && Object.hasOwnProperty.call(message, "fixedFeatures")) + $root.google.protobuf.FeatureSet.encode(message.fixedFeatures, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -37256,8 +38986,12 @@ message.edition = reader.int32(); break; } - case 2: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + case 4: { + message.overridableFeatures = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 5: { + message.fixedFeatures = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); break; } default: @@ -37300,6 +39034,7 @@ default: return "edition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -37312,10 +39047,15 @@ case 2147483647: break; } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (message.overridableFeatures != null && message.hasOwnProperty("overridableFeatures")) { + var error = $root.google.protobuf.FeatureSet.verify(message.overridableFeatures); + if (error) + return "overridableFeatures." + error; + } + if (message.fixedFeatures != null && message.hasOwnProperty("fixedFeatures")) { + var error = $root.google.protobuf.FeatureSet.verify(message.fixedFeatures); if (error) - return "features." + error; + return "fixedFeatures." + error; } return null; }; @@ -37343,6 +39083,10 @@ case 0: message.edition = 0; break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; case "EDITION_PROTO2": case 998: message.edition = 998; @@ -37384,10 +39128,15 @@ message.edition = 2147483647; break; } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + if (object.overridableFeatures != null) { + if (typeof object.overridableFeatures !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.overridableFeatures: object expected"); + message.overridableFeatures = $root.google.protobuf.FeatureSet.fromObject(object.overridableFeatures); + } + if (object.fixedFeatures != null) { + if (typeof object.fixedFeatures !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fixedFeatures: object expected"); + message.fixedFeatures = $root.google.protobuf.FeatureSet.fromObject(object.fixedFeatures); } return message; }; @@ -37406,13 +39155,16 @@ options = {}; var object = {}; if (options.defaults) { - object.features = null; object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.overridableFeatures = null; + object.fixedFeatures = null; } - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); if (message.edition != null && message.hasOwnProperty("edition")) object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + if (message.overridableFeatures != null && message.hasOwnProperty("overridableFeatures")) + object.overridableFeatures = $root.google.protobuf.FeatureSet.toObject(message.overridableFeatures, options); + if (message.fixedFeatures != null && message.hasOwnProperty("fixedFeatures")) + object.fixedFeatures = $root.google.protobuf.FeatureSet.toObject(message.fixedFeatures, options); return object; }; @@ -38627,6 +40379,22 @@ return GeneratedCodeInfo; })(); + /** + * SymbolVisibility enum. + * @name google.protobuf.SymbolVisibility + * @enum {number} + * @property {number} VISIBILITY_UNSET=0 VISIBILITY_UNSET value + * @property {number} VISIBILITY_LOCAL=1 VISIBILITY_LOCAL value + * @property {number} VISIBILITY_EXPORT=2 VISIBILITY_EXPORT value + */ + protobuf.SymbolVisibility = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VISIBILITY_UNSET"] = 0; + values[valuesById[1] = "VISIBILITY_LOCAL"] = 1; + values[valuesById[2] = "VISIBILITY_EXPORT"] = 2; + return values; + })(); + protobuf.Timestamp = (function() { /** diff --git a/packages/google-api-servicemanagement/protos/protos.json b/packages/google-api-servicemanagement/protos/protos.json index 9d13ccf1c9f..e71465fcd32 100644 --- a/packages/google-api-servicemanagement/protos/protos.json +++ b/packages/google-api-servicemanagement/protos/protos.json @@ -8,8 +8,7 @@ "java_multiple_files": true, "java_outer_classname": "UsageProto", "java_package": "com.google.api", - "objc_class_prefix": "GAPI", - "cc_enable_arenas": true + "objc_class_prefix": "GAPI" }, "nested": { "servicemanagement": { @@ -1037,6 +1036,10 @@ "rule": "repeated", "type": "ClientLibraryDestination", "id": 2 + }, + "selectiveGapicGeneration": { + "type": "SelectiveGapicGeneration", + "id": 3 } } }, @@ -1177,6 +1180,28 @@ "common": { "type": "CommonLanguageSettings", "id": 1 + }, + "experimentalFeatures": { + "type": "ExperimentalFeatures", + "id": 2 + } + }, + "nested": { + "ExperimentalFeatures": { + "fields": { + "restAsyncIoEnabled": { + "type": "bool", + "id": 1 + }, + "protobufPythonicTypesEnabled": { + "type": "bool", + "id": 2 + }, + "unversionedPackageDisabled": { + "type": "bool", + "id": 3 + } + } } } }, @@ -1234,6 +1259,11 @@ "common": { "type": "CommonLanguageSettings", "id": 1 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 } } }, @@ -1295,6 +1325,19 @@ "PACKAGE_MANAGER": 20 } }, + "SelectiveGapicGeneration": { + "fields": { + "methods": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "generateOmittedAsInternal": { + "type": "bool", + "id": 2 + } + } + }, "LaunchStage": { "values": { "LAUNCH_STAGE_UNSPECIFIED": 0, @@ -1684,12 +1727,12 @@ } }, "fieldPolicy": { - "type": "FieldPolicy", + "type": "google.api.FieldPolicy", "id": 158361448, "extend": "google.protobuf.FieldOptions" }, "methodPolicy": { - "type": "MethodPolicy", + "type": "google.api.MethodPolicy", "id": 161893301, "extend": "google.protobuf.MethodOptions" }, @@ -1794,10 +1837,7 @@ "aliases": { "rule": "repeated", "type": "string", - "id": 2, - "options": { - "deprecated": true - } + "id": 2 }, "target": { "type": "string", @@ -1969,6 +2009,21 @@ "ingestDelay": { "type": "google.protobuf.Duration", "id": 3 + }, + "timeSeriesResourceHierarchyLevel": { + "rule": "repeated", + "type": "TimeSeriesResourceHierarchyLevel", + "id": 4 + } + }, + "nested": { + "TimeSeriesResourceHierarchyLevel": { + "values": { + "TIME_SERIES_RESOURCE_HIERARCHY_LEVEL_UNSPECIFIED": 0, + "PROJECT": 1, + "ORGANIZATION": 2, + "FOLDER": 3 + } } } } @@ -2246,12 +2301,19 @@ "type": "FileDescriptorProto", "id": 1 } - } + }, + "extensions": [ + [ + 536000000, + 536000000 + ] + ] }, "Edition": { "edition": "proto2", "values": { "EDITION_UNKNOWN": 0, + "EDITION_LEGACY": 900, "EDITION_PROTO2": 998, "EDITION_PROTO3": 999, "EDITION_2023": 1000, @@ -2290,6 +2352,11 @@ "type": "int32", "id": 11 }, + "optionDependency": { + "rule": "repeated", + "type": "string", + "id": 15 + }, "messageType": { "rule": "repeated", "type": "DescriptorProto", @@ -2378,6 +2445,10 @@ "rule": "repeated", "type": "string", "id": 10 + }, + "visibility": { + "type": "SymbolVisibility", + "id": 11 } }, "nested": { @@ -2603,6 +2674,10 @@ "rule": "repeated", "type": "string", "id": 5 + }, + "visibility": { + "type": "SymbolVisibility", + "id": 6 } }, "nested": { @@ -2817,6 +2892,7 @@ 42, 42 ], + "php_generic_services", [ 38, 38 @@ -2952,7 +3028,8 @@ "type": "bool", "id": 10, "options": { - "default": false + "default": false, + "deprecated": true } }, "debugRedact": { @@ -2980,6 +3057,10 @@ "type": "FeatureSet", "id": 21 }, + "featureSupport": { + "type": "FeatureSupport", + "id": 22 + }, "uninterpretedOption": { "rule": "repeated", "type": "UninterpretedOption", @@ -3049,6 +3130,26 @@ "id": 2 } } + }, + "FeatureSupport": { + "fields": { + "editionIntroduced": { + "type": "Edition", + "id": 1 + }, + "editionDeprecated": { + "type": "Edition", + "id": 2 + }, + "deprecationWarning": { + "type": "string", + "id": 3 + }, + "editionRemoved": { + "type": "Edition", + "id": 4 + } + } } } }, @@ -3137,6 +3238,10 @@ "default": false } }, + "featureSupport": { + "type": "FieldOptions.FeatureSupport", + "id": 4 + }, "uninterpretedOption": { "rule": "repeated", "type": "UninterpretedOption", @@ -3279,6 +3384,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_2023", "edition_defaults.value": "EXPLICIT" } @@ -3289,6 +3395,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "OPEN" } @@ -3299,6 +3406,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "PACKED" } @@ -3309,6 +3417,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "VERIFY" } @@ -3319,7 +3428,8 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO2", + "feature_support.edition_introduced": "EDITION_2023", + "edition_defaults.edition": "EDITION_LEGACY", "edition_defaults.value": "LENGTH_PREFIXED" } }, @@ -3329,27 +3439,38 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "ALLOW" } + }, + "enforceNamingStyle": { + "type": "EnforceNamingStyle", + "id": 7, + "options": { + "retention": "RETENTION_SOURCE", + "targets": "TARGET_TYPE_METHOD", + "feature_support.edition_introduced": "EDITION_2024", + "edition_defaults.edition": "EDITION_2024", + "edition_defaults.value": "STYLE2024" + } + }, + "defaultSymbolVisibility": { + "type": "VisibilityFeature.DefaultSymbolVisibility", + "id": 8, + "options": { + "retention": "RETENTION_SOURCE", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2024", + "edition_defaults.edition": "EDITION_2024", + "edition_defaults.value": "EXPORT_TOP_LEVEL" + } } }, "extensions": [ [ 1000, - 1000 - ], - [ - 1001, - 1001 - ], - [ - 1002, - 1002 - ], - [ - 9990, - 9990 + 9994 ], [ 9995, @@ -3394,7 +3515,13 @@ "UTF8_VALIDATION_UNKNOWN": 0, "VERIFY": 2, "NONE": 3 - } + }, + "reserved": [ + [ + 1, + 1 + ] + ] }, "MessageEncoding": { "values": { @@ -3409,6 +3536,33 @@ "ALLOW": 1, "LEGACY_BEST_EFFORT": 2 } + }, + "EnforceNamingStyle": { + "values": { + "ENFORCE_NAMING_STYLE_UNKNOWN": 0, + "STYLE2024": 1, + "STYLE_LEGACY": 2 + } + }, + "VisibilityFeature": { + "fields": {}, + "reserved": [ + [ + 1, + 536870911 + ] + ], + "nested": { + "DefaultSymbolVisibility": { + "values": { + "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN": 0, + "EXPORT_ALL": 1, + "EXPORT_TOP_LEVEL": 2, + "LOCAL_ALL": 3, + "STRICT": 4 + } + } + } } } }, @@ -3436,11 +3590,26 @@ "type": "Edition", "id": 3 }, - "features": { + "overridableFeatures": { "type": "FeatureSet", - "id": 2 + "id": 4 + }, + "fixedFeatures": { + "type": "FeatureSet", + "id": 5 } - } + }, + "reserved": [ + [ + 1, + 1 + ], + [ + 2, + 2 + ], + "features" + ] } } }, @@ -3453,6 +3622,12 @@ "id": 1 } }, + "extensions": [ + [ + 536000000, + 536000000 + ] + ], "nested": { "Location": { "fields": { @@ -3538,6 +3713,14 @@ } } }, + "SymbolVisibility": { + "edition": "proto2", + "values": { + "VISIBILITY_UNSET": 0, + "VISIBILITY_LOCAL": 1, + "VISIBILITY_EXPORT": 2 + } + }, "Timestamp": { "fields": { "seconds": { @@ -3989,6 +4172,7 @@ "java_multiple_files": true, "java_outer_classname": "OperationsProto", "java_package": "com.google.longrunning", + "objc_class_prefix": "GLRUN", "php_namespace": "Google\\LongRunning" }, "nested": { diff --git a/packages/google-api-servicemanagement/src/v1/service_manager_client.ts b/packages/google-api-servicemanagement/src/v1/service_manager_client.ts index bb8f5b72d29..b06136b59fc 100644 --- a/packages/google-api-servicemanagement/src/v1/service_manager_client.ts +++ b/packages/google-api-servicemanagement/src/v1/service_manager_client.ts @@ -571,7 +571,7 @@ export class ServiceManagerClient { 'x-goog-request-params' ] = this._gaxModule.routingHeader.fromParams({ 'service_name': request.serviceName ?? '', - 'config_id': request.configId ?? '', + 'config_id': request.configId?.toString() ?? '', }); this.initialize().catch(err => {throw err}); this._log.info('getServiceConfig request %j', request); @@ -776,7 +776,7 @@ export class ServiceManagerClient { 'x-goog-request-params' ] = this._gaxModule.routingHeader.fromParams({ 'service_name': request.serviceName ?? '', - 'rollout_id': request.rolloutId ?? '', + 'rollout_id': request.rolloutId?.toString() ?? '', }); this.initialize().catch(err => {throw err}); this._log.info('getServiceRollout request %j', request); diff --git a/packages/google-api-serviceusage/protos/protos.d.ts b/packages/google-api-serviceusage/protos/protos.d.ts index 33d95f4717e..bea03ad2216 100644 --- a/packages/google-api-serviceusage/protos/protos.d.ts +++ b/packages/google-api-serviceusage/protos/protos.d.ts @@ -449,6 +449,7 @@ export namespace google { /** Edition enum. */ enum Edition { EDITION_UNKNOWN = 0, + EDITION_LEGACY = 900, EDITION_PROTO2 = 998, EDITION_PROTO3 = 999, EDITION_2023 = 1000, @@ -479,6 +480,9 @@ export namespace google { /** FileDescriptorProto weakDependency */ weakDependency?: (number[]|null); + /** FileDescriptorProto optionDependency */ + optionDependency?: (string[]|null); + /** FileDescriptorProto messageType */ messageType?: (google.protobuf.IDescriptorProto[]|null); @@ -528,6 +532,9 @@ export namespace google { /** FileDescriptorProto weakDependency. */ public weakDependency: number[]; + /** FileDescriptorProto optionDependency. */ + public optionDependency: string[]; + /** FileDescriptorProto messageType. */ public messageType: google.protobuf.IDescriptorProto[]; @@ -662,6 +669,9 @@ export namespace google { /** DescriptorProto reservedName */ reservedName?: (string[]|null); + + /** DescriptorProto visibility */ + visibility?: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility|null); } /** Represents a DescriptorProto. */ @@ -703,6 +713,9 @@ export namespace google { /** DescriptorProto reservedName. */ public reservedName: string[]; + /** DescriptorProto visibility. */ + public visibility: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility); + /** * Creates a new DescriptorProto instance using the specified properties. * @param [properties] Properties to set @@ -1550,6 +1563,9 @@ export namespace google { /** EnumDescriptorProto reservedName */ reservedName?: (string[]|null); + + /** EnumDescriptorProto visibility */ + visibility?: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility|null); } /** Represents an EnumDescriptorProto. */ @@ -1576,6 +1592,9 @@ export namespace google { /** EnumDescriptorProto reservedName. */ public reservedName: string[]; + /** EnumDescriptorProto visibility. */ + public visibility: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility); + /** * Creates a new EnumDescriptorProto instance using the specified properties. * @param [properties] Properties to set @@ -2510,6 +2529,9 @@ export namespace google { /** FieldOptions features */ features?: (google.protobuf.IFeatureSet|null); + /** FieldOptions featureSupport */ + featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** FieldOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); @@ -2565,6 +2587,9 @@ export namespace google { /** FieldOptions features. */ public features?: (google.protobuf.IFeatureSet|null); + /** FieldOptions featureSupport. */ + public featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** FieldOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; @@ -2785,6 +2810,121 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** Properties of a FeatureSupport. */ + interface IFeatureSupport { + + /** FeatureSupport editionIntroduced */ + editionIntroduced?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSupport editionDeprecated */ + editionDeprecated?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSupport deprecationWarning */ + deprecationWarning?: (string|null); + + /** FeatureSupport editionRemoved */ + editionRemoved?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSupport. */ + class FeatureSupport implements IFeatureSupport { + + /** + * Constructs a new FeatureSupport. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IFeatureSupport); + + /** FeatureSupport editionIntroduced. */ + public editionIntroduced: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSupport editionDeprecated. */ + public editionDeprecated: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSupport deprecationWarning. */ + public deprecationWarning: string; + + /** FeatureSupport editionRemoved. */ + public editionRemoved: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSupport instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSupport instance + */ + public static create(properties?: google.protobuf.FieldOptions.IFeatureSupport): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Encodes the specified FeatureSupport message. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @param message FeatureSupport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IFeatureSupport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSupport message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @param message FeatureSupport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IFeatureSupport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Verifies a FeatureSupport message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSupport message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSupport + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Creates a plain object from a FeatureSupport message. Also converts values to other types if specified. + * @param message FeatureSupport + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.FeatureSupport, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSupport to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSupport + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } /** Properties of an OneofOptions. */ @@ -3023,6 +3163,9 @@ export namespace google { /** EnumValueOptions debugRedact */ debugRedact?: (boolean|null); + /** EnumValueOptions featureSupport */ + featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** EnumValueOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); } @@ -3045,6 +3188,9 @@ export namespace google { /** EnumValueOptions debugRedact. */ public debugRedact: boolean; + /** EnumValueOptions featureSupport. */ + public featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** EnumValueOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; @@ -3637,6 +3783,12 @@ export namespace google { /** FeatureSet jsonFormat */ jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); + + /** FeatureSet enforceNamingStyle */ + enforceNamingStyle?: (google.protobuf.FeatureSet.EnforceNamingStyle|keyof typeof google.protobuf.FeatureSet.EnforceNamingStyle|null); + + /** FeatureSet defaultSymbolVisibility */ + defaultSymbolVisibility?: (google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|keyof typeof google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|null); } /** Represents a FeatureSet. */ @@ -3666,6 +3818,12 @@ export namespace google { /** FeatureSet jsonFormat. */ public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); + /** FeatureSet enforceNamingStyle. */ + public enforceNamingStyle: (google.protobuf.FeatureSet.EnforceNamingStyle|keyof typeof google.protobuf.FeatureSet.EnforceNamingStyle); + + /** FeatureSet defaultSymbolVisibility. */ + public defaultSymbolVisibility: (google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|keyof typeof google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility); + /** * Creates a new FeatureSet instance using the specified properties. * @param [properties] Properties to set @@ -3788,6 +3946,116 @@ export namespace google { ALLOW = 1, LEGACY_BEST_EFFORT = 2 } + + /** EnforceNamingStyle enum. */ + enum EnforceNamingStyle { + ENFORCE_NAMING_STYLE_UNKNOWN = 0, + STYLE2024 = 1, + STYLE_LEGACY = 2 + } + + /** Properties of a VisibilityFeature. */ + interface IVisibilityFeature { + } + + /** Represents a VisibilityFeature. */ + class VisibilityFeature implements IVisibilityFeature { + + /** + * Constructs a new VisibilityFeature. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSet.IVisibilityFeature); + + /** + * Creates a new VisibilityFeature instance using the specified properties. + * @param [properties] Properties to set + * @returns VisibilityFeature instance + */ + public static create(properties?: google.protobuf.FeatureSet.IVisibilityFeature): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Encodes the specified VisibilityFeature message. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @param message VisibilityFeature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSet.IVisibilityFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VisibilityFeature message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @param message VisibilityFeature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSet.IVisibilityFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Verifies a VisibilityFeature message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VisibilityFeature message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VisibilityFeature + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Creates a plain object from a VisibilityFeature message. Also converts values to other types if specified. + * @param message VisibilityFeature + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet.VisibilityFeature, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VisibilityFeature to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VisibilityFeature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace VisibilityFeature { + + /** DefaultSymbolVisibility enum. */ + enum DefaultSymbolVisibility { + DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0, + EXPORT_ALL = 1, + EXPORT_TOP_LEVEL = 2, + LOCAL_ALL = 3, + STRICT = 4 + } + } } /** Properties of a FeatureSetDefaults. */ @@ -3907,8 +4175,11 @@ export namespace google { /** FeatureSetEditionDefault edition */ edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - /** FeatureSetEditionDefault features */ - features?: (google.protobuf.IFeatureSet|null); + /** FeatureSetEditionDefault overridableFeatures */ + overridableFeatures?: (google.protobuf.IFeatureSet|null); + + /** FeatureSetEditionDefault fixedFeatures */ + fixedFeatures?: (google.protobuf.IFeatureSet|null); } /** Represents a FeatureSetEditionDefault. */ @@ -3923,8 +4194,11 @@ export namespace google { /** FeatureSetEditionDefault edition. */ public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - /** FeatureSetEditionDefault features. */ - public features?: (google.protobuf.IFeatureSet|null); + /** FeatureSetEditionDefault overridableFeatures. */ + public overridableFeatures?: (google.protobuf.IFeatureSet|null); + + /** FeatureSetEditionDefault fixedFeatures. */ + public fixedFeatures?: (google.protobuf.IFeatureSet|null); /** * Creates a new FeatureSetEditionDefault instance using the specified properties. @@ -4457,6 +4731,13 @@ export namespace google { } } + /** SymbolVisibility enum. */ + enum SymbolVisibility { + VISIBILITY_UNSET = 0, + VISIBILITY_LOCAL = 1, + VISIBILITY_EXPORT = 2 + } + /** Properties of an Api. */ interface IApi { @@ -16243,6 +16524,9 @@ export namespace google { /** CommonLanguageSettings destinations */ destinations?: (google.api.ClientLibraryDestination[]|null); + + /** CommonLanguageSettings selectiveGapicGeneration */ + selectiveGapicGeneration?: (google.api.ISelectiveGapicGeneration|null); } /** Represents a CommonLanguageSettings. */ @@ -16260,6 +16544,9 @@ export namespace google { /** CommonLanguageSettings destinations. */ public destinations: google.api.ClientLibraryDestination[]; + /** CommonLanguageSettings selectiveGapicGeneration. */ + public selectiveGapicGeneration?: (google.api.ISelectiveGapicGeneration|null); + /** * Creates a new CommonLanguageSettings instance using the specified properties. * @param [properties] Properties to set @@ -16960,6 +17247,9 @@ export namespace google { /** PythonSettings common */ common?: (google.api.ICommonLanguageSettings|null); + + /** PythonSettings experimentalFeatures */ + experimentalFeatures?: (google.api.PythonSettings.IExperimentalFeatures|null); } /** Represents a PythonSettings. */ @@ -16974,6 +17264,9 @@ export namespace google { /** PythonSettings common. */ public common?: (google.api.ICommonLanguageSettings|null); + /** PythonSettings experimentalFeatures. */ + public experimentalFeatures?: (google.api.PythonSettings.IExperimentalFeatures|null); + /** * Creates a new PythonSettings instance using the specified properties. * @param [properties] Properties to set @@ -17052,6 +17345,118 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + namespace PythonSettings { + + /** Properties of an ExperimentalFeatures. */ + interface IExperimentalFeatures { + + /** ExperimentalFeatures restAsyncIoEnabled */ + restAsyncIoEnabled?: (boolean|null); + + /** ExperimentalFeatures protobufPythonicTypesEnabled */ + protobufPythonicTypesEnabled?: (boolean|null); + + /** ExperimentalFeatures unversionedPackageDisabled */ + unversionedPackageDisabled?: (boolean|null); + } + + /** Represents an ExperimentalFeatures. */ + class ExperimentalFeatures implements IExperimentalFeatures { + + /** + * Constructs a new ExperimentalFeatures. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.PythonSettings.IExperimentalFeatures); + + /** ExperimentalFeatures restAsyncIoEnabled. */ + public restAsyncIoEnabled: boolean; + + /** ExperimentalFeatures protobufPythonicTypesEnabled. */ + public protobufPythonicTypesEnabled: boolean; + + /** ExperimentalFeatures unversionedPackageDisabled. */ + public unversionedPackageDisabled: boolean; + + /** + * Creates a new ExperimentalFeatures instance using the specified properties. + * @param [properties] Properties to set + * @returns ExperimentalFeatures instance + */ + public static create(properties?: google.api.PythonSettings.IExperimentalFeatures): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Encodes the specified ExperimentalFeatures message. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @param message ExperimentalFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.PythonSettings.IExperimentalFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExperimentalFeatures message, length delimited. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @param message ExperimentalFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.PythonSettings.IExperimentalFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Verifies an ExperimentalFeatures message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExperimentalFeatures message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExperimentalFeatures + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Creates a plain object from an ExperimentalFeatures message. Also converts values to other types if specified. + * @param message ExperimentalFeatures + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings.ExperimentalFeatures, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExperimentalFeatures to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExperimentalFeatures + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + /** Properties of a NodeSettings. */ interface INodeSettings { @@ -17378,6 +17783,9 @@ export namespace google { /** GoSettings common */ common?: (google.api.ICommonLanguageSettings|null); + + /** GoSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|null); } /** Represents a GoSettings. */ @@ -17392,6 +17800,9 @@ export namespace google { /** GoSettings common. */ public common?: (google.api.ICommonLanguageSettings|null); + /** GoSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + /** * Creates a new GoSettings instance using the specified properties. * @param [properties] Properties to set @@ -17716,6 +18127,109 @@ export namespace google { PACKAGE_MANAGER = 20 } + /** Properties of a SelectiveGapicGeneration. */ + interface ISelectiveGapicGeneration { + + /** SelectiveGapicGeneration methods */ + methods?: (string[]|null); + + /** SelectiveGapicGeneration generateOmittedAsInternal */ + generateOmittedAsInternal?: (boolean|null); + } + + /** Represents a SelectiveGapicGeneration. */ + class SelectiveGapicGeneration implements ISelectiveGapicGeneration { + + /** + * Constructs a new SelectiveGapicGeneration. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ISelectiveGapicGeneration); + + /** SelectiveGapicGeneration methods. */ + public methods: string[]; + + /** SelectiveGapicGeneration generateOmittedAsInternal. */ + public generateOmittedAsInternal: boolean; + + /** + * Creates a new SelectiveGapicGeneration instance using the specified properties. + * @param [properties] Properties to set + * @returns SelectiveGapicGeneration instance + */ + public static create(properties?: google.api.ISelectiveGapicGeneration): google.api.SelectiveGapicGeneration; + + /** + * Encodes the specified SelectiveGapicGeneration message. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @param message SelectiveGapicGeneration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ISelectiveGapicGeneration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SelectiveGapicGeneration message, length delimited. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @param message SelectiveGapicGeneration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ISelectiveGapicGeneration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.SelectiveGapicGeneration; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.SelectiveGapicGeneration; + + /** + * Verifies a SelectiveGapicGeneration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SelectiveGapicGeneration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SelectiveGapicGeneration + */ + public static fromObject(object: { [k: string]: any }): google.api.SelectiveGapicGeneration; + + /** + * Creates a plain object from a SelectiveGapicGeneration message. Also converts values to other types if specified. + * @param message SelectiveGapicGeneration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.SelectiveGapicGeneration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SelectiveGapicGeneration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SelectiveGapicGeneration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** FieldBehavior enum. */ enum FieldBehavior { FIELD_BEHAVIOR_UNSPECIFIED = 0, diff --git a/packages/google-api-serviceusage/protos/protos.js b/packages/google-api-serviceusage/protos/protos.js index 7c729316a11..db3fa115550 100644 --- a/packages/google-api-serviceusage/protos/protos.js +++ b/packages/google-api-serviceusage/protos/protos.js @@ -1158,6 +1158,7 @@ * @name google.protobuf.Edition * @enum {number} * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value + * @property {number} EDITION_LEGACY=900 EDITION_LEGACY value * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value * @property {number} EDITION_2023=1000 EDITION_2023 value @@ -1172,6 +1173,7 @@ protobuf.Edition = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "EDITION_UNKNOWN"] = 0; + values[valuesById[900] = "EDITION_LEGACY"] = 900; values[valuesById[998] = "EDITION_PROTO2"] = 998; values[valuesById[999] = "EDITION_PROTO3"] = 999; values[valuesById[1000] = "EDITION_2023"] = 1000; @@ -1196,6 +1198,7 @@ * @property {Array.|null} [dependency] FileDescriptorProto dependency * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [optionDependency] FileDescriptorProto optionDependency * @property {Array.|null} [messageType] FileDescriptorProto messageType * @property {Array.|null} [enumType] FileDescriptorProto enumType * @property {Array.|null} [service] FileDescriptorProto service @@ -1218,6 +1221,7 @@ this.dependency = []; this.publicDependency = []; this.weakDependency = []; + this.optionDependency = []; this.messageType = []; this.enumType = []; this.service = []; @@ -1268,6 +1272,14 @@ */ FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + /** + * FileDescriptorProto optionDependency. + * @member {Array.} optionDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.optionDependency = $util.emptyArray; + /** * FileDescriptorProto messageType. * @member {Array.} messageType @@ -1389,6 +1401,9 @@ writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); + if (message.optionDependency != null && message.optionDependency.length) + for (var i = 0; i < message.optionDependency.length; ++i) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.optionDependency[i]); return writer; }; @@ -1461,6 +1476,12 @@ message.weakDependency.push(reader.int32()); break; } + case 15: { + if (!(message.optionDependency && message.optionDependency.length)) + message.optionDependency = []; + message.optionDependency.push(reader.string()); + break; + } case 4: { if (!(message.messageType && message.messageType.length)) message.messageType = []; @@ -1563,6 +1584,13 @@ if (!$util.isInteger(message.weakDependency[i])) return "weakDependency: integer[] expected"; } + if (message.optionDependency != null && message.hasOwnProperty("optionDependency")) { + if (!Array.isArray(message.optionDependency)) + return "optionDependency: array expected"; + for (var i = 0; i < message.optionDependency.length; ++i) + if (!$util.isString(message.optionDependency[i])) + return "optionDependency: string[] expected"; + } if (message.messageType != null && message.hasOwnProperty("messageType")) { if (!Array.isArray(message.messageType)) return "messageType: array expected"; @@ -1617,6 +1645,7 @@ default: return "edition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -1669,6 +1698,13 @@ for (var i = 0; i < object.weakDependency.length; ++i) message.weakDependency[i] = object.weakDependency[i] | 0; } + if (object.optionDependency) { + if (!Array.isArray(object.optionDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.optionDependency: array expected"); + message.optionDependency = []; + for (var i = 0; i < object.optionDependency.length; ++i) + message.optionDependency[i] = String(object.optionDependency[i]); + } if (object.messageType) { if (!Array.isArray(object.messageType)) throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); @@ -1732,6 +1768,10 @@ case 0: message.edition = 0; break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; case "EDITION_PROTO2": case 998: message.edition = 998; @@ -1797,6 +1837,7 @@ object.extension = []; object.publicDependency = []; object.weakDependency = []; + object.optionDependency = []; } if (options.defaults) { object.name = ""; @@ -1853,6 +1894,11 @@ object.syntax = message.syntax; if (message.edition != null && message.hasOwnProperty("edition")) object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + if (message.optionDependency && message.optionDependency.length) { + object.optionDependency = []; + for (var j = 0; j < message.optionDependency.length; ++j) + object.optionDependency[j] = message.optionDependency[j]; + } return object; }; @@ -1901,6 +1947,7 @@ * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options * @property {Array.|null} [reservedRange] DescriptorProto reservedRange * @property {Array.|null} [reservedName] DescriptorProto reservedName + * @property {google.protobuf.SymbolVisibility|null} [visibility] DescriptorProto visibility */ /** @@ -2006,6 +2053,14 @@ */ DescriptorProto.prototype.reservedName = $util.emptyArray; + /** + * DescriptorProto visibility. + * @member {google.protobuf.SymbolVisibility} visibility + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.visibility = 0; + /** * Creates a new DescriptorProto instance using the specified properties. * @function create @@ -2058,6 +2113,8 @@ if (message.reservedName != null && message.reservedName.length) for (var i = 0; i < message.reservedName.length; ++i) writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.visibility); return writer; }; @@ -2150,6 +2207,10 @@ message.reservedName.push(reader.string()); break; } + case 11: { + message.visibility = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -2263,6 +2324,15 @@ if (!$util.isString(message.reservedName[i])) return "reservedName: string[] expected"; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + switch (message.visibility) { + default: + return "visibility: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; @@ -2362,6 +2432,26 @@ for (var i = 0; i < object.reservedName.length; ++i) message.reservedName[i] = String(object.reservedName[i]); } + switch (object.visibility) { + default: + if (typeof object.visibility === "number") { + message.visibility = object.visibility; + break; + } + break; + case "VISIBILITY_UNSET": + case 0: + message.visibility = 0; + break; + case "VISIBILITY_LOCAL": + case 1: + message.visibility = 1; + break; + case "VISIBILITY_EXPORT": + case 2: + message.visibility = 2; + break; + } return message; }; @@ -2391,6 +2481,7 @@ if (options.defaults) { object.name = ""; object.options = null; + object.visibility = options.enums === String ? "VISIBILITY_UNSET" : 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -2436,6 +2527,8 @@ for (var j = 0; j < message.reservedName.length; ++j) object.reservedName[j] = message.reservedName[j]; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + object.visibility = options.enums === String ? $root.google.protobuf.SymbolVisibility[message.visibility] === undefined ? message.visibility : $root.google.protobuf.SymbolVisibility[message.visibility] : message.visibility; return object; }; @@ -4480,6 +4573,7 @@ * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + * @property {google.protobuf.SymbolVisibility|null} [visibility] EnumDescriptorProto visibility */ /** @@ -4540,6 +4634,14 @@ */ EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + /** + * EnumDescriptorProto visibility. + * @member {google.protobuf.SymbolVisibility} visibility + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.visibility = 0; + /** * Creates a new EnumDescriptorProto instance using the specified properties. * @function create @@ -4577,6 +4679,8 @@ if (message.reservedName != null && message.reservedName.length) for (var i = 0; i < message.reservedName.length; ++i) writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.visibility); return writer; }; @@ -4639,6 +4743,10 @@ message.reservedName.push(reader.string()); break; } + case 6: { + message.visibility = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -4707,6 +4815,15 @@ if (!$util.isString(message.reservedName[i])) return "reservedName: string[] expected"; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + switch (message.visibility) { + default: + return "visibility: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; @@ -4756,6 +4873,26 @@ for (var i = 0; i < object.reservedName.length; ++i) message.reservedName[i] = String(object.reservedName[i]); } + switch (object.visibility) { + default: + if (typeof object.visibility === "number") { + message.visibility = object.visibility; + break; + } + break; + case "VISIBILITY_UNSET": + case 0: + message.visibility = 0; + break; + case "VISIBILITY_LOCAL": + case 1: + message.visibility = 1; + break; + case "VISIBILITY_EXPORT": + case 2: + message.visibility = 2; + break; + } return message; }; @@ -4780,6 +4917,7 @@ if (options.defaults) { object.name = ""; object.options = null; + object.visibility = options.enums === String ? "VISIBILITY_UNSET" : 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -4800,6 +4938,8 @@ for (var j = 0; j < message.reservedName.length; ++j) object.reservedName[j] = message.reservedName[j]; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + object.visibility = options.enums === String ? $root.google.protobuf.SymbolVisibility[message.visibility] === undefined ? message.visibility : $root.google.protobuf.SymbolVisibility[message.visibility] : message.visibility; return object; }; @@ -7118,6 +7258,7 @@ * @property {Array.|null} [targets] FieldOptions targets * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features + * @property {google.protobuf.FieldOptions.IFeatureSupport|null} [featureSupport] FieldOptions featureSupport * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior @@ -7238,6 +7379,14 @@ */ FieldOptions.prototype.features = null; + /** + * FieldOptions featureSupport. + * @member {google.protobuf.FieldOptions.IFeatureSupport|null|undefined} featureSupport + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.featureSupport = null; + /** * FieldOptions uninterpretedOption. * @member {Array.} uninterpretedOption @@ -7312,6 +7461,8 @@ $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); if (message.features != null && Object.hasOwnProperty.call(message, "features")) $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) + $root.google.protobuf.FieldOptions.FeatureSupport.encode(message.featureSupport, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); @@ -7413,6 +7564,10 @@ message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); break; } + case 22: { + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.decode(reader, reader.uint32()); + break; + } case 999: { if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; @@ -7548,6 +7703,11 @@ if (error) return "features." + error; } + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) { + var error = $root.google.protobuf.FieldOptions.FeatureSupport.verify(message.featureSupport); + if (error) + return "featureSupport." + error; + } if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; @@ -7736,6 +7896,11 @@ throw TypeError(".google.protobuf.FieldOptions.features: object expected"); message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); } + if (object.featureSupport != null) { + if (typeof object.featureSupport !== "object") + throw TypeError(".google.protobuf.FieldOptions.featureSupport: object expected"); + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.fromObject(object.featureSupport); + } if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); @@ -7833,6 +7998,7 @@ object.debugRedact = false; object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; object.features = null; + object.featureSupport = null; object[".google.api.resourceReference"] = null; } if (message.ctype != null && message.hasOwnProperty("ctype")) @@ -7865,6 +8031,8 @@ } if (message.features != null && message.hasOwnProperty("features")) object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) + object.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.toObject(message.featureSupport, options); if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) @@ -8137,6 +8305,7 @@ default: return "edition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -8178,6 +8347,10 @@ case 0: message.edition = 0; break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; case "EDITION_PROTO2": case 998: message.edition = 998; @@ -8277,6 +8450,488 @@ return EditionDefault; })(); + FieldOptions.FeatureSupport = (function() { + + /** + * Properties of a FeatureSupport. + * @memberof google.protobuf.FieldOptions + * @interface IFeatureSupport + * @property {google.protobuf.Edition|null} [editionIntroduced] FeatureSupport editionIntroduced + * @property {google.protobuf.Edition|null} [editionDeprecated] FeatureSupport editionDeprecated + * @property {string|null} [deprecationWarning] FeatureSupport deprecationWarning + * @property {google.protobuf.Edition|null} [editionRemoved] FeatureSupport editionRemoved + */ + + /** + * Constructs a new FeatureSupport. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents a FeatureSupport. + * @implements IFeatureSupport + * @constructor + * @param {google.protobuf.FieldOptions.IFeatureSupport=} [properties] Properties to set + */ + function FeatureSupport(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSupport editionIntroduced. + * @member {google.protobuf.Edition} editionIntroduced + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionIntroduced = 0; + + /** + * FeatureSupport editionDeprecated. + * @member {google.protobuf.Edition} editionDeprecated + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionDeprecated = 0; + + /** + * FeatureSupport deprecationWarning. + * @member {string} deprecationWarning + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.deprecationWarning = ""; + + /** + * FeatureSupport editionRemoved. + * @member {google.protobuf.Edition} editionRemoved + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionRemoved = 0; + + /** + * Creates a new FeatureSupport instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport instance + */ + FeatureSupport.create = function create(properties) { + return new FeatureSupport(properties); + }; + + /** + * Encodes the specified FeatureSupport message. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport} message FeatureSupport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSupport.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.editionIntroduced != null && Object.hasOwnProperty.call(message, "editionIntroduced")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.editionIntroduced); + if (message.editionDeprecated != null && Object.hasOwnProperty.call(message, "editionDeprecated")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.editionDeprecated); + if (message.deprecationWarning != null && Object.hasOwnProperty.call(message, "deprecationWarning")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.deprecationWarning); + if (message.editionRemoved != null && Object.hasOwnProperty.call(message, "editionRemoved")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.editionRemoved); + return writer; + }; + + /** + * Encodes the specified FeatureSupport message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport} message FeatureSupport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSupport.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSupport.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.FeatureSupport(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.editionIntroduced = reader.int32(); + break; + } + case 2: { + message.editionDeprecated = reader.int32(); + break; + } + case 3: { + message.deprecationWarning = reader.string(); + break; + } + case 4: { + message.editionRemoved = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSupport.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSupport message. + * @function verify + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSupport.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.editionIntroduced != null && message.hasOwnProperty("editionIntroduced")) + switch (message.editionIntroduced) { + default: + return "editionIntroduced: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.editionDeprecated != null && message.hasOwnProperty("editionDeprecated")) + switch (message.editionDeprecated) { + default: + return "editionDeprecated: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.deprecationWarning != null && message.hasOwnProperty("deprecationWarning")) + if (!$util.isString(message.deprecationWarning)) + return "deprecationWarning: string expected"; + if (message.editionRemoved != null && message.hasOwnProperty("editionRemoved")) + switch (message.editionRemoved) { + default: + return "editionRemoved: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FeatureSupport message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + */ + FeatureSupport.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions.FeatureSupport) + return object; + var message = new $root.google.protobuf.FieldOptions.FeatureSupport(); + switch (object.editionIntroduced) { + default: + if (typeof object.editionIntroduced === "number") { + message.editionIntroduced = object.editionIntroduced; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionIntroduced = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionIntroduced = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionIntroduced = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionIntroduced = 999; + break; + case "EDITION_2023": + case 1000: + message.editionIntroduced = 1000; + break; + case "EDITION_2024": + case 1001: + message.editionIntroduced = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.editionIntroduced = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.editionIntroduced = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.editionIntroduced = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.editionIntroduced = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.editionIntroduced = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.editionIntroduced = 2147483647; + break; + } + switch (object.editionDeprecated) { + default: + if (typeof object.editionDeprecated === "number") { + message.editionDeprecated = object.editionDeprecated; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionDeprecated = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionDeprecated = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionDeprecated = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionDeprecated = 999; + break; + case "EDITION_2023": + case 1000: + message.editionDeprecated = 1000; + break; + case "EDITION_2024": + case 1001: + message.editionDeprecated = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.editionDeprecated = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.editionDeprecated = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.editionDeprecated = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.editionDeprecated = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.editionDeprecated = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.editionDeprecated = 2147483647; + break; + } + if (object.deprecationWarning != null) + message.deprecationWarning = String(object.deprecationWarning); + switch (object.editionRemoved) { + default: + if (typeof object.editionRemoved === "number") { + message.editionRemoved = object.editionRemoved; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionRemoved = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionRemoved = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionRemoved = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionRemoved = 999; + break; + case "EDITION_2023": + case 1000: + message.editionRemoved = 1000; + break; + case "EDITION_2024": + case 1001: + message.editionRemoved = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.editionRemoved = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.editionRemoved = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.editionRemoved = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.editionRemoved = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.editionRemoved = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.editionRemoved = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSupport message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.FeatureSupport} message FeatureSupport + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSupport.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.editionIntroduced = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.editionDeprecated = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.deprecationWarning = ""; + object.editionRemoved = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.editionIntroduced != null && message.hasOwnProperty("editionIntroduced")) + object.editionIntroduced = options.enums === String ? $root.google.protobuf.Edition[message.editionIntroduced] === undefined ? message.editionIntroduced : $root.google.protobuf.Edition[message.editionIntroduced] : message.editionIntroduced; + if (message.editionDeprecated != null && message.hasOwnProperty("editionDeprecated")) + object.editionDeprecated = options.enums === String ? $root.google.protobuf.Edition[message.editionDeprecated] === undefined ? message.editionDeprecated : $root.google.protobuf.Edition[message.editionDeprecated] : message.editionDeprecated; + if (message.deprecationWarning != null && message.hasOwnProperty("deprecationWarning")) + object.deprecationWarning = message.deprecationWarning; + if (message.editionRemoved != null && message.hasOwnProperty("editionRemoved")) + object.editionRemoved = options.enums === String ? $root.google.protobuf.Edition[message.editionRemoved] === undefined ? message.editionRemoved : $root.google.protobuf.Edition[message.editionRemoved] : message.editionRemoved; + return object; + }; + + /** + * Converts this FeatureSupport to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + * @returns {Object.} JSON object + */ + FeatureSupport.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSupport + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSupport.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.FeatureSupport"; + }; + + return FeatureSupport; + })(); + return FieldOptions; })(); @@ -8869,6 +9524,7 @@ * @property {boolean|null} [deprecated] EnumValueOptions deprecated * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact + * @property {google.protobuf.FieldOptions.IFeatureSupport|null} [featureSupport] EnumValueOptions featureSupport * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption */ @@ -8912,6 +9568,14 @@ */ EnumValueOptions.prototype.debugRedact = false; + /** + * EnumValueOptions featureSupport. + * @member {google.protobuf.FieldOptions.IFeatureSupport|null|undefined} featureSupport + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.featureSupport = null; + /** * EnumValueOptions uninterpretedOption. * @member {Array.} uninterpretedOption @@ -8950,6 +9614,8 @@ $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); + if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) + $root.google.protobuf.FieldOptions.FeatureSupport.encode(message.featureSupport, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); @@ -9001,6 +9667,10 @@ message.debugRedact = reader.bool(); break; } + case 4: { + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.decode(reader, reader.uint32()); + break; + } case 999: { if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; @@ -9053,6 +9723,11 @@ if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) if (typeof message.debugRedact !== "boolean") return "debugRedact: boolean expected"; + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) { + var error = $root.google.protobuf.FieldOptions.FeatureSupport.verify(message.featureSupport); + if (error) + return "featureSupport." + error; + } if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; @@ -9086,6 +9761,11 @@ } if (object.debugRedact != null) message.debugRedact = Boolean(object.debugRedact); + if (object.featureSupport != null) { + if (typeof object.featureSupport !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.featureSupport: object expected"); + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.fromObject(object.featureSupport); + } if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); @@ -9118,6 +9798,7 @@ object.deprecated = false; object.features = null; object.debugRedact = false; + object.featureSupport = null; } if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; @@ -9125,6 +9806,8 @@ object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) object.debugRedact = message.debugRedact; + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) + object.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.toObject(message.featureSupport, options); if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) @@ -10592,6 +11275,8 @@ * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat + * @property {google.protobuf.FeatureSet.EnforceNamingStyle|null} [enforceNamingStyle] FeatureSet enforceNamingStyle + * @property {google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|null} [defaultSymbolVisibility] FeatureSet defaultSymbolVisibility */ /** @@ -10657,6 +11342,22 @@ */ FeatureSet.prototype.jsonFormat = 0; + /** + * FeatureSet enforceNamingStyle. + * @member {google.protobuf.FeatureSet.EnforceNamingStyle} enforceNamingStyle + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enforceNamingStyle = 0; + + /** + * FeatureSet defaultSymbolVisibility. + * @member {google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility} defaultSymbolVisibility + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.defaultSymbolVisibility = 0; + /** * Creates a new FeatureSet instance using the specified properties. * @function create @@ -10693,6 +11394,10 @@ writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); + if (message.enforceNamingStyle != null && Object.hasOwnProperty.call(message, "enforceNamingStyle")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.enforceNamingStyle); + if (message.defaultSymbolVisibility != null && Object.hasOwnProperty.call(message, "defaultSymbolVisibility")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.defaultSymbolVisibility); return writer; }; @@ -10753,6 +11458,14 @@ message.jsonFormat = reader.int32(); break; } + case 7: { + message.enforceNamingStyle = reader.int32(); + break; + } + case 8: { + message.defaultSymbolVisibility = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -10843,6 +11556,26 @@ case 2: break; } + if (message.enforceNamingStyle != null && message.hasOwnProperty("enforceNamingStyle")) + switch (message.enforceNamingStyle) { + default: + return "enforceNamingStyle: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.defaultSymbolVisibility != null && message.hasOwnProperty("defaultSymbolVisibility")) + switch (message.defaultSymbolVisibility) { + default: + return "defaultSymbolVisibility: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } return null; }; @@ -10982,6 +11715,54 @@ message.jsonFormat = 2; break; } + switch (object.enforceNamingStyle) { + default: + if (typeof object.enforceNamingStyle === "number") { + message.enforceNamingStyle = object.enforceNamingStyle; + break; + } + break; + case "ENFORCE_NAMING_STYLE_UNKNOWN": + case 0: + message.enforceNamingStyle = 0; + break; + case "STYLE2024": + case 1: + message.enforceNamingStyle = 1; + break; + case "STYLE_LEGACY": + case 2: + message.enforceNamingStyle = 2; + break; + } + switch (object.defaultSymbolVisibility) { + default: + if (typeof object.defaultSymbolVisibility === "number") { + message.defaultSymbolVisibility = object.defaultSymbolVisibility; + break; + } + break; + case "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN": + case 0: + message.defaultSymbolVisibility = 0; + break; + case "EXPORT_ALL": + case 1: + message.defaultSymbolVisibility = 1; + break; + case "EXPORT_TOP_LEVEL": + case 2: + message.defaultSymbolVisibility = 2; + break; + case "LOCAL_ALL": + case 3: + message.defaultSymbolVisibility = 3; + break; + case "STRICT": + case 4: + message.defaultSymbolVisibility = 4; + break; + } return message; }; @@ -11005,6 +11786,8 @@ object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; + object.enforceNamingStyle = options.enums === String ? "ENFORCE_NAMING_STYLE_UNKNOWN" : 0; + object.defaultSymbolVisibility = options.enums === String ? "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN" : 0; } if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; @@ -11018,6 +11801,10 @@ object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; + if (message.enforceNamingStyle != null && message.hasOwnProperty("enforceNamingStyle")) + object.enforceNamingStyle = options.enums === String ? $root.google.protobuf.FeatureSet.EnforceNamingStyle[message.enforceNamingStyle] === undefined ? message.enforceNamingStyle : $root.google.protobuf.FeatureSet.EnforceNamingStyle[message.enforceNamingStyle] : message.enforceNamingStyle; + if (message.defaultSymbolVisibility != null && message.hasOwnProperty("defaultSymbolVisibility")) + object.defaultSymbolVisibility = options.enums === String ? $root.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility[message.defaultSymbolVisibility] === undefined ? message.defaultSymbolVisibility : $root.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility[message.defaultSymbolVisibility] : message.defaultSymbolVisibility; return object; }; @@ -11145,6 +11932,219 @@ return values; })(); + /** + * EnforceNamingStyle enum. + * @name google.protobuf.FeatureSet.EnforceNamingStyle + * @enum {number} + * @property {number} ENFORCE_NAMING_STYLE_UNKNOWN=0 ENFORCE_NAMING_STYLE_UNKNOWN value + * @property {number} STYLE2024=1 STYLE2024 value + * @property {number} STYLE_LEGACY=2 STYLE_LEGACY value + */ + FeatureSet.EnforceNamingStyle = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENFORCE_NAMING_STYLE_UNKNOWN"] = 0; + values[valuesById[1] = "STYLE2024"] = 1; + values[valuesById[2] = "STYLE_LEGACY"] = 2; + return values; + })(); + + FeatureSet.VisibilityFeature = (function() { + + /** + * Properties of a VisibilityFeature. + * @memberof google.protobuf.FeatureSet + * @interface IVisibilityFeature + */ + + /** + * Constructs a new VisibilityFeature. + * @memberof google.protobuf.FeatureSet + * @classdesc Represents a VisibilityFeature. + * @implements IVisibilityFeature + * @constructor + * @param {google.protobuf.FeatureSet.IVisibilityFeature=} [properties] Properties to set + */ + function VisibilityFeature(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new VisibilityFeature instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature instance + */ + VisibilityFeature.create = function create(properties) { + return new VisibilityFeature(properties); + }; + + /** + * Encodes the specified VisibilityFeature message. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature} message VisibilityFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VisibilityFeature.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified VisibilityFeature message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature} message VisibilityFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VisibilityFeature.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VisibilityFeature.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet.VisibilityFeature(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VisibilityFeature.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VisibilityFeature message. + * @function verify + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VisibilityFeature.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a VisibilityFeature message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + */ + VisibilityFeature.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSet.VisibilityFeature) + return object; + return new $root.google.protobuf.FeatureSet.VisibilityFeature(); + }; + + /** + * Creates a plain object from a VisibilityFeature message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.VisibilityFeature} message VisibilityFeature + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VisibilityFeature.toObject = function toObject() { + return {}; + }; + + /** + * Converts this VisibilityFeature to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @instance + * @returns {Object.} JSON object + */ + VisibilityFeature.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VisibilityFeature + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VisibilityFeature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet.VisibilityFeature"; + }; + + /** + * DefaultSymbolVisibility enum. + * @name google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility + * @enum {number} + * @property {number} DEFAULT_SYMBOL_VISIBILITY_UNKNOWN=0 DEFAULT_SYMBOL_VISIBILITY_UNKNOWN value + * @property {number} EXPORT_ALL=1 EXPORT_ALL value + * @property {number} EXPORT_TOP_LEVEL=2 EXPORT_TOP_LEVEL value + * @property {number} LOCAL_ALL=3 LOCAL_ALL value + * @property {number} STRICT=4 STRICT value + */ + VisibilityFeature.DefaultSymbolVisibility = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN"] = 0; + values[valuesById[1] = "EXPORT_ALL"] = 1; + values[valuesById[2] = "EXPORT_TOP_LEVEL"] = 2; + values[valuesById[3] = "LOCAL_ALL"] = 3; + values[valuesById[4] = "STRICT"] = 4; + return values; + })(); + + return VisibilityFeature; + })(); + return FeatureSet; })(); @@ -11329,6 +12329,7 @@ default: return "minimumEdition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -11346,6 +12347,7 @@ default: return "maximumEdition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -11394,6 +12396,10 @@ case 0: message.minimumEdition = 0; break; + case "EDITION_LEGACY": + case 900: + message.minimumEdition = 900; + break; case "EDITION_PROTO2": case 998: message.minimumEdition = 998; @@ -11446,6 +12452,10 @@ case 0: message.maximumEdition = 0; break; + case "EDITION_LEGACY": + case 900: + message.maximumEdition = 900; + break; case "EDITION_PROTO2": case 998: message.maximumEdition = 998; @@ -11554,7 +12564,8 @@ * @memberof google.protobuf.FeatureSetDefaults * @interface IFeatureSetEditionDefault * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition - * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features + * @property {google.protobuf.IFeatureSet|null} [overridableFeatures] FeatureSetEditionDefault overridableFeatures + * @property {google.protobuf.IFeatureSet|null} [fixedFeatures] FeatureSetEditionDefault fixedFeatures */ /** @@ -11581,12 +12592,20 @@ FeatureSetEditionDefault.prototype.edition = 0; /** - * FeatureSetEditionDefault features. - * @member {google.protobuf.IFeatureSet|null|undefined} features + * FeatureSetEditionDefault overridableFeatures. + * @member {google.protobuf.IFeatureSet|null|undefined} overridableFeatures + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.overridableFeatures = null; + + /** + * FeatureSetEditionDefault fixedFeatures. + * @member {google.protobuf.IFeatureSet|null|undefined} fixedFeatures * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault * @instance */ - FeatureSetEditionDefault.prototype.features = null; + FeatureSetEditionDefault.prototype.fixedFeatures = null; /** * Creates a new FeatureSetEditionDefault instance using the specified properties. @@ -11612,10 +12631,12 @@ FeatureSetEditionDefault.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + if (message.overridableFeatures != null && Object.hasOwnProperty.call(message, "overridableFeatures")) + $root.google.protobuf.FeatureSet.encode(message.overridableFeatures, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.fixedFeatures != null && Object.hasOwnProperty.call(message, "fixedFeatures")) + $root.google.protobuf.FeatureSet.encode(message.fixedFeatures, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -11656,8 +12677,12 @@ message.edition = reader.int32(); break; } - case 2: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + case 4: { + message.overridableFeatures = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 5: { + message.fixedFeatures = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); break; } default: @@ -11700,6 +12725,7 @@ default: return "edition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -11712,10 +12738,15 @@ case 2147483647: break; } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (message.overridableFeatures != null && message.hasOwnProperty("overridableFeatures")) { + var error = $root.google.protobuf.FeatureSet.verify(message.overridableFeatures); + if (error) + return "overridableFeatures." + error; + } + if (message.fixedFeatures != null && message.hasOwnProperty("fixedFeatures")) { + var error = $root.google.protobuf.FeatureSet.verify(message.fixedFeatures); if (error) - return "features." + error; + return "fixedFeatures." + error; } return null; }; @@ -11743,6 +12774,10 @@ case 0: message.edition = 0; break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; case "EDITION_PROTO2": case 998: message.edition = 998; @@ -11784,10 +12819,15 @@ message.edition = 2147483647; break; } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + if (object.overridableFeatures != null) { + if (typeof object.overridableFeatures !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.overridableFeatures: object expected"); + message.overridableFeatures = $root.google.protobuf.FeatureSet.fromObject(object.overridableFeatures); + } + if (object.fixedFeatures != null) { + if (typeof object.fixedFeatures !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fixedFeatures: object expected"); + message.fixedFeatures = $root.google.protobuf.FeatureSet.fromObject(object.fixedFeatures); } return message; }; @@ -11806,13 +12846,16 @@ options = {}; var object = {}; if (options.defaults) { - object.features = null; object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.overridableFeatures = null; + object.fixedFeatures = null; } - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); if (message.edition != null && message.hasOwnProperty("edition")) object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + if (message.overridableFeatures != null && message.hasOwnProperty("overridableFeatures")) + object.overridableFeatures = $root.google.protobuf.FeatureSet.toObject(message.overridableFeatures, options); + if (message.fixedFeatures != null && message.hasOwnProperty("fixedFeatures")) + object.fixedFeatures = $root.google.protobuf.FeatureSet.toObject(message.fixedFeatures, options); return object; }; @@ -13027,6 +14070,22 @@ return GeneratedCodeInfo; })(); + /** + * SymbolVisibility enum. + * @name google.protobuf.SymbolVisibility + * @enum {number} + * @property {number} VISIBILITY_UNSET=0 VISIBILITY_UNSET value + * @property {number} VISIBILITY_LOCAL=1 VISIBILITY_LOCAL value + * @property {number} VISIBILITY_EXPORT=2 VISIBILITY_EXPORT value + */ + protobuf.SymbolVisibility = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VISIBILITY_UNSET"] = 0; + values[valuesById[1] = "VISIBILITY_LOCAL"] = 1; + values[valuesById[2] = "VISIBILITY_EXPORT"] = 2; + return values; + })(); + protobuf.Api = (function() { /** @@ -42630,6 +43689,7 @@ * @interface ICommonLanguageSettings * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri * @property {Array.|null} [destinations] CommonLanguageSettings destinations + * @property {google.api.ISelectiveGapicGeneration|null} [selectiveGapicGeneration] CommonLanguageSettings selectiveGapicGeneration */ /** @@ -42664,6 +43724,14 @@ */ CommonLanguageSettings.prototype.destinations = $util.emptyArray; + /** + * CommonLanguageSettings selectiveGapicGeneration. + * @member {google.api.ISelectiveGapicGeneration|null|undefined} selectiveGapicGeneration + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.selectiveGapicGeneration = null; + /** * Creates a new CommonLanguageSettings instance using the specified properties. * @function create @@ -42696,6 +43764,8 @@ writer.int32(message.destinations[i]); writer.ldelim(); } + if (message.selectiveGapicGeneration != null && Object.hasOwnProperty.call(message, "selectiveGapicGeneration")) + $root.google.api.SelectiveGapicGeneration.encode(message.selectiveGapicGeneration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -42747,6 +43817,10 @@ message.destinations.push(reader.int32()); break; } + case 3: { + message.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -42798,6 +43872,11 @@ break; } } + if (message.selectiveGapicGeneration != null && message.hasOwnProperty("selectiveGapicGeneration")) { + var error = $root.google.api.SelectiveGapicGeneration.verify(message.selectiveGapicGeneration); + if (error) + return "selectiveGapicGeneration." + error; + } return null; }; @@ -42840,6 +43919,11 @@ break; } } + if (object.selectiveGapicGeneration != null) { + if (typeof object.selectiveGapicGeneration !== "object") + throw TypeError(".google.api.CommonLanguageSettings.selectiveGapicGeneration: object expected"); + message.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.fromObject(object.selectiveGapicGeneration); + } return message; }; @@ -42858,8 +43942,10 @@ var object = {}; if (options.arrays || options.defaults) object.destinations = []; - if (options.defaults) + if (options.defaults) { object.referenceDocsUri = ""; + object.selectiveGapicGeneration = null; + } if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) object.referenceDocsUri = message.referenceDocsUri; if (message.destinations && message.destinations.length) { @@ -42867,6 +43953,8 @@ for (var j = 0; j < message.destinations.length; ++j) object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; } + if (message.selectiveGapicGeneration != null && message.hasOwnProperty("selectiveGapicGeneration")) + object.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.toObject(message.selectiveGapicGeneration, options); return object; }; @@ -44689,6 +45777,7 @@ * @memberof google.api * @interface IPythonSettings * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common + * @property {google.api.PythonSettings.IExperimentalFeatures|null} [experimentalFeatures] PythonSettings experimentalFeatures */ /** @@ -44714,6 +45803,14 @@ */ PythonSettings.prototype.common = null; + /** + * PythonSettings experimentalFeatures. + * @member {google.api.PythonSettings.IExperimentalFeatures|null|undefined} experimentalFeatures + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.experimentalFeatures = null; + /** * Creates a new PythonSettings instance using the specified properties. * @function create @@ -44740,6 +45837,8 @@ writer = $Writer.create(); if (message.common != null && Object.hasOwnProperty.call(message, "common")) $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.experimentalFeatures != null && Object.hasOwnProperty.call(message, "experimentalFeatures")) + $root.google.api.PythonSettings.ExperimentalFeatures.encode(message.experimentalFeatures, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -44780,6 +45879,10 @@ message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); break; } + case 2: { + message.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -44820,6 +45923,11 @@ if (error) return "common." + error; } + if (message.experimentalFeatures != null && message.hasOwnProperty("experimentalFeatures")) { + var error = $root.google.api.PythonSettings.ExperimentalFeatures.verify(message.experimentalFeatures); + if (error) + return "experimentalFeatures." + error; + } return null; }; @@ -44840,6 +45948,11 @@ throw TypeError(".google.api.PythonSettings.common: object expected"); message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); } + if (object.experimentalFeatures != null) { + if (typeof object.experimentalFeatures !== "object") + throw TypeError(".google.api.PythonSettings.experimentalFeatures: object expected"); + message.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.fromObject(object.experimentalFeatures); + } return message; }; @@ -44856,10 +45969,14 @@ if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.common = null; + object.experimentalFeatures = null; + } if (message.common != null && message.hasOwnProperty("common")) object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + if (message.experimentalFeatures != null && message.hasOwnProperty("experimentalFeatures")) + object.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.toObject(message.experimentalFeatures, options); return object; }; @@ -44889,6 +46006,258 @@ return typeUrlPrefix + "/google.api.PythonSettings"; }; + PythonSettings.ExperimentalFeatures = (function() { + + /** + * Properties of an ExperimentalFeatures. + * @memberof google.api.PythonSettings + * @interface IExperimentalFeatures + * @property {boolean|null} [restAsyncIoEnabled] ExperimentalFeatures restAsyncIoEnabled + * @property {boolean|null} [protobufPythonicTypesEnabled] ExperimentalFeatures protobufPythonicTypesEnabled + * @property {boolean|null} [unversionedPackageDisabled] ExperimentalFeatures unversionedPackageDisabled + */ + + /** + * Constructs a new ExperimentalFeatures. + * @memberof google.api.PythonSettings + * @classdesc Represents an ExperimentalFeatures. + * @implements IExperimentalFeatures + * @constructor + * @param {google.api.PythonSettings.IExperimentalFeatures=} [properties] Properties to set + */ + function ExperimentalFeatures(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExperimentalFeatures restAsyncIoEnabled. + * @member {boolean} restAsyncIoEnabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.restAsyncIoEnabled = false; + + /** + * ExperimentalFeatures protobufPythonicTypesEnabled. + * @member {boolean} protobufPythonicTypesEnabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.protobufPythonicTypesEnabled = false; + + /** + * ExperimentalFeatures unversionedPackageDisabled. + * @member {boolean} unversionedPackageDisabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.unversionedPackageDisabled = false; + + /** + * Creates a new ExperimentalFeatures instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures=} [properties] Properties to set + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures instance + */ + ExperimentalFeatures.create = function create(properties) { + return new ExperimentalFeatures(properties); + }; + + /** + * Encodes the specified ExperimentalFeatures message. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures} message ExperimentalFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExperimentalFeatures.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.restAsyncIoEnabled != null && Object.hasOwnProperty.call(message, "restAsyncIoEnabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.restAsyncIoEnabled); + if (message.protobufPythonicTypesEnabled != null && Object.hasOwnProperty.call(message, "protobufPythonicTypesEnabled")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.protobufPythonicTypesEnabled); + if (message.unversionedPackageDisabled != null && Object.hasOwnProperty.call(message, "unversionedPackageDisabled")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.unversionedPackageDisabled); + return writer; + }; + + /** + * Encodes the specified ExperimentalFeatures message, length delimited. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures} message ExperimentalFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExperimentalFeatures.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExperimentalFeatures.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings.ExperimentalFeatures(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.restAsyncIoEnabled = reader.bool(); + break; + } + case 2: { + message.protobufPythonicTypesEnabled = reader.bool(); + break; + } + case 3: { + message.unversionedPackageDisabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExperimentalFeatures.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExperimentalFeatures message. + * @function verify + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExperimentalFeatures.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.restAsyncIoEnabled != null && message.hasOwnProperty("restAsyncIoEnabled")) + if (typeof message.restAsyncIoEnabled !== "boolean") + return "restAsyncIoEnabled: boolean expected"; + if (message.protobufPythonicTypesEnabled != null && message.hasOwnProperty("protobufPythonicTypesEnabled")) + if (typeof message.protobufPythonicTypesEnabled !== "boolean") + return "protobufPythonicTypesEnabled: boolean expected"; + if (message.unversionedPackageDisabled != null && message.hasOwnProperty("unversionedPackageDisabled")) + if (typeof message.unversionedPackageDisabled !== "boolean") + return "unversionedPackageDisabled: boolean expected"; + return null; + }; + + /** + * Creates an ExperimentalFeatures message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + */ + ExperimentalFeatures.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PythonSettings.ExperimentalFeatures) + return object; + var message = new $root.google.api.PythonSettings.ExperimentalFeatures(); + if (object.restAsyncIoEnabled != null) + message.restAsyncIoEnabled = Boolean(object.restAsyncIoEnabled); + if (object.protobufPythonicTypesEnabled != null) + message.protobufPythonicTypesEnabled = Boolean(object.protobufPythonicTypesEnabled); + if (object.unversionedPackageDisabled != null) + message.unversionedPackageDisabled = Boolean(object.unversionedPackageDisabled); + return message; + }; + + /** + * Creates a plain object from an ExperimentalFeatures message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.ExperimentalFeatures} message ExperimentalFeatures + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExperimentalFeatures.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.restAsyncIoEnabled = false; + object.protobufPythonicTypesEnabled = false; + object.unversionedPackageDisabled = false; + } + if (message.restAsyncIoEnabled != null && message.hasOwnProperty("restAsyncIoEnabled")) + object.restAsyncIoEnabled = message.restAsyncIoEnabled; + if (message.protobufPythonicTypesEnabled != null && message.hasOwnProperty("protobufPythonicTypesEnabled")) + object.protobufPythonicTypesEnabled = message.protobufPythonicTypesEnabled; + if (message.unversionedPackageDisabled != null && message.hasOwnProperty("unversionedPackageDisabled")) + object.unversionedPackageDisabled = message.unversionedPackageDisabled; + return object; + }; + + /** + * Converts this ExperimentalFeatures to JSON. + * @function toJSON + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + * @returns {Object.} JSON object + */ + ExperimentalFeatures.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExperimentalFeatures + * @function getTypeUrl + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExperimentalFeatures.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings.ExperimentalFeatures"; + }; + + return ExperimentalFeatures; + })(); + return PythonSettings; })(); @@ -45765,6 +47134,7 @@ * @memberof google.api * @interface IGoSettings * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common + * @property {Object.|null} [renamedServices] GoSettings renamedServices */ /** @@ -45776,6 +47146,7 @@ * @param {google.api.IGoSettings=} [properties] Properties to set */ function GoSettings(properties) { + this.renamedServices = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -45790,6 +47161,14 @@ */ GoSettings.prototype.common = null; + /** + * GoSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.renamedServices = $util.emptyObject; + /** * Creates a new GoSettings instance using the specified properties. * @function create @@ -45816,6 +47195,9 @@ writer = $Writer.create(); if (message.common != null && Object.hasOwnProperty.call(message, "common")) $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); return writer; }; @@ -45846,7 +47228,7 @@ GoSettings.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(), key, value; while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) @@ -45856,6 +47238,29 @@ message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); break; } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedServices[key] = value; + break; + } default: reader.skipType(tag & 7); break; @@ -45896,6 +47301,14 @@ if (error) return "common." + error; } + if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } return null; }; @@ -45916,6 +47329,13 @@ throw TypeError(".google.api.GoSettings.common: object expected"); message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); } + if (object.renamedServices) { + if (typeof object.renamedServices !== "object") + throw TypeError(".google.api.GoSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } return message; }; @@ -45932,10 +47352,18 @@ if (!options) options = {}; var object = {}; + if (options.objects || options.defaults) + object.renamedServices = {}; if (options.defaults) object.common = null; if (message.common != null && message.hasOwnProperty("common")) object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } return object; }; @@ -46574,6 +48002,251 @@ return values; })(); + api.SelectiveGapicGeneration = (function() { + + /** + * Properties of a SelectiveGapicGeneration. + * @memberof google.api + * @interface ISelectiveGapicGeneration + * @property {Array.|null} [methods] SelectiveGapicGeneration methods + * @property {boolean|null} [generateOmittedAsInternal] SelectiveGapicGeneration generateOmittedAsInternal + */ + + /** + * Constructs a new SelectiveGapicGeneration. + * @memberof google.api + * @classdesc Represents a SelectiveGapicGeneration. + * @implements ISelectiveGapicGeneration + * @constructor + * @param {google.api.ISelectiveGapicGeneration=} [properties] Properties to set + */ + function SelectiveGapicGeneration(properties) { + this.methods = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SelectiveGapicGeneration methods. + * @member {Array.} methods + * @memberof google.api.SelectiveGapicGeneration + * @instance + */ + SelectiveGapicGeneration.prototype.methods = $util.emptyArray; + + /** + * SelectiveGapicGeneration generateOmittedAsInternal. + * @member {boolean} generateOmittedAsInternal + * @memberof google.api.SelectiveGapicGeneration + * @instance + */ + SelectiveGapicGeneration.prototype.generateOmittedAsInternal = false; + + /** + * Creates a new SelectiveGapicGeneration instance using the specified properties. + * @function create + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration=} [properties] Properties to set + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration instance + */ + SelectiveGapicGeneration.create = function create(properties) { + return new SelectiveGapicGeneration(properties); + }; + + /** + * Encodes the specified SelectiveGapicGeneration message. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @function encode + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration} message SelectiveGapicGeneration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelectiveGapicGeneration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.methods != null && message.methods.length) + for (var i = 0; i < message.methods.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.methods[i]); + if (message.generateOmittedAsInternal != null && Object.hasOwnProperty.call(message, "generateOmittedAsInternal")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.generateOmittedAsInternal); + return writer; + }; + + /** + * Encodes the specified SelectiveGapicGeneration message, length delimited. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration} message SelectiveGapicGeneration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelectiveGapicGeneration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer. + * @function decode + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelectiveGapicGeneration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.SelectiveGapicGeneration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.methods && message.methods.length)) + message.methods = []; + message.methods.push(reader.string()); + break; + } + case 2: { + message.generateOmittedAsInternal = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelectiveGapicGeneration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SelectiveGapicGeneration message. + * @function verify + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SelectiveGapicGeneration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.methods != null && message.hasOwnProperty("methods")) { + if (!Array.isArray(message.methods)) + return "methods: array expected"; + for (var i = 0; i < message.methods.length; ++i) + if (!$util.isString(message.methods[i])) + return "methods: string[] expected"; + } + if (message.generateOmittedAsInternal != null && message.hasOwnProperty("generateOmittedAsInternal")) + if (typeof message.generateOmittedAsInternal !== "boolean") + return "generateOmittedAsInternal: boolean expected"; + return null; + }; + + /** + * Creates a SelectiveGapicGeneration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {Object.} object Plain object + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + */ + SelectiveGapicGeneration.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.SelectiveGapicGeneration) + return object; + var message = new $root.google.api.SelectiveGapicGeneration(); + if (object.methods) { + if (!Array.isArray(object.methods)) + throw TypeError(".google.api.SelectiveGapicGeneration.methods: array expected"); + message.methods = []; + for (var i = 0; i < object.methods.length; ++i) + message.methods[i] = String(object.methods[i]); + } + if (object.generateOmittedAsInternal != null) + message.generateOmittedAsInternal = Boolean(object.generateOmittedAsInternal); + return message; + }; + + /** + * Creates a plain object from a SelectiveGapicGeneration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.SelectiveGapicGeneration} message SelectiveGapicGeneration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SelectiveGapicGeneration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.methods = []; + if (options.defaults) + object.generateOmittedAsInternal = false; + if (message.methods && message.methods.length) { + object.methods = []; + for (var j = 0; j < message.methods.length; ++j) + object.methods[j] = message.methods[j]; + } + if (message.generateOmittedAsInternal != null && message.hasOwnProperty("generateOmittedAsInternal")) + object.generateOmittedAsInternal = message.generateOmittedAsInternal; + return object; + }; + + /** + * Converts this SelectiveGapicGeneration to JSON. + * @function toJSON + * @memberof google.api.SelectiveGapicGeneration + * @instance + * @returns {Object.} JSON object + */ + SelectiveGapicGeneration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SelectiveGapicGeneration + * @function getTypeUrl + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SelectiveGapicGeneration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.SelectiveGapicGeneration"; + }; + + return SelectiveGapicGeneration; + })(); + /** * FieldBehavior enum. * @name google.api.FieldBehavior diff --git a/packages/google-api-serviceusage/protos/protos.json b/packages/google-api-serviceusage/protos/protos.json index d7b465772e1..a617c405f90 100644 --- a/packages/google-api-serviceusage/protos/protos.json +++ b/packages/google-api-serviceusage/protos/protos.json @@ -85,12 +85,19 @@ "type": "FileDescriptorProto", "id": 1 } - } + }, + "extensions": [ + [ + 536000000, + 536000000 + ] + ] }, "Edition": { "edition": "proto2", "values": { "EDITION_UNKNOWN": 0, + "EDITION_LEGACY": 900, "EDITION_PROTO2": 998, "EDITION_PROTO3": 999, "EDITION_2023": 1000, @@ -129,6 +136,11 @@ "type": "int32", "id": 11 }, + "optionDependency": { + "rule": "repeated", + "type": "string", + "id": 15 + }, "messageType": { "rule": "repeated", "type": "DescriptorProto", @@ -217,6 +229,10 @@ "rule": "repeated", "type": "string", "id": 10 + }, + "visibility": { + "type": "SymbolVisibility", + "id": 11 } }, "nested": { @@ -442,6 +458,10 @@ "rule": "repeated", "type": "string", "id": 5 + }, + "visibility": { + "type": "SymbolVisibility", + "id": 6 } }, "nested": { @@ -656,6 +676,7 @@ 42, 42 ], + "php_generic_services", [ 38, 38 @@ -791,7 +812,8 @@ "type": "bool", "id": 10, "options": { - "default": false + "default": false, + "deprecated": true } }, "debugRedact": { @@ -819,6 +841,10 @@ "type": "FeatureSet", "id": 21 }, + "featureSupport": { + "type": "FeatureSupport", + "id": 22 + }, "uninterpretedOption": { "rule": "repeated", "type": "UninterpretedOption", @@ -888,6 +914,26 @@ "id": 2 } } + }, + "FeatureSupport": { + "fields": { + "editionIntroduced": { + "type": "Edition", + "id": 1 + }, + "editionDeprecated": { + "type": "Edition", + "id": 2 + }, + "deprecationWarning": { + "type": "string", + "id": 3 + }, + "editionRemoved": { + "type": "Edition", + "id": 4 + } + } } } }, @@ -976,6 +1022,10 @@ "default": false } }, + "featureSupport": { + "type": "FieldOptions.FeatureSupport", + "id": 4 + }, "uninterpretedOption": { "rule": "repeated", "type": "UninterpretedOption", @@ -1118,6 +1168,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_2023", "edition_defaults.value": "EXPLICIT" } @@ -1128,6 +1179,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "OPEN" } @@ -1138,6 +1190,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "PACKED" } @@ -1148,6 +1201,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "VERIFY" } @@ -1158,7 +1212,8 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO2", + "feature_support.edition_introduced": "EDITION_2023", + "edition_defaults.edition": "EDITION_LEGACY", "edition_defaults.value": "LENGTH_PREFIXED" } }, @@ -1168,27 +1223,38 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "ALLOW" } + }, + "enforceNamingStyle": { + "type": "EnforceNamingStyle", + "id": 7, + "options": { + "retention": "RETENTION_SOURCE", + "targets": "TARGET_TYPE_METHOD", + "feature_support.edition_introduced": "EDITION_2024", + "edition_defaults.edition": "EDITION_2024", + "edition_defaults.value": "STYLE2024" + } + }, + "defaultSymbolVisibility": { + "type": "VisibilityFeature.DefaultSymbolVisibility", + "id": 8, + "options": { + "retention": "RETENTION_SOURCE", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2024", + "edition_defaults.edition": "EDITION_2024", + "edition_defaults.value": "EXPORT_TOP_LEVEL" + } } }, "extensions": [ [ 1000, - 1000 - ], - [ - 1001, - 1001 - ], - [ - 1002, - 1002 - ], - [ - 9990, - 9990 + 9994 ], [ 9995, @@ -1233,7 +1299,13 @@ "UTF8_VALIDATION_UNKNOWN": 0, "VERIFY": 2, "NONE": 3 - } + }, + "reserved": [ + [ + 1, + 1 + ] + ] }, "MessageEncoding": { "values": { @@ -1248,6 +1320,33 @@ "ALLOW": 1, "LEGACY_BEST_EFFORT": 2 } + }, + "EnforceNamingStyle": { + "values": { + "ENFORCE_NAMING_STYLE_UNKNOWN": 0, + "STYLE2024": 1, + "STYLE_LEGACY": 2 + } + }, + "VisibilityFeature": { + "fields": {}, + "reserved": [ + [ + 1, + 536870911 + ] + ], + "nested": { + "DefaultSymbolVisibility": { + "values": { + "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN": 0, + "EXPORT_ALL": 1, + "EXPORT_TOP_LEVEL": 2, + "LOCAL_ALL": 3, + "STRICT": 4 + } + } + } } } }, @@ -1275,11 +1374,26 @@ "type": "Edition", "id": 3 }, - "features": { + "overridableFeatures": { "type": "FeatureSet", - "id": 2 + "id": 4 + }, + "fixedFeatures": { + "type": "FeatureSet", + "id": 5 } - } + }, + "reserved": [ + [ + 1, + 1 + ], + [ + 2, + 2 + ], + "features" + ] } } }, @@ -1292,6 +1406,12 @@ "id": 1 } }, + "extensions": [ + [ + 536000000, + 536000000 + ] + ], "nested": { "Location": { "fields": { @@ -1377,6 +1497,14 @@ } } }, + "SymbolVisibility": { + "edition": "proto2", + "values": { + "VISIBILITY_UNSET": 0, + "VISIBILITY_LOCAL": 1, + "VISIBILITY_EXPORT": 2 + } + }, "Api": { "fields": { "name": { @@ -1688,8 +1816,7 @@ "java_multiple_files": true, "java_outer_classname": "FieldBehaviorProto", "java_package": "com.google.api", - "objc_class_prefix": "GAPI", - "cc_enable_arenas": true + "objc_class_prefix": "GAPI" }, "nested": { "serviceusage": { @@ -3440,10 +3567,7 @@ "aliases": { "rule": "repeated", "type": "string", - "id": 2, - "options": { - "deprecated": true - } + "id": 2 }, "target": { "type": "string", @@ -3880,6 +4004,10 @@ "rule": "repeated", "type": "ClientLibraryDestination", "id": 2 + }, + "selectiveGapicGeneration": { + "type": "SelectiveGapicGeneration", + "id": 3 } } }, @@ -4020,6 +4148,28 @@ "common": { "type": "CommonLanguageSettings", "id": 1 + }, + "experimentalFeatures": { + "type": "ExperimentalFeatures", + "id": 2 + } + }, + "nested": { + "ExperimentalFeatures": { + "fields": { + "restAsyncIoEnabled": { + "type": "bool", + "id": 1 + }, + "protobufPythonicTypesEnabled": { + "type": "bool", + "id": 2 + }, + "unversionedPackageDisabled": { + "type": "bool", + "id": 3 + } + } } } }, @@ -4077,6 +4227,11 @@ "common": { "type": "CommonLanguageSettings", "id": 1 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 } } }, @@ -4138,6 +4293,19 @@ "PACKAGE_MANAGER": 20 } }, + "SelectiveGapicGeneration": { + "fields": { + "methods": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "generateOmittedAsInternal": { + "type": "bool", + "id": 2 + } + } + }, "fieldBehavior": { "rule": "repeated", "type": "google.api.FieldBehavior", @@ -4170,6 +4338,7 @@ "java_multiple_files": true, "java_outer_classname": "OperationsProto", "java_package": "com.google.longrunning", + "objc_class_prefix": "GLRUN", "php_namespace": "Google\\LongRunning" }, "nested": { diff --git a/packages/google-appengine/protos/protos.d.ts b/packages/google-appengine/protos/protos.d.ts index 23b474b297d..35e282d5514 100644 --- a/packages/google-appengine/protos/protos.d.ts +++ b/packages/google-appengine/protos/protos.d.ts @@ -223,6 +223,7 @@ export namespace google { /** Edition enum. */ enum Edition { EDITION_UNKNOWN = 0, + EDITION_LEGACY = 900, EDITION_PROTO2 = 998, EDITION_PROTO3 = 999, EDITION_2023 = 1000, @@ -253,6 +254,9 @@ export namespace google { /** FileDescriptorProto weakDependency */ weakDependency?: (number[]|null); + /** FileDescriptorProto optionDependency */ + optionDependency?: (string[]|null); + /** FileDescriptorProto messageType */ messageType?: (google.protobuf.IDescriptorProto[]|null); @@ -302,6 +306,9 @@ export namespace google { /** FileDescriptorProto weakDependency. */ public weakDependency: number[]; + /** FileDescriptorProto optionDependency. */ + public optionDependency: string[]; + /** FileDescriptorProto messageType. */ public messageType: google.protobuf.IDescriptorProto[]; @@ -436,6 +443,9 @@ export namespace google { /** DescriptorProto reservedName */ reservedName?: (string[]|null); + + /** DescriptorProto visibility */ + visibility?: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility|null); } /** Represents a DescriptorProto. */ @@ -477,6 +487,9 @@ export namespace google { /** DescriptorProto reservedName. */ public reservedName: string[]; + /** DescriptorProto visibility. */ + public visibility: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility); + /** * Creates a new DescriptorProto instance using the specified properties. * @param [properties] Properties to set @@ -1324,6 +1337,9 @@ export namespace google { /** EnumDescriptorProto reservedName */ reservedName?: (string[]|null); + + /** EnumDescriptorProto visibility */ + visibility?: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility|null); } /** Represents an EnumDescriptorProto. */ @@ -1350,6 +1366,9 @@ export namespace google { /** EnumDescriptorProto reservedName. */ public reservedName: string[]; + /** EnumDescriptorProto visibility. */ + public visibility: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility); + /** * Creates a new EnumDescriptorProto instance using the specified properties. * @param [properties] Properties to set @@ -2284,6 +2303,9 @@ export namespace google { /** FieldOptions features */ features?: (google.protobuf.IFeatureSet|null); + /** FieldOptions featureSupport */ + featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** FieldOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); @@ -2339,6 +2361,9 @@ export namespace google { /** FieldOptions features. */ public features?: (google.protobuf.IFeatureSet|null); + /** FieldOptions featureSupport. */ + public featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** FieldOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; @@ -2559,6 +2584,121 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** Properties of a FeatureSupport. */ + interface IFeatureSupport { + + /** FeatureSupport editionIntroduced */ + editionIntroduced?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSupport editionDeprecated */ + editionDeprecated?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSupport deprecationWarning */ + deprecationWarning?: (string|null); + + /** FeatureSupport editionRemoved */ + editionRemoved?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSupport. */ + class FeatureSupport implements IFeatureSupport { + + /** + * Constructs a new FeatureSupport. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IFeatureSupport); + + /** FeatureSupport editionIntroduced. */ + public editionIntroduced: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSupport editionDeprecated. */ + public editionDeprecated: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSupport deprecationWarning. */ + public deprecationWarning: string; + + /** FeatureSupport editionRemoved. */ + public editionRemoved: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSupport instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSupport instance + */ + public static create(properties?: google.protobuf.FieldOptions.IFeatureSupport): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Encodes the specified FeatureSupport message. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @param message FeatureSupport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IFeatureSupport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSupport message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @param message FeatureSupport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IFeatureSupport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Verifies a FeatureSupport message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSupport message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSupport + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Creates a plain object from a FeatureSupport message. Also converts values to other types if specified. + * @param message FeatureSupport + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.FeatureSupport, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSupport to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSupport + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } /** Properties of an OneofOptions. */ @@ -2797,6 +2937,9 @@ export namespace google { /** EnumValueOptions debugRedact */ debugRedact?: (boolean|null); + /** EnumValueOptions featureSupport */ + featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** EnumValueOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); } @@ -2819,6 +2962,9 @@ export namespace google { /** EnumValueOptions debugRedact. */ public debugRedact: boolean; + /** EnumValueOptions featureSupport. */ + public featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** EnumValueOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; @@ -3411,6 +3557,12 @@ export namespace google { /** FeatureSet jsonFormat */ jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); + + /** FeatureSet enforceNamingStyle */ + enforceNamingStyle?: (google.protobuf.FeatureSet.EnforceNamingStyle|keyof typeof google.protobuf.FeatureSet.EnforceNamingStyle|null); + + /** FeatureSet defaultSymbolVisibility */ + defaultSymbolVisibility?: (google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|keyof typeof google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|null); } /** Represents a FeatureSet. */ @@ -3440,6 +3592,12 @@ export namespace google { /** FeatureSet jsonFormat. */ public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); + /** FeatureSet enforceNamingStyle. */ + public enforceNamingStyle: (google.protobuf.FeatureSet.EnforceNamingStyle|keyof typeof google.protobuf.FeatureSet.EnforceNamingStyle); + + /** FeatureSet defaultSymbolVisibility. */ + public defaultSymbolVisibility: (google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|keyof typeof google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility); + /** * Creates a new FeatureSet instance using the specified properties. * @param [properties] Properties to set @@ -3562,6 +3720,116 @@ export namespace google { ALLOW = 1, LEGACY_BEST_EFFORT = 2 } + + /** EnforceNamingStyle enum. */ + enum EnforceNamingStyle { + ENFORCE_NAMING_STYLE_UNKNOWN = 0, + STYLE2024 = 1, + STYLE_LEGACY = 2 + } + + /** Properties of a VisibilityFeature. */ + interface IVisibilityFeature { + } + + /** Represents a VisibilityFeature. */ + class VisibilityFeature implements IVisibilityFeature { + + /** + * Constructs a new VisibilityFeature. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSet.IVisibilityFeature); + + /** + * Creates a new VisibilityFeature instance using the specified properties. + * @param [properties] Properties to set + * @returns VisibilityFeature instance + */ + public static create(properties?: google.protobuf.FeatureSet.IVisibilityFeature): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Encodes the specified VisibilityFeature message. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @param message VisibilityFeature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSet.IVisibilityFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VisibilityFeature message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @param message VisibilityFeature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSet.IVisibilityFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Verifies a VisibilityFeature message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VisibilityFeature message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VisibilityFeature + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Creates a plain object from a VisibilityFeature message. Also converts values to other types if specified. + * @param message VisibilityFeature + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet.VisibilityFeature, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VisibilityFeature to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VisibilityFeature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace VisibilityFeature { + + /** DefaultSymbolVisibility enum. */ + enum DefaultSymbolVisibility { + DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0, + EXPORT_ALL = 1, + EXPORT_TOP_LEVEL = 2, + LOCAL_ALL = 3, + STRICT = 4 + } + } } /** Properties of a FeatureSetDefaults. */ @@ -3681,8 +3949,11 @@ export namespace google { /** FeatureSetEditionDefault edition */ edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - /** FeatureSetEditionDefault features */ - features?: (google.protobuf.IFeatureSet|null); + /** FeatureSetEditionDefault overridableFeatures */ + overridableFeatures?: (google.protobuf.IFeatureSet|null); + + /** FeatureSetEditionDefault fixedFeatures */ + fixedFeatures?: (google.protobuf.IFeatureSet|null); } /** Represents a FeatureSetEditionDefault. */ @@ -3697,8 +3968,11 @@ export namespace google { /** FeatureSetEditionDefault edition. */ public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - /** FeatureSetEditionDefault features. */ - public features?: (google.protobuf.IFeatureSet|null); + /** FeatureSetEditionDefault overridableFeatures. */ + public overridableFeatures?: (google.protobuf.IFeatureSet|null); + + /** FeatureSetEditionDefault fixedFeatures. */ + public fixedFeatures?: (google.protobuf.IFeatureSet|null); /** * Creates a new FeatureSetEditionDefault instance using the specified properties. @@ -4231,6 +4505,13 @@ export namespace google { } } + /** SymbolVisibility enum. */ + enum SymbolVisibility { + VISIBILITY_UNSET = 0, + VISIBILITY_LOCAL = 1, + VISIBILITY_EXPORT = 2 + } + /** Properties of a Timestamp. */ interface ITimestamp { @@ -16788,6 +17069,9 @@ export namespace google { /** CommonLanguageSettings destinations */ destinations?: (google.api.ClientLibraryDestination[]|null); + + /** CommonLanguageSettings selectiveGapicGeneration */ + selectiveGapicGeneration?: (google.api.ISelectiveGapicGeneration|null); } /** Represents a CommonLanguageSettings. */ @@ -16805,6 +17089,9 @@ export namespace google { /** CommonLanguageSettings destinations. */ public destinations: google.api.ClientLibraryDestination[]; + /** CommonLanguageSettings selectiveGapicGeneration. */ + public selectiveGapicGeneration?: (google.api.ISelectiveGapicGeneration|null); + /** * Creates a new CommonLanguageSettings instance using the specified properties. * @param [properties] Properties to set @@ -17505,6 +17792,9 @@ export namespace google { /** PythonSettings common */ common?: (google.api.ICommonLanguageSettings|null); + + /** PythonSettings experimentalFeatures */ + experimentalFeatures?: (google.api.PythonSettings.IExperimentalFeatures|null); } /** Represents a PythonSettings. */ @@ -17519,6 +17809,9 @@ export namespace google { /** PythonSettings common. */ public common?: (google.api.ICommonLanguageSettings|null); + /** PythonSettings experimentalFeatures. */ + public experimentalFeatures?: (google.api.PythonSettings.IExperimentalFeatures|null); + /** * Creates a new PythonSettings instance using the specified properties. * @param [properties] Properties to set @@ -17597,6 +17890,118 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + namespace PythonSettings { + + /** Properties of an ExperimentalFeatures. */ + interface IExperimentalFeatures { + + /** ExperimentalFeatures restAsyncIoEnabled */ + restAsyncIoEnabled?: (boolean|null); + + /** ExperimentalFeatures protobufPythonicTypesEnabled */ + protobufPythonicTypesEnabled?: (boolean|null); + + /** ExperimentalFeatures unversionedPackageDisabled */ + unversionedPackageDisabled?: (boolean|null); + } + + /** Represents an ExperimentalFeatures. */ + class ExperimentalFeatures implements IExperimentalFeatures { + + /** + * Constructs a new ExperimentalFeatures. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.PythonSettings.IExperimentalFeatures); + + /** ExperimentalFeatures restAsyncIoEnabled. */ + public restAsyncIoEnabled: boolean; + + /** ExperimentalFeatures protobufPythonicTypesEnabled. */ + public protobufPythonicTypesEnabled: boolean; + + /** ExperimentalFeatures unversionedPackageDisabled. */ + public unversionedPackageDisabled: boolean; + + /** + * Creates a new ExperimentalFeatures instance using the specified properties. + * @param [properties] Properties to set + * @returns ExperimentalFeatures instance + */ + public static create(properties?: google.api.PythonSettings.IExperimentalFeatures): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Encodes the specified ExperimentalFeatures message. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @param message ExperimentalFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.PythonSettings.IExperimentalFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExperimentalFeatures message, length delimited. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @param message ExperimentalFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.PythonSettings.IExperimentalFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Verifies an ExperimentalFeatures message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExperimentalFeatures message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExperimentalFeatures + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Creates a plain object from an ExperimentalFeatures message. Also converts values to other types if specified. + * @param message ExperimentalFeatures + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings.ExperimentalFeatures, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExperimentalFeatures to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExperimentalFeatures + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + /** Properties of a NodeSettings. */ interface INodeSettings { @@ -17923,6 +18328,9 @@ export namespace google { /** GoSettings common */ common?: (google.api.ICommonLanguageSettings|null); + + /** GoSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|null); } /** Represents a GoSettings. */ @@ -17937,6 +18345,9 @@ export namespace google { /** GoSettings common. */ public common?: (google.api.ICommonLanguageSettings|null); + /** GoSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + /** * Creates a new GoSettings instance using the specified properties. * @param [properties] Properties to set @@ -18261,6 +18672,109 @@ export namespace google { PACKAGE_MANAGER = 20 } + /** Properties of a SelectiveGapicGeneration. */ + interface ISelectiveGapicGeneration { + + /** SelectiveGapicGeneration methods */ + methods?: (string[]|null); + + /** SelectiveGapicGeneration generateOmittedAsInternal */ + generateOmittedAsInternal?: (boolean|null); + } + + /** Represents a SelectiveGapicGeneration. */ + class SelectiveGapicGeneration implements ISelectiveGapicGeneration { + + /** + * Constructs a new SelectiveGapicGeneration. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ISelectiveGapicGeneration); + + /** SelectiveGapicGeneration methods. */ + public methods: string[]; + + /** SelectiveGapicGeneration generateOmittedAsInternal. */ + public generateOmittedAsInternal: boolean; + + /** + * Creates a new SelectiveGapicGeneration instance using the specified properties. + * @param [properties] Properties to set + * @returns SelectiveGapicGeneration instance + */ + public static create(properties?: google.api.ISelectiveGapicGeneration): google.api.SelectiveGapicGeneration; + + /** + * Encodes the specified SelectiveGapicGeneration message. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @param message SelectiveGapicGeneration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ISelectiveGapicGeneration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SelectiveGapicGeneration message, length delimited. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @param message SelectiveGapicGeneration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ISelectiveGapicGeneration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.SelectiveGapicGeneration; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.SelectiveGapicGeneration; + + /** + * Verifies a SelectiveGapicGeneration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SelectiveGapicGeneration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SelectiveGapicGeneration + */ + public static fromObject(object: { [k: string]: any }): google.api.SelectiveGapicGeneration; + + /** + * Creates a plain object from a SelectiveGapicGeneration message. Also converts values to other types if specified. + * @param message SelectiveGapicGeneration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.SelectiveGapicGeneration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SelectiveGapicGeneration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SelectiveGapicGeneration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** LaunchStage enum. */ enum LaunchStage { LAUNCH_STAGE_UNSPECIFIED = 0, diff --git a/packages/google-appengine/protos/protos.js b/packages/google-appengine/protos/protos.js index 168a298805f..451728fc146 100644 --- a/packages/google-appengine/protos/protos.js +++ b/packages/google-appengine/protos/protos.js @@ -522,6 +522,7 @@ * @name google.protobuf.Edition * @enum {number} * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value + * @property {number} EDITION_LEGACY=900 EDITION_LEGACY value * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value * @property {number} EDITION_2023=1000 EDITION_2023 value @@ -536,6 +537,7 @@ protobuf.Edition = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "EDITION_UNKNOWN"] = 0; + values[valuesById[900] = "EDITION_LEGACY"] = 900; values[valuesById[998] = "EDITION_PROTO2"] = 998; values[valuesById[999] = "EDITION_PROTO3"] = 999; values[valuesById[1000] = "EDITION_2023"] = 1000; @@ -560,6 +562,7 @@ * @property {Array.|null} [dependency] FileDescriptorProto dependency * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [optionDependency] FileDescriptorProto optionDependency * @property {Array.|null} [messageType] FileDescriptorProto messageType * @property {Array.|null} [enumType] FileDescriptorProto enumType * @property {Array.|null} [service] FileDescriptorProto service @@ -582,6 +585,7 @@ this.dependency = []; this.publicDependency = []; this.weakDependency = []; + this.optionDependency = []; this.messageType = []; this.enumType = []; this.service = []; @@ -632,6 +636,14 @@ */ FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + /** + * FileDescriptorProto optionDependency. + * @member {Array.} optionDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.optionDependency = $util.emptyArray; + /** * FileDescriptorProto messageType. * @member {Array.} messageType @@ -753,6 +765,9 @@ writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); + if (message.optionDependency != null && message.optionDependency.length) + for (var i = 0; i < message.optionDependency.length; ++i) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.optionDependency[i]); return writer; }; @@ -825,6 +840,12 @@ message.weakDependency.push(reader.int32()); break; } + case 15: { + if (!(message.optionDependency && message.optionDependency.length)) + message.optionDependency = []; + message.optionDependency.push(reader.string()); + break; + } case 4: { if (!(message.messageType && message.messageType.length)) message.messageType = []; @@ -927,6 +948,13 @@ if (!$util.isInteger(message.weakDependency[i])) return "weakDependency: integer[] expected"; } + if (message.optionDependency != null && message.hasOwnProperty("optionDependency")) { + if (!Array.isArray(message.optionDependency)) + return "optionDependency: array expected"; + for (var i = 0; i < message.optionDependency.length; ++i) + if (!$util.isString(message.optionDependency[i])) + return "optionDependency: string[] expected"; + } if (message.messageType != null && message.hasOwnProperty("messageType")) { if (!Array.isArray(message.messageType)) return "messageType: array expected"; @@ -981,6 +1009,7 @@ default: return "edition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -1033,6 +1062,13 @@ for (var i = 0; i < object.weakDependency.length; ++i) message.weakDependency[i] = object.weakDependency[i] | 0; } + if (object.optionDependency) { + if (!Array.isArray(object.optionDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.optionDependency: array expected"); + message.optionDependency = []; + for (var i = 0; i < object.optionDependency.length; ++i) + message.optionDependency[i] = String(object.optionDependency[i]); + } if (object.messageType) { if (!Array.isArray(object.messageType)) throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); @@ -1096,6 +1132,10 @@ case 0: message.edition = 0; break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; case "EDITION_PROTO2": case 998: message.edition = 998; @@ -1161,6 +1201,7 @@ object.extension = []; object.publicDependency = []; object.weakDependency = []; + object.optionDependency = []; } if (options.defaults) { object.name = ""; @@ -1217,6 +1258,11 @@ object.syntax = message.syntax; if (message.edition != null && message.hasOwnProperty("edition")) object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + if (message.optionDependency && message.optionDependency.length) { + object.optionDependency = []; + for (var j = 0; j < message.optionDependency.length; ++j) + object.optionDependency[j] = message.optionDependency[j]; + } return object; }; @@ -1265,6 +1311,7 @@ * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options * @property {Array.|null} [reservedRange] DescriptorProto reservedRange * @property {Array.|null} [reservedName] DescriptorProto reservedName + * @property {google.protobuf.SymbolVisibility|null} [visibility] DescriptorProto visibility */ /** @@ -1370,6 +1417,14 @@ */ DescriptorProto.prototype.reservedName = $util.emptyArray; + /** + * DescriptorProto visibility. + * @member {google.protobuf.SymbolVisibility} visibility + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.visibility = 0; + /** * Creates a new DescriptorProto instance using the specified properties. * @function create @@ -1422,6 +1477,8 @@ if (message.reservedName != null && message.reservedName.length) for (var i = 0; i < message.reservedName.length; ++i) writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.visibility); return writer; }; @@ -1514,6 +1571,10 @@ message.reservedName.push(reader.string()); break; } + case 11: { + message.visibility = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -1627,6 +1688,15 @@ if (!$util.isString(message.reservedName[i])) return "reservedName: string[] expected"; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + switch (message.visibility) { + default: + return "visibility: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; @@ -1726,6 +1796,26 @@ for (var i = 0; i < object.reservedName.length; ++i) message.reservedName[i] = String(object.reservedName[i]); } + switch (object.visibility) { + default: + if (typeof object.visibility === "number") { + message.visibility = object.visibility; + break; + } + break; + case "VISIBILITY_UNSET": + case 0: + message.visibility = 0; + break; + case "VISIBILITY_LOCAL": + case 1: + message.visibility = 1; + break; + case "VISIBILITY_EXPORT": + case 2: + message.visibility = 2; + break; + } return message; }; @@ -1755,6 +1845,7 @@ if (options.defaults) { object.name = ""; object.options = null; + object.visibility = options.enums === String ? "VISIBILITY_UNSET" : 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -1800,6 +1891,8 @@ for (var j = 0; j < message.reservedName.length; ++j) object.reservedName[j] = message.reservedName[j]; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + object.visibility = options.enums === String ? $root.google.protobuf.SymbolVisibility[message.visibility] === undefined ? message.visibility : $root.google.protobuf.SymbolVisibility[message.visibility] : message.visibility; return object; }; @@ -3844,6 +3937,7 @@ * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + * @property {google.protobuf.SymbolVisibility|null} [visibility] EnumDescriptorProto visibility */ /** @@ -3904,6 +3998,14 @@ */ EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + /** + * EnumDescriptorProto visibility. + * @member {google.protobuf.SymbolVisibility} visibility + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.visibility = 0; + /** * Creates a new EnumDescriptorProto instance using the specified properties. * @function create @@ -3941,6 +4043,8 @@ if (message.reservedName != null && message.reservedName.length) for (var i = 0; i < message.reservedName.length; ++i) writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.visibility); return writer; }; @@ -4003,6 +4107,10 @@ message.reservedName.push(reader.string()); break; } + case 6: { + message.visibility = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -4071,6 +4179,15 @@ if (!$util.isString(message.reservedName[i])) return "reservedName: string[] expected"; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + switch (message.visibility) { + default: + return "visibility: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; @@ -4120,6 +4237,26 @@ for (var i = 0; i < object.reservedName.length; ++i) message.reservedName[i] = String(object.reservedName[i]); } + switch (object.visibility) { + default: + if (typeof object.visibility === "number") { + message.visibility = object.visibility; + break; + } + break; + case "VISIBILITY_UNSET": + case 0: + message.visibility = 0; + break; + case "VISIBILITY_LOCAL": + case 1: + message.visibility = 1; + break; + case "VISIBILITY_EXPORT": + case 2: + message.visibility = 2; + break; + } return message; }; @@ -4144,6 +4281,7 @@ if (options.defaults) { object.name = ""; object.options = null; + object.visibility = options.enums === String ? "VISIBILITY_UNSET" : 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -4164,6 +4302,8 @@ for (var j = 0; j < message.reservedName.length; ++j) object.reservedName[j] = message.reservedName[j]; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + object.visibility = options.enums === String ? $root.google.protobuf.SymbolVisibility[message.visibility] === undefined ? message.visibility : $root.google.protobuf.SymbolVisibility[message.visibility] : message.visibility; return object; }; @@ -6482,6 +6622,7 @@ * @property {Array.|null} [targets] FieldOptions targets * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features + * @property {google.protobuf.FieldOptions.IFeatureSupport|null} [featureSupport] FieldOptions featureSupport * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference @@ -6602,6 +6743,14 @@ */ FieldOptions.prototype.features = null; + /** + * FieldOptions featureSupport. + * @member {google.protobuf.FieldOptions.IFeatureSupport|null|undefined} featureSupport + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.featureSupport = null; + /** * FieldOptions uninterpretedOption. * @member {Array.} uninterpretedOption @@ -6676,6 +6825,8 @@ $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); if (message.features != null && Object.hasOwnProperty.call(message, "features")) $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) + $root.google.protobuf.FieldOptions.FeatureSupport.encode(message.featureSupport, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); @@ -6777,6 +6928,10 @@ message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); break; } + case 22: { + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.decode(reader, reader.uint32()); + break; + } case 999: { if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; @@ -6912,6 +7067,11 @@ if (error) return "features." + error; } + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) { + var error = $root.google.protobuf.FieldOptions.FeatureSupport.verify(message.featureSupport); + if (error) + return "featureSupport." + error; + } if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; @@ -7100,6 +7260,11 @@ throw TypeError(".google.protobuf.FieldOptions.features: object expected"); message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); } + if (object.featureSupport != null) { + if (typeof object.featureSupport !== "object") + throw TypeError(".google.protobuf.FieldOptions.featureSupport: object expected"); + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.fromObject(object.featureSupport); + } if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); @@ -7197,6 +7362,7 @@ object.debugRedact = false; object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; object.features = null; + object.featureSupport = null; object[".google.api.resourceReference"] = null; } if (message.ctype != null && message.hasOwnProperty("ctype")) @@ -7229,6 +7395,8 @@ } if (message.features != null && message.hasOwnProperty("features")) object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) + object.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.toObject(message.featureSupport, options); if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) @@ -7501,6 +7669,7 @@ default: return "edition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -7542,6 +7711,10 @@ case 0: message.edition = 0; break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; case "EDITION_PROTO2": case 998: message.edition = 998; @@ -7641,6 +7814,488 @@ return EditionDefault; })(); + FieldOptions.FeatureSupport = (function() { + + /** + * Properties of a FeatureSupport. + * @memberof google.protobuf.FieldOptions + * @interface IFeatureSupport + * @property {google.protobuf.Edition|null} [editionIntroduced] FeatureSupport editionIntroduced + * @property {google.protobuf.Edition|null} [editionDeprecated] FeatureSupport editionDeprecated + * @property {string|null} [deprecationWarning] FeatureSupport deprecationWarning + * @property {google.protobuf.Edition|null} [editionRemoved] FeatureSupport editionRemoved + */ + + /** + * Constructs a new FeatureSupport. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents a FeatureSupport. + * @implements IFeatureSupport + * @constructor + * @param {google.protobuf.FieldOptions.IFeatureSupport=} [properties] Properties to set + */ + function FeatureSupport(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSupport editionIntroduced. + * @member {google.protobuf.Edition} editionIntroduced + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionIntroduced = 0; + + /** + * FeatureSupport editionDeprecated. + * @member {google.protobuf.Edition} editionDeprecated + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionDeprecated = 0; + + /** + * FeatureSupport deprecationWarning. + * @member {string} deprecationWarning + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.deprecationWarning = ""; + + /** + * FeatureSupport editionRemoved. + * @member {google.protobuf.Edition} editionRemoved + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionRemoved = 0; + + /** + * Creates a new FeatureSupport instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport instance + */ + FeatureSupport.create = function create(properties) { + return new FeatureSupport(properties); + }; + + /** + * Encodes the specified FeatureSupport message. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport} message FeatureSupport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSupport.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.editionIntroduced != null && Object.hasOwnProperty.call(message, "editionIntroduced")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.editionIntroduced); + if (message.editionDeprecated != null && Object.hasOwnProperty.call(message, "editionDeprecated")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.editionDeprecated); + if (message.deprecationWarning != null && Object.hasOwnProperty.call(message, "deprecationWarning")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.deprecationWarning); + if (message.editionRemoved != null && Object.hasOwnProperty.call(message, "editionRemoved")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.editionRemoved); + return writer; + }; + + /** + * Encodes the specified FeatureSupport message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport} message FeatureSupport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSupport.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSupport.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.FeatureSupport(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.editionIntroduced = reader.int32(); + break; + } + case 2: { + message.editionDeprecated = reader.int32(); + break; + } + case 3: { + message.deprecationWarning = reader.string(); + break; + } + case 4: { + message.editionRemoved = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSupport.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSupport message. + * @function verify + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSupport.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.editionIntroduced != null && message.hasOwnProperty("editionIntroduced")) + switch (message.editionIntroduced) { + default: + return "editionIntroduced: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.editionDeprecated != null && message.hasOwnProperty("editionDeprecated")) + switch (message.editionDeprecated) { + default: + return "editionDeprecated: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.deprecationWarning != null && message.hasOwnProperty("deprecationWarning")) + if (!$util.isString(message.deprecationWarning)) + return "deprecationWarning: string expected"; + if (message.editionRemoved != null && message.hasOwnProperty("editionRemoved")) + switch (message.editionRemoved) { + default: + return "editionRemoved: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FeatureSupport message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + */ + FeatureSupport.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions.FeatureSupport) + return object; + var message = new $root.google.protobuf.FieldOptions.FeatureSupport(); + switch (object.editionIntroduced) { + default: + if (typeof object.editionIntroduced === "number") { + message.editionIntroduced = object.editionIntroduced; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionIntroduced = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionIntroduced = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionIntroduced = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionIntroduced = 999; + break; + case "EDITION_2023": + case 1000: + message.editionIntroduced = 1000; + break; + case "EDITION_2024": + case 1001: + message.editionIntroduced = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.editionIntroduced = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.editionIntroduced = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.editionIntroduced = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.editionIntroduced = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.editionIntroduced = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.editionIntroduced = 2147483647; + break; + } + switch (object.editionDeprecated) { + default: + if (typeof object.editionDeprecated === "number") { + message.editionDeprecated = object.editionDeprecated; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionDeprecated = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionDeprecated = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionDeprecated = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionDeprecated = 999; + break; + case "EDITION_2023": + case 1000: + message.editionDeprecated = 1000; + break; + case "EDITION_2024": + case 1001: + message.editionDeprecated = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.editionDeprecated = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.editionDeprecated = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.editionDeprecated = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.editionDeprecated = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.editionDeprecated = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.editionDeprecated = 2147483647; + break; + } + if (object.deprecationWarning != null) + message.deprecationWarning = String(object.deprecationWarning); + switch (object.editionRemoved) { + default: + if (typeof object.editionRemoved === "number") { + message.editionRemoved = object.editionRemoved; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionRemoved = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionRemoved = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionRemoved = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionRemoved = 999; + break; + case "EDITION_2023": + case 1000: + message.editionRemoved = 1000; + break; + case "EDITION_2024": + case 1001: + message.editionRemoved = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.editionRemoved = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.editionRemoved = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.editionRemoved = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.editionRemoved = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.editionRemoved = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.editionRemoved = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSupport message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.FeatureSupport} message FeatureSupport + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSupport.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.editionIntroduced = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.editionDeprecated = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.deprecationWarning = ""; + object.editionRemoved = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.editionIntroduced != null && message.hasOwnProperty("editionIntroduced")) + object.editionIntroduced = options.enums === String ? $root.google.protobuf.Edition[message.editionIntroduced] === undefined ? message.editionIntroduced : $root.google.protobuf.Edition[message.editionIntroduced] : message.editionIntroduced; + if (message.editionDeprecated != null && message.hasOwnProperty("editionDeprecated")) + object.editionDeprecated = options.enums === String ? $root.google.protobuf.Edition[message.editionDeprecated] === undefined ? message.editionDeprecated : $root.google.protobuf.Edition[message.editionDeprecated] : message.editionDeprecated; + if (message.deprecationWarning != null && message.hasOwnProperty("deprecationWarning")) + object.deprecationWarning = message.deprecationWarning; + if (message.editionRemoved != null && message.hasOwnProperty("editionRemoved")) + object.editionRemoved = options.enums === String ? $root.google.protobuf.Edition[message.editionRemoved] === undefined ? message.editionRemoved : $root.google.protobuf.Edition[message.editionRemoved] : message.editionRemoved; + return object; + }; + + /** + * Converts this FeatureSupport to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + * @returns {Object.} JSON object + */ + FeatureSupport.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSupport + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSupport.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.FeatureSupport"; + }; + + return FeatureSupport; + })(); + return FieldOptions; })(); @@ -8233,6 +8888,7 @@ * @property {boolean|null} [deprecated] EnumValueOptions deprecated * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact + * @property {google.protobuf.FieldOptions.IFeatureSupport|null} [featureSupport] EnumValueOptions featureSupport * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption */ @@ -8276,6 +8932,14 @@ */ EnumValueOptions.prototype.debugRedact = false; + /** + * EnumValueOptions featureSupport. + * @member {google.protobuf.FieldOptions.IFeatureSupport|null|undefined} featureSupport + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.featureSupport = null; + /** * EnumValueOptions uninterpretedOption. * @member {Array.} uninterpretedOption @@ -8314,6 +8978,8 @@ $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); + if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) + $root.google.protobuf.FieldOptions.FeatureSupport.encode(message.featureSupport, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); @@ -8365,6 +9031,10 @@ message.debugRedact = reader.bool(); break; } + case 4: { + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.decode(reader, reader.uint32()); + break; + } case 999: { if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; @@ -8417,6 +9087,11 @@ if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) if (typeof message.debugRedact !== "boolean") return "debugRedact: boolean expected"; + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) { + var error = $root.google.protobuf.FieldOptions.FeatureSupport.verify(message.featureSupport); + if (error) + return "featureSupport." + error; + } if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; @@ -8450,6 +9125,11 @@ } if (object.debugRedact != null) message.debugRedact = Boolean(object.debugRedact); + if (object.featureSupport != null) { + if (typeof object.featureSupport !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.featureSupport: object expected"); + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.fromObject(object.featureSupport); + } if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); @@ -8482,6 +9162,7 @@ object.deprecated = false; object.features = null; object.debugRedact = false; + object.featureSupport = null; } if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; @@ -8489,6 +9170,8 @@ object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) object.debugRedact = message.debugRedact; + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) + object.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.toObject(message.featureSupport, options); if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) @@ -9956,6 +10639,8 @@ * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat + * @property {google.protobuf.FeatureSet.EnforceNamingStyle|null} [enforceNamingStyle] FeatureSet enforceNamingStyle + * @property {google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|null} [defaultSymbolVisibility] FeatureSet defaultSymbolVisibility */ /** @@ -10021,6 +10706,22 @@ */ FeatureSet.prototype.jsonFormat = 0; + /** + * FeatureSet enforceNamingStyle. + * @member {google.protobuf.FeatureSet.EnforceNamingStyle} enforceNamingStyle + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enforceNamingStyle = 0; + + /** + * FeatureSet defaultSymbolVisibility. + * @member {google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility} defaultSymbolVisibility + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.defaultSymbolVisibility = 0; + /** * Creates a new FeatureSet instance using the specified properties. * @function create @@ -10057,6 +10758,10 @@ writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); + if (message.enforceNamingStyle != null && Object.hasOwnProperty.call(message, "enforceNamingStyle")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.enforceNamingStyle); + if (message.defaultSymbolVisibility != null && Object.hasOwnProperty.call(message, "defaultSymbolVisibility")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.defaultSymbolVisibility); return writer; }; @@ -10117,6 +10822,14 @@ message.jsonFormat = reader.int32(); break; } + case 7: { + message.enforceNamingStyle = reader.int32(); + break; + } + case 8: { + message.defaultSymbolVisibility = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -10207,6 +10920,26 @@ case 2: break; } + if (message.enforceNamingStyle != null && message.hasOwnProperty("enforceNamingStyle")) + switch (message.enforceNamingStyle) { + default: + return "enforceNamingStyle: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.defaultSymbolVisibility != null && message.hasOwnProperty("defaultSymbolVisibility")) + switch (message.defaultSymbolVisibility) { + default: + return "defaultSymbolVisibility: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } return null; }; @@ -10346,6 +11079,54 @@ message.jsonFormat = 2; break; } + switch (object.enforceNamingStyle) { + default: + if (typeof object.enforceNamingStyle === "number") { + message.enforceNamingStyle = object.enforceNamingStyle; + break; + } + break; + case "ENFORCE_NAMING_STYLE_UNKNOWN": + case 0: + message.enforceNamingStyle = 0; + break; + case "STYLE2024": + case 1: + message.enforceNamingStyle = 1; + break; + case "STYLE_LEGACY": + case 2: + message.enforceNamingStyle = 2; + break; + } + switch (object.defaultSymbolVisibility) { + default: + if (typeof object.defaultSymbolVisibility === "number") { + message.defaultSymbolVisibility = object.defaultSymbolVisibility; + break; + } + break; + case "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN": + case 0: + message.defaultSymbolVisibility = 0; + break; + case "EXPORT_ALL": + case 1: + message.defaultSymbolVisibility = 1; + break; + case "EXPORT_TOP_LEVEL": + case 2: + message.defaultSymbolVisibility = 2; + break; + case "LOCAL_ALL": + case 3: + message.defaultSymbolVisibility = 3; + break; + case "STRICT": + case 4: + message.defaultSymbolVisibility = 4; + break; + } return message; }; @@ -10369,6 +11150,8 @@ object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; + object.enforceNamingStyle = options.enums === String ? "ENFORCE_NAMING_STYLE_UNKNOWN" : 0; + object.defaultSymbolVisibility = options.enums === String ? "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN" : 0; } if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; @@ -10382,6 +11165,10 @@ object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; + if (message.enforceNamingStyle != null && message.hasOwnProperty("enforceNamingStyle")) + object.enforceNamingStyle = options.enums === String ? $root.google.protobuf.FeatureSet.EnforceNamingStyle[message.enforceNamingStyle] === undefined ? message.enforceNamingStyle : $root.google.protobuf.FeatureSet.EnforceNamingStyle[message.enforceNamingStyle] : message.enforceNamingStyle; + if (message.defaultSymbolVisibility != null && message.hasOwnProperty("defaultSymbolVisibility")) + object.defaultSymbolVisibility = options.enums === String ? $root.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility[message.defaultSymbolVisibility] === undefined ? message.defaultSymbolVisibility : $root.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility[message.defaultSymbolVisibility] : message.defaultSymbolVisibility; return object; }; @@ -10509,6 +11296,219 @@ return values; })(); + /** + * EnforceNamingStyle enum. + * @name google.protobuf.FeatureSet.EnforceNamingStyle + * @enum {number} + * @property {number} ENFORCE_NAMING_STYLE_UNKNOWN=0 ENFORCE_NAMING_STYLE_UNKNOWN value + * @property {number} STYLE2024=1 STYLE2024 value + * @property {number} STYLE_LEGACY=2 STYLE_LEGACY value + */ + FeatureSet.EnforceNamingStyle = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENFORCE_NAMING_STYLE_UNKNOWN"] = 0; + values[valuesById[1] = "STYLE2024"] = 1; + values[valuesById[2] = "STYLE_LEGACY"] = 2; + return values; + })(); + + FeatureSet.VisibilityFeature = (function() { + + /** + * Properties of a VisibilityFeature. + * @memberof google.protobuf.FeatureSet + * @interface IVisibilityFeature + */ + + /** + * Constructs a new VisibilityFeature. + * @memberof google.protobuf.FeatureSet + * @classdesc Represents a VisibilityFeature. + * @implements IVisibilityFeature + * @constructor + * @param {google.protobuf.FeatureSet.IVisibilityFeature=} [properties] Properties to set + */ + function VisibilityFeature(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new VisibilityFeature instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature instance + */ + VisibilityFeature.create = function create(properties) { + return new VisibilityFeature(properties); + }; + + /** + * Encodes the specified VisibilityFeature message. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature} message VisibilityFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VisibilityFeature.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified VisibilityFeature message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature} message VisibilityFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VisibilityFeature.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VisibilityFeature.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet.VisibilityFeature(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VisibilityFeature.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VisibilityFeature message. + * @function verify + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VisibilityFeature.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a VisibilityFeature message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + */ + VisibilityFeature.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSet.VisibilityFeature) + return object; + return new $root.google.protobuf.FeatureSet.VisibilityFeature(); + }; + + /** + * Creates a plain object from a VisibilityFeature message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.VisibilityFeature} message VisibilityFeature + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VisibilityFeature.toObject = function toObject() { + return {}; + }; + + /** + * Converts this VisibilityFeature to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @instance + * @returns {Object.} JSON object + */ + VisibilityFeature.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VisibilityFeature + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VisibilityFeature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet.VisibilityFeature"; + }; + + /** + * DefaultSymbolVisibility enum. + * @name google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility + * @enum {number} + * @property {number} DEFAULT_SYMBOL_VISIBILITY_UNKNOWN=0 DEFAULT_SYMBOL_VISIBILITY_UNKNOWN value + * @property {number} EXPORT_ALL=1 EXPORT_ALL value + * @property {number} EXPORT_TOP_LEVEL=2 EXPORT_TOP_LEVEL value + * @property {number} LOCAL_ALL=3 LOCAL_ALL value + * @property {number} STRICT=4 STRICT value + */ + VisibilityFeature.DefaultSymbolVisibility = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN"] = 0; + values[valuesById[1] = "EXPORT_ALL"] = 1; + values[valuesById[2] = "EXPORT_TOP_LEVEL"] = 2; + values[valuesById[3] = "LOCAL_ALL"] = 3; + values[valuesById[4] = "STRICT"] = 4; + return values; + })(); + + return VisibilityFeature; + })(); + return FeatureSet; })(); @@ -10693,6 +11693,7 @@ default: return "minimumEdition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -10710,6 +11711,7 @@ default: return "maximumEdition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -10758,6 +11760,10 @@ case 0: message.minimumEdition = 0; break; + case "EDITION_LEGACY": + case 900: + message.minimumEdition = 900; + break; case "EDITION_PROTO2": case 998: message.minimumEdition = 998; @@ -10810,6 +11816,10 @@ case 0: message.maximumEdition = 0; break; + case "EDITION_LEGACY": + case 900: + message.maximumEdition = 900; + break; case "EDITION_PROTO2": case 998: message.maximumEdition = 998; @@ -10918,7 +11928,8 @@ * @memberof google.protobuf.FeatureSetDefaults * @interface IFeatureSetEditionDefault * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition - * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features + * @property {google.protobuf.IFeatureSet|null} [overridableFeatures] FeatureSetEditionDefault overridableFeatures + * @property {google.protobuf.IFeatureSet|null} [fixedFeatures] FeatureSetEditionDefault fixedFeatures */ /** @@ -10945,12 +11956,20 @@ FeatureSetEditionDefault.prototype.edition = 0; /** - * FeatureSetEditionDefault features. - * @member {google.protobuf.IFeatureSet|null|undefined} features + * FeatureSetEditionDefault overridableFeatures. + * @member {google.protobuf.IFeatureSet|null|undefined} overridableFeatures + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.overridableFeatures = null; + + /** + * FeatureSetEditionDefault fixedFeatures. + * @member {google.protobuf.IFeatureSet|null|undefined} fixedFeatures * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault * @instance */ - FeatureSetEditionDefault.prototype.features = null; + FeatureSetEditionDefault.prototype.fixedFeatures = null; /** * Creates a new FeatureSetEditionDefault instance using the specified properties. @@ -10976,10 +11995,12 @@ FeatureSetEditionDefault.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + if (message.overridableFeatures != null && Object.hasOwnProperty.call(message, "overridableFeatures")) + $root.google.protobuf.FeatureSet.encode(message.overridableFeatures, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.fixedFeatures != null && Object.hasOwnProperty.call(message, "fixedFeatures")) + $root.google.protobuf.FeatureSet.encode(message.fixedFeatures, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -11020,8 +12041,12 @@ message.edition = reader.int32(); break; } - case 2: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + case 4: { + message.overridableFeatures = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 5: { + message.fixedFeatures = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); break; } default: @@ -11064,6 +12089,7 @@ default: return "edition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -11076,10 +12102,15 @@ case 2147483647: break; } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (message.overridableFeatures != null && message.hasOwnProperty("overridableFeatures")) { + var error = $root.google.protobuf.FeatureSet.verify(message.overridableFeatures); + if (error) + return "overridableFeatures." + error; + } + if (message.fixedFeatures != null && message.hasOwnProperty("fixedFeatures")) { + var error = $root.google.protobuf.FeatureSet.verify(message.fixedFeatures); if (error) - return "features." + error; + return "fixedFeatures." + error; } return null; }; @@ -11107,6 +12138,10 @@ case 0: message.edition = 0; break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; case "EDITION_PROTO2": case 998: message.edition = 998; @@ -11148,10 +12183,15 @@ message.edition = 2147483647; break; } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + if (object.overridableFeatures != null) { + if (typeof object.overridableFeatures !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.overridableFeatures: object expected"); + message.overridableFeatures = $root.google.protobuf.FeatureSet.fromObject(object.overridableFeatures); + } + if (object.fixedFeatures != null) { + if (typeof object.fixedFeatures !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fixedFeatures: object expected"); + message.fixedFeatures = $root.google.protobuf.FeatureSet.fromObject(object.fixedFeatures); } return message; }; @@ -11170,13 +12210,16 @@ options = {}; var object = {}; if (options.defaults) { - object.features = null; object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.overridableFeatures = null; + object.fixedFeatures = null; } - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); if (message.edition != null && message.hasOwnProperty("edition")) object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + if (message.overridableFeatures != null && message.hasOwnProperty("overridableFeatures")) + object.overridableFeatures = $root.google.protobuf.FeatureSet.toObject(message.overridableFeatures, options); + if (message.fixedFeatures != null && message.hasOwnProperty("fixedFeatures")) + object.fixedFeatures = $root.google.protobuf.FeatureSet.toObject(message.fixedFeatures, options); return object; }; @@ -12391,6 +13434,22 @@ return GeneratedCodeInfo; })(); + /** + * SymbolVisibility enum. + * @name google.protobuf.SymbolVisibility + * @enum {number} + * @property {number} VISIBILITY_UNSET=0 VISIBILITY_UNSET value + * @property {number} VISIBILITY_LOCAL=1 VISIBILITY_LOCAL value + * @property {number} VISIBILITY_EXPORT=2 VISIBILITY_EXPORT value + */ + protobuf.SymbolVisibility = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VISIBILITY_UNSET"] = 0; + values[valuesById[1] = "VISIBILITY_LOCAL"] = 1; + values[valuesById[2] = "VISIBILITY_EXPORT"] = 2; + return values; + })(); + protobuf.Timestamp = (function() { /** @@ -43111,6 +44170,7 @@ * @interface ICommonLanguageSettings * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri * @property {Array.|null} [destinations] CommonLanguageSettings destinations + * @property {google.api.ISelectiveGapicGeneration|null} [selectiveGapicGeneration] CommonLanguageSettings selectiveGapicGeneration */ /** @@ -43145,6 +44205,14 @@ */ CommonLanguageSettings.prototype.destinations = $util.emptyArray; + /** + * CommonLanguageSettings selectiveGapicGeneration. + * @member {google.api.ISelectiveGapicGeneration|null|undefined} selectiveGapicGeneration + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.selectiveGapicGeneration = null; + /** * Creates a new CommonLanguageSettings instance using the specified properties. * @function create @@ -43177,6 +44245,8 @@ writer.int32(message.destinations[i]); writer.ldelim(); } + if (message.selectiveGapicGeneration != null && Object.hasOwnProperty.call(message, "selectiveGapicGeneration")) + $root.google.api.SelectiveGapicGeneration.encode(message.selectiveGapicGeneration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -43228,6 +44298,10 @@ message.destinations.push(reader.int32()); break; } + case 3: { + message.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -43279,6 +44353,11 @@ break; } } + if (message.selectiveGapicGeneration != null && message.hasOwnProperty("selectiveGapicGeneration")) { + var error = $root.google.api.SelectiveGapicGeneration.verify(message.selectiveGapicGeneration); + if (error) + return "selectiveGapicGeneration." + error; + } return null; }; @@ -43321,6 +44400,11 @@ break; } } + if (object.selectiveGapicGeneration != null) { + if (typeof object.selectiveGapicGeneration !== "object") + throw TypeError(".google.api.CommonLanguageSettings.selectiveGapicGeneration: object expected"); + message.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.fromObject(object.selectiveGapicGeneration); + } return message; }; @@ -43339,8 +44423,10 @@ var object = {}; if (options.arrays || options.defaults) object.destinations = []; - if (options.defaults) + if (options.defaults) { object.referenceDocsUri = ""; + object.selectiveGapicGeneration = null; + } if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) object.referenceDocsUri = message.referenceDocsUri; if (message.destinations && message.destinations.length) { @@ -43348,6 +44434,8 @@ for (var j = 0; j < message.destinations.length; ++j) object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; } + if (message.selectiveGapicGeneration != null && message.hasOwnProperty("selectiveGapicGeneration")) + object.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.toObject(message.selectiveGapicGeneration, options); return object; }; @@ -45170,6 +46258,7 @@ * @memberof google.api * @interface IPythonSettings * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common + * @property {google.api.PythonSettings.IExperimentalFeatures|null} [experimentalFeatures] PythonSettings experimentalFeatures */ /** @@ -45195,6 +46284,14 @@ */ PythonSettings.prototype.common = null; + /** + * PythonSettings experimentalFeatures. + * @member {google.api.PythonSettings.IExperimentalFeatures|null|undefined} experimentalFeatures + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.experimentalFeatures = null; + /** * Creates a new PythonSettings instance using the specified properties. * @function create @@ -45221,6 +46318,8 @@ writer = $Writer.create(); if (message.common != null && Object.hasOwnProperty.call(message, "common")) $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.experimentalFeatures != null && Object.hasOwnProperty.call(message, "experimentalFeatures")) + $root.google.api.PythonSettings.ExperimentalFeatures.encode(message.experimentalFeatures, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -45261,6 +46360,10 @@ message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); break; } + case 2: { + message.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -45301,6 +46404,11 @@ if (error) return "common." + error; } + if (message.experimentalFeatures != null && message.hasOwnProperty("experimentalFeatures")) { + var error = $root.google.api.PythonSettings.ExperimentalFeatures.verify(message.experimentalFeatures); + if (error) + return "experimentalFeatures." + error; + } return null; }; @@ -45321,6 +46429,11 @@ throw TypeError(".google.api.PythonSettings.common: object expected"); message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); } + if (object.experimentalFeatures != null) { + if (typeof object.experimentalFeatures !== "object") + throw TypeError(".google.api.PythonSettings.experimentalFeatures: object expected"); + message.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.fromObject(object.experimentalFeatures); + } return message; }; @@ -45337,10 +46450,14 @@ if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.common = null; + object.experimentalFeatures = null; + } if (message.common != null && message.hasOwnProperty("common")) object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + if (message.experimentalFeatures != null && message.hasOwnProperty("experimentalFeatures")) + object.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.toObject(message.experimentalFeatures, options); return object; }; @@ -45370,6 +46487,258 @@ return typeUrlPrefix + "/google.api.PythonSettings"; }; + PythonSettings.ExperimentalFeatures = (function() { + + /** + * Properties of an ExperimentalFeatures. + * @memberof google.api.PythonSettings + * @interface IExperimentalFeatures + * @property {boolean|null} [restAsyncIoEnabled] ExperimentalFeatures restAsyncIoEnabled + * @property {boolean|null} [protobufPythonicTypesEnabled] ExperimentalFeatures protobufPythonicTypesEnabled + * @property {boolean|null} [unversionedPackageDisabled] ExperimentalFeatures unversionedPackageDisabled + */ + + /** + * Constructs a new ExperimentalFeatures. + * @memberof google.api.PythonSettings + * @classdesc Represents an ExperimentalFeatures. + * @implements IExperimentalFeatures + * @constructor + * @param {google.api.PythonSettings.IExperimentalFeatures=} [properties] Properties to set + */ + function ExperimentalFeatures(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExperimentalFeatures restAsyncIoEnabled. + * @member {boolean} restAsyncIoEnabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.restAsyncIoEnabled = false; + + /** + * ExperimentalFeatures protobufPythonicTypesEnabled. + * @member {boolean} protobufPythonicTypesEnabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.protobufPythonicTypesEnabled = false; + + /** + * ExperimentalFeatures unversionedPackageDisabled. + * @member {boolean} unversionedPackageDisabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.unversionedPackageDisabled = false; + + /** + * Creates a new ExperimentalFeatures instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures=} [properties] Properties to set + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures instance + */ + ExperimentalFeatures.create = function create(properties) { + return new ExperimentalFeatures(properties); + }; + + /** + * Encodes the specified ExperimentalFeatures message. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures} message ExperimentalFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExperimentalFeatures.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.restAsyncIoEnabled != null && Object.hasOwnProperty.call(message, "restAsyncIoEnabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.restAsyncIoEnabled); + if (message.protobufPythonicTypesEnabled != null && Object.hasOwnProperty.call(message, "protobufPythonicTypesEnabled")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.protobufPythonicTypesEnabled); + if (message.unversionedPackageDisabled != null && Object.hasOwnProperty.call(message, "unversionedPackageDisabled")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.unversionedPackageDisabled); + return writer; + }; + + /** + * Encodes the specified ExperimentalFeatures message, length delimited. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures} message ExperimentalFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExperimentalFeatures.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExperimentalFeatures.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings.ExperimentalFeatures(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.restAsyncIoEnabled = reader.bool(); + break; + } + case 2: { + message.protobufPythonicTypesEnabled = reader.bool(); + break; + } + case 3: { + message.unversionedPackageDisabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExperimentalFeatures.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExperimentalFeatures message. + * @function verify + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExperimentalFeatures.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.restAsyncIoEnabled != null && message.hasOwnProperty("restAsyncIoEnabled")) + if (typeof message.restAsyncIoEnabled !== "boolean") + return "restAsyncIoEnabled: boolean expected"; + if (message.protobufPythonicTypesEnabled != null && message.hasOwnProperty("protobufPythonicTypesEnabled")) + if (typeof message.protobufPythonicTypesEnabled !== "boolean") + return "protobufPythonicTypesEnabled: boolean expected"; + if (message.unversionedPackageDisabled != null && message.hasOwnProperty("unversionedPackageDisabled")) + if (typeof message.unversionedPackageDisabled !== "boolean") + return "unversionedPackageDisabled: boolean expected"; + return null; + }; + + /** + * Creates an ExperimentalFeatures message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + */ + ExperimentalFeatures.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PythonSettings.ExperimentalFeatures) + return object; + var message = new $root.google.api.PythonSettings.ExperimentalFeatures(); + if (object.restAsyncIoEnabled != null) + message.restAsyncIoEnabled = Boolean(object.restAsyncIoEnabled); + if (object.protobufPythonicTypesEnabled != null) + message.protobufPythonicTypesEnabled = Boolean(object.protobufPythonicTypesEnabled); + if (object.unversionedPackageDisabled != null) + message.unversionedPackageDisabled = Boolean(object.unversionedPackageDisabled); + return message; + }; + + /** + * Creates a plain object from an ExperimentalFeatures message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.ExperimentalFeatures} message ExperimentalFeatures + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExperimentalFeatures.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.restAsyncIoEnabled = false; + object.protobufPythonicTypesEnabled = false; + object.unversionedPackageDisabled = false; + } + if (message.restAsyncIoEnabled != null && message.hasOwnProperty("restAsyncIoEnabled")) + object.restAsyncIoEnabled = message.restAsyncIoEnabled; + if (message.protobufPythonicTypesEnabled != null && message.hasOwnProperty("protobufPythonicTypesEnabled")) + object.protobufPythonicTypesEnabled = message.protobufPythonicTypesEnabled; + if (message.unversionedPackageDisabled != null && message.hasOwnProperty("unversionedPackageDisabled")) + object.unversionedPackageDisabled = message.unversionedPackageDisabled; + return object; + }; + + /** + * Converts this ExperimentalFeatures to JSON. + * @function toJSON + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + * @returns {Object.} JSON object + */ + ExperimentalFeatures.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExperimentalFeatures + * @function getTypeUrl + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExperimentalFeatures.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings.ExperimentalFeatures"; + }; + + return ExperimentalFeatures; + })(); + return PythonSettings; })(); @@ -46246,6 +47615,7 @@ * @memberof google.api * @interface IGoSettings * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common + * @property {Object.|null} [renamedServices] GoSettings renamedServices */ /** @@ -46257,6 +47627,7 @@ * @param {google.api.IGoSettings=} [properties] Properties to set */ function GoSettings(properties) { + this.renamedServices = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -46271,6 +47642,14 @@ */ GoSettings.prototype.common = null; + /** + * GoSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.renamedServices = $util.emptyObject; + /** * Creates a new GoSettings instance using the specified properties. * @function create @@ -46297,6 +47676,9 @@ writer = $Writer.create(); if (message.common != null && Object.hasOwnProperty.call(message, "common")) $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); return writer; }; @@ -46327,7 +47709,7 @@ GoSettings.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(), key, value; while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) @@ -46337,6 +47719,29 @@ message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); break; } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedServices[key] = value; + break; + } default: reader.skipType(tag & 7); break; @@ -46377,6 +47782,14 @@ if (error) return "common." + error; } + if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } return null; }; @@ -46397,6 +47810,13 @@ throw TypeError(".google.api.GoSettings.common: object expected"); message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); } + if (object.renamedServices) { + if (typeof object.renamedServices !== "object") + throw TypeError(".google.api.GoSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } return message; }; @@ -46413,10 +47833,18 @@ if (!options) options = {}; var object = {}; + if (options.objects || options.defaults) + object.renamedServices = {}; if (options.defaults) object.common = null; if (message.common != null && message.hasOwnProperty("common")) object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } return object; }; @@ -47055,6 +48483,251 @@ return values; })(); + api.SelectiveGapicGeneration = (function() { + + /** + * Properties of a SelectiveGapicGeneration. + * @memberof google.api + * @interface ISelectiveGapicGeneration + * @property {Array.|null} [methods] SelectiveGapicGeneration methods + * @property {boolean|null} [generateOmittedAsInternal] SelectiveGapicGeneration generateOmittedAsInternal + */ + + /** + * Constructs a new SelectiveGapicGeneration. + * @memberof google.api + * @classdesc Represents a SelectiveGapicGeneration. + * @implements ISelectiveGapicGeneration + * @constructor + * @param {google.api.ISelectiveGapicGeneration=} [properties] Properties to set + */ + function SelectiveGapicGeneration(properties) { + this.methods = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SelectiveGapicGeneration methods. + * @member {Array.} methods + * @memberof google.api.SelectiveGapicGeneration + * @instance + */ + SelectiveGapicGeneration.prototype.methods = $util.emptyArray; + + /** + * SelectiveGapicGeneration generateOmittedAsInternal. + * @member {boolean} generateOmittedAsInternal + * @memberof google.api.SelectiveGapicGeneration + * @instance + */ + SelectiveGapicGeneration.prototype.generateOmittedAsInternal = false; + + /** + * Creates a new SelectiveGapicGeneration instance using the specified properties. + * @function create + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration=} [properties] Properties to set + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration instance + */ + SelectiveGapicGeneration.create = function create(properties) { + return new SelectiveGapicGeneration(properties); + }; + + /** + * Encodes the specified SelectiveGapicGeneration message. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @function encode + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration} message SelectiveGapicGeneration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelectiveGapicGeneration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.methods != null && message.methods.length) + for (var i = 0; i < message.methods.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.methods[i]); + if (message.generateOmittedAsInternal != null && Object.hasOwnProperty.call(message, "generateOmittedAsInternal")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.generateOmittedAsInternal); + return writer; + }; + + /** + * Encodes the specified SelectiveGapicGeneration message, length delimited. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration} message SelectiveGapicGeneration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelectiveGapicGeneration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer. + * @function decode + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelectiveGapicGeneration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.SelectiveGapicGeneration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.methods && message.methods.length)) + message.methods = []; + message.methods.push(reader.string()); + break; + } + case 2: { + message.generateOmittedAsInternal = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelectiveGapicGeneration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SelectiveGapicGeneration message. + * @function verify + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SelectiveGapicGeneration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.methods != null && message.hasOwnProperty("methods")) { + if (!Array.isArray(message.methods)) + return "methods: array expected"; + for (var i = 0; i < message.methods.length; ++i) + if (!$util.isString(message.methods[i])) + return "methods: string[] expected"; + } + if (message.generateOmittedAsInternal != null && message.hasOwnProperty("generateOmittedAsInternal")) + if (typeof message.generateOmittedAsInternal !== "boolean") + return "generateOmittedAsInternal: boolean expected"; + return null; + }; + + /** + * Creates a SelectiveGapicGeneration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {Object.} object Plain object + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + */ + SelectiveGapicGeneration.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.SelectiveGapicGeneration) + return object; + var message = new $root.google.api.SelectiveGapicGeneration(); + if (object.methods) { + if (!Array.isArray(object.methods)) + throw TypeError(".google.api.SelectiveGapicGeneration.methods: array expected"); + message.methods = []; + for (var i = 0; i < object.methods.length; ++i) + message.methods[i] = String(object.methods[i]); + } + if (object.generateOmittedAsInternal != null) + message.generateOmittedAsInternal = Boolean(object.generateOmittedAsInternal); + return message; + }; + + /** + * Creates a plain object from a SelectiveGapicGeneration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.SelectiveGapicGeneration} message SelectiveGapicGeneration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SelectiveGapicGeneration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.methods = []; + if (options.defaults) + object.generateOmittedAsInternal = false; + if (message.methods && message.methods.length) { + object.methods = []; + for (var j = 0; j < message.methods.length; ++j) + object.methods[j] = message.methods[j]; + } + if (message.generateOmittedAsInternal != null && message.hasOwnProperty("generateOmittedAsInternal")) + object.generateOmittedAsInternal = message.generateOmittedAsInternal; + return object; + }; + + /** + * Converts this SelectiveGapicGeneration to JSON. + * @function toJSON + * @memberof google.api.SelectiveGapicGeneration + * @instance + * @returns {Object.} JSON object + */ + SelectiveGapicGeneration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SelectiveGapicGeneration + * @function getTypeUrl + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SelectiveGapicGeneration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.SelectiveGapicGeneration"; + }; + + return SelectiveGapicGeneration; + })(); + /** * LaunchStage enum. * @name google.api.LaunchStage diff --git a/packages/google-appengine/protos/protos.json b/packages/google-appengine/protos/protos.json index 9e829d9c99c..a4e74d4f1c3 100644 --- a/packages/google-appengine/protos/protos.json +++ b/packages/google-appengine/protos/protos.json @@ -33,12 +33,19 @@ "type": "FileDescriptorProto", "id": 1 } - } + }, + "extensions": [ + [ + 536000000, + 536000000 + ] + ] }, "Edition": { "edition": "proto2", "values": { "EDITION_UNKNOWN": 0, + "EDITION_LEGACY": 900, "EDITION_PROTO2": 998, "EDITION_PROTO3": 999, "EDITION_2023": 1000, @@ -77,6 +84,11 @@ "type": "int32", "id": 11 }, + "optionDependency": { + "rule": "repeated", + "type": "string", + "id": 15 + }, "messageType": { "rule": "repeated", "type": "DescriptorProto", @@ -165,6 +177,10 @@ "rule": "repeated", "type": "string", "id": 10 + }, + "visibility": { + "type": "SymbolVisibility", + "id": 11 } }, "nested": { @@ -390,6 +406,10 @@ "rule": "repeated", "type": "string", "id": 5 + }, + "visibility": { + "type": "SymbolVisibility", + "id": 6 } }, "nested": { @@ -604,6 +624,7 @@ 42, 42 ], + "php_generic_services", [ 38, 38 @@ -739,7 +760,8 @@ "type": "bool", "id": 10, "options": { - "default": false + "default": false, + "deprecated": true } }, "debugRedact": { @@ -767,6 +789,10 @@ "type": "FeatureSet", "id": 21 }, + "featureSupport": { + "type": "FeatureSupport", + "id": 22 + }, "uninterpretedOption": { "rule": "repeated", "type": "UninterpretedOption", @@ -836,6 +862,26 @@ "id": 2 } } + }, + "FeatureSupport": { + "fields": { + "editionIntroduced": { + "type": "Edition", + "id": 1 + }, + "editionDeprecated": { + "type": "Edition", + "id": 2 + }, + "deprecationWarning": { + "type": "string", + "id": 3 + }, + "editionRemoved": { + "type": "Edition", + "id": 4 + } + } } } }, @@ -924,6 +970,10 @@ "default": false } }, + "featureSupport": { + "type": "FieldOptions.FeatureSupport", + "id": 4 + }, "uninterpretedOption": { "rule": "repeated", "type": "UninterpretedOption", @@ -1066,6 +1116,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_2023", "edition_defaults.value": "EXPLICIT" } @@ -1076,6 +1127,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "OPEN" } @@ -1086,6 +1138,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "PACKED" } @@ -1096,6 +1149,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "VERIFY" } @@ -1106,7 +1160,8 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO2", + "feature_support.edition_introduced": "EDITION_2023", + "edition_defaults.edition": "EDITION_LEGACY", "edition_defaults.value": "LENGTH_PREFIXED" } }, @@ -1116,27 +1171,38 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "ALLOW" } + }, + "enforceNamingStyle": { + "type": "EnforceNamingStyle", + "id": 7, + "options": { + "retention": "RETENTION_SOURCE", + "targets": "TARGET_TYPE_METHOD", + "feature_support.edition_introduced": "EDITION_2024", + "edition_defaults.edition": "EDITION_2024", + "edition_defaults.value": "STYLE2024" + } + }, + "defaultSymbolVisibility": { + "type": "VisibilityFeature.DefaultSymbolVisibility", + "id": 8, + "options": { + "retention": "RETENTION_SOURCE", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2024", + "edition_defaults.edition": "EDITION_2024", + "edition_defaults.value": "EXPORT_TOP_LEVEL" + } } }, "extensions": [ [ 1000, - 1000 - ], - [ - 1001, - 1001 - ], - [ - 1002, - 1002 - ], - [ - 9990, - 9990 + 9994 ], [ 9995, @@ -1181,7 +1247,13 @@ "UTF8_VALIDATION_UNKNOWN": 0, "VERIFY": 2, "NONE": 3 - } + }, + "reserved": [ + [ + 1, + 1 + ] + ] }, "MessageEncoding": { "values": { @@ -1196,6 +1268,33 @@ "ALLOW": 1, "LEGACY_BEST_EFFORT": 2 } + }, + "EnforceNamingStyle": { + "values": { + "ENFORCE_NAMING_STYLE_UNKNOWN": 0, + "STYLE2024": 1, + "STYLE_LEGACY": 2 + } + }, + "VisibilityFeature": { + "fields": {}, + "reserved": [ + [ + 1, + 536870911 + ] + ], + "nested": { + "DefaultSymbolVisibility": { + "values": { + "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN": 0, + "EXPORT_ALL": 1, + "EXPORT_TOP_LEVEL": 2, + "LOCAL_ALL": 3, + "STRICT": 4 + } + } + } } } }, @@ -1223,11 +1322,26 @@ "type": "Edition", "id": 3 }, - "features": { + "overridableFeatures": { "type": "FeatureSet", - "id": 2 + "id": 4 + }, + "fixedFeatures": { + "type": "FeatureSet", + "id": 5 } - } + }, + "reserved": [ + [ + 1, + 1 + ], + [ + 2, + 2 + ], + "features" + ] } } }, @@ -1240,6 +1354,12 @@ "id": 1 } }, + "extensions": [ + [ + 536000000, + 536000000 + ] + ], "nested": { "Location": { "fields": { @@ -1325,6 +1445,14 @@ } } }, + "SymbolVisibility": { + "edition": "proto2", + "values": { + "VISIBILITY_UNSET": 0, + "VISIBILITY_LOCAL": 1, + "VISIBILITY_EXPORT": 2 + } + }, "Timestamp": { "fields": { "seconds": { @@ -4110,8 +4238,7 @@ "java_multiple_files": true, "java_outer_classname": "ResourceProto", "java_package": "com.google.api", - "objc_class_prefix": "GAPI", - "cc_enable_arenas": true + "objc_class_prefix": "GAPI" }, "nested": { "http": { @@ -4235,6 +4362,10 @@ "rule": "repeated", "type": "ClientLibraryDestination", "id": 2 + }, + "selectiveGapicGeneration": { + "type": "SelectiveGapicGeneration", + "id": 3 } } }, @@ -4375,6 +4506,28 @@ "common": { "type": "CommonLanguageSettings", "id": 1 + }, + "experimentalFeatures": { + "type": "ExperimentalFeatures", + "id": 2 + } + }, + "nested": { + "ExperimentalFeatures": { + "fields": { + "restAsyncIoEnabled": { + "type": "bool", + "id": 1 + }, + "protobufPythonicTypesEnabled": { + "type": "bool", + "id": 2 + }, + "unversionedPackageDisabled": { + "type": "bool", + "id": 3 + } + } } } }, @@ -4432,6 +4585,11 @@ "common": { "type": "CommonLanguageSettings", "id": 1 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 } } }, @@ -4493,6 +4651,19 @@ "PACKAGE_MANAGER": 20 } }, + "SelectiveGapicGeneration": { + "fields": { + "methods": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "generateOmittedAsInternal": { + "type": "bool", + "id": 2 + } + } + }, "LaunchStage": { "values": { "LAUNCH_STAGE_UNSPECIFIED": 0, @@ -4614,6 +4785,7 @@ "java_multiple_files": true, "java_outer_classname": "OperationsProto", "java_package": "com.google.longrunning", + "objc_class_prefix": "GLRUN", "php_namespace": "Google\\LongRunning" }, "nested": { diff --git a/packages/google-apps-events-subscriptions/protos/protos.d.ts b/packages/google-apps-events-subscriptions/protos/protos.d.ts index 007e6a90233..ec32613b2f0 100644 --- a/packages/google-apps-events-subscriptions/protos/protos.d.ts +++ b/packages/google-apps-events-subscriptions/protos/protos.d.ts @@ -4093,6 +4093,9 @@ export namespace google { /** CommonLanguageSettings destinations */ destinations?: (google.api.ClientLibraryDestination[]|null); + + /** CommonLanguageSettings selectiveGapicGeneration */ + selectiveGapicGeneration?: (google.api.ISelectiveGapicGeneration|null); } /** Represents a CommonLanguageSettings. */ @@ -4110,6 +4113,9 @@ export namespace google { /** CommonLanguageSettings destinations. */ public destinations: google.api.ClientLibraryDestination[]; + /** CommonLanguageSettings selectiveGapicGeneration. */ + public selectiveGapicGeneration?: (google.api.ISelectiveGapicGeneration|null); + /** * Creates a new CommonLanguageSettings instance using the specified properties. * @param [properties] Properties to set @@ -4810,6 +4816,9 @@ export namespace google { /** PythonSettings common */ common?: (google.api.ICommonLanguageSettings|null); + + /** PythonSettings experimentalFeatures */ + experimentalFeatures?: (google.api.PythonSettings.IExperimentalFeatures|null); } /** Represents a PythonSettings. */ @@ -4824,6 +4833,9 @@ export namespace google { /** PythonSettings common. */ public common?: (google.api.ICommonLanguageSettings|null); + /** PythonSettings experimentalFeatures. */ + public experimentalFeatures?: (google.api.PythonSettings.IExperimentalFeatures|null); + /** * Creates a new PythonSettings instance using the specified properties. * @param [properties] Properties to set @@ -4902,6 +4914,118 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + namespace PythonSettings { + + /** Properties of an ExperimentalFeatures. */ + interface IExperimentalFeatures { + + /** ExperimentalFeatures restAsyncIoEnabled */ + restAsyncIoEnabled?: (boolean|null); + + /** ExperimentalFeatures protobufPythonicTypesEnabled */ + protobufPythonicTypesEnabled?: (boolean|null); + + /** ExperimentalFeatures unversionedPackageDisabled */ + unversionedPackageDisabled?: (boolean|null); + } + + /** Represents an ExperimentalFeatures. */ + class ExperimentalFeatures implements IExperimentalFeatures { + + /** + * Constructs a new ExperimentalFeatures. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.PythonSettings.IExperimentalFeatures); + + /** ExperimentalFeatures restAsyncIoEnabled. */ + public restAsyncIoEnabled: boolean; + + /** ExperimentalFeatures protobufPythonicTypesEnabled. */ + public protobufPythonicTypesEnabled: boolean; + + /** ExperimentalFeatures unversionedPackageDisabled. */ + public unversionedPackageDisabled: boolean; + + /** + * Creates a new ExperimentalFeatures instance using the specified properties. + * @param [properties] Properties to set + * @returns ExperimentalFeatures instance + */ + public static create(properties?: google.api.PythonSettings.IExperimentalFeatures): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Encodes the specified ExperimentalFeatures message. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @param message ExperimentalFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.PythonSettings.IExperimentalFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExperimentalFeatures message, length delimited. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @param message ExperimentalFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.PythonSettings.IExperimentalFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Verifies an ExperimentalFeatures message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExperimentalFeatures message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExperimentalFeatures + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Creates a plain object from an ExperimentalFeatures message. Also converts values to other types if specified. + * @param message ExperimentalFeatures + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings.ExperimentalFeatures, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExperimentalFeatures to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExperimentalFeatures + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + /** Properties of a NodeSettings. */ interface INodeSettings { @@ -5228,6 +5352,9 @@ export namespace google { /** GoSettings common */ common?: (google.api.ICommonLanguageSettings|null); + + /** GoSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|null); } /** Represents a GoSettings. */ @@ -5242,6 +5369,9 @@ export namespace google { /** GoSettings common. */ public common?: (google.api.ICommonLanguageSettings|null); + /** GoSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + /** * Creates a new GoSettings instance using the specified properties. * @param [properties] Properties to set @@ -5566,6 +5696,109 @@ export namespace google { PACKAGE_MANAGER = 20 } + /** Properties of a SelectiveGapicGeneration. */ + interface ISelectiveGapicGeneration { + + /** SelectiveGapicGeneration methods */ + methods?: (string[]|null); + + /** SelectiveGapicGeneration generateOmittedAsInternal */ + generateOmittedAsInternal?: (boolean|null); + } + + /** Represents a SelectiveGapicGeneration. */ + class SelectiveGapicGeneration implements ISelectiveGapicGeneration { + + /** + * Constructs a new SelectiveGapicGeneration. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ISelectiveGapicGeneration); + + /** SelectiveGapicGeneration methods. */ + public methods: string[]; + + /** SelectiveGapicGeneration generateOmittedAsInternal. */ + public generateOmittedAsInternal: boolean; + + /** + * Creates a new SelectiveGapicGeneration instance using the specified properties. + * @param [properties] Properties to set + * @returns SelectiveGapicGeneration instance + */ + public static create(properties?: google.api.ISelectiveGapicGeneration): google.api.SelectiveGapicGeneration; + + /** + * Encodes the specified SelectiveGapicGeneration message. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @param message SelectiveGapicGeneration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ISelectiveGapicGeneration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SelectiveGapicGeneration message, length delimited. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @param message SelectiveGapicGeneration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ISelectiveGapicGeneration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.SelectiveGapicGeneration; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.SelectiveGapicGeneration; + + /** + * Verifies a SelectiveGapicGeneration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SelectiveGapicGeneration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SelectiveGapicGeneration + */ + public static fromObject(object: { [k: string]: any }): google.api.SelectiveGapicGeneration; + + /** + * Creates a plain object from a SelectiveGapicGeneration message. Also converts values to other types if specified. + * @param message SelectiveGapicGeneration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.SelectiveGapicGeneration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SelectiveGapicGeneration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SelectiveGapicGeneration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** LaunchStage enum. */ enum LaunchStage { LAUNCH_STAGE_UNSPECIFIED = 0, @@ -5583,6 +5816,9 @@ export namespace google { /** FieldInfo format */ format?: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format|null); + + /** FieldInfo referencedTypes */ + referencedTypes?: (google.api.ITypeReference[]|null); } /** Represents a FieldInfo. */ @@ -5597,6 +5833,9 @@ export namespace google { /** FieldInfo format. */ public format: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format); + /** FieldInfo referencedTypes. */ + public referencedTypes: google.api.ITypeReference[]; + /** * Creates a new FieldInfo instance using the specified properties. * @param [properties] Properties to set @@ -5686,6 +5925,103 @@ export namespace google { IPV4_OR_IPV6 = 4 } } + + /** Properties of a TypeReference. */ + interface ITypeReference { + + /** TypeReference typeName */ + typeName?: (string|null); + } + + /** Represents a TypeReference. */ + class TypeReference implements ITypeReference { + + /** + * Constructs a new TypeReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ITypeReference); + + /** TypeReference typeName. */ + public typeName: string; + + /** + * Creates a new TypeReference instance using the specified properties. + * @param [properties] Properties to set + * @returns TypeReference instance + */ + public static create(properties?: google.api.ITypeReference): google.api.TypeReference; + + /** + * Encodes the specified TypeReference message. Does not implicitly {@link google.api.TypeReference.verify|verify} messages. + * @param message TypeReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ITypeReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TypeReference message, length delimited. Does not implicitly {@link google.api.TypeReference.verify|verify} messages. + * @param message TypeReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ITypeReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TypeReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TypeReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.TypeReference; + + /** + * Decodes a TypeReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TypeReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.TypeReference; + + /** + * Verifies a TypeReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TypeReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TypeReference + */ + public static fromObject(object: { [k: string]: any }): google.api.TypeReference; + + /** + * Creates a plain object from a TypeReference message. Also converts values to other types if specified. + * @param message TypeReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.TypeReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TypeReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TypeReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } /** Namespace protobuf. */ @@ -5791,6 +6127,7 @@ export namespace google { /** Edition enum. */ enum Edition { EDITION_UNKNOWN = 0, + EDITION_LEGACY = 900, EDITION_PROTO2 = 998, EDITION_PROTO3 = 999, EDITION_2023 = 1000, @@ -5821,6 +6158,9 @@ export namespace google { /** FileDescriptorProto weakDependency */ weakDependency?: (number[]|null); + /** FileDescriptorProto optionDependency */ + optionDependency?: (string[]|null); + /** FileDescriptorProto messageType */ messageType?: (google.protobuf.IDescriptorProto[]|null); @@ -5870,6 +6210,9 @@ export namespace google { /** FileDescriptorProto weakDependency. */ public weakDependency: number[]; + /** FileDescriptorProto optionDependency. */ + public optionDependency: string[]; + /** FileDescriptorProto messageType. */ public messageType: google.protobuf.IDescriptorProto[]; @@ -6004,6 +6347,9 @@ export namespace google { /** DescriptorProto reservedName */ reservedName?: (string[]|null); + + /** DescriptorProto visibility */ + visibility?: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility|null); } /** Represents a DescriptorProto. */ @@ -6045,6 +6391,9 @@ export namespace google { /** DescriptorProto reservedName. */ public reservedName: string[]; + /** DescriptorProto visibility. */ + public visibility: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility); + /** * Creates a new DescriptorProto instance using the specified properties. * @param [properties] Properties to set @@ -6892,6 +7241,9 @@ export namespace google { /** EnumDescriptorProto reservedName */ reservedName?: (string[]|null); + + /** EnumDescriptorProto visibility */ + visibility?: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility|null); } /** Represents an EnumDescriptorProto. */ @@ -6918,6 +7270,9 @@ export namespace google { /** EnumDescriptorProto reservedName. */ public reservedName: string[]; + /** EnumDescriptorProto visibility. */ + public visibility: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility); + /** * Creates a new EnumDescriptorProto instance using the specified properties. * @param [properties] Properties to set @@ -7852,6 +8207,9 @@ export namespace google { /** FieldOptions features */ features?: (google.protobuf.IFeatureSet|null); + /** FieldOptions featureSupport */ + featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** FieldOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); @@ -7910,6 +8268,9 @@ export namespace google { /** FieldOptions features. */ public features?: (google.protobuf.IFeatureSet|null); + /** FieldOptions featureSupport. */ + public featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** FieldOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; @@ -8130,6 +8491,121 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** Properties of a FeatureSupport. */ + interface IFeatureSupport { + + /** FeatureSupport editionIntroduced */ + editionIntroduced?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSupport editionDeprecated */ + editionDeprecated?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSupport deprecationWarning */ + deprecationWarning?: (string|null); + + /** FeatureSupport editionRemoved */ + editionRemoved?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSupport. */ + class FeatureSupport implements IFeatureSupport { + + /** + * Constructs a new FeatureSupport. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IFeatureSupport); + + /** FeatureSupport editionIntroduced. */ + public editionIntroduced: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSupport editionDeprecated. */ + public editionDeprecated: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSupport deprecationWarning. */ + public deprecationWarning: string; + + /** FeatureSupport editionRemoved. */ + public editionRemoved: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSupport instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSupport instance + */ + public static create(properties?: google.protobuf.FieldOptions.IFeatureSupport): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Encodes the specified FeatureSupport message. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @param message FeatureSupport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IFeatureSupport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSupport message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @param message FeatureSupport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IFeatureSupport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Verifies a FeatureSupport message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSupport message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSupport + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Creates a plain object from a FeatureSupport message. Also converts values to other types if specified. + * @param message FeatureSupport + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.FeatureSupport, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSupport to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSupport + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } /** Properties of an OneofOptions. */ @@ -8368,6 +8844,9 @@ export namespace google { /** EnumValueOptions debugRedact */ debugRedact?: (boolean|null); + /** EnumValueOptions featureSupport */ + featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** EnumValueOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); } @@ -8390,6 +8869,9 @@ export namespace google { /** EnumValueOptions debugRedact. */ public debugRedact: boolean; + /** EnumValueOptions featureSupport. */ + public featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** EnumValueOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; @@ -8982,6 +9464,12 @@ export namespace google { /** FeatureSet jsonFormat */ jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); + + /** FeatureSet enforceNamingStyle */ + enforceNamingStyle?: (google.protobuf.FeatureSet.EnforceNamingStyle|keyof typeof google.protobuf.FeatureSet.EnforceNamingStyle|null); + + /** FeatureSet defaultSymbolVisibility */ + defaultSymbolVisibility?: (google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|keyof typeof google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|null); } /** Represents a FeatureSet. */ @@ -9011,6 +9499,12 @@ export namespace google { /** FeatureSet jsonFormat. */ public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); + /** FeatureSet enforceNamingStyle. */ + public enforceNamingStyle: (google.protobuf.FeatureSet.EnforceNamingStyle|keyof typeof google.protobuf.FeatureSet.EnforceNamingStyle); + + /** FeatureSet defaultSymbolVisibility. */ + public defaultSymbolVisibility: (google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|keyof typeof google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility); + /** * Creates a new FeatureSet instance using the specified properties. * @param [properties] Properties to set @@ -9133,6 +9627,116 @@ export namespace google { ALLOW = 1, LEGACY_BEST_EFFORT = 2 } + + /** EnforceNamingStyle enum. */ + enum EnforceNamingStyle { + ENFORCE_NAMING_STYLE_UNKNOWN = 0, + STYLE2024 = 1, + STYLE_LEGACY = 2 + } + + /** Properties of a VisibilityFeature. */ + interface IVisibilityFeature { + } + + /** Represents a VisibilityFeature. */ + class VisibilityFeature implements IVisibilityFeature { + + /** + * Constructs a new VisibilityFeature. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSet.IVisibilityFeature); + + /** + * Creates a new VisibilityFeature instance using the specified properties. + * @param [properties] Properties to set + * @returns VisibilityFeature instance + */ + public static create(properties?: google.protobuf.FeatureSet.IVisibilityFeature): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Encodes the specified VisibilityFeature message. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @param message VisibilityFeature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSet.IVisibilityFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VisibilityFeature message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @param message VisibilityFeature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSet.IVisibilityFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Verifies a VisibilityFeature message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VisibilityFeature message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VisibilityFeature + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Creates a plain object from a VisibilityFeature message. Also converts values to other types if specified. + * @param message VisibilityFeature + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet.VisibilityFeature, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VisibilityFeature to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VisibilityFeature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace VisibilityFeature { + + /** DefaultSymbolVisibility enum. */ + enum DefaultSymbolVisibility { + DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0, + EXPORT_ALL = 1, + EXPORT_TOP_LEVEL = 2, + LOCAL_ALL = 3, + STRICT = 4 + } + } } /** Properties of a FeatureSetDefaults. */ @@ -9252,8 +9856,11 @@ export namespace google { /** FeatureSetEditionDefault edition */ edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - /** FeatureSetEditionDefault features */ - features?: (google.protobuf.IFeatureSet|null); + /** FeatureSetEditionDefault overridableFeatures */ + overridableFeatures?: (google.protobuf.IFeatureSet|null); + + /** FeatureSetEditionDefault fixedFeatures */ + fixedFeatures?: (google.protobuf.IFeatureSet|null); } /** Represents a FeatureSetEditionDefault. */ @@ -9268,8 +9875,11 @@ export namespace google { /** FeatureSetEditionDefault edition. */ public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - /** FeatureSetEditionDefault features. */ - public features?: (google.protobuf.IFeatureSet|null); + /** FeatureSetEditionDefault overridableFeatures. */ + public overridableFeatures?: (google.protobuf.IFeatureSet|null); + + /** FeatureSetEditionDefault fixedFeatures. */ + public fixedFeatures?: (google.protobuf.IFeatureSet|null); /** * Creates a new FeatureSetEditionDefault instance using the specified properties. @@ -9802,6 +10412,13 @@ export namespace google { } } + /** SymbolVisibility enum. */ + enum SymbolVisibility { + VISIBILITY_UNSET = 0, + VISIBILITY_LOCAL = 1, + VISIBILITY_EXPORT = 2 + } + /** Properties of a Duration. */ interface IDuration { diff --git a/packages/google-apps-events-subscriptions/protos/protos.js b/packages/google-apps-events-subscriptions/protos/protos.js index 07179b27fdc..546236cc3d2 100644 --- a/packages/google-apps-events-subscriptions/protos/protos.js +++ b/packages/google-apps-events-subscriptions/protos/protos.js @@ -9660,6 +9660,7 @@ * @interface ICommonLanguageSettings * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri * @property {Array.|null} [destinations] CommonLanguageSettings destinations + * @property {google.api.ISelectiveGapicGeneration|null} [selectiveGapicGeneration] CommonLanguageSettings selectiveGapicGeneration */ /** @@ -9694,6 +9695,14 @@ */ CommonLanguageSettings.prototype.destinations = $util.emptyArray; + /** + * CommonLanguageSettings selectiveGapicGeneration. + * @member {google.api.ISelectiveGapicGeneration|null|undefined} selectiveGapicGeneration + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.selectiveGapicGeneration = null; + /** * Creates a new CommonLanguageSettings instance using the specified properties. * @function create @@ -9726,6 +9735,8 @@ writer.int32(message.destinations[i]); writer.ldelim(); } + if (message.selectiveGapicGeneration != null && Object.hasOwnProperty.call(message, "selectiveGapicGeneration")) + $root.google.api.SelectiveGapicGeneration.encode(message.selectiveGapicGeneration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -9777,6 +9788,10 @@ message.destinations.push(reader.int32()); break; } + case 3: { + message.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -9828,6 +9843,11 @@ break; } } + if (message.selectiveGapicGeneration != null && message.hasOwnProperty("selectiveGapicGeneration")) { + var error = $root.google.api.SelectiveGapicGeneration.verify(message.selectiveGapicGeneration); + if (error) + return "selectiveGapicGeneration." + error; + } return null; }; @@ -9870,6 +9890,11 @@ break; } } + if (object.selectiveGapicGeneration != null) { + if (typeof object.selectiveGapicGeneration !== "object") + throw TypeError(".google.api.CommonLanguageSettings.selectiveGapicGeneration: object expected"); + message.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.fromObject(object.selectiveGapicGeneration); + } return message; }; @@ -9888,8 +9913,10 @@ var object = {}; if (options.arrays || options.defaults) object.destinations = []; - if (options.defaults) + if (options.defaults) { object.referenceDocsUri = ""; + object.selectiveGapicGeneration = null; + } if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) object.referenceDocsUri = message.referenceDocsUri; if (message.destinations && message.destinations.length) { @@ -9897,6 +9924,8 @@ for (var j = 0; j < message.destinations.length; ++j) object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; } + if (message.selectiveGapicGeneration != null && message.hasOwnProperty("selectiveGapicGeneration")) + object.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.toObject(message.selectiveGapicGeneration, options); return object; }; @@ -11719,6 +11748,7 @@ * @memberof google.api * @interface IPythonSettings * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common + * @property {google.api.PythonSettings.IExperimentalFeatures|null} [experimentalFeatures] PythonSettings experimentalFeatures */ /** @@ -11744,6 +11774,14 @@ */ PythonSettings.prototype.common = null; + /** + * PythonSettings experimentalFeatures. + * @member {google.api.PythonSettings.IExperimentalFeatures|null|undefined} experimentalFeatures + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.experimentalFeatures = null; + /** * Creates a new PythonSettings instance using the specified properties. * @function create @@ -11770,6 +11808,8 @@ writer = $Writer.create(); if (message.common != null && Object.hasOwnProperty.call(message, "common")) $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.experimentalFeatures != null && Object.hasOwnProperty.call(message, "experimentalFeatures")) + $root.google.api.PythonSettings.ExperimentalFeatures.encode(message.experimentalFeatures, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -11810,6 +11850,10 @@ message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); break; } + case 2: { + message.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -11850,6 +11894,11 @@ if (error) return "common." + error; } + if (message.experimentalFeatures != null && message.hasOwnProperty("experimentalFeatures")) { + var error = $root.google.api.PythonSettings.ExperimentalFeatures.verify(message.experimentalFeatures); + if (error) + return "experimentalFeatures." + error; + } return null; }; @@ -11870,6 +11919,11 @@ throw TypeError(".google.api.PythonSettings.common: object expected"); message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); } + if (object.experimentalFeatures != null) { + if (typeof object.experimentalFeatures !== "object") + throw TypeError(".google.api.PythonSettings.experimentalFeatures: object expected"); + message.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.fromObject(object.experimentalFeatures); + } return message; }; @@ -11886,10 +11940,14 @@ if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.common = null; + object.experimentalFeatures = null; + } if (message.common != null && message.hasOwnProperty("common")) object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + if (message.experimentalFeatures != null && message.hasOwnProperty("experimentalFeatures")) + object.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.toObject(message.experimentalFeatures, options); return object; }; @@ -11919,6 +11977,258 @@ return typeUrlPrefix + "/google.api.PythonSettings"; }; + PythonSettings.ExperimentalFeatures = (function() { + + /** + * Properties of an ExperimentalFeatures. + * @memberof google.api.PythonSettings + * @interface IExperimentalFeatures + * @property {boolean|null} [restAsyncIoEnabled] ExperimentalFeatures restAsyncIoEnabled + * @property {boolean|null} [protobufPythonicTypesEnabled] ExperimentalFeatures protobufPythonicTypesEnabled + * @property {boolean|null} [unversionedPackageDisabled] ExperimentalFeatures unversionedPackageDisabled + */ + + /** + * Constructs a new ExperimentalFeatures. + * @memberof google.api.PythonSettings + * @classdesc Represents an ExperimentalFeatures. + * @implements IExperimentalFeatures + * @constructor + * @param {google.api.PythonSettings.IExperimentalFeatures=} [properties] Properties to set + */ + function ExperimentalFeatures(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExperimentalFeatures restAsyncIoEnabled. + * @member {boolean} restAsyncIoEnabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.restAsyncIoEnabled = false; + + /** + * ExperimentalFeatures protobufPythonicTypesEnabled. + * @member {boolean} protobufPythonicTypesEnabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.protobufPythonicTypesEnabled = false; + + /** + * ExperimentalFeatures unversionedPackageDisabled. + * @member {boolean} unversionedPackageDisabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.unversionedPackageDisabled = false; + + /** + * Creates a new ExperimentalFeatures instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures=} [properties] Properties to set + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures instance + */ + ExperimentalFeatures.create = function create(properties) { + return new ExperimentalFeatures(properties); + }; + + /** + * Encodes the specified ExperimentalFeatures message. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures} message ExperimentalFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExperimentalFeatures.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.restAsyncIoEnabled != null && Object.hasOwnProperty.call(message, "restAsyncIoEnabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.restAsyncIoEnabled); + if (message.protobufPythonicTypesEnabled != null && Object.hasOwnProperty.call(message, "protobufPythonicTypesEnabled")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.protobufPythonicTypesEnabled); + if (message.unversionedPackageDisabled != null && Object.hasOwnProperty.call(message, "unversionedPackageDisabled")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.unversionedPackageDisabled); + return writer; + }; + + /** + * Encodes the specified ExperimentalFeatures message, length delimited. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures} message ExperimentalFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExperimentalFeatures.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExperimentalFeatures.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings.ExperimentalFeatures(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.restAsyncIoEnabled = reader.bool(); + break; + } + case 2: { + message.protobufPythonicTypesEnabled = reader.bool(); + break; + } + case 3: { + message.unversionedPackageDisabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExperimentalFeatures.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExperimentalFeatures message. + * @function verify + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExperimentalFeatures.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.restAsyncIoEnabled != null && message.hasOwnProperty("restAsyncIoEnabled")) + if (typeof message.restAsyncIoEnabled !== "boolean") + return "restAsyncIoEnabled: boolean expected"; + if (message.protobufPythonicTypesEnabled != null && message.hasOwnProperty("protobufPythonicTypesEnabled")) + if (typeof message.protobufPythonicTypesEnabled !== "boolean") + return "protobufPythonicTypesEnabled: boolean expected"; + if (message.unversionedPackageDisabled != null && message.hasOwnProperty("unversionedPackageDisabled")) + if (typeof message.unversionedPackageDisabled !== "boolean") + return "unversionedPackageDisabled: boolean expected"; + return null; + }; + + /** + * Creates an ExperimentalFeatures message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + */ + ExperimentalFeatures.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PythonSettings.ExperimentalFeatures) + return object; + var message = new $root.google.api.PythonSettings.ExperimentalFeatures(); + if (object.restAsyncIoEnabled != null) + message.restAsyncIoEnabled = Boolean(object.restAsyncIoEnabled); + if (object.protobufPythonicTypesEnabled != null) + message.protobufPythonicTypesEnabled = Boolean(object.protobufPythonicTypesEnabled); + if (object.unversionedPackageDisabled != null) + message.unversionedPackageDisabled = Boolean(object.unversionedPackageDisabled); + return message; + }; + + /** + * Creates a plain object from an ExperimentalFeatures message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.ExperimentalFeatures} message ExperimentalFeatures + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExperimentalFeatures.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.restAsyncIoEnabled = false; + object.protobufPythonicTypesEnabled = false; + object.unversionedPackageDisabled = false; + } + if (message.restAsyncIoEnabled != null && message.hasOwnProperty("restAsyncIoEnabled")) + object.restAsyncIoEnabled = message.restAsyncIoEnabled; + if (message.protobufPythonicTypesEnabled != null && message.hasOwnProperty("protobufPythonicTypesEnabled")) + object.protobufPythonicTypesEnabled = message.protobufPythonicTypesEnabled; + if (message.unversionedPackageDisabled != null && message.hasOwnProperty("unversionedPackageDisabled")) + object.unversionedPackageDisabled = message.unversionedPackageDisabled; + return object; + }; + + /** + * Converts this ExperimentalFeatures to JSON. + * @function toJSON + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + * @returns {Object.} JSON object + */ + ExperimentalFeatures.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExperimentalFeatures + * @function getTypeUrl + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExperimentalFeatures.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings.ExperimentalFeatures"; + }; + + return ExperimentalFeatures; + })(); + return PythonSettings; })(); @@ -12795,6 +13105,7 @@ * @memberof google.api * @interface IGoSettings * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common + * @property {Object.|null} [renamedServices] GoSettings renamedServices */ /** @@ -12806,6 +13117,7 @@ * @param {google.api.IGoSettings=} [properties] Properties to set */ function GoSettings(properties) { + this.renamedServices = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12820,6 +13132,14 @@ */ GoSettings.prototype.common = null; + /** + * GoSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.renamedServices = $util.emptyObject; + /** * Creates a new GoSettings instance using the specified properties. * @function create @@ -12846,6 +13166,9 @@ writer = $Writer.create(); if (message.common != null && Object.hasOwnProperty.call(message, "common")) $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); return writer; }; @@ -12876,7 +13199,7 @@ GoSettings.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(), key, value; while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) @@ -12886,6 +13209,29 @@ message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); break; } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedServices[key] = value; + break; + } default: reader.skipType(tag & 7); break; @@ -12926,6 +13272,14 @@ if (error) return "common." + error; } + if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } return null; }; @@ -12946,6 +13300,13 @@ throw TypeError(".google.api.GoSettings.common: object expected"); message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); } + if (object.renamedServices) { + if (typeof object.renamedServices !== "object") + throw TypeError(".google.api.GoSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } return message; }; @@ -12962,10 +13323,18 @@ if (!options) options = {}; var object = {}; + if (options.objects || options.defaults) + object.renamedServices = {}; if (options.defaults) object.common = null; if (message.common != null && message.hasOwnProperty("common")) object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } return object; }; @@ -13604,29 +13973,274 @@ return values; })(); - /** - * LaunchStage enum. - * @name google.api.LaunchStage - * @enum {number} - * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value - * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value - * @property {number} PRELAUNCH=7 PRELAUNCH value - * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value - * @property {number} ALPHA=2 ALPHA value - * @property {number} BETA=3 BETA value - * @property {number} GA=4 GA value - * @property {number} DEPRECATED=5 DEPRECATED value - */ - api.LaunchStage = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; - values[valuesById[6] = "UNIMPLEMENTED"] = 6; - values[valuesById[7] = "PRELAUNCH"] = 7; - values[valuesById[1] = "EARLY_ACCESS"] = 1; - values[valuesById[2] = "ALPHA"] = 2; - values[valuesById[3] = "BETA"] = 3; - values[valuesById[4] = "GA"] = 4; - values[valuesById[5] = "DEPRECATED"] = 5; + api.SelectiveGapicGeneration = (function() { + + /** + * Properties of a SelectiveGapicGeneration. + * @memberof google.api + * @interface ISelectiveGapicGeneration + * @property {Array.|null} [methods] SelectiveGapicGeneration methods + * @property {boolean|null} [generateOmittedAsInternal] SelectiveGapicGeneration generateOmittedAsInternal + */ + + /** + * Constructs a new SelectiveGapicGeneration. + * @memberof google.api + * @classdesc Represents a SelectiveGapicGeneration. + * @implements ISelectiveGapicGeneration + * @constructor + * @param {google.api.ISelectiveGapicGeneration=} [properties] Properties to set + */ + function SelectiveGapicGeneration(properties) { + this.methods = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SelectiveGapicGeneration methods. + * @member {Array.} methods + * @memberof google.api.SelectiveGapicGeneration + * @instance + */ + SelectiveGapicGeneration.prototype.methods = $util.emptyArray; + + /** + * SelectiveGapicGeneration generateOmittedAsInternal. + * @member {boolean} generateOmittedAsInternal + * @memberof google.api.SelectiveGapicGeneration + * @instance + */ + SelectiveGapicGeneration.prototype.generateOmittedAsInternal = false; + + /** + * Creates a new SelectiveGapicGeneration instance using the specified properties. + * @function create + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration=} [properties] Properties to set + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration instance + */ + SelectiveGapicGeneration.create = function create(properties) { + return new SelectiveGapicGeneration(properties); + }; + + /** + * Encodes the specified SelectiveGapicGeneration message. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @function encode + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration} message SelectiveGapicGeneration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelectiveGapicGeneration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.methods != null && message.methods.length) + for (var i = 0; i < message.methods.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.methods[i]); + if (message.generateOmittedAsInternal != null && Object.hasOwnProperty.call(message, "generateOmittedAsInternal")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.generateOmittedAsInternal); + return writer; + }; + + /** + * Encodes the specified SelectiveGapicGeneration message, length delimited. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration} message SelectiveGapicGeneration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelectiveGapicGeneration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer. + * @function decode + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelectiveGapicGeneration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.SelectiveGapicGeneration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.methods && message.methods.length)) + message.methods = []; + message.methods.push(reader.string()); + break; + } + case 2: { + message.generateOmittedAsInternal = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelectiveGapicGeneration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SelectiveGapicGeneration message. + * @function verify + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SelectiveGapicGeneration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.methods != null && message.hasOwnProperty("methods")) { + if (!Array.isArray(message.methods)) + return "methods: array expected"; + for (var i = 0; i < message.methods.length; ++i) + if (!$util.isString(message.methods[i])) + return "methods: string[] expected"; + } + if (message.generateOmittedAsInternal != null && message.hasOwnProperty("generateOmittedAsInternal")) + if (typeof message.generateOmittedAsInternal !== "boolean") + return "generateOmittedAsInternal: boolean expected"; + return null; + }; + + /** + * Creates a SelectiveGapicGeneration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {Object.} object Plain object + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + */ + SelectiveGapicGeneration.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.SelectiveGapicGeneration) + return object; + var message = new $root.google.api.SelectiveGapicGeneration(); + if (object.methods) { + if (!Array.isArray(object.methods)) + throw TypeError(".google.api.SelectiveGapicGeneration.methods: array expected"); + message.methods = []; + for (var i = 0; i < object.methods.length; ++i) + message.methods[i] = String(object.methods[i]); + } + if (object.generateOmittedAsInternal != null) + message.generateOmittedAsInternal = Boolean(object.generateOmittedAsInternal); + return message; + }; + + /** + * Creates a plain object from a SelectiveGapicGeneration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.SelectiveGapicGeneration} message SelectiveGapicGeneration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SelectiveGapicGeneration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.methods = []; + if (options.defaults) + object.generateOmittedAsInternal = false; + if (message.methods && message.methods.length) { + object.methods = []; + for (var j = 0; j < message.methods.length; ++j) + object.methods[j] = message.methods[j]; + } + if (message.generateOmittedAsInternal != null && message.hasOwnProperty("generateOmittedAsInternal")) + object.generateOmittedAsInternal = message.generateOmittedAsInternal; + return object; + }; + + /** + * Converts this SelectiveGapicGeneration to JSON. + * @function toJSON + * @memberof google.api.SelectiveGapicGeneration + * @instance + * @returns {Object.} JSON object + */ + SelectiveGapicGeneration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SelectiveGapicGeneration + * @function getTypeUrl + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SelectiveGapicGeneration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.SelectiveGapicGeneration"; + }; + + return SelectiveGapicGeneration; + })(); + + /** + * LaunchStage enum. + * @name google.api.LaunchStage + * @enum {number} + * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value + * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value + * @property {number} PRELAUNCH=7 PRELAUNCH value + * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value + * @property {number} ALPHA=2 ALPHA value + * @property {number} BETA=3 BETA value + * @property {number} GA=4 GA value + * @property {number} DEPRECATED=5 DEPRECATED value + */ + api.LaunchStage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; + values[valuesById[6] = "UNIMPLEMENTED"] = 6; + values[valuesById[7] = "PRELAUNCH"] = 7; + values[valuesById[1] = "EARLY_ACCESS"] = 1; + values[valuesById[2] = "ALPHA"] = 2; + values[valuesById[3] = "BETA"] = 3; + values[valuesById[4] = "GA"] = 4; + values[valuesById[5] = "DEPRECATED"] = 5; return values; })(); @@ -13637,6 +14251,7 @@ * @memberof google.api * @interface IFieldInfo * @property {google.api.FieldInfo.Format|null} [format] FieldInfo format + * @property {Array.|null} [referencedTypes] FieldInfo referencedTypes */ /** @@ -13648,6 +14263,7 @@ * @param {google.api.IFieldInfo=} [properties] Properties to set */ function FieldInfo(properties) { + this.referencedTypes = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13662,6 +14278,14 @@ */ FieldInfo.prototype.format = 0; + /** + * FieldInfo referencedTypes. + * @member {Array.} referencedTypes + * @memberof google.api.FieldInfo + * @instance + */ + FieldInfo.prototype.referencedTypes = $util.emptyArray; + /** * Creates a new FieldInfo instance using the specified properties. * @function create @@ -13688,6 +14312,9 @@ writer = $Writer.create(); if (message.format != null && Object.hasOwnProperty.call(message, "format")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.format); + if (message.referencedTypes != null && message.referencedTypes.length) + for (var i = 0; i < message.referencedTypes.length; ++i) + $root.google.api.TypeReference.encode(message.referencedTypes[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -13728,6 +14355,12 @@ message.format = reader.int32(); break; } + case 2: { + if (!(message.referencedTypes && message.referencedTypes.length)) + message.referencedTypes = []; + message.referencedTypes.push($root.google.api.TypeReference.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -13774,6 +14407,15 @@ case 4: break; } + if (message.referencedTypes != null && message.hasOwnProperty("referencedTypes")) { + if (!Array.isArray(message.referencedTypes)) + return "referencedTypes: array expected"; + for (var i = 0; i < message.referencedTypes.length; ++i) { + var error = $root.google.api.TypeReference.verify(message.referencedTypes[i]); + if (error) + return "referencedTypes." + error; + } + } return null; }; @@ -13817,6 +14459,16 @@ message.format = 4; break; } + if (object.referencedTypes) { + if (!Array.isArray(object.referencedTypes)) + throw TypeError(".google.api.FieldInfo.referencedTypes: array expected"); + message.referencedTypes = []; + for (var i = 0; i < object.referencedTypes.length; ++i) { + if (typeof object.referencedTypes[i] !== "object") + throw TypeError(".google.api.FieldInfo.referencedTypes: object expected"); + message.referencedTypes[i] = $root.google.api.TypeReference.fromObject(object.referencedTypes[i]); + } + } return message; }; @@ -13833,10 +14485,17 @@ if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.referencedTypes = []; if (options.defaults) object.format = options.enums === String ? "FORMAT_UNSPECIFIED" : 0; if (message.format != null && message.hasOwnProperty("format")) object.format = options.enums === String ? $root.google.api.FieldInfo.Format[message.format] === undefined ? message.format : $root.google.api.FieldInfo.Format[message.format] : message.format; + if (message.referencedTypes && message.referencedTypes.length) { + object.referencedTypes = []; + for (var j = 0; j < message.referencedTypes.length; ++j) + object.referencedTypes[j] = $root.google.api.TypeReference.toObject(message.referencedTypes[j], options); + } return object; }; @@ -13889,37 +14548,24 @@ return FieldInfo; })(); - return api; - })(); - - google.protobuf = (function() { - - /** - * Namespace protobuf. - * @memberof google - * @namespace - */ - var protobuf = {}; - - protobuf.FileDescriptorSet = (function() { + api.TypeReference = (function() { /** - * Properties of a FileDescriptorSet. - * @memberof google.protobuf - * @interface IFileDescriptorSet - * @property {Array.|null} [file] FileDescriptorSet file + * Properties of a TypeReference. + * @memberof google.api + * @interface ITypeReference + * @property {string|null} [typeName] TypeReference typeName */ /** - * Constructs a new FileDescriptorSet. - * @memberof google.protobuf - * @classdesc Represents a FileDescriptorSet. - * @implements IFileDescriptorSet + * Constructs a new TypeReference. + * @memberof google.api + * @classdesc Represents a TypeReference. + * @implements ITypeReference * @constructor - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @param {google.api.ITypeReference=} [properties] Properties to set */ - function FileDescriptorSet(properties) { - this.file = []; + function TypeReference(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13927,80 +14573,77 @@ } /** - * FileDescriptorSet file. - * @member {Array.} file - * @memberof google.protobuf.FileDescriptorSet + * TypeReference typeName. + * @member {string} typeName + * @memberof google.api.TypeReference * @instance */ - FileDescriptorSet.prototype.file = $util.emptyArray; + TypeReference.prototype.typeName = ""; /** - * Creates a new FileDescriptorSet instance using the specified properties. + * Creates a new TypeReference instance using the specified properties. * @function create - * @memberof google.protobuf.FileDescriptorSet + * @memberof google.api.TypeReference * @static - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + * @param {google.api.ITypeReference=} [properties] Properties to set + * @returns {google.api.TypeReference} TypeReference instance */ - FileDescriptorSet.create = function create(properties) { - return new FileDescriptorSet(properties); + TypeReference.create = function create(properties) { + return new TypeReference(properties); }; /** - * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * Encodes the specified TypeReference message. Does not implicitly {@link google.api.TypeReference.verify|verify} messages. * @function encode - * @memberof google.protobuf.FileDescriptorSet + * @memberof google.api.TypeReference * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {google.api.ITypeReference} message TypeReference message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FileDescriptorSet.encode = function encode(message, writer) { + TypeReference.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.file != null && message.file.length) - for (var i = 0; i < message.file.length; ++i) - $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.typeName); return writer; }; /** - * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * Encodes the specified TypeReference message, length delimited. Does not implicitly {@link google.api.TypeReference.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorSet + * @memberof google.api.TypeReference * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {google.api.ITypeReference} message TypeReference message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + TypeReference.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. + * Decodes a TypeReference message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.FileDescriptorSet + * @memberof google.api.TypeReference * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @returns {google.api.TypeReference} TypeReference * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FileDescriptorSet.decode = function decode(reader, length, error) { + TypeReference.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.TypeReference(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { - if (!(message.file && message.file.length)) - message.file = []; - message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + message.typeName = reader.string(); break; } default: @@ -14012,40 +14655,261 @@ }; /** - * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * Decodes a TypeReference message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorSet + * @memberof google.api.TypeReference * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @returns {google.api.TypeReference} TypeReference * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + TypeReference.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FileDescriptorSet message. + * Verifies a TypeReference message. * @function verify - * @memberof google.protobuf.FileDescriptorSet + * @memberof google.api.TypeReference * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - FileDescriptorSet.verify = function verify(message) { + TypeReference.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.file != null && message.hasOwnProperty("file")) { - if (!Array.isArray(message.file)) - return "file: array expected"; - for (var i = 0; i < message.file.length; ++i) { - var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); - if (error) - return "file." + error; - } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + return null; + }; + + /** + * Creates a TypeReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.TypeReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.TypeReference} TypeReference + */ + TypeReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.TypeReference) + return object; + var message = new $root.google.api.TypeReference(); + if (object.typeName != null) + message.typeName = String(object.typeName); + return message; + }; + + /** + * Creates a plain object from a TypeReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.TypeReference + * @static + * @param {google.api.TypeReference} message TypeReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TypeReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.typeName = ""; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + return object; + }; + + /** + * Converts this TypeReference to JSON. + * @function toJSON + * @memberof google.api.TypeReference + * @instance + * @returns {Object.} JSON object + */ + TypeReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TypeReference + * @function getTypeUrl + * @memberof google.api.TypeReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TypeReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.TypeReference"; + }; + + return TypeReference; + })(); + + return api; + })(); + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (error) + return "file." + error; + } } return null; }; @@ -14132,6 +14996,7 @@ * @name google.protobuf.Edition * @enum {number} * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value + * @property {number} EDITION_LEGACY=900 EDITION_LEGACY value * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value * @property {number} EDITION_2023=1000 EDITION_2023 value @@ -14146,6 +15011,7 @@ protobuf.Edition = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "EDITION_UNKNOWN"] = 0; + values[valuesById[900] = "EDITION_LEGACY"] = 900; values[valuesById[998] = "EDITION_PROTO2"] = 998; values[valuesById[999] = "EDITION_PROTO3"] = 999; values[valuesById[1000] = "EDITION_2023"] = 1000; @@ -14170,6 +15036,7 @@ * @property {Array.|null} [dependency] FileDescriptorProto dependency * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [optionDependency] FileDescriptorProto optionDependency * @property {Array.|null} [messageType] FileDescriptorProto messageType * @property {Array.|null} [enumType] FileDescriptorProto enumType * @property {Array.|null} [service] FileDescriptorProto service @@ -14192,6 +15059,7 @@ this.dependency = []; this.publicDependency = []; this.weakDependency = []; + this.optionDependency = []; this.messageType = []; this.enumType = []; this.service = []; @@ -14242,6 +15110,14 @@ */ FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + /** + * FileDescriptorProto optionDependency. + * @member {Array.} optionDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.optionDependency = $util.emptyArray; + /** * FileDescriptorProto messageType. * @member {Array.} messageType @@ -14363,6 +15239,9 @@ writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); + if (message.optionDependency != null && message.optionDependency.length) + for (var i = 0; i < message.optionDependency.length; ++i) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.optionDependency[i]); return writer; }; @@ -14435,6 +15314,12 @@ message.weakDependency.push(reader.int32()); break; } + case 15: { + if (!(message.optionDependency && message.optionDependency.length)) + message.optionDependency = []; + message.optionDependency.push(reader.string()); + break; + } case 4: { if (!(message.messageType && message.messageType.length)) message.messageType = []; @@ -14537,6 +15422,13 @@ if (!$util.isInteger(message.weakDependency[i])) return "weakDependency: integer[] expected"; } + if (message.optionDependency != null && message.hasOwnProperty("optionDependency")) { + if (!Array.isArray(message.optionDependency)) + return "optionDependency: array expected"; + for (var i = 0; i < message.optionDependency.length; ++i) + if (!$util.isString(message.optionDependency[i])) + return "optionDependency: string[] expected"; + } if (message.messageType != null && message.hasOwnProperty("messageType")) { if (!Array.isArray(message.messageType)) return "messageType: array expected"; @@ -14591,6 +15483,7 @@ default: return "edition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -14643,6 +15536,13 @@ for (var i = 0; i < object.weakDependency.length; ++i) message.weakDependency[i] = object.weakDependency[i] | 0; } + if (object.optionDependency) { + if (!Array.isArray(object.optionDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.optionDependency: array expected"); + message.optionDependency = []; + for (var i = 0; i < object.optionDependency.length; ++i) + message.optionDependency[i] = String(object.optionDependency[i]); + } if (object.messageType) { if (!Array.isArray(object.messageType)) throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); @@ -14706,6 +15606,10 @@ case 0: message.edition = 0; break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; case "EDITION_PROTO2": case 998: message.edition = 998; @@ -14771,6 +15675,7 @@ object.extension = []; object.publicDependency = []; object.weakDependency = []; + object.optionDependency = []; } if (options.defaults) { object.name = ""; @@ -14827,6 +15732,11 @@ object.syntax = message.syntax; if (message.edition != null && message.hasOwnProperty("edition")) object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + if (message.optionDependency && message.optionDependency.length) { + object.optionDependency = []; + for (var j = 0; j < message.optionDependency.length; ++j) + object.optionDependency[j] = message.optionDependency[j]; + } return object; }; @@ -14875,6 +15785,7 @@ * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options * @property {Array.|null} [reservedRange] DescriptorProto reservedRange * @property {Array.|null} [reservedName] DescriptorProto reservedName + * @property {google.protobuf.SymbolVisibility|null} [visibility] DescriptorProto visibility */ /** @@ -14980,6 +15891,14 @@ */ DescriptorProto.prototype.reservedName = $util.emptyArray; + /** + * DescriptorProto visibility. + * @member {google.protobuf.SymbolVisibility} visibility + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.visibility = 0; + /** * Creates a new DescriptorProto instance using the specified properties. * @function create @@ -15032,6 +15951,8 @@ if (message.reservedName != null && message.reservedName.length) for (var i = 0; i < message.reservedName.length; ++i) writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.visibility); return writer; }; @@ -15124,6 +16045,10 @@ message.reservedName.push(reader.string()); break; } + case 11: { + message.visibility = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -15237,6 +16162,15 @@ if (!$util.isString(message.reservedName[i])) return "reservedName: string[] expected"; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + switch (message.visibility) { + default: + return "visibility: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; @@ -15336,6 +16270,26 @@ for (var i = 0; i < object.reservedName.length; ++i) message.reservedName[i] = String(object.reservedName[i]); } + switch (object.visibility) { + default: + if (typeof object.visibility === "number") { + message.visibility = object.visibility; + break; + } + break; + case "VISIBILITY_UNSET": + case 0: + message.visibility = 0; + break; + case "VISIBILITY_LOCAL": + case 1: + message.visibility = 1; + break; + case "VISIBILITY_EXPORT": + case 2: + message.visibility = 2; + break; + } return message; }; @@ -15365,6 +16319,7 @@ if (options.defaults) { object.name = ""; object.options = null; + object.visibility = options.enums === String ? "VISIBILITY_UNSET" : 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -15410,6 +16365,8 @@ for (var j = 0; j < message.reservedName.length; ++j) object.reservedName[j] = message.reservedName[j]; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + object.visibility = options.enums === String ? $root.google.protobuf.SymbolVisibility[message.visibility] === undefined ? message.visibility : $root.google.protobuf.SymbolVisibility[message.visibility] : message.visibility; return object; }; @@ -17454,6 +18411,7 @@ * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + * @property {google.protobuf.SymbolVisibility|null} [visibility] EnumDescriptorProto visibility */ /** @@ -17514,6 +18472,14 @@ */ EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + /** + * EnumDescriptorProto visibility. + * @member {google.protobuf.SymbolVisibility} visibility + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.visibility = 0; + /** * Creates a new EnumDescriptorProto instance using the specified properties. * @function create @@ -17551,6 +18517,8 @@ if (message.reservedName != null && message.reservedName.length) for (var i = 0; i < message.reservedName.length; ++i) writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.visibility); return writer; }; @@ -17613,6 +18581,10 @@ message.reservedName.push(reader.string()); break; } + case 6: { + message.visibility = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -17681,6 +18653,15 @@ if (!$util.isString(message.reservedName[i])) return "reservedName: string[] expected"; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + switch (message.visibility) { + default: + return "visibility: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; @@ -17730,6 +18711,26 @@ for (var i = 0; i < object.reservedName.length; ++i) message.reservedName[i] = String(object.reservedName[i]); } + switch (object.visibility) { + default: + if (typeof object.visibility === "number") { + message.visibility = object.visibility; + break; + } + break; + case "VISIBILITY_UNSET": + case 0: + message.visibility = 0; + break; + case "VISIBILITY_LOCAL": + case 1: + message.visibility = 1; + break; + case "VISIBILITY_EXPORT": + case 2: + message.visibility = 2; + break; + } return message; }; @@ -17754,6 +18755,7 @@ if (options.defaults) { object.name = ""; object.options = null; + object.visibility = options.enums === String ? "VISIBILITY_UNSET" : 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -17774,6 +18776,8 @@ for (var j = 0; j < message.reservedName.length; ++j) object.reservedName[j] = message.reservedName[j]; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + object.visibility = options.enums === String ? $root.google.protobuf.SymbolVisibility[message.visibility] === undefined ? message.visibility : $root.google.protobuf.SymbolVisibility[message.visibility] : message.visibility; return object; }; @@ -20092,6 +21096,7 @@ * @property {Array.|null} [targets] FieldOptions targets * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features + * @property {google.protobuf.FieldOptions.IFeatureSupport|null} [featureSupport] FieldOptions featureSupport * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference @@ -20213,6 +21218,14 @@ */ FieldOptions.prototype.features = null; + /** + * FieldOptions featureSupport. + * @member {google.protobuf.FieldOptions.IFeatureSupport|null|undefined} featureSupport + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.featureSupport = null; + /** * FieldOptions uninterpretedOption. * @member {Array.} uninterpretedOption @@ -20295,6 +21308,8 @@ $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); if (message.features != null && Object.hasOwnProperty.call(message, "features")) $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) + $root.google.protobuf.FieldOptions.FeatureSupport.encode(message.featureSupport, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); @@ -20398,6 +21413,10 @@ message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); break; } + case 22: { + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.decode(reader, reader.uint32()); + break; + } case 999: { if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; @@ -20537,6 +21556,11 @@ if (error) return "features." + error; } + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) { + var error = $root.google.protobuf.FieldOptions.FeatureSupport.verify(message.featureSupport); + if (error) + return "featureSupport." + error; + } if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; @@ -20730,6 +21754,11 @@ throw TypeError(".google.protobuf.FieldOptions.features: object expected"); message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); } + if (object.featureSupport != null) { + if (typeof object.featureSupport !== "object") + throw TypeError(".google.protobuf.FieldOptions.featureSupport: object expected"); + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.fromObject(object.featureSupport); + } if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); @@ -20832,6 +21861,7 @@ object.debugRedact = false; object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; object.features = null; + object.featureSupport = null; object[".google.api.resourceReference"] = null; object[".google.api.fieldInfo"] = null; } @@ -20865,6 +21895,8 @@ } if (message.features != null && message.hasOwnProperty("features")) object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) + object.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.toObject(message.featureSupport, options); if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) @@ -21139,6 +22171,7 @@ default: return "edition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -21180,103 +22213,589 @@ case 0: message.edition = 0; break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this EditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + * @returns {Object.} JSON object + */ + EditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; + }; + + return EditionDefault; + })(); + + FieldOptions.FeatureSupport = (function() { + + /** + * Properties of a FeatureSupport. + * @memberof google.protobuf.FieldOptions + * @interface IFeatureSupport + * @property {google.protobuf.Edition|null} [editionIntroduced] FeatureSupport editionIntroduced + * @property {google.protobuf.Edition|null} [editionDeprecated] FeatureSupport editionDeprecated + * @property {string|null} [deprecationWarning] FeatureSupport deprecationWarning + * @property {google.protobuf.Edition|null} [editionRemoved] FeatureSupport editionRemoved + */ + + /** + * Constructs a new FeatureSupport. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents a FeatureSupport. + * @implements IFeatureSupport + * @constructor + * @param {google.protobuf.FieldOptions.IFeatureSupport=} [properties] Properties to set + */ + function FeatureSupport(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSupport editionIntroduced. + * @member {google.protobuf.Edition} editionIntroduced + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionIntroduced = 0; + + /** + * FeatureSupport editionDeprecated. + * @member {google.protobuf.Edition} editionDeprecated + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionDeprecated = 0; + + /** + * FeatureSupport deprecationWarning. + * @member {string} deprecationWarning + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.deprecationWarning = ""; + + /** + * FeatureSupport editionRemoved. + * @member {google.protobuf.Edition} editionRemoved + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionRemoved = 0; + + /** + * Creates a new FeatureSupport instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport instance + */ + FeatureSupport.create = function create(properties) { + return new FeatureSupport(properties); + }; + + /** + * Encodes the specified FeatureSupport message. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport} message FeatureSupport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSupport.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.editionIntroduced != null && Object.hasOwnProperty.call(message, "editionIntroduced")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.editionIntroduced); + if (message.editionDeprecated != null && Object.hasOwnProperty.call(message, "editionDeprecated")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.editionDeprecated); + if (message.deprecationWarning != null && Object.hasOwnProperty.call(message, "deprecationWarning")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.deprecationWarning); + if (message.editionRemoved != null && Object.hasOwnProperty.call(message, "editionRemoved")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.editionRemoved); + return writer; + }; + + /** + * Encodes the specified FeatureSupport message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport} message FeatureSupport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSupport.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSupport.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.FeatureSupport(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.editionIntroduced = reader.int32(); + break; + } + case 2: { + message.editionDeprecated = reader.int32(); + break; + } + case 3: { + message.deprecationWarning = reader.string(); + break; + } + case 4: { + message.editionRemoved = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSupport.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSupport message. + * @function verify + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSupport.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.editionIntroduced != null && message.hasOwnProperty("editionIntroduced")) + switch (message.editionIntroduced) { + default: + return "editionIntroduced: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.editionDeprecated != null && message.hasOwnProperty("editionDeprecated")) + switch (message.editionDeprecated) { + default: + return "editionDeprecated: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.deprecationWarning != null && message.hasOwnProperty("deprecationWarning")) + if (!$util.isString(message.deprecationWarning)) + return "deprecationWarning: string expected"; + if (message.editionRemoved != null && message.hasOwnProperty("editionRemoved")) + switch (message.editionRemoved) { + default: + return "editionRemoved: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FeatureSupport message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + */ + FeatureSupport.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions.FeatureSupport) + return object; + var message = new $root.google.protobuf.FieldOptions.FeatureSupport(); + switch (object.editionIntroduced) { + default: + if (typeof object.editionIntroduced === "number") { + message.editionIntroduced = object.editionIntroduced; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionIntroduced = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionIntroduced = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionIntroduced = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionIntroduced = 999; + break; + case "EDITION_2023": + case 1000: + message.editionIntroduced = 1000; + break; + case "EDITION_2024": + case 1001: + message.editionIntroduced = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.editionIntroduced = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.editionIntroduced = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.editionIntroduced = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.editionIntroduced = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.editionIntroduced = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.editionIntroduced = 2147483647; + break; + } + switch (object.editionDeprecated) { + default: + if (typeof object.editionDeprecated === "number") { + message.editionDeprecated = object.editionDeprecated; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionDeprecated = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionDeprecated = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionDeprecated = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionDeprecated = 999; + break; + case "EDITION_2023": + case 1000: + message.editionDeprecated = 1000; + break; + case "EDITION_2024": + case 1001: + message.editionDeprecated = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.editionDeprecated = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.editionDeprecated = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.editionDeprecated = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.editionDeprecated = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.editionDeprecated = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.editionDeprecated = 2147483647; + break; + } + if (object.deprecationWarning != null) + message.deprecationWarning = String(object.deprecationWarning); + switch (object.editionRemoved) { + default: + if (typeof object.editionRemoved === "number") { + message.editionRemoved = object.editionRemoved; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionRemoved = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionRemoved = 900; + break; case "EDITION_PROTO2": case 998: - message.edition = 998; + message.editionRemoved = 998; break; case "EDITION_PROTO3": case 999: - message.edition = 999; + message.editionRemoved = 999; break; case "EDITION_2023": case 1000: - message.edition = 1000; + message.editionRemoved = 1000; break; case "EDITION_2024": case 1001: - message.edition = 1001; + message.editionRemoved = 1001; break; case "EDITION_1_TEST_ONLY": case 1: - message.edition = 1; + message.editionRemoved = 1; break; case "EDITION_2_TEST_ONLY": case 2: - message.edition = 2; + message.editionRemoved = 2; break; case "EDITION_99997_TEST_ONLY": case 99997: - message.edition = 99997; + message.editionRemoved = 99997; break; case "EDITION_99998_TEST_ONLY": case 99998: - message.edition = 99998; + message.editionRemoved = 99998; break; case "EDITION_99999_TEST_ONLY": case 99999: - message.edition = 99999; + message.editionRemoved = 99999; break; case "EDITION_MAX": case 2147483647: - message.edition = 2147483647; + message.editionRemoved = 2147483647; break; } - if (object.value != null) - message.value = String(object.value); return message; }; /** - * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * Creates a plain object from a FeatureSupport message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.FieldOptions.EditionDefault + * @memberof google.protobuf.FieldOptions.FeatureSupport * @static - * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault + * @param {google.protobuf.FieldOptions.FeatureSupport} message FeatureSupport * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EditionDefault.toObject = function toObject(message, options) { + FeatureSupport.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.value = ""; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.editionIntroduced = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.editionDeprecated = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.deprecationWarning = ""; + object.editionRemoved = options.enums === String ? "EDITION_UNKNOWN" : 0; } - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + if (message.editionIntroduced != null && message.hasOwnProperty("editionIntroduced")) + object.editionIntroduced = options.enums === String ? $root.google.protobuf.Edition[message.editionIntroduced] === undefined ? message.editionIntroduced : $root.google.protobuf.Edition[message.editionIntroduced] : message.editionIntroduced; + if (message.editionDeprecated != null && message.hasOwnProperty("editionDeprecated")) + object.editionDeprecated = options.enums === String ? $root.google.protobuf.Edition[message.editionDeprecated] === undefined ? message.editionDeprecated : $root.google.protobuf.Edition[message.editionDeprecated] : message.editionDeprecated; + if (message.deprecationWarning != null && message.hasOwnProperty("deprecationWarning")) + object.deprecationWarning = message.deprecationWarning; + if (message.editionRemoved != null && message.hasOwnProperty("editionRemoved")) + object.editionRemoved = options.enums === String ? $root.google.protobuf.Edition[message.editionRemoved] === undefined ? message.editionRemoved : $root.google.protobuf.Edition[message.editionRemoved] : message.editionRemoved; return object; }; /** - * Converts this EditionDefault to JSON. + * Converts this FeatureSupport to JSON. * @function toJSON - * @memberof google.protobuf.FieldOptions.EditionDefault + * @memberof google.protobuf.FieldOptions.FeatureSupport * @instance * @returns {Object.} JSON object */ - EditionDefault.prototype.toJSON = function toJSON() { + FeatureSupport.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for EditionDefault + * Gets the default type url for FeatureSupport * @function getTypeUrl - * @memberof google.protobuf.FieldOptions.EditionDefault + * @memberof google.protobuf.FieldOptions.FeatureSupport * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + FeatureSupport.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; + return typeUrlPrefix + "/google.protobuf.FieldOptions.FeatureSupport"; }; - return EditionDefault; + return FeatureSupport; })(); return FieldOptions; @@ -21871,6 +23390,7 @@ * @property {boolean|null} [deprecated] EnumValueOptions deprecated * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact + * @property {google.protobuf.FieldOptions.IFeatureSupport|null} [featureSupport] EnumValueOptions featureSupport * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption */ @@ -21914,6 +23434,14 @@ */ EnumValueOptions.prototype.debugRedact = false; + /** + * EnumValueOptions featureSupport. + * @member {google.protobuf.FieldOptions.IFeatureSupport|null|undefined} featureSupport + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.featureSupport = null; + /** * EnumValueOptions uninterpretedOption. * @member {Array.} uninterpretedOption @@ -21952,6 +23480,8 @@ $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); + if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) + $root.google.protobuf.FieldOptions.FeatureSupport.encode(message.featureSupport, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); @@ -22003,6 +23533,10 @@ message.debugRedact = reader.bool(); break; } + case 4: { + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.decode(reader, reader.uint32()); + break; + } case 999: { if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; @@ -22055,6 +23589,11 @@ if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) if (typeof message.debugRedact !== "boolean") return "debugRedact: boolean expected"; + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) { + var error = $root.google.protobuf.FieldOptions.FeatureSupport.verify(message.featureSupport); + if (error) + return "featureSupport." + error; + } if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; @@ -22088,6 +23627,11 @@ } if (object.debugRedact != null) message.debugRedact = Boolean(object.debugRedact); + if (object.featureSupport != null) { + if (typeof object.featureSupport !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.featureSupport: object expected"); + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.fromObject(object.featureSupport); + } if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); @@ -22120,6 +23664,7 @@ object.deprecated = false; object.features = null; object.debugRedact = false; + object.featureSupport = null; } if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; @@ -22127,6 +23672,8 @@ object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) object.debugRedact = message.debugRedact; + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) + object.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.toObject(message.featureSupport, options); if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) @@ -23594,6 +25141,8 @@ * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat + * @property {google.protobuf.FeatureSet.EnforceNamingStyle|null} [enforceNamingStyle] FeatureSet enforceNamingStyle + * @property {google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|null} [defaultSymbolVisibility] FeatureSet defaultSymbolVisibility */ /** @@ -23659,6 +25208,22 @@ */ FeatureSet.prototype.jsonFormat = 0; + /** + * FeatureSet enforceNamingStyle. + * @member {google.protobuf.FeatureSet.EnforceNamingStyle} enforceNamingStyle + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enforceNamingStyle = 0; + + /** + * FeatureSet defaultSymbolVisibility. + * @member {google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility} defaultSymbolVisibility + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.defaultSymbolVisibility = 0; + /** * Creates a new FeatureSet instance using the specified properties. * @function create @@ -23695,6 +25260,10 @@ writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); + if (message.enforceNamingStyle != null && Object.hasOwnProperty.call(message, "enforceNamingStyle")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.enforceNamingStyle); + if (message.defaultSymbolVisibility != null && Object.hasOwnProperty.call(message, "defaultSymbolVisibility")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.defaultSymbolVisibility); return writer; }; @@ -23755,6 +25324,14 @@ message.jsonFormat = reader.int32(); break; } + case 7: { + message.enforceNamingStyle = reader.int32(); + break; + } + case 8: { + message.defaultSymbolVisibility = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -23845,6 +25422,26 @@ case 2: break; } + if (message.enforceNamingStyle != null && message.hasOwnProperty("enforceNamingStyle")) + switch (message.enforceNamingStyle) { + default: + return "enforceNamingStyle: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.defaultSymbolVisibility != null && message.hasOwnProperty("defaultSymbolVisibility")) + switch (message.defaultSymbolVisibility) { + default: + return "defaultSymbolVisibility: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } return null; }; @@ -23984,6 +25581,54 @@ message.jsonFormat = 2; break; } + switch (object.enforceNamingStyle) { + default: + if (typeof object.enforceNamingStyle === "number") { + message.enforceNamingStyle = object.enforceNamingStyle; + break; + } + break; + case "ENFORCE_NAMING_STYLE_UNKNOWN": + case 0: + message.enforceNamingStyle = 0; + break; + case "STYLE2024": + case 1: + message.enforceNamingStyle = 1; + break; + case "STYLE_LEGACY": + case 2: + message.enforceNamingStyle = 2; + break; + } + switch (object.defaultSymbolVisibility) { + default: + if (typeof object.defaultSymbolVisibility === "number") { + message.defaultSymbolVisibility = object.defaultSymbolVisibility; + break; + } + break; + case "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN": + case 0: + message.defaultSymbolVisibility = 0; + break; + case "EXPORT_ALL": + case 1: + message.defaultSymbolVisibility = 1; + break; + case "EXPORT_TOP_LEVEL": + case 2: + message.defaultSymbolVisibility = 2; + break; + case "LOCAL_ALL": + case 3: + message.defaultSymbolVisibility = 3; + break; + case "STRICT": + case 4: + message.defaultSymbolVisibility = 4; + break; + } return message; }; @@ -24007,6 +25652,8 @@ object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; + object.enforceNamingStyle = options.enums === String ? "ENFORCE_NAMING_STYLE_UNKNOWN" : 0; + object.defaultSymbolVisibility = options.enums === String ? "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN" : 0; } if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; @@ -24020,6 +25667,10 @@ object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; + if (message.enforceNamingStyle != null && message.hasOwnProperty("enforceNamingStyle")) + object.enforceNamingStyle = options.enums === String ? $root.google.protobuf.FeatureSet.EnforceNamingStyle[message.enforceNamingStyle] === undefined ? message.enforceNamingStyle : $root.google.protobuf.FeatureSet.EnforceNamingStyle[message.enforceNamingStyle] : message.enforceNamingStyle; + if (message.defaultSymbolVisibility != null && message.hasOwnProperty("defaultSymbolVisibility")) + object.defaultSymbolVisibility = options.enums === String ? $root.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility[message.defaultSymbolVisibility] === undefined ? message.defaultSymbolVisibility : $root.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility[message.defaultSymbolVisibility] : message.defaultSymbolVisibility; return object; }; @@ -24147,6 +25798,219 @@ return values; })(); + /** + * EnforceNamingStyle enum. + * @name google.protobuf.FeatureSet.EnforceNamingStyle + * @enum {number} + * @property {number} ENFORCE_NAMING_STYLE_UNKNOWN=0 ENFORCE_NAMING_STYLE_UNKNOWN value + * @property {number} STYLE2024=1 STYLE2024 value + * @property {number} STYLE_LEGACY=2 STYLE_LEGACY value + */ + FeatureSet.EnforceNamingStyle = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENFORCE_NAMING_STYLE_UNKNOWN"] = 0; + values[valuesById[1] = "STYLE2024"] = 1; + values[valuesById[2] = "STYLE_LEGACY"] = 2; + return values; + })(); + + FeatureSet.VisibilityFeature = (function() { + + /** + * Properties of a VisibilityFeature. + * @memberof google.protobuf.FeatureSet + * @interface IVisibilityFeature + */ + + /** + * Constructs a new VisibilityFeature. + * @memberof google.protobuf.FeatureSet + * @classdesc Represents a VisibilityFeature. + * @implements IVisibilityFeature + * @constructor + * @param {google.protobuf.FeatureSet.IVisibilityFeature=} [properties] Properties to set + */ + function VisibilityFeature(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new VisibilityFeature instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature instance + */ + VisibilityFeature.create = function create(properties) { + return new VisibilityFeature(properties); + }; + + /** + * Encodes the specified VisibilityFeature message. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature} message VisibilityFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VisibilityFeature.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified VisibilityFeature message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature} message VisibilityFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VisibilityFeature.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VisibilityFeature.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet.VisibilityFeature(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VisibilityFeature.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VisibilityFeature message. + * @function verify + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VisibilityFeature.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a VisibilityFeature message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + */ + VisibilityFeature.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSet.VisibilityFeature) + return object; + return new $root.google.protobuf.FeatureSet.VisibilityFeature(); + }; + + /** + * Creates a plain object from a VisibilityFeature message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.VisibilityFeature} message VisibilityFeature + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VisibilityFeature.toObject = function toObject() { + return {}; + }; + + /** + * Converts this VisibilityFeature to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @instance + * @returns {Object.} JSON object + */ + VisibilityFeature.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VisibilityFeature + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VisibilityFeature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet.VisibilityFeature"; + }; + + /** + * DefaultSymbolVisibility enum. + * @name google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility + * @enum {number} + * @property {number} DEFAULT_SYMBOL_VISIBILITY_UNKNOWN=0 DEFAULT_SYMBOL_VISIBILITY_UNKNOWN value + * @property {number} EXPORT_ALL=1 EXPORT_ALL value + * @property {number} EXPORT_TOP_LEVEL=2 EXPORT_TOP_LEVEL value + * @property {number} LOCAL_ALL=3 LOCAL_ALL value + * @property {number} STRICT=4 STRICT value + */ + VisibilityFeature.DefaultSymbolVisibility = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN"] = 0; + values[valuesById[1] = "EXPORT_ALL"] = 1; + values[valuesById[2] = "EXPORT_TOP_LEVEL"] = 2; + values[valuesById[3] = "LOCAL_ALL"] = 3; + values[valuesById[4] = "STRICT"] = 4; + return values; + })(); + + return VisibilityFeature; + })(); + return FeatureSet; })(); @@ -24331,6 +26195,7 @@ default: return "minimumEdition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -24348,6 +26213,7 @@ default: return "maximumEdition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -24396,6 +26262,10 @@ case 0: message.minimumEdition = 0; break; + case "EDITION_LEGACY": + case 900: + message.minimumEdition = 900; + break; case "EDITION_PROTO2": case 998: message.minimumEdition = 998; @@ -24448,6 +26318,10 @@ case 0: message.maximumEdition = 0; break; + case "EDITION_LEGACY": + case 900: + message.maximumEdition = 900; + break; case "EDITION_PROTO2": case 998: message.maximumEdition = 998; @@ -24556,7 +26430,8 @@ * @memberof google.protobuf.FeatureSetDefaults * @interface IFeatureSetEditionDefault * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition - * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features + * @property {google.protobuf.IFeatureSet|null} [overridableFeatures] FeatureSetEditionDefault overridableFeatures + * @property {google.protobuf.IFeatureSet|null} [fixedFeatures] FeatureSetEditionDefault fixedFeatures */ /** @@ -24583,12 +26458,20 @@ FeatureSetEditionDefault.prototype.edition = 0; /** - * FeatureSetEditionDefault features. - * @member {google.protobuf.IFeatureSet|null|undefined} features + * FeatureSetEditionDefault overridableFeatures. + * @member {google.protobuf.IFeatureSet|null|undefined} overridableFeatures + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.overridableFeatures = null; + + /** + * FeatureSetEditionDefault fixedFeatures. + * @member {google.protobuf.IFeatureSet|null|undefined} fixedFeatures * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault * @instance */ - FeatureSetEditionDefault.prototype.features = null; + FeatureSetEditionDefault.prototype.fixedFeatures = null; /** * Creates a new FeatureSetEditionDefault instance using the specified properties. @@ -24614,10 +26497,12 @@ FeatureSetEditionDefault.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + if (message.overridableFeatures != null && Object.hasOwnProperty.call(message, "overridableFeatures")) + $root.google.protobuf.FeatureSet.encode(message.overridableFeatures, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.fixedFeatures != null && Object.hasOwnProperty.call(message, "fixedFeatures")) + $root.google.protobuf.FeatureSet.encode(message.fixedFeatures, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -24658,8 +26543,12 @@ message.edition = reader.int32(); break; } - case 2: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + case 4: { + message.overridableFeatures = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 5: { + message.fixedFeatures = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); break; } default: @@ -24702,6 +26591,7 @@ default: return "edition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -24714,10 +26604,15 @@ case 2147483647: break; } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (message.overridableFeatures != null && message.hasOwnProperty("overridableFeatures")) { + var error = $root.google.protobuf.FeatureSet.verify(message.overridableFeatures); + if (error) + return "overridableFeatures." + error; + } + if (message.fixedFeatures != null && message.hasOwnProperty("fixedFeatures")) { + var error = $root.google.protobuf.FeatureSet.verify(message.fixedFeatures); if (error) - return "features." + error; + return "fixedFeatures." + error; } return null; }; @@ -24745,6 +26640,10 @@ case 0: message.edition = 0; break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; case "EDITION_PROTO2": case 998: message.edition = 998; @@ -24786,10 +26685,15 @@ message.edition = 2147483647; break; } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + if (object.overridableFeatures != null) { + if (typeof object.overridableFeatures !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.overridableFeatures: object expected"); + message.overridableFeatures = $root.google.protobuf.FeatureSet.fromObject(object.overridableFeatures); + } + if (object.fixedFeatures != null) { + if (typeof object.fixedFeatures !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fixedFeatures: object expected"); + message.fixedFeatures = $root.google.protobuf.FeatureSet.fromObject(object.fixedFeatures); } return message; }; @@ -24808,13 +26712,16 @@ options = {}; var object = {}; if (options.defaults) { - object.features = null; object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.overridableFeatures = null; + object.fixedFeatures = null; } - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); if (message.edition != null && message.hasOwnProperty("edition")) object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + if (message.overridableFeatures != null && message.hasOwnProperty("overridableFeatures")) + object.overridableFeatures = $root.google.protobuf.FeatureSet.toObject(message.overridableFeatures, options); + if (message.fixedFeatures != null && message.hasOwnProperty("fixedFeatures")) + object.fixedFeatures = $root.google.protobuf.FeatureSet.toObject(message.fixedFeatures, options); return object; }; @@ -26029,6 +27936,22 @@ return GeneratedCodeInfo; })(); + /** + * SymbolVisibility enum. + * @name google.protobuf.SymbolVisibility + * @enum {number} + * @property {number} VISIBILITY_UNSET=0 VISIBILITY_UNSET value + * @property {number} VISIBILITY_LOCAL=1 VISIBILITY_LOCAL value + * @property {number} VISIBILITY_EXPORT=2 VISIBILITY_EXPORT value + */ + protobuf.SymbolVisibility = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VISIBILITY_UNSET"] = 0; + values[valuesById[1] = "VISIBILITY_LOCAL"] = 1; + values[valuesById[2] = "VISIBILITY_EXPORT"] = 2; + return values; + })(); + protobuf.Duration = (function() { /** diff --git a/packages/google-apps-events-subscriptions/protos/protos.json b/packages/google-apps-events-subscriptions/protos/protos.json index d5c690ed493..2a6d92ab4ce 100644 --- a/packages/google-apps-events-subscriptions/protos/protos.json +++ b/packages/google-apps-events-subscriptions/protos/protos.json @@ -1054,8 +1054,7 @@ "java_multiple_files": true, "java_outer_classname": "FieldInfoProto", "java_package": "com.google.api", - "objc_class_prefix": "GAPI", - "cc_enable_arenas": true + "objc_class_prefix": "GAPI" }, "nested": { "fieldBehavior": { @@ -1278,6 +1277,10 @@ "rule": "repeated", "type": "ClientLibraryDestination", "id": 2 + }, + "selectiveGapicGeneration": { + "type": "SelectiveGapicGeneration", + "id": 3 } } }, @@ -1418,6 +1421,28 @@ "common": { "type": "CommonLanguageSettings", "id": 1 + }, + "experimentalFeatures": { + "type": "ExperimentalFeatures", + "id": 2 + } + }, + "nested": { + "ExperimentalFeatures": { + "fields": { + "restAsyncIoEnabled": { + "type": "bool", + "id": 1 + }, + "protobufPythonicTypesEnabled": { + "type": "bool", + "id": 2 + }, + "unversionedPackageDisabled": { + "type": "bool", + "id": 3 + } + } } } }, @@ -1475,6 +1500,11 @@ "common": { "type": "CommonLanguageSettings", "id": 1 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 } } }, @@ -1536,6 +1566,19 @@ "PACKAGE_MANAGER": 20 } }, + "SelectiveGapicGeneration": { + "fields": { + "methods": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "generateOmittedAsInternal": { + "type": "bool", + "id": 2 + } + } + }, "LaunchStage": { "values": { "LAUNCH_STAGE_UNSPECIFIED": 0, @@ -1558,6 +1601,11 @@ "format": { "type": "Format", "id": 1 + }, + "referencedTypes": { + "rule": "repeated", + "type": "TypeReference", + "id": 2 } }, "nested": { @@ -1571,6 +1619,14 @@ } } } + }, + "TypeReference": { + "fields": { + "typeName": { + "type": "string", + "id": 1 + } + } } } }, @@ -1593,12 +1649,19 @@ "type": "FileDescriptorProto", "id": 1 } - } + }, + "extensions": [ + [ + 536000000, + 536000000 + ] + ] }, "Edition": { "edition": "proto2", "values": { "EDITION_UNKNOWN": 0, + "EDITION_LEGACY": 900, "EDITION_PROTO2": 998, "EDITION_PROTO3": 999, "EDITION_2023": 1000, @@ -1637,6 +1700,11 @@ "type": "int32", "id": 11 }, + "optionDependency": { + "rule": "repeated", + "type": "string", + "id": 15 + }, "messageType": { "rule": "repeated", "type": "DescriptorProto", @@ -1725,6 +1793,10 @@ "rule": "repeated", "type": "string", "id": 10 + }, + "visibility": { + "type": "SymbolVisibility", + "id": 11 } }, "nested": { @@ -1950,6 +2022,10 @@ "rule": "repeated", "type": "string", "id": 5 + }, + "visibility": { + "type": "SymbolVisibility", + "id": 6 } }, "nested": { @@ -2164,6 +2240,7 @@ 42, 42 ], + "php_generic_services", [ 38, 38 @@ -2299,7 +2376,8 @@ "type": "bool", "id": 10, "options": { - "default": false + "default": false, + "deprecated": true } }, "debugRedact": { @@ -2327,6 +2405,10 @@ "type": "FeatureSet", "id": 21 }, + "featureSupport": { + "type": "FeatureSupport", + "id": 22 + }, "uninterpretedOption": { "rule": "repeated", "type": "UninterpretedOption", @@ -2396,6 +2478,26 @@ "id": 2 } } + }, + "FeatureSupport": { + "fields": { + "editionIntroduced": { + "type": "Edition", + "id": 1 + }, + "editionDeprecated": { + "type": "Edition", + "id": 2 + }, + "deprecationWarning": { + "type": "string", + "id": 3 + }, + "editionRemoved": { + "type": "Edition", + "id": 4 + } + } } } }, @@ -2484,6 +2586,10 @@ "default": false } }, + "featureSupport": { + "type": "FieldOptions.FeatureSupport", + "id": 4 + }, "uninterpretedOption": { "rule": "repeated", "type": "UninterpretedOption", @@ -2626,6 +2732,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_2023", "edition_defaults.value": "EXPLICIT" } @@ -2636,6 +2743,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "OPEN" } @@ -2646,6 +2754,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "PACKED" } @@ -2656,6 +2765,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "VERIFY" } @@ -2666,7 +2776,8 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO2", + "feature_support.edition_introduced": "EDITION_2023", + "edition_defaults.edition": "EDITION_LEGACY", "edition_defaults.value": "LENGTH_PREFIXED" } }, @@ -2676,27 +2787,38 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "ALLOW" } + }, + "enforceNamingStyle": { + "type": "EnforceNamingStyle", + "id": 7, + "options": { + "retention": "RETENTION_SOURCE", + "targets": "TARGET_TYPE_METHOD", + "feature_support.edition_introduced": "EDITION_2024", + "edition_defaults.edition": "EDITION_2024", + "edition_defaults.value": "STYLE2024" + } + }, + "defaultSymbolVisibility": { + "type": "VisibilityFeature.DefaultSymbolVisibility", + "id": 8, + "options": { + "retention": "RETENTION_SOURCE", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2024", + "edition_defaults.edition": "EDITION_2024", + "edition_defaults.value": "EXPORT_TOP_LEVEL" + } } }, "extensions": [ [ 1000, - 1000 - ], - [ - 1001, - 1001 - ], - [ - 1002, - 1002 - ], - [ - 9990, - 9990 + 9994 ], [ 9995, @@ -2741,7 +2863,13 @@ "UTF8_VALIDATION_UNKNOWN": 0, "VERIFY": 2, "NONE": 3 - } + }, + "reserved": [ + [ + 1, + 1 + ] + ] }, "MessageEncoding": { "values": { @@ -2756,6 +2884,33 @@ "ALLOW": 1, "LEGACY_BEST_EFFORT": 2 } + }, + "EnforceNamingStyle": { + "values": { + "ENFORCE_NAMING_STYLE_UNKNOWN": 0, + "STYLE2024": 1, + "STYLE_LEGACY": 2 + } + }, + "VisibilityFeature": { + "fields": {}, + "reserved": [ + [ + 1, + 536870911 + ] + ], + "nested": { + "DefaultSymbolVisibility": { + "values": { + "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN": 0, + "EXPORT_ALL": 1, + "EXPORT_TOP_LEVEL": 2, + "LOCAL_ALL": 3, + "STRICT": 4 + } + } + } } } }, @@ -2783,11 +2938,26 @@ "type": "Edition", "id": 3 }, - "features": { + "overridableFeatures": { "type": "FeatureSet", - "id": 2 + "id": 4 + }, + "fixedFeatures": { + "type": "FeatureSet", + "id": 5 } - } + }, + "reserved": [ + [ + 1, + 1 + ], + [ + 2, + 2 + ], + "features" + ] } } }, @@ -2800,6 +2970,12 @@ "id": 1 } }, + "extensions": [ + [ + 536000000, + 536000000 + ] + ], "nested": { "Location": { "fields": { @@ -2885,6 +3061,14 @@ } } }, + "SymbolVisibility": { + "edition": "proto2", + "values": { + "VISIBILITY_UNSET": 0, + "VISIBILITY_LOCAL": 1, + "VISIBILITY_EXPORT": 2 + } + }, "Duration": { "fields": { "seconds": { @@ -2943,6 +3127,7 @@ "java_multiple_files": true, "java_outer_classname": "OperationsProto", "java_package": "com.google.longrunning", + "objc_class_prefix": "GLRUN", "php_namespace": "Google\\LongRunning" }, "nested": { diff --git a/packages/google-apps-meet/protos/protos.d.ts b/packages/google-apps-meet/protos/protos.d.ts index 71bceecb367..eda6a6cd60b 100644 --- a/packages/google-apps-meet/protos/protos.d.ts +++ b/packages/google-apps-meet/protos/protos.d.ts @@ -10691,6 +10691,9 @@ export namespace google { /** CommonLanguageSettings destinations */ destinations?: (google.api.ClientLibraryDestination[]|null); + + /** CommonLanguageSettings selectiveGapicGeneration */ + selectiveGapicGeneration?: (google.api.ISelectiveGapicGeneration|null); } /** Represents a CommonLanguageSettings. */ @@ -10708,6 +10711,9 @@ export namespace google { /** CommonLanguageSettings destinations. */ public destinations: google.api.ClientLibraryDestination[]; + /** CommonLanguageSettings selectiveGapicGeneration. */ + public selectiveGapicGeneration?: (google.api.ISelectiveGapicGeneration|null); + /** * Creates a new CommonLanguageSettings instance using the specified properties. * @param [properties] Properties to set @@ -11408,6 +11414,9 @@ export namespace google { /** PythonSettings common */ common?: (google.api.ICommonLanguageSettings|null); + + /** PythonSettings experimentalFeatures */ + experimentalFeatures?: (google.api.PythonSettings.IExperimentalFeatures|null); } /** Represents a PythonSettings. */ @@ -11422,6 +11431,9 @@ export namespace google { /** PythonSettings common. */ public common?: (google.api.ICommonLanguageSettings|null); + /** PythonSettings experimentalFeatures. */ + public experimentalFeatures?: (google.api.PythonSettings.IExperimentalFeatures|null); + /** * Creates a new PythonSettings instance using the specified properties. * @param [properties] Properties to set @@ -11500,6 +11512,118 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + namespace PythonSettings { + + /** Properties of an ExperimentalFeatures. */ + interface IExperimentalFeatures { + + /** ExperimentalFeatures restAsyncIoEnabled */ + restAsyncIoEnabled?: (boolean|null); + + /** ExperimentalFeatures protobufPythonicTypesEnabled */ + protobufPythonicTypesEnabled?: (boolean|null); + + /** ExperimentalFeatures unversionedPackageDisabled */ + unversionedPackageDisabled?: (boolean|null); + } + + /** Represents an ExperimentalFeatures. */ + class ExperimentalFeatures implements IExperimentalFeatures { + + /** + * Constructs a new ExperimentalFeatures. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.PythonSettings.IExperimentalFeatures); + + /** ExperimentalFeatures restAsyncIoEnabled. */ + public restAsyncIoEnabled: boolean; + + /** ExperimentalFeatures protobufPythonicTypesEnabled. */ + public protobufPythonicTypesEnabled: boolean; + + /** ExperimentalFeatures unversionedPackageDisabled. */ + public unversionedPackageDisabled: boolean; + + /** + * Creates a new ExperimentalFeatures instance using the specified properties. + * @param [properties] Properties to set + * @returns ExperimentalFeatures instance + */ + public static create(properties?: google.api.PythonSettings.IExperimentalFeatures): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Encodes the specified ExperimentalFeatures message. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @param message ExperimentalFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.PythonSettings.IExperimentalFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExperimentalFeatures message, length delimited. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @param message ExperimentalFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.PythonSettings.IExperimentalFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Verifies an ExperimentalFeatures message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExperimentalFeatures message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExperimentalFeatures + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Creates a plain object from an ExperimentalFeatures message. Also converts values to other types if specified. + * @param message ExperimentalFeatures + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings.ExperimentalFeatures, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExperimentalFeatures to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExperimentalFeatures + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + /** Properties of a NodeSettings. */ interface INodeSettings { @@ -11826,6 +11950,9 @@ export namespace google { /** GoSettings common */ common?: (google.api.ICommonLanguageSettings|null); + + /** GoSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|null); } /** Represents a GoSettings. */ @@ -11840,6 +11967,9 @@ export namespace google { /** GoSettings common. */ public common?: (google.api.ICommonLanguageSettings|null); + /** GoSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + /** * Creates a new GoSettings instance using the specified properties. * @param [properties] Properties to set @@ -12164,6 +12294,109 @@ export namespace google { PACKAGE_MANAGER = 20 } + /** Properties of a SelectiveGapicGeneration. */ + interface ISelectiveGapicGeneration { + + /** SelectiveGapicGeneration methods */ + methods?: (string[]|null); + + /** SelectiveGapicGeneration generateOmittedAsInternal */ + generateOmittedAsInternal?: (boolean|null); + } + + /** Represents a SelectiveGapicGeneration. */ + class SelectiveGapicGeneration implements ISelectiveGapicGeneration { + + /** + * Constructs a new SelectiveGapicGeneration. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ISelectiveGapicGeneration); + + /** SelectiveGapicGeneration methods. */ + public methods: string[]; + + /** SelectiveGapicGeneration generateOmittedAsInternal. */ + public generateOmittedAsInternal: boolean; + + /** + * Creates a new SelectiveGapicGeneration instance using the specified properties. + * @param [properties] Properties to set + * @returns SelectiveGapicGeneration instance + */ + public static create(properties?: google.api.ISelectiveGapicGeneration): google.api.SelectiveGapicGeneration; + + /** + * Encodes the specified SelectiveGapicGeneration message. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @param message SelectiveGapicGeneration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ISelectiveGapicGeneration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SelectiveGapicGeneration message, length delimited. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @param message SelectiveGapicGeneration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ISelectiveGapicGeneration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.SelectiveGapicGeneration; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.SelectiveGapicGeneration; + + /** + * Verifies a SelectiveGapicGeneration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SelectiveGapicGeneration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SelectiveGapicGeneration + */ + public static fromObject(object: { [k: string]: any }): google.api.SelectiveGapicGeneration; + + /** + * Creates a plain object from a SelectiveGapicGeneration message. Also converts values to other types if specified. + * @param message SelectiveGapicGeneration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.SelectiveGapicGeneration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SelectiveGapicGeneration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SelectiveGapicGeneration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** LaunchStage enum. */ enum LaunchStage { LAUNCH_STAGE_UNSPECIFIED = 0, @@ -12280,6 +12513,7 @@ export namespace google { /** Edition enum. */ enum Edition { EDITION_UNKNOWN = 0, + EDITION_LEGACY = 900, EDITION_PROTO2 = 998, EDITION_PROTO3 = 999, EDITION_2023 = 1000, @@ -12310,6 +12544,9 @@ export namespace google { /** FileDescriptorProto weakDependency */ weakDependency?: (number[]|null); + /** FileDescriptorProto optionDependency */ + optionDependency?: (string[]|null); + /** FileDescriptorProto messageType */ messageType?: (google.protobuf.IDescriptorProto[]|null); @@ -12359,6 +12596,9 @@ export namespace google { /** FileDescriptorProto weakDependency. */ public weakDependency: number[]; + /** FileDescriptorProto optionDependency. */ + public optionDependency: string[]; + /** FileDescriptorProto messageType. */ public messageType: google.protobuf.IDescriptorProto[]; @@ -12493,6 +12733,9 @@ export namespace google { /** DescriptorProto reservedName */ reservedName?: (string[]|null); + + /** DescriptorProto visibility */ + visibility?: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility|null); } /** Represents a DescriptorProto. */ @@ -12534,6 +12777,9 @@ export namespace google { /** DescriptorProto reservedName. */ public reservedName: string[]; + /** DescriptorProto visibility. */ + public visibility: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility); + /** * Creates a new DescriptorProto instance using the specified properties. * @param [properties] Properties to set @@ -13381,6 +13627,9 @@ export namespace google { /** EnumDescriptorProto reservedName */ reservedName?: (string[]|null); + + /** EnumDescriptorProto visibility */ + visibility?: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility|null); } /** Represents an EnumDescriptorProto. */ @@ -13407,6 +13656,9 @@ export namespace google { /** EnumDescriptorProto reservedName. */ public reservedName: string[]; + /** EnumDescriptorProto visibility. */ + public visibility: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility); + /** * Creates a new EnumDescriptorProto instance using the specified properties. * @param [properties] Properties to set @@ -14341,6 +14593,9 @@ export namespace google { /** FieldOptions features */ features?: (google.protobuf.IFeatureSet|null); + /** FieldOptions featureSupport */ + featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** FieldOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); @@ -14396,6 +14651,9 @@ export namespace google { /** FieldOptions features. */ public features?: (google.protobuf.IFeatureSet|null); + /** FieldOptions featureSupport. */ + public featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** FieldOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; @@ -14616,6 +14874,121 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** Properties of a FeatureSupport. */ + interface IFeatureSupport { + + /** FeatureSupport editionIntroduced */ + editionIntroduced?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSupport editionDeprecated */ + editionDeprecated?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSupport deprecationWarning */ + deprecationWarning?: (string|null); + + /** FeatureSupport editionRemoved */ + editionRemoved?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSupport. */ + class FeatureSupport implements IFeatureSupport { + + /** + * Constructs a new FeatureSupport. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IFeatureSupport); + + /** FeatureSupport editionIntroduced. */ + public editionIntroduced: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSupport editionDeprecated. */ + public editionDeprecated: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSupport deprecationWarning. */ + public deprecationWarning: string; + + /** FeatureSupport editionRemoved. */ + public editionRemoved: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSupport instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSupport instance + */ + public static create(properties?: google.protobuf.FieldOptions.IFeatureSupport): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Encodes the specified FeatureSupport message. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @param message FeatureSupport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IFeatureSupport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSupport message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @param message FeatureSupport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IFeatureSupport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Verifies a FeatureSupport message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSupport message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSupport + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Creates a plain object from a FeatureSupport message. Also converts values to other types if specified. + * @param message FeatureSupport + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.FeatureSupport, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSupport to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSupport + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } /** Properties of an OneofOptions. */ @@ -14854,6 +15227,9 @@ export namespace google { /** EnumValueOptions debugRedact */ debugRedact?: (boolean|null); + /** EnumValueOptions featureSupport */ + featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** EnumValueOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); } @@ -14876,6 +15252,9 @@ export namespace google { /** EnumValueOptions debugRedact. */ public debugRedact: boolean; + /** EnumValueOptions featureSupport. */ + public featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** EnumValueOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; @@ -15465,6 +15844,12 @@ export namespace google { /** FeatureSet jsonFormat */ jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); + + /** FeatureSet enforceNamingStyle */ + enforceNamingStyle?: (google.protobuf.FeatureSet.EnforceNamingStyle|keyof typeof google.protobuf.FeatureSet.EnforceNamingStyle|null); + + /** FeatureSet defaultSymbolVisibility */ + defaultSymbolVisibility?: (google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|keyof typeof google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|null); } /** Represents a FeatureSet. */ @@ -15494,6 +15879,12 @@ export namespace google { /** FeatureSet jsonFormat. */ public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); + /** FeatureSet enforceNamingStyle. */ + public enforceNamingStyle: (google.protobuf.FeatureSet.EnforceNamingStyle|keyof typeof google.protobuf.FeatureSet.EnforceNamingStyle); + + /** FeatureSet defaultSymbolVisibility. */ + public defaultSymbolVisibility: (google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|keyof typeof google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility); + /** * Creates a new FeatureSet instance using the specified properties. * @param [properties] Properties to set @@ -15616,6 +16007,116 @@ export namespace google { ALLOW = 1, LEGACY_BEST_EFFORT = 2 } + + /** EnforceNamingStyle enum. */ + enum EnforceNamingStyle { + ENFORCE_NAMING_STYLE_UNKNOWN = 0, + STYLE2024 = 1, + STYLE_LEGACY = 2 + } + + /** Properties of a VisibilityFeature. */ + interface IVisibilityFeature { + } + + /** Represents a VisibilityFeature. */ + class VisibilityFeature implements IVisibilityFeature { + + /** + * Constructs a new VisibilityFeature. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSet.IVisibilityFeature); + + /** + * Creates a new VisibilityFeature instance using the specified properties. + * @param [properties] Properties to set + * @returns VisibilityFeature instance + */ + public static create(properties?: google.protobuf.FeatureSet.IVisibilityFeature): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Encodes the specified VisibilityFeature message. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @param message VisibilityFeature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSet.IVisibilityFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VisibilityFeature message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @param message VisibilityFeature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSet.IVisibilityFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Verifies a VisibilityFeature message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VisibilityFeature message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VisibilityFeature + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Creates a plain object from a VisibilityFeature message. Also converts values to other types if specified. + * @param message VisibilityFeature + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet.VisibilityFeature, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VisibilityFeature to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VisibilityFeature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace VisibilityFeature { + + /** DefaultSymbolVisibility enum. */ + enum DefaultSymbolVisibility { + DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0, + EXPORT_ALL = 1, + EXPORT_TOP_LEVEL = 2, + LOCAL_ALL = 3, + STRICT = 4 + } + } } /** Properties of a FeatureSetDefaults. */ @@ -15735,8 +16236,11 @@ export namespace google { /** FeatureSetEditionDefault edition */ edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - /** FeatureSetEditionDefault features */ - features?: (google.protobuf.IFeatureSet|null); + /** FeatureSetEditionDefault overridableFeatures */ + overridableFeatures?: (google.protobuf.IFeatureSet|null); + + /** FeatureSetEditionDefault fixedFeatures */ + fixedFeatures?: (google.protobuf.IFeatureSet|null); } /** Represents a FeatureSetEditionDefault. */ @@ -15751,8 +16255,11 @@ export namespace google { /** FeatureSetEditionDefault edition. */ public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - /** FeatureSetEditionDefault features. */ - public features?: (google.protobuf.IFeatureSet|null); + /** FeatureSetEditionDefault overridableFeatures. */ + public overridableFeatures?: (google.protobuf.IFeatureSet|null); + + /** FeatureSetEditionDefault fixedFeatures. */ + public fixedFeatures?: (google.protobuf.IFeatureSet|null); /** * Creates a new FeatureSetEditionDefault instance using the specified properties. @@ -16285,6 +16792,13 @@ export namespace google { } } + /** SymbolVisibility enum. */ + enum SymbolVisibility { + VISIBILITY_UNSET = 0, + VISIBILITY_LOCAL = 1, + VISIBILITY_EXPORT = 2 + } + /** Properties of a Timestamp. */ interface ITimestamp { diff --git a/packages/google-apps-meet/protos/protos.js b/packages/google-apps-meet/protos/protos.js index 792c3608737..0849630cbe5 100644 --- a/packages/google-apps-meet/protos/protos.js +++ b/packages/google-apps-meet/protos/protos.js @@ -24903,6 +24903,7 @@ * @interface ICommonLanguageSettings * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri * @property {Array.|null} [destinations] CommonLanguageSettings destinations + * @property {google.api.ISelectiveGapicGeneration|null} [selectiveGapicGeneration] CommonLanguageSettings selectiveGapicGeneration */ /** @@ -24937,6 +24938,14 @@ */ CommonLanguageSettings.prototype.destinations = $util.emptyArray; + /** + * CommonLanguageSettings selectiveGapicGeneration. + * @member {google.api.ISelectiveGapicGeneration|null|undefined} selectiveGapicGeneration + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.selectiveGapicGeneration = null; + /** * Creates a new CommonLanguageSettings instance using the specified properties. * @function create @@ -24969,6 +24978,8 @@ writer.int32(message.destinations[i]); writer.ldelim(); } + if (message.selectiveGapicGeneration != null && Object.hasOwnProperty.call(message, "selectiveGapicGeneration")) + $root.google.api.SelectiveGapicGeneration.encode(message.selectiveGapicGeneration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -25020,6 +25031,10 @@ message.destinations.push(reader.int32()); break; } + case 3: { + message.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -25071,6 +25086,11 @@ break; } } + if (message.selectiveGapicGeneration != null && message.hasOwnProperty("selectiveGapicGeneration")) { + var error = $root.google.api.SelectiveGapicGeneration.verify(message.selectiveGapicGeneration); + if (error) + return "selectiveGapicGeneration." + error; + } return null; }; @@ -25113,6 +25133,11 @@ break; } } + if (object.selectiveGapicGeneration != null) { + if (typeof object.selectiveGapicGeneration !== "object") + throw TypeError(".google.api.CommonLanguageSettings.selectiveGapicGeneration: object expected"); + message.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.fromObject(object.selectiveGapicGeneration); + } return message; }; @@ -25131,8 +25156,10 @@ var object = {}; if (options.arrays || options.defaults) object.destinations = []; - if (options.defaults) + if (options.defaults) { object.referenceDocsUri = ""; + object.selectiveGapicGeneration = null; + } if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) object.referenceDocsUri = message.referenceDocsUri; if (message.destinations && message.destinations.length) { @@ -25140,6 +25167,8 @@ for (var j = 0; j < message.destinations.length; ++j) object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; } + if (message.selectiveGapicGeneration != null && message.hasOwnProperty("selectiveGapicGeneration")) + object.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.toObject(message.selectiveGapicGeneration, options); return object; }; @@ -26962,6 +26991,7 @@ * @memberof google.api * @interface IPythonSettings * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common + * @property {google.api.PythonSettings.IExperimentalFeatures|null} [experimentalFeatures] PythonSettings experimentalFeatures */ /** @@ -26987,6 +27017,14 @@ */ PythonSettings.prototype.common = null; + /** + * PythonSettings experimentalFeatures. + * @member {google.api.PythonSettings.IExperimentalFeatures|null|undefined} experimentalFeatures + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.experimentalFeatures = null; + /** * Creates a new PythonSettings instance using the specified properties. * @function create @@ -27013,6 +27051,8 @@ writer = $Writer.create(); if (message.common != null && Object.hasOwnProperty.call(message, "common")) $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.experimentalFeatures != null && Object.hasOwnProperty.call(message, "experimentalFeatures")) + $root.google.api.PythonSettings.ExperimentalFeatures.encode(message.experimentalFeatures, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -27053,6 +27093,10 @@ message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); break; } + case 2: { + message.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -27093,6 +27137,11 @@ if (error) return "common." + error; } + if (message.experimentalFeatures != null && message.hasOwnProperty("experimentalFeatures")) { + var error = $root.google.api.PythonSettings.ExperimentalFeatures.verify(message.experimentalFeatures); + if (error) + return "experimentalFeatures." + error; + } return null; }; @@ -27113,6 +27162,11 @@ throw TypeError(".google.api.PythonSettings.common: object expected"); message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); } + if (object.experimentalFeatures != null) { + if (typeof object.experimentalFeatures !== "object") + throw TypeError(".google.api.PythonSettings.experimentalFeatures: object expected"); + message.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.fromObject(object.experimentalFeatures); + } return message; }; @@ -27129,10 +27183,14 @@ if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.common = null; + object.experimentalFeatures = null; + } if (message.common != null && message.hasOwnProperty("common")) object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + if (message.experimentalFeatures != null && message.hasOwnProperty("experimentalFeatures")) + object.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.toObject(message.experimentalFeatures, options); return object; }; @@ -27162,6 +27220,258 @@ return typeUrlPrefix + "/google.api.PythonSettings"; }; + PythonSettings.ExperimentalFeatures = (function() { + + /** + * Properties of an ExperimentalFeatures. + * @memberof google.api.PythonSettings + * @interface IExperimentalFeatures + * @property {boolean|null} [restAsyncIoEnabled] ExperimentalFeatures restAsyncIoEnabled + * @property {boolean|null} [protobufPythonicTypesEnabled] ExperimentalFeatures protobufPythonicTypesEnabled + * @property {boolean|null} [unversionedPackageDisabled] ExperimentalFeatures unversionedPackageDisabled + */ + + /** + * Constructs a new ExperimentalFeatures. + * @memberof google.api.PythonSettings + * @classdesc Represents an ExperimentalFeatures. + * @implements IExperimentalFeatures + * @constructor + * @param {google.api.PythonSettings.IExperimentalFeatures=} [properties] Properties to set + */ + function ExperimentalFeatures(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExperimentalFeatures restAsyncIoEnabled. + * @member {boolean} restAsyncIoEnabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.restAsyncIoEnabled = false; + + /** + * ExperimentalFeatures protobufPythonicTypesEnabled. + * @member {boolean} protobufPythonicTypesEnabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.protobufPythonicTypesEnabled = false; + + /** + * ExperimentalFeatures unversionedPackageDisabled. + * @member {boolean} unversionedPackageDisabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.unversionedPackageDisabled = false; + + /** + * Creates a new ExperimentalFeatures instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures=} [properties] Properties to set + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures instance + */ + ExperimentalFeatures.create = function create(properties) { + return new ExperimentalFeatures(properties); + }; + + /** + * Encodes the specified ExperimentalFeatures message. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures} message ExperimentalFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExperimentalFeatures.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.restAsyncIoEnabled != null && Object.hasOwnProperty.call(message, "restAsyncIoEnabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.restAsyncIoEnabled); + if (message.protobufPythonicTypesEnabled != null && Object.hasOwnProperty.call(message, "protobufPythonicTypesEnabled")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.protobufPythonicTypesEnabled); + if (message.unversionedPackageDisabled != null && Object.hasOwnProperty.call(message, "unversionedPackageDisabled")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.unversionedPackageDisabled); + return writer; + }; + + /** + * Encodes the specified ExperimentalFeatures message, length delimited. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures} message ExperimentalFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExperimentalFeatures.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExperimentalFeatures.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings.ExperimentalFeatures(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.restAsyncIoEnabled = reader.bool(); + break; + } + case 2: { + message.protobufPythonicTypesEnabled = reader.bool(); + break; + } + case 3: { + message.unversionedPackageDisabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExperimentalFeatures.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExperimentalFeatures message. + * @function verify + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExperimentalFeatures.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.restAsyncIoEnabled != null && message.hasOwnProperty("restAsyncIoEnabled")) + if (typeof message.restAsyncIoEnabled !== "boolean") + return "restAsyncIoEnabled: boolean expected"; + if (message.protobufPythonicTypesEnabled != null && message.hasOwnProperty("protobufPythonicTypesEnabled")) + if (typeof message.protobufPythonicTypesEnabled !== "boolean") + return "protobufPythonicTypesEnabled: boolean expected"; + if (message.unversionedPackageDisabled != null && message.hasOwnProperty("unversionedPackageDisabled")) + if (typeof message.unversionedPackageDisabled !== "boolean") + return "unversionedPackageDisabled: boolean expected"; + return null; + }; + + /** + * Creates an ExperimentalFeatures message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + */ + ExperimentalFeatures.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PythonSettings.ExperimentalFeatures) + return object; + var message = new $root.google.api.PythonSettings.ExperimentalFeatures(); + if (object.restAsyncIoEnabled != null) + message.restAsyncIoEnabled = Boolean(object.restAsyncIoEnabled); + if (object.protobufPythonicTypesEnabled != null) + message.protobufPythonicTypesEnabled = Boolean(object.protobufPythonicTypesEnabled); + if (object.unversionedPackageDisabled != null) + message.unversionedPackageDisabled = Boolean(object.unversionedPackageDisabled); + return message; + }; + + /** + * Creates a plain object from an ExperimentalFeatures message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.ExperimentalFeatures} message ExperimentalFeatures + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExperimentalFeatures.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.restAsyncIoEnabled = false; + object.protobufPythonicTypesEnabled = false; + object.unversionedPackageDisabled = false; + } + if (message.restAsyncIoEnabled != null && message.hasOwnProperty("restAsyncIoEnabled")) + object.restAsyncIoEnabled = message.restAsyncIoEnabled; + if (message.protobufPythonicTypesEnabled != null && message.hasOwnProperty("protobufPythonicTypesEnabled")) + object.protobufPythonicTypesEnabled = message.protobufPythonicTypesEnabled; + if (message.unversionedPackageDisabled != null && message.hasOwnProperty("unversionedPackageDisabled")) + object.unversionedPackageDisabled = message.unversionedPackageDisabled; + return object; + }; + + /** + * Converts this ExperimentalFeatures to JSON. + * @function toJSON + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + * @returns {Object.} JSON object + */ + ExperimentalFeatures.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExperimentalFeatures + * @function getTypeUrl + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExperimentalFeatures.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings.ExperimentalFeatures"; + }; + + return ExperimentalFeatures; + })(); + return PythonSettings; })(); @@ -28038,6 +28348,7 @@ * @memberof google.api * @interface IGoSettings * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common + * @property {Object.|null} [renamedServices] GoSettings renamedServices */ /** @@ -28049,6 +28360,7 @@ * @param {google.api.IGoSettings=} [properties] Properties to set */ function GoSettings(properties) { + this.renamedServices = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -28063,6 +28375,14 @@ */ GoSettings.prototype.common = null; + /** + * GoSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.renamedServices = $util.emptyObject; + /** * Creates a new GoSettings instance using the specified properties. * @function create @@ -28089,6 +28409,9 @@ writer = $Writer.create(); if (message.common != null && Object.hasOwnProperty.call(message, "common")) $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); return writer; }; @@ -28119,7 +28442,7 @@ GoSettings.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(), key, value; while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) @@ -28129,6 +28452,29 @@ message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); break; } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedServices[key] = value; + break; + } default: reader.skipType(tag & 7); break; @@ -28169,6 +28515,14 @@ if (error) return "common." + error; } + if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } return null; }; @@ -28189,6 +28543,13 @@ throw TypeError(".google.api.GoSettings.common: object expected"); message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); } + if (object.renamedServices) { + if (typeof object.renamedServices !== "object") + throw TypeError(".google.api.GoSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } return message; }; @@ -28205,10 +28566,18 @@ if (!options) options = {}; var object = {}; + if (options.objects || options.defaults) + object.renamedServices = {}; if (options.defaults) object.common = null; if (message.common != null && message.hasOwnProperty("common")) object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } return object; }; @@ -28847,30 +29216,275 @@ return values; })(); - /** - * LaunchStage enum. - * @name google.api.LaunchStage - * @enum {number} - * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value - * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value - * @property {number} PRELAUNCH=7 PRELAUNCH value - * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value - * @property {number} ALPHA=2 ALPHA value - * @property {number} BETA=3 BETA value - * @property {number} GA=4 GA value - * @property {number} DEPRECATED=5 DEPRECATED value - */ - api.LaunchStage = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; - values[valuesById[6] = "UNIMPLEMENTED"] = 6; - values[valuesById[7] = "PRELAUNCH"] = 7; - values[valuesById[1] = "EARLY_ACCESS"] = 1; - values[valuesById[2] = "ALPHA"] = 2; - values[valuesById[3] = "BETA"] = 3; - values[valuesById[4] = "GA"] = 4; - values[valuesById[5] = "DEPRECATED"] = 5; - return values; + api.SelectiveGapicGeneration = (function() { + + /** + * Properties of a SelectiveGapicGeneration. + * @memberof google.api + * @interface ISelectiveGapicGeneration + * @property {Array.|null} [methods] SelectiveGapicGeneration methods + * @property {boolean|null} [generateOmittedAsInternal] SelectiveGapicGeneration generateOmittedAsInternal + */ + + /** + * Constructs a new SelectiveGapicGeneration. + * @memberof google.api + * @classdesc Represents a SelectiveGapicGeneration. + * @implements ISelectiveGapicGeneration + * @constructor + * @param {google.api.ISelectiveGapicGeneration=} [properties] Properties to set + */ + function SelectiveGapicGeneration(properties) { + this.methods = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SelectiveGapicGeneration methods. + * @member {Array.} methods + * @memberof google.api.SelectiveGapicGeneration + * @instance + */ + SelectiveGapicGeneration.prototype.methods = $util.emptyArray; + + /** + * SelectiveGapicGeneration generateOmittedAsInternal. + * @member {boolean} generateOmittedAsInternal + * @memberof google.api.SelectiveGapicGeneration + * @instance + */ + SelectiveGapicGeneration.prototype.generateOmittedAsInternal = false; + + /** + * Creates a new SelectiveGapicGeneration instance using the specified properties. + * @function create + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration=} [properties] Properties to set + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration instance + */ + SelectiveGapicGeneration.create = function create(properties) { + return new SelectiveGapicGeneration(properties); + }; + + /** + * Encodes the specified SelectiveGapicGeneration message. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @function encode + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration} message SelectiveGapicGeneration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelectiveGapicGeneration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.methods != null && message.methods.length) + for (var i = 0; i < message.methods.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.methods[i]); + if (message.generateOmittedAsInternal != null && Object.hasOwnProperty.call(message, "generateOmittedAsInternal")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.generateOmittedAsInternal); + return writer; + }; + + /** + * Encodes the specified SelectiveGapicGeneration message, length delimited. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration} message SelectiveGapicGeneration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelectiveGapicGeneration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer. + * @function decode + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelectiveGapicGeneration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.SelectiveGapicGeneration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.methods && message.methods.length)) + message.methods = []; + message.methods.push(reader.string()); + break; + } + case 2: { + message.generateOmittedAsInternal = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelectiveGapicGeneration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SelectiveGapicGeneration message. + * @function verify + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SelectiveGapicGeneration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.methods != null && message.hasOwnProperty("methods")) { + if (!Array.isArray(message.methods)) + return "methods: array expected"; + for (var i = 0; i < message.methods.length; ++i) + if (!$util.isString(message.methods[i])) + return "methods: string[] expected"; + } + if (message.generateOmittedAsInternal != null && message.hasOwnProperty("generateOmittedAsInternal")) + if (typeof message.generateOmittedAsInternal !== "boolean") + return "generateOmittedAsInternal: boolean expected"; + return null; + }; + + /** + * Creates a SelectiveGapicGeneration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {Object.} object Plain object + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + */ + SelectiveGapicGeneration.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.SelectiveGapicGeneration) + return object; + var message = new $root.google.api.SelectiveGapicGeneration(); + if (object.methods) { + if (!Array.isArray(object.methods)) + throw TypeError(".google.api.SelectiveGapicGeneration.methods: array expected"); + message.methods = []; + for (var i = 0; i < object.methods.length; ++i) + message.methods[i] = String(object.methods[i]); + } + if (object.generateOmittedAsInternal != null) + message.generateOmittedAsInternal = Boolean(object.generateOmittedAsInternal); + return message; + }; + + /** + * Creates a plain object from a SelectiveGapicGeneration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.SelectiveGapicGeneration} message SelectiveGapicGeneration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SelectiveGapicGeneration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.methods = []; + if (options.defaults) + object.generateOmittedAsInternal = false; + if (message.methods && message.methods.length) { + object.methods = []; + for (var j = 0; j < message.methods.length; ++j) + object.methods[j] = message.methods[j]; + } + if (message.generateOmittedAsInternal != null && message.hasOwnProperty("generateOmittedAsInternal")) + object.generateOmittedAsInternal = message.generateOmittedAsInternal; + return object; + }; + + /** + * Converts this SelectiveGapicGeneration to JSON. + * @function toJSON + * @memberof google.api.SelectiveGapicGeneration + * @instance + * @returns {Object.} JSON object + */ + SelectiveGapicGeneration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SelectiveGapicGeneration + * @function getTypeUrl + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SelectiveGapicGeneration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.SelectiveGapicGeneration"; + }; + + return SelectiveGapicGeneration; + })(); + + /** + * LaunchStage enum. + * @name google.api.LaunchStage + * @enum {number} + * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value + * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value + * @property {number} PRELAUNCH=7 PRELAUNCH value + * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value + * @property {number} ALPHA=2 ALPHA value + * @property {number} BETA=3 BETA value + * @property {number} GA=4 GA value + * @property {number} DEPRECATED=5 DEPRECATED value + */ + api.LaunchStage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; + values[valuesById[6] = "UNIMPLEMENTED"] = 6; + values[valuesById[7] = "PRELAUNCH"] = 7; + values[valuesById[1] = "EARLY_ACCESS"] = 1; + values[valuesById[2] = "ALPHA"] = 2; + values[valuesById[3] = "BETA"] = 3; + values[valuesById[4] = "GA"] = 4; + values[valuesById[5] = "DEPRECATED"] = 5; + return values; })(); return api; @@ -29116,6 +29730,7 @@ * @name google.protobuf.Edition * @enum {number} * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value + * @property {number} EDITION_LEGACY=900 EDITION_LEGACY value * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value * @property {number} EDITION_2023=1000 EDITION_2023 value @@ -29130,6 +29745,7 @@ protobuf.Edition = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "EDITION_UNKNOWN"] = 0; + values[valuesById[900] = "EDITION_LEGACY"] = 900; values[valuesById[998] = "EDITION_PROTO2"] = 998; values[valuesById[999] = "EDITION_PROTO3"] = 999; values[valuesById[1000] = "EDITION_2023"] = 1000; @@ -29154,6 +29770,7 @@ * @property {Array.|null} [dependency] FileDescriptorProto dependency * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [optionDependency] FileDescriptorProto optionDependency * @property {Array.|null} [messageType] FileDescriptorProto messageType * @property {Array.|null} [enumType] FileDescriptorProto enumType * @property {Array.|null} [service] FileDescriptorProto service @@ -29176,6 +29793,7 @@ this.dependency = []; this.publicDependency = []; this.weakDependency = []; + this.optionDependency = []; this.messageType = []; this.enumType = []; this.service = []; @@ -29226,6 +29844,14 @@ */ FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + /** + * FileDescriptorProto optionDependency. + * @member {Array.} optionDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.optionDependency = $util.emptyArray; + /** * FileDescriptorProto messageType. * @member {Array.} messageType @@ -29347,6 +29973,9 @@ writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); + if (message.optionDependency != null && message.optionDependency.length) + for (var i = 0; i < message.optionDependency.length; ++i) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.optionDependency[i]); return writer; }; @@ -29419,6 +30048,12 @@ message.weakDependency.push(reader.int32()); break; } + case 15: { + if (!(message.optionDependency && message.optionDependency.length)) + message.optionDependency = []; + message.optionDependency.push(reader.string()); + break; + } case 4: { if (!(message.messageType && message.messageType.length)) message.messageType = []; @@ -29521,6 +30156,13 @@ if (!$util.isInteger(message.weakDependency[i])) return "weakDependency: integer[] expected"; } + if (message.optionDependency != null && message.hasOwnProperty("optionDependency")) { + if (!Array.isArray(message.optionDependency)) + return "optionDependency: array expected"; + for (var i = 0; i < message.optionDependency.length; ++i) + if (!$util.isString(message.optionDependency[i])) + return "optionDependency: string[] expected"; + } if (message.messageType != null && message.hasOwnProperty("messageType")) { if (!Array.isArray(message.messageType)) return "messageType: array expected"; @@ -29575,6 +30217,7 @@ default: return "edition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -29627,6 +30270,13 @@ for (var i = 0; i < object.weakDependency.length; ++i) message.weakDependency[i] = object.weakDependency[i] | 0; } + if (object.optionDependency) { + if (!Array.isArray(object.optionDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.optionDependency: array expected"); + message.optionDependency = []; + for (var i = 0; i < object.optionDependency.length; ++i) + message.optionDependency[i] = String(object.optionDependency[i]); + } if (object.messageType) { if (!Array.isArray(object.messageType)) throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); @@ -29690,6 +30340,10 @@ case 0: message.edition = 0; break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; case "EDITION_PROTO2": case 998: message.edition = 998; @@ -29755,6 +30409,7 @@ object.extension = []; object.publicDependency = []; object.weakDependency = []; + object.optionDependency = []; } if (options.defaults) { object.name = ""; @@ -29811,6 +30466,11 @@ object.syntax = message.syntax; if (message.edition != null && message.hasOwnProperty("edition")) object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + if (message.optionDependency && message.optionDependency.length) { + object.optionDependency = []; + for (var j = 0; j < message.optionDependency.length; ++j) + object.optionDependency[j] = message.optionDependency[j]; + } return object; }; @@ -29859,6 +30519,7 @@ * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options * @property {Array.|null} [reservedRange] DescriptorProto reservedRange * @property {Array.|null} [reservedName] DescriptorProto reservedName + * @property {google.protobuf.SymbolVisibility|null} [visibility] DescriptorProto visibility */ /** @@ -29964,6 +30625,14 @@ */ DescriptorProto.prototype.reservedName = $util.emptyArray; + /** + * DescriptorProto visibility. + * @member {google.protobuf.SymbolVisibility} visibility + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.visibility = 0; + /** * Creates a new DescriptorProto instance using the specified properties. * @function create @@ -30016,6 +30685,8 @@ if (message.reservedName != null && message.reservedName.length) for (var i = 0; i < message.reservedName.length; ++i) writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.visibility); return writer; }; @@ -30108,6 +30779,10 @@ message.reservedName.push(reader.string()); break; } + case 11: { + message.visibility = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -30221,6 +30896,15 @@ if (!$util.isString(message.reservedName[i])) return "reservedName: string[] expected"; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + switch (message.visibility) { + default: + return "visibility: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; @@ -30320,6 +31004,26 @@ for (var i = 0; i < object.reservedName.length; ++i) message.reservedName[i] = String(object.reservedName[i]); } + switch (object.visibility) { + default: + if (typeof object.visibility === "number") { + message.visibility = object.visibility; + break; + } + break; + case "VISIBILITY_UNSET": + case 0: + message.visibility = 0; + break; + case "VISIBILITY_LOCAL": + case 1: + message.visibility = 1; + break; + case "VISIBILITY_EXPORT": + case 2: + message.visibility = 2; + break; + } return message; }; @@ -30349,6 +31053,7 @@ if (options.defaults) { object.name = ""; object.options = null; + object.visibility = options.enums === String ? "VISIBILITY_UNSET" : 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -30394,6 +31099,8 @@ for (var j = 0; j < message.reservedName.length; ++j) object.reservedName[j] = message.reservedName[j]; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + object.visibility = options.enums === String ? $root.google.protobuf.SymbolVisibility[message.visibility] === undefined ? message.visibility : $root.google.protobuf.SymbolVisibility[message.visibility] : message.visibility; return object; }; @@ -32438,6 +33145,7 @@ * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + * @property {google.protobuf.SymbolVisibility|null} [visibility] EnumDescriptorProto visibility */ /** @@ -32498,6 +33206,14 @@ */ EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + /** + * EnumDescriptorProto visibility. + * @member {google.protobuf.SymbolVisibility} visibility + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.visibility = 0; + /** * Creates a new EnumDescriptorProto instance using the specified properties. * @function create @@ -32535,6 +33251,8 @@ if (message.reservedName != null && message.reservedName.length) for (var i = 0; i < message.reservedName.length; ++i) writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.visibility); return writer; }; @@ -32597,6 +33315,10 @@ message.reservedName.push(reader.string()); break; } + case 6: { + message.visibility = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -32665,6 +33387,15 @@ if (!$util.isString(message.reservedName[i])) return "reservedName: string[] expected"; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + switch (message.visibility) { + default: + return "visibility: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; @@ -32714,6 +33445,26 @@ for (var i = 0; i < object.reservedName.length; ++i) message.reservedName[i] = String(object.reservedName[i]); } + switch (object.visibility) { + default: + if (typeof object.visibility === "number") { + message.visibility = object.visibility; + break; + } + break; + case "VISIBILITY_UNSET": + case 0: + message.visibility = 0; + break; + case "VISIBILITY_LOCAL": + case 1: + message.visibility = 1; + break; + case "VISIBILITY_EXPORT": + case 2: + message.visibility = 2; + break; + } return message; }; @@ -32738,6 +33489,7 @@ if (options.defaults) { object.name = ""; object.options = null; + object.visibility = options.enums === String ? "VISIBILITY_UNSET" : 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -32758,6 +33510,8 @@ for (var j = 0; j < message.reservedName.length; ++j) object.reservedName[j] = message.reservedName[j]; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + object.visibility = options.enums === String ? $root.google.protobuf.SymbolVisibility[message.visibility] === undefined ? message.visibility : $root.google.protobuf.SymbolVisibility[message.visibility] : message.visibility; return object; }; @@ -35076,6 +35830,7 @@ * @property {Array.|null} [targets] FieldOptions targets * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features + * @property {google.protobuf.FieldOptions.IFeatureSupport|null} [featureSupport] FieldOptions featureSupport * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference @@ -35196,6 +35951,14 @@ */ FieldOptions.prototype.features = null; + /** + * FieldOptions featureSupport. + * @member {google.protobuf.FieldOptions.IFeatureSupport|null|undefined} featureSupport + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.featureSupport = null; + /** * FieldOptions uninterpretedOption. * @member {Array.} uninterpretedOption @@ -35270,6 +36033,8 @@ $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); if (message.features != null && Object.hasOwnProperty.call(message, "features")) $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) + $root.google.protobuf.FieldOptions.FeatureSupport.encode(message.featureSupport, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); @@ -35371,6 +36136,10 @@ message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); break; } + case 22: { + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.decode(reader, reader.uint32()); + break; + } case 999: { if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; @@ -35506,6 +36275,11 @@ if (error) return "features." + error; } + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) { + var error = $root.google.protobuf.FieldOptions.FeatureSupport.verify(message.featureSupport); + if (error) + return "featureSupport." + error; + } if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; @@ -35694,6 +36468,11 @@ throw TypeError(".google.protobuf.FieldOptions.features: object expected"); message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); } + if (object.featureSupport != null) { + if (typeof object.featureSupport !== "object") + throw TypeError(".google.protobuf.FieldOptions.featureSupport: object expected"); + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.fromObject(object.featureSupport); + } if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); @@ -35791,6 +36570,7 @@ object.debugRedact = false; object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; object.features = null; + object.featureSupport = null; object[".google.api.resourceReference"] = null; } if (message.ctype != null && message.hasOwnProperty("ctype")) @@ -35823,6 +36603,8 @@ } if (message.features != null && message.hasOwnProperty("features")) object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) + object.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.toObject(message.featureSupport, options); if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) @@ -36095,6 +36877,7 @@ default: return "edition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -36136,103 +36919,589 @@ case 0: message.edition = 0; break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; case "EDITION_PROTO2": case 998: message.edition = 998; break; case "EDITION_PROTO3": case 999: - message.edition = 999; + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this EditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + * @returns {Object.} JSON object + */ + EditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; + }; + + return EditionDefault; + })(); + + FieldOptions.FeatureSupport = (function() { + + /** + * Properties of a FeatureSupport. + * @memberof google.protobuf.FieldOptions + * @interface IFeatureSupport + * @property {google.protobuf.Edition|null} [editionIntroduced] FeatureSupport editionIntroduced + * @property {google.protobuf.Edition|null} [editionDeprecated] FeatureSupport editionDeprecated + * @property {string|null} [deprecationWarning] FeatureSupport deprecationWarning + * @property {google.protobuf.Edition|null} [editionRemoved] FeatureSupport editionRemoved + */ + + /** + * Constructs a new FeatureSupport. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents a FeatureSupport. + * @implements IFeatureSupport + * @constructor + * @param {google.protobuf.FieldOptions.IFeatureSupport=} [properties] Properties to set + */ + function FeatureSupport(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSupport editionIntroduced. + * @member {google.protobuf.Edition} editionIntroduced + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionIntroduced = 0; + + /** + * FeatureSupport editionDeprecated. + * @member {google.protobuf.Edition} editionDeprecated + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionDeprecated = 0; + + /** + * FeatureSupport deprecationWarning. + * @member {string} deprecationWarning + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.deprecationWarning = ""; + + /** + * FeatureSupport editionRemoved. + * @member {google.protobuf.Edition} editionRemoved + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionRemoved = 0; + + /** + * Creates a new FeatureSupport instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport instance + */ + FeatureSupport.create = function create(properties) { + return new FeatureSupport(properties); + }; + + /** + * Encodes the specified FeatureSupport message. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport} message FeatureSupport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSupport.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.editionIntroduced != null && Object.hasOwnProperty.call(message, "editionIntroduced")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.editionIntroduced); + if (message.editionDeprecated != null && Object.hasOwnProperty.call(message, "editionDeprecated")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.editionDeprecated); + if (message.deprecationWarning != null && Object.hasOwnProperty.call(message, "deprecationWarning")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.deprecationWarning); + if (message.editionRemoved != null && Object.hasOwnProperty.call(message, "editionRemoved")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.editionRemoved); + return writer; + }; + + /** + * Encodes the specified FeatureSupport message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport} message FeatureSupport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSupport.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSupport.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.FeatureSupport(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.editionIntroduced = reader.int32(); + break; + } + case 2: { + message.editionDeprecated = reader.int32(); + break; + } + case 3: { + message.deprecationWarning = reader.string(); + break; + } + case 4: { + message.editionRemoved = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSupport.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSupport message. + * @function verify + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSupport.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.editionIntroduced != null && message.hasOwnProperty("editionIntroduced")) + switch (message.editionIntroduced) { + default: + return "editionIntroduced: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.editionDeprecated != null && message.hasOwnProperty("editionDeprecated")) + switch (message.editionDeprecated) { + default: + return "editionDeprecated: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.deprecationWarning != null && message.hasOwnProperty("deprecationWarning")) + if (!$util.isString(message.deprecationWarning)) + return "deprecationWarning: string expected"; + if (message.editionRemoved != null && message.hasOwnProperty("editionRemoved")) + switch (message.editionRemoved) { + default: + return "editionRemoved: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FeatureSupport message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + */ + FeatureSupport.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions.FeatureSupport) + return object; + var message = new $root.google.protobuf.FieldOptions.FeatureSupport(); + switch (object.editionIntroduced) { + default: + if (typeof object.editionIntroduced === "number") { + message.editionIntroduced = object.editionIntroduced; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionIntroduced = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionIntroduced = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionIntroduced = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionIntroduced = 999; + break; + case "EDITION_2023": + case 1000: + message.editionIntroduced = 1000; + break; + case "EDITION_2024": + case 1001: + message.editionIntroduced = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.editionIntroduced = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.editionIntroduced = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.editionIntroduced = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.editionIntroduced = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.editionIntroduced = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.editionIntroduced = 2147483647; + break; + } + switch (object.editionDeprecated) { + default: + if (typeof object.editionDeprecated === "number") { + message.editionDeprecated = object.editionDeprecated; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionDeprecated = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionDeprecated = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionDeprecated = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionDeprecated = 999; + break; + case "EDITION_2023": + case 1000: + message.editionDeprecated = 1000; + break; + case "EDITION_2024": + case 1001: + message.editionDeprecated = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.editionDeprecated = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.editionDeprecated = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.editionDeprecated = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.editionDeprecated = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.editionDeprecated = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.editionDeprecated = 2147483647; + break; + } + if (object.deprecationWarning != null) + message.deprecationWarning = String(object.deprecationWarning); + switch (object.editionRemoved) { + default: + if (typeof object.editionRemoved === "number") { + message.editionRemoved = object.editionRemoved; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionRemoved = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionRemoved = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionRemoved = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionRemoved = 999; break; case "EDITION_2023": case 1000: - message.edition = 1000; + message.editionRemoved = 1000; break; case "EDITION_2024": case 1001: - message.edition = 1001; + message.editionRemoved = 1001; break; case "EDITION_1_TEST_ONLY": case 1: - message.edition = 1; + message.editionRemoved = 1; break; case "EDITION_2_TEST_ONLY": case 2: - message.edition = 2; + message.editionRemoved = 2; break; case "EDITION_99997_TEST_ONLY": case 99997: - message.edition = 99997; + message.editionRemoved = 99997; break; case "EDITION_99998_TEST_ONLY": case 99998: - message.edition = 99998; + message.editionRemoved = 99998; break; case "EDITION_99999_TEST_ONLY": case 99999: - message.edition = 99999; + message.editionRemoved = 99999; break; case "EDITION_MAX": case 2147483647: - message.edition = 2147483647; + message.editionRemoved = 2147483647; break; } - if (object.value != null) - message.value = String(object.value); return message; }; /** - * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * Creates a plain object from a FeatureSupport message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.FieldOptions.EditionDefault + * @memberof google.protobuf.FieldOptions.FeatureSupport * @static - * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault + * @param {google.protobuf.FieldOptions.FeatureSupport} message FeatureSupport * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EditionDefault.toObject = function toObject(message, options) { + FeatureSupport.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.value = ""; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + object.editionIntroduced = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.editionDeprecated = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.deprecationWarning = ""; + object.editionRemoved = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.editionIntroduced != null && message.hasOwnProperty("editionIntroduced")) + object.editionIntroduced = options.enums === String ? $root.google.protobuf.Edition[message.editionIntroduced] === undefined ? message.editionIntroduced : $root.google.protobuf.Edition[message.editionIntroduced] : message.editionIntroduced; + if (message.editionDeprecated != null && message.hasOwnProperty("editionDeprecated")) + object.editionDeprecated = options.enums === String ? $root.google.protobuf.Edition[message.editionDeprecated] === undefined ? message.editionDeprecated : $root.google.protobuf.Edition[message.editionDeprecated] : message.editionDeprecated; + if (message.deprecationWarning != null && message.hasOwnProperty("deprecationWarning")) + object.deprecationWarning = message.deprecationWarning; + if (message.editionRemoved != null && message.hasOwnProperty("editionRemoved")) + object.editionRemoved = options.enums === String ? $root.google.protobuf.Edition[message.editionRemoved] === undefined ? message.editionRemoved : $root.google.protobuf.Edition[message.editionRemoved] : message.editionRemoved; return object; }; /** - * Converts this EditionDefault to JSON. + * Converts this FeatureSupport to JSON. * @function toJSON - * @memberof google.protobuf.FieldOptions.EditionDefault + * @memberof google.protobuf.FieldOptions.FeatureSupport * @instance * @returns {Object.} JSON object */ - EditionDefault.prototype.toJSON = function toJSON() { + FeatureSupport.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for EditionDefault + * Gets the default type url for FeatureSupport * @function getTypeUrl - * @memberof google.protobuf.FieldOptions.EditionDefault + * @memberof google.protobuf.FieldOptions.FeatureSupport * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + FeatureSupport.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; + return typeUrlPrefix + "/google.protobuf.FieldOptions.FeatureSupport"; }; - return EditionDefault; + return FeatureSupport; })(); return FieldOptions; @@ -36827,6 +38096,7 @@ * @property {boolean|null} [deprecated] EnumValueOptions deprecated * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact + * @property {google.protobuf.FieldOptions.IFeatureSupport|null} [featureSupport] EnumValueOptions featureSupport * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption */ @@ -36870,6 +38140,14 @@ */ EnumValueOptions.prototype.debugRedact = false; + /** + * EnumValueOptions featureSupport. + * @member {google.protobuf.FieldOptions.IFeatureSupport|null|undefined} featureSupport + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.featureSupport = null; + /** * EnumValueOptions uninterpretedOption. * @member {Array.} uninterpretedOption @@ -36908,6 +38186,8 @@ $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); + if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) + $root.google.protobuf.FieldOptions.FeatureSupport.encode(message.featureSupport, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); @@ -36959,6 +38239,10 @@ message.debugRedact = reader.bool(); break; } + case 4: { + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.decode(reader, reader.uint32()); + break; + } case 999: { if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; @@ -37011,6 +38295,11 @@ if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) if (typeof message.debugRedact !== "boolean") return "debugRedact: boolean expected"; + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) { + var error = $root.google.protobuf.FieldOptions.FeatureSupport.verify(message.featureSupport); + if (error) + return "featureSupport." + error; + } if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; @@ -37044,6 +38333,11 @@ } if (object.debugRedact != null) message.debugRedact = Boolean(object.debugRedact); + if (object.featureSupport != null) { + if (typeof object.featureSupport !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.featureSupport: object expected"); + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.fromObject(object.featureSupport); + } if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); @@ -37076,6 +38370,7 @@ object.deprecated = false; object.features = null; object.debugRedact = false; + object.featureSupport = null; } if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; @@ -37083,6 +38378,8 @@ object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) object.debugRedact = message.debugRedact; + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) + object.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.toObject(message.featureSupport, options); if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) @@ -38522,6 +39819,8 @@ * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat + * @property {google.protobuf.FeatureSet.EnforceNamingStyle|null} [enforceNamingStyle] FeatureSet enforceNamingStyle + * @property {google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|null} [defaultSymbolVisibility] FeatureSet defaultSymbolVisibility */ /** @@ -38587,6 +39886,22 @@ */ FeatureSet.prototype.jsonFormat = 0; + /** + * FeatureSet enforceNamingStyle. + * @member {google.protobuf.FeatureSet.EnforceNamingStyle} enforceNamingStyle + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enforceNamingStyle = 0; + + /** + * FeatureSet defaultSymbolVisibility. + * @member {google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility} defaultSymbolVisibility + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.defaultSymbolVisibility = 0; + /** * Creates a new FeatureSet instance using the specified properties. * @function create @@ -38623,6 +39938,10 @@ writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); + if (message.enforceNamingStyle != null && Object.hasOwnProperty.call(message, "enforceNamingStyle")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.enforceNamingStyle); + if (message.defaultSymbolVisibility != null && Object.hasOwnProperty.call(message, "defaultSymbolVisibility")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.defaultSymbolVisibility); return writer; }; @@ -38683,6 +40002,14 @@ message.jsonFormat = reader.int32(); break; } + case 7: { + message.enforceNamingStyle = reader.int32(); + break; + } + case 8: { + message.defaultSymbolVisibility = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -38773,6 +40100,26 @@ case 2: break; } + if (message.enforceNamingStyle != null && message.hasOwnProperty("enforceNamingStyle")) + switch (message.enforceNamingStyle) { + default: + return "enforceNamingStyle: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.defaultSymbolVisibility != null && message.hasOwnProperty("defaultSymbolVisibility")) + switch (message.defaultSymbolVisibility) { + default: + return "defaultSymbolVisibility: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } return null; }; @@ -38912,6 +40259,54 @@ message.jsonFormat = 2; break; } + switch (object.enforceNamingStyle) { + default: + if (typeof object.enforceNamingStyle === "number") { + message.enforceNamingStyle = object.enforceNamingStyle; + break; + } + break; + case "ENFORCE_NAMING_STYLE_UNKNOWN": + case 0: + message.enforceNamingStyle = 0; + break; + case "STYLE2024": + case 1: + message.enforceNamingStyle = 1; + break; + case "STYLE_LEGACY": + case 2: + message.enforceNamingStyle = 2; + break; + } + switch (object.defaultSymbolVisibility) { + default: + if (typeof object.defaultSymbolVisibility === "number") { + message.defaultSymbolVisibility = object.defaultSymbolVisibility; + break; + } + break; + case "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN": + case 0: + message.defaultSymbolVisibility = 0; + break; + case "EXPORT_ALL": + case 1: + message.defaultSymbolVisibility = 1; + break; + case "EXPORT_TOP_LEVEL": + case 2: + message.defaultSymbolVisibility = 2; + break; + case "LOCAL_ALL": + case 3: + message.defaultSymbolVisibility = 3; + break; + case "STRICT": + case 4: + message.defaultSymbolVisibility = 4; + break; + } return message; }; @@ -38935,6 +40330,8 @@ object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; + object.enforceNamingStyle = options.enums === String ? "ENFORCE_NAMING_STYLE_UNKNOWN" : 0; + object.defaultSymbolVisibility = options.enums === String ? "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN" : 0; } if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; @@ -38948,6 +40345,10 @@ object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; + if (message.enforceNamingStyle != null && message.hasOwnProperty("enforceNamingStyle")) + object.enforceNamingStyle = options.enums === String ? $root.google.protobuf.FeatureSet.EnforceNamingStyle[message.enforceNamingStyle] === undefined ? message.enforceNamingStyle : $root.google.protobuf.FeatureSet.EnforceNamingStyle[message.enforceNamingStyle] : message.enforceNamingStyle; + if (message.defaultSymbolVisibility != null && message.hasOwnProperty("defaultSymbolVisibility")) + object.defaultSymbolVisibility = options.enums === String ? $root.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility[message.defaultSymbolVisibility] === undefined ? message.defaultSymbolVisibility : $root.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility[message.defaultSymbolVisibility] : message.defaultSymbolVisibility; return object; }; @@ -39075,6 +40476,219 @@ return values; })(); + /** + * EnforceNamingStyle enum. + * @name google.protobuf.FeatureSet.EnforceNamingStyle + * @enum {number} + * @property {number} ENFORCE_NAMING_STYLE_UNKNOWN=0 ENFORCE_NAMING_STYLE_UNKNOWN value + * @property {number} STYLE2024=1 STYLE2024 value + * @property {number} STYLE_LEGACY=2 STYLE_LEGACY value + */ + FeatureSet.EnforceNamingStyle = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENFORCE_NAMING_STYLE_UNKNOWN"] = 0; + values[valuesById[1] = "STYLE2024"] = 1; + values[valuesById[2] = "STYLE_LEGACY"] = 2; + return values; + })(); + + FeatureSet.VisibilityFeature = (function() { + + /** + * Properties of a VisibilityFeature. + * @memberof google.protobuf.FeatureSet + * @interface IVisibilityFeature + */ + + /** + * Constructs a new VisibilityFeature. + * @memberof google.protobuf.FeatureSet + * @classdesc Represents a VisibilityFeature. + * @implements IVisibilityFeature + * @constructor + * @param {google.protobuf.FeatureSet.IVisibilityFeature=} [properties] Properties to set + */ + function VisibilityFeature(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new VisibilityFeature instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature instance + */ + VisibilityFeature.create = function create(properties) { + return new VisibilityFeature(properties); + }; + + /** + * Encodes the specified VisibilityFeature message. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature} message VisibilityFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VisibilityFeature.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified VisibilityFeature message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature} message VisibilityFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VisibilityFeature.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VisibilityFeature.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet.VisibilityFeature(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VisibilityFeature.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VisibilityFeature message. + * @function verify + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VisibilityFeature.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a VisibilityFeature message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + */ + VisibilityFeature.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSet.VisibilityFeature) + return object; + return new $root.google.protobuf.FeatureSet.VisibilityFeature(); + }; + + /** + * Creates a plain object from a VisibilityFeature message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.VisibilityFeature} message VisibilityFeature + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VisibilityFeature.toObject = function toObject() { + return {}; + }; + + /** + * Converts this VisibilityFeature to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @instance + * @returns {Object.} JSON object + */ + VisibilityFeature.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VisibilityFeature + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VisibilityFeature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet.VisibilityFeature"; + }; + + /** + * DefaultSymbolVisibility enum. + * @name google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility + * @enum {number} + * @property {number} DEFAULT_SYMBOL_VISIBILITY_UNKNOWN=0 DEFAULT_SYMBOL_VISIBILITY_UNKNOWN value + * @property {number} EXPORT_ALL=1 EXPORT_ALL value + * @property {number} EXPORT_TOP_LEVEL=2 EXPORT_TOP_LEVEL value + * @property {number} LOCAL_ALL=3 LOCAL_ALL value + * @property {number} STRICT=4 STRICT value + */ + VisibilityFeature.DefaultSymbolVisibility = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN"] = 0; + values[valuesById[1] = "EXPORT_ALL"] = 1; + values[valuesById[2] = "EXPORT_TOP_LEVEL"] = 2; + values[valuesById[3] = "LOCAL_ALL"] = 3; + values[valuesById[4] = "STRICT"] = 4; + return values; + })(); + + return VisibilityFeature; + })(); + return FeatureSet; })(); @@ -39259,6 +40873,7 @@ default: return "minimumEdition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -39276,6 +40891,7 @@ default: return "maximumEdition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -39324,6 +40940,10 @@ case 0: message.minimumEdition = 0; break; + case "EDITION_LEGACY": + case 900: + message.minimumEdition = 900; + break; case "EDITION_PROTO2": case 998: message.minimumEdition = 998; @@ -39376,6 +40996,10 @@ case 0: message.maximumEdition = 0; break; + case "EDITION_LEGACY": + case 900: + message.maximumEdition = 900; + break; case "EDITION_PROTO2": case 998: message.maximumEdition = 998; @@ -39484,7 +41108,8 @@ * @memberof google.protobuf.FeatureSetDefaults * @interface IFeatureSetEditionDefault * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition - * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features + * @property {google.protobuf.IFeatureSet|null} [overridableFeatures] FeatureSetEditionDefault overridableFeatures + * @property {google.protobuf.IFeatureSet|null} [fixedFeatures] FeatureSetEditionDefault fixedFeatures */ /** @@ -39511,12 +41136,20 @@ FeatureSetEditionDefault.prototype.edition = 0; /** - * FeatureSetEditionDefault features. - * @member {google.protobuf.IFeatureSet|null|undefined} features + * FeatureSetEditionDefault overridableFeatures. + * @member {google.protobuf.IFeatureSet|null|undefined} overridableFeatures + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.overridableFeatures = null; + + /** + * FeatureSetEditionDefault fixedFeatures. + * @member {google.protobuf.IFeatureSet|null|undefined} fixedFeatures * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault * @instance */ - FeatureSetEditionDefault.prototype.features = null; + FeatureSetEditionDefault.prototype.fixedFeatures = null; /** * Creates a new FeatureSetEditionDefault instance using the specified properties. @@ -39542,10 +41175,12 @@ FeatureSetEditionDefault.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + if (message.overridableFeatures != null && Object.hasOwnProperty.call(message, "overridableFeatures")) + $root.google.protobuf.FeatureSet.encode(message.overridableFeatures, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.fixedFeatures != null && Object.hasOwnProperty.call(message, "fixedFeatures")) + $root.google.protobuf.FeatureSet.encode(message.fixedFeatures, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -39586,8 +41221,12 @@ message.edition = reader.int32(); break; } - case 2: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + case 4: { + message.overridableFeatures = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 5: { + message.fixedFeatures = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); break; } default: @@ -39630,6 +41269,7 @@ default: return "edition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -39642,10 +41282,15 @@ case 2147483647: break; } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (message.overridableFeatures != null && message.hasOwnProperty("overridableFeatures")) { + var error = $root.google.protobuf.FeatureSet.verify(message.overridableFeatures); + if (error) + return "overridableFeatures." + error; + } + if (message.fixedFeatures != null && message.hasOwnProperty("fixedFeatures")) { + var error = $root.google.protobuf.FeatureSet.verify(message.fixedFeatures); if (error) - return "features." + error; + return "fixedFeatures." + error; } return null; }; @@ -39673,6 +41318,10 @@ case 0: message.edition = 0; break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; case "EDITION_PROTO2": case 998: message.edition = 998; @@ -39714,10 +41363,15 @@ message.edition = 2147483647; break; } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + if (object.overridableFeatures != null) { + if (typeof object.overridableFeatures !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.overridableFeatures: object expected"); + message.overridableFeatures = $root.google.protobuf.FeatureSet.fromObject(object.overridableFeatures); + } + if (object.fixedFeatures != null) { + if (typeof object.fixedFeatures !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fixedFeatures: object expected"); + message.fixedFeatures = $root.google.protobuf.FeatureSet.fromObject(object.fixedFeatures); } return message; }; @@ -39736,13 +41390,16 @@ options = {}; var object = {}; if (options.defaults) { - object.features = null; object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.overridableFeatures = null; + object.fixedFeatures = null; } - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); if (message.edition != null && message.hasOwnProperty("edition")) object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + if (message.overridableFeatures != null && message.hasOwnProperty("overridableFeatures")) + object.overridableFeatures = $root.google.protobuf.FeatureSet.toObject(message.overridableFeatures, options); + if (message.fixedFeatures != null && message.hasOwnProperty("fixedFeatures")) + object.fixedFeatures = $root.google.protobuf.FeatureSet.toObject(message.fixedFeatures, options); return object; }; @@ -40957,6 +42614,22 @@ return GeneratedCodeInfo; })(); + /** + * SymbolVisibility enum. + * @name google.protobuf.SymbolVisibility + * @enum {number} + * @property {number} VISIBILITY_UNSET=0 VISIBILITY_UNSET value + * @property {number} VISIBILITY_LOCAL=1 VISIBILITY_LOCAL value + * @property {number} VISIBILITY_EXPORT=2 VISIBILITY_EXPORT value + */ + protobuf.SymbolVisibility = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VISIBILITY_UNSET"] = 0; + values[valuesById[1] = "VISIBILITY_LOCAL"] = 1; + values[valuesById[2] = "VISIBILITY_EXPORT"] = 2; + return values; + })(); + protobuf.Timestamp = (function() { /** diff --git a/packages/google-apps-meet/protos/protos.json b/packages/google-apps-meet/protos/protos.json index 6aa3e52fae5..8b992042642 100644 --- a/packages/google-apps-meet/protos/protos.json +++ b/packages/google-apps-meet/protos/protos.json @@ -2631,8 +2631,7 @@ "java_multiple_files": true, "java_outer_classname": "LaunchStageProto", "java_package": "com.google.api", - "objc_class_prefix": "GAPI", - "cc_enable_arenas": true + "objc_class_prefix": "GAPI" }, "nested": { "fieldBehavior": { @@ -2855,6 +2854,10 @@ "rule": "repeated", "type": "ClientLibraryDestination", "id": 2 + }, + "selectiveGapicGeneration": { + "type": "SelectiveGapicGeneration", + "id": 3 } } }, @@ -2995,6 +2998,28 @@ "common": { "type": "CommonLanguageSettings", "id": 1 + }, + "experimentalFeatures": { + "type": "ExperimentalFeatures", + "id": 2 + } + }, + "nested": { + "ExperimentalFeatures": { + "fields": { + "restAsyncIoEnabled": { + "type": "bool", + "id": 1 + }, + "protobufPythonicTypesEnabled": { + "type": "bool", + "id": 2 + }, + "unversionedPackageDisabled": { + "type": "bool", + "id": 3 + } + } } } }, @@ -3052,6 +3077,11 @@ "common": { "type": "CommonLanguageSettings", "id": 1 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 } } }, @@ -3113,6 +3143,19 @@ "PACKAGE_MANAGER": 20 } }, + "SelectiveGapicGeneration": { + "fields": { + "methods": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "generateOmittedAsInternal": { + "type": "bool", + "id": 2 + } + } + }, "LaunchStage": { "values": { "LAUNCH_STAGE_UNSPECIFIED": 0, @@ -3146,12 +3189,19 @@ "type": "FileDescriptorProto", "id": 1 } - } + }, + "extensions": [ + [ + 536000000, + 536000000 + ] + ] }, "Edition": { "edition": "proto2", "values": { "EDITION_UNKNOWN": 0, + "EDITION_LEGACY": 900, "EDITION_PROTO2": 998, "EDITION_PROTO3": 999, "EDITION_2023": 1000, @@ -3190,6 +3240,11 @@ "type": "int32", "id": 11 }, + "optionDependency": { + "rule": "repeated", + "type": "string", + "id": 15 + }, "messageType": { "rule": "repeated", "type": "DescriptorProto", @@ -3278,6 +3333,10 @@ "rule": "repeated", "type": "string", "id": 10 + }, + "visibility": { + "type": "SymbolVisibility", + "id": 11 } }, "nested": { @@ -3503,6 +3562,10 @@ "rule": "repeated", "type": "string", "id": 5 + }, + "visibility": { + "type": "SymbolVisibility", + "id": 6 } }, "nested": { @@ -3717,6 +3780,7 @@ 42, 42 ], + "php_generic_services", [ 38, 38 @@ -3852,7 +3916,8 @@ "type": "bool", "id": 10, "options": { - "default": false + "default": false, + "deprecated": true } }, "debugRedact": { @@ -3880,6 +3945,10 @@ "type": "FeatureSet", "id": 21 }, + "featureSupport": { + "type": "FeatureSupport", + "id": 22 + }, "uninterpretedOption": { "rule": "repeated", "type": "UninterpretedOption", @@ -3949,6 +4018,26 @@ "id": 2 } } + }, + "FeatureSupport": { + "fields": { + "editionIntroduced": { + "type": "Edition", + "id": 1 + }, + "editionDeprecated": { + "type": "Edition", + "id": 2 + }, + "deprecationWarning": { + "type": "string", + "id": 3 + }, + "editionRemoved": { + "type": "Edition", + "id": 4 + } + } } } }, @@ -4037,6 +4126,10 @@ "default": false } }, + "featureSupport": { + "type": "FieldOptions.FeatureSupport", + "id": 4 + }, "uninterpretedOption": { "rule": "repeated", "type": "UninterpretedOption", @@ -4179,6 +4272,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_2023", "edition_defaults.value": "EXPLICIT" } @@ -4189,6 +4283,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "OPEN" } @@ -4199,6 +4294,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "PACKED" } @@ -4209,6 +4305,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "VERIFY" } @@ -4219,7 +4316,8 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO2", + "feature_support.edition_introduced": "EDITION_2023", + "edition_defaults.edition": "EDITION_LEGACY", "edition_defaults.value": "LENGTH_PREFIXED" } }, @@ -4229,27 +4327,38 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "ALLOW" } + }, + "enforceNamingStyle": { + "type": "EnforceNamingStyle", + "id": 7, + "options": { + "retention": "RETENTION_SOURCE", + "targets": "TARGET_TYPE_METHOD", + "feature_support.edition_introduced": "EDITION_2024", + "edition_defaults.edition": "EDITION_2024", + "edition_defaults.value": "STYLE2024" + } + }, + "defaultSymbolVisibility": { + "type": "VisibilityFeature.DefaultSymbolVisibility", + "id": 8, + "options": { + "retention": "RETENTION_SOURCE", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2024", + "edition_defaults.edition": "EDITION_2024", + "edition_defaults.value": "EXPORT_TOP_LEVEL" + } } }, "extensions": [ [ 1000, - 1000 - ], - [ - 1001, - 1001 - ], - [ - 1002, - 1002 - ], - [ - 9990, - 9990 + 9994 ], [ 9995, @@ -4294,7 +4403,13 @@ "UTF8_VALIDATION_UNKNOWN": 0, "VERIFY": 2, "NONE": 3 - } + }, + "reserved": [ + [ + 1, + 1 + ] + ] }, "MessageEncoding": { "values": { @@ -4309,6 +4424,33 @@ "ALLOW": 1, "LEGACY_BEST_EFFORT": 2 } + }, + "EnforceNamingStyle": { + "values": { + "ENFORCE_NAMING_STYLE_UNKNOWN": 0, + "STYLE2024": 1, + "STYLE_LEGACY": 2 + } + }, + "VisibilityFeature": { + "fields": {}, + "reserved": [ + [ + 1, + 536870911 + ] + ], + "nested": { + "DefaultSymbolVisibility": { + "values": { + "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN": 0, + "EXPORT_ALL": 1, + "EXPORT_TOP_LEVEL": 2, + "LOCAL_ALL": 3, + "STRICT": 4 + } + } + } } } }, @@ -4336,11 +4478,26 @@ "type": "Edition", "id": 3 }, - "features": { + "overridableFeatures": { "type": "FeatureSet", - "id": 2 + "id": 4 + }, + "fixedFeatures": { + "type": "FeatureSet", + "id": 5 } - } + }, + "reserved": [ + [ + 1, + 1 + ], + [ + 2, + 2 + ], + "features" + ] } } }, @@ -4353,6 +4510,12 @@ "id": 1 } }, + "extensions": [ + [ + 536000000, + 536000000 + ] + ], "nested": { "Location": { "fields": { @@ -4438,6 +4601,14 @@ } } }, + "SymbolVisibility": { + "edition": "proto2", + "values": { + "VISIBILITY_UNSET": 0, + "VISIBILITY_LOCAL": 1, + "VISIBILITY_EXPORT": 2 + } + }, "Timestamp": { "fields": { "seconds": { diff --git a/packages/google-area120-tables/protos/protos.d.ts b/packages/google-area120-tables/protos/protos.d.ts index 7746c98f7ef..7c62b02ab60 100644 --- a/packages/google-area120-tables/protos/protos.d.ts +++ b/packages/google-area120-tables/protos/protos.d.ts @@ -3184,6 +3184,9 @@ export namespace google { /** CommonLanguageSettings destinations */ destinations?: (google.api.ClientLibraryDestination[]|null); + + /** CommonLanguageSettings selectiveGapicGeneration */ + selectiveGapicGeneration?: (google.api.ISelectiveGapicGeneration|null); } /** Represents a CommonLanguageSettings. */ @@ -3201,6 +3204,9 @@ export namespace google { /** CommonLanguageSettings destinations. */ public destinations: google.api.ClientLibraryDestination[]; + /** CommonLanguageSettings selectiveGapicGeneration. */ + public selectiveGapicGeneration?: (google.api.ISelectiveGapicGeneration|null); + /** * Creates a new CommonLanguageSettings instance using the specified properties. * @param [properties] Properties to set @@ -3901,6 +3907,9 @@ export namespace google { /** PythonSettings common */ common?: (google.api.ICommonLanguageSettings|null); + + /** PythonSettings experimentalFeatures */ + experimentalFeatures?: (google.api.PythonSettings.IExperimentalFeatures|null); } /** Represents a PythonSettings. */ @@ -3915,6 +3924,9 @@ export namespace google { /** PythonSettings common. */ public common?: (google.api.ICommonLanguageSettings|null); + /** PythonSettings experimentalFeatures. */ + public experimentalFeatures?: (google.api.PythonSettings.IExperimentalFeatures|null); + /** * Creates a new PythonSettings instance using the specified properties. * @param [properties] Properties to set @@ -3993,6 +4005,118 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + namespace PythonSettings { + + /** Properties of an ExperimentalFeatures. */ + interface IExperimentalFeatures { + + /** ExperimentalFeatures restAsyncIoEnabled */ + restAsyncIoEnabled?: (boolean|null); + + /** ExperimentalFeatures protobufPythonicTypesEnabled */ + protobufPythonicTypesEnabled?: (boolean|null); + + /** ExperimentalFeatures unversionedPackageDisabled */ + unversionedPackageDisabled?: (boolean|null); + } + + /** Represents an ExperimentalFeatures. */ + class ExperimentalFeatures implements IExperimentalFeatures { + + /** + * Constructs a new ExperimentalFeatures. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.PythonSettings.IExperimentalFeatures); + + /** ExperimentalFeatures restAsyncIoEnabled. */ + public restAsyncIoEnabled: boolean; + + /** ExperimentalFeatures protobufPythonicTypesEnabled. */ + public protobufPythonicTypesEnabled: boolean; + + /** ExperimentalFeatures unversionedPackageDisabled. */ + public unversionedPackageDisabled: boolean; + + /** + * Creates a new ExperimentalFeatures instance using the specified properties. + * @param [properties] Properties to set + * @returns ExperimentalFeatures instance + */ + public static create(properties?: google.api.PythonSettings.IExperimentalFeatures): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Encodes the specified ExperimentalFeatures message. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @param message ExperimentalFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.PythonSettings.IExperimentalFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExperimentalFeatures message, length delimited. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @param message ExperimentalFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.PythonSettings.IExperimentalFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Verifies an ExperimentalFeatures message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExperimentalFeatures message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExperimentalFeatures + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Creates a plain object from an ExperimentalFeatures message. Also converts values to other types if specified. + * @param message ExperimentalFeatures + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings.ExperimentalFeatures, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExperimentalFeatures to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExperimentalFeatures + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + /** Properties of a NodeSettings. */ interface INodeSettings { @@ -4319,6 +4443,9 @@ export namespace google { /** GoSettings common */ common?: (google.api.ICommonLanguageSettings|null); + + /** GoSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|null); } /** Represents a GoSettings. */ @@ -4333,6 +4460,9 @@ export namespace google { /** GoSettings common. */ public common?: (google.api.ICommonLanguageSettings|null); + /** GoSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + /** * Creates a new GoSettings instance using the specified properties. * @param [properties] Properties to set @@ -4657,6 +4787,109 @@ export namespace google { PACKAGE_MANAGER = 20 } + /** Properties of a SelectiveGapicGeneration. */ + interface ISelectiveGapicGeneration { + + /** SelectiveGapicGeneration methods */ + methods?: (string[]|null); + + /** SelectiveGapicGeneration generateOmittedAsInternal */ + generateOmittedAsInternal?: (boolean|null); + } + + /** Represents a SelectiveGapicGeneration. */ + class SelectiveGapicGeneration implements ISelectiveGapicGeneration { + + /** + * Constructs a new SelectiveGapicGeneration. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ISelectiveGapicGeneration); + + /** SelectiveGapicGeneration methods. */ + public methods: string[]; + + /** SelectiveGapicGeneration generateOmittedAsInternal. */ + public generateOmittedAsInternal: boolean; + + /** + * Creates a new SelectiveGapicGeneration instance using the specified properties. + * @param [properties] Properties to set + * @returns SelectiveGapicGeneration instance + */ + public static create(properties?: google.api.ISelectiveGapicGeneration): google.api.SelectiveGapicGeneration; + + /** + * Encodes the specified SelectiveGapicGeneration message. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @param message SelectiveGapicGeneration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ISelectiveGapicGeneration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SelectiveGapicGeneration message, length delimited. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @param message SelectiveGapicGeneration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ISelectiveGapicGeneration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.SelectiveGapicGeneration; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.SelectiveGapicGeneration; + + /** + * Verifies a SelectiveGapicGeneration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SelectiveGapicGeneration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SelectiveGapicGeneration + */ + public static fromObject(object: { [k: string]: any }): google.api.SelectiveGapicGeneration; + + /** + * Creates a plain object from a SelectiveGapicGeneration message. Also converts values to other types if specified. + * @param message SelectiveGapicGeneration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.SelectiveGapicGeneration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SelectiveGapicGeneration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SelectiveGapicGeneration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** LaunchStage enum. */ enum LaunchStage { LAUNCH_STAGE_UNSPECIFIED = 0, @@ -5038,6 +5271,7 @@ export namespace google { /** Edition enum. */ enum Edition { EDITION_UNKNOWN = 0, + EDITION_LEGACY = 900, EDITION_PROTO2 = 998, EDITION_PROTO3 = 999, EDITION_2023 = 1000, @@ -5068,6 +5302,9 @@ export namespace google { /** FileDescriptorProto weakDependency */ weakDependency?: (number[]|null); + /** FileDescriptorProto optionDependency */ + optionDependency?: (string[]|null); + /** FileDescriptorProto messageType */ messageType?: (google.protobuf.IDescriptorProto[]|null); @@ -5117,6 +5354,9 @@ export namespace google { /** FileDescriptorProto weakDependency. */ public weakDependency: number[]; + /** FileDescriptorProto optionDependency. */ + public optionDependency: string[]; + /** FileDescriptorProto messageType. */ public messageType: google.protobuf.IDescriptorProto[]; @@ -5251,6 +5491,9 @@ export namespace google { /** DescriptorProto reservedName */ reservedName?: (string[]|null); + + /** DescriptorProto visibility */ + visibility?: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility|null); } /** Represents a DescriptorProto. */ @@ -5292,6 +5535,9 @@ export namespace google { /** DescriptorProto reservedName. */ public reservedName: string[]; + /** DescriptorProto visibility. */ + public visibility: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility); + /** * Creates a new DescriptorProto instance using the specified properties. * @param [properties] Properties to set @@ -6139,6 +6385,9 @@ export namespace google { /** EnumDescriptorProto reservedName */ reservedName?: (string[]|null); + + /** EnumDescriptorProto visibility */ + visibility?: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility|null); } /** Represents an EnumDescriptorProto. */ @@ -6165,6 +6414,9 @@ export namespace google { /** EnumDescriptorProto reservedName. */ public reservedName: string[]; + /** EnumDescriptorProto visibility. */ + public visibility: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility); + /** * Creates a new EnumDescriptorProto instance using the specified properties. * @param [properties] Properties to set @@ -7099,6 +7351,9 @@ export namespace google { /** FieldOptions features */ features?: (google.protobuf.IFeatureSet|null); + /** FieldOptions featureSupport */ + featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** FieldOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); @@ -7154,6 +7409,9 @@ export namespace google { /** FieldOptions features. */ public features?: (google.protobuf.IFeatureSet|null); + /** FieldOptions featureSupport. */ + public featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** FieldOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; @@ -7374,6 +7632,121 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** Properties of a FeatureSupport. */ + interface IFeatureSupport { + + /** FeatureSupport editionIntroduced */ + editionIntroduced?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSupport editionDeprecated */ + editionDeprecated?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSupport deprecationWarning */ + deprecationWarning?: (string|null); + + /** FeatureSupport editionRemoved */ + editionRemoved?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSupport. */ + class FeatureSupport implements IFeatureSupport { + + /** + * Constructs a new FeatureSupport. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IFeatureSupport); + + /** FeatureSupport editionIntroduced. */ + public editionIntroduced: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSupport editionDeprecated. */ + public editionDeprecated: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSupport deprecationWarning. */ + public deprecationWarning: string; + + /** FeatureSupport editionRemoved. */ + public editionRemoved: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSupport instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSupport instance + */ + public static create(properties?: google.protobuf.FieldOptions.IFeatureSupport): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Encodes the specified FeatureSupport message. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @param message FeatureSupport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IFeatureSupport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSupport message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @param message FeatureSupport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IFeatureSupport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Verifies a FeatureSupport message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSupport message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSupport + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Creates a plain object from a FeatureSupport message. Also converts values to other types if specified. + * @param message FeatureSupport + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.FeatureSupport, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSupport to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSupport + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } /** Properties of an OneofOptions. */ @@ -7612,6 +7985,9 @@ export namespace google { /** EnumValueOptions debugRedact */ debugRedact?: (boolean|null); + /** EnumValueOptions featureSupport */ + featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** EnumValueOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); } @@ -7634,6 +8010,9 @@ export namespace google { /** EnumValueOptions debugRedact. */ public debugRedact: boolean; + /** EnumValueOptions featureSupport. */ + public featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** EnumValueOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; @@ -8223,6 +8602,12 @@ export namespace google { /** FeatureSet jsonFormat */ jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); + + /** FeatureSet enforceNamingStyle */ + enforceNamingStyle?: (google.protobuf.FeatureSet.EnforceNamingStyle|keyof typeof google.protobuf.FeatureSet.EnforceNamingStyle|null); + + /** FeatureSet defaultSymbolVisibility */ + defaultSymbolVisibility?: (google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|keyof typeof google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|null); } /** Represents a FeatureSet. */ @@ -8252,6 +8637,12 @@ export namespace google { /** FeatureSet jsonFormat. */ public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); + /** FeatureSet enforceNamingStyle. */ + public enforceNamingStyle: (google.protobuf.FeatureSet.EnforceNamingStyle|keyof typeof google.protobuf.FeatureSet.EnforceNamingStyle); + + /** FeatureSet defaultSymbolVisibility. */ + public defaultSymbolVisibility: (google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|keyof typeof google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility); + /** * Creates a new FeatureSet instance using the specified properties. * @param [properties] Properties to set @@ -8374,6 +8765,116 @@ export namespace google { ALLOW = 1, LEGACY_BEST_EFFORT = 2 } + + /** EnforceNamingStyle enum. */ + enum EnforceNamingStyle { + ENFORCE_NAMING_STYLE_UNKNOWN = 0, + STYLE2024 = 1, + STYLE_LEGACY = 2 + } + + /** Properties of a VisibilityFeature. */ + interface IVisibilityFeature { + } + + /** Represents a VisibilityFeature. */ + class VisibilityFeature implements IVisibilityFeature { + + /** + * Constructs a new VisibilityFeature. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSet.IVisibilityFeature); + + /** + * Creates a new VisibilityFeature instance using the specified properties. + * @param [properties] Properties to set + * @returns VisibilityFeature instance + */ + public static create(properties?: google.protobuf.FeatureSet.IVisibilityFeature): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Encodes the specified VisibilityFeature message. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @param message VisibilityFeature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSet.IVisibilityFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VisibilityFeature message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @param message VisibilityFeature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSet.IVisibilityFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Verifies a VisibilityFeature message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VisibilityFeature message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VisibilityFeature + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Creates a plain object from a VisibilityFeature message. Also converts values to other types if specified. + * @param message VisibilityFeature + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet.VisibilityFeature, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VisibilityFeature to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VisibilityFeature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace VisibilityFeature { + + /** DefaultSymbolVisibility enum. */ + enum DefaultSymbolVisibility { + DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0, + EXPORT_ALL = 1, + EXPORT_TOP_LEVEL = 2, + LOCAL_ALL = 3, + STRICT = 4 + } + } } /** Properties of a FeatureSetDefaults. */ @@ -8493,8 +8994,11 @@ export namespace google { /** FeatureSetEditionDefault edition */ edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - /** FeatureSetEditionDefault features */ - features?: (google.protobuf.IFeatureSet|null); + /** FeatureSetEditionDefault overridableFeatures */ + overridableFeatures?: (google.protobuf.IFeatureSet|null); + + /** FeatureSetEditionDefault fixedFeatures */ + fixedFeatures?: (google.protobuf.IFeatureSet|null); } /** Represents a FeatureSetEditionDefault. */ @@ -8509,8 +9013,11 @@ export namespace google { /** FeatureSetEditionDefault edition. */ public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - /** FeatureSetEditionDefault features. */ - public features?: (google.protobuf.IFeatureSet|null); + /** FeatureSetEditionDefault overridableFeatures. */ + public overridableFeatures?: (google.protobuf.IFeatureSet|null); + + /** FeatureSetEditionDefault fixedFeatures. */ + public fixedFeatures?: (google.protobuf.IFeatureSet|null); /** * Creates a new FeatureSetEditionDefault instance using the specified properties. @@ -9043,6 +9550,13 @@ export namespace google { } } + /** SymbolVisibility enum. */ + enum SymbolVisibility { + VISIBILITY_UNSET = 0, + VISIBILITY_LOCAL = 1, + VISIBILITY_EXPORT = 2 + } + /** Properties of a Duration. */ interface IDuration { diff --git a/packages/google-area120-tables/protos/protos.js b/packages/google-area120-tables/protos/protos.js index f9c9001525c..1cdc8e77b1b 100644 --- a/packages/google-area120-tables/protos/protos.js +++ b/packages/google-area120-tables/protos/protos.js @@ -7483,6 +7483,7 @@ * @interface ICommonLanguageSettings * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri * @property {Array.|null} [destinations] CommonLanguageSettings destinations + * @property {google.api.ISelectiveGapicGeneration|null} [selectiveGapicGeneration] CommonLanguageSettings selectiveGapicGeneration */ /** @@ -7517,6 +7518,14 @@ */ CommonLanguageSettings.prototype.destinations = $util.emptyArray; + /** + * CommonLanguageSettings selectiveGapicGeneration. + * @member {google.api.ISelectiveGapicGeneration|null|undefined} selectiveGapicGeneration + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.selectiveGapicGeneration = null; + /** * Creates a new CommonLanguageSettings instance using the specified properties. * @function create @@ -7549,6 +7558,8 @@ writer.int32(message.destinations[i]); writer.ldelim(); } + if (message.selectiveGapicGeneration != null && Object.hasOwnProperty.call(message, "selectiveGapicGeneration")) + $root.google.api.SelectiveGapicGeneration.encode(message.selectiveGapicGeneration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -7600,6 +7611,10 @@ message.destinations.push(reader.int32()); break; } + case 3: { + message.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -7651,6 +7666,11 @@ break; } } + if (message.selectiveGapicGeneration != null && message.hasOwnProperty("selectiveGapicGeneration")) { + var error = $root.google.api.SelectiveGapicGeneration.verify(message.selectiveGapicGeneration); + if (error) + return "selectiveGapicGeneration." + error; + } return null; }; @@ -7693,6 +7713,11 @@ break; } } + if (object.selectiveGapicGeneration != null) { + if (typeof object.selectiveGapicGeneration !== "object") + throw TypeError(".google.api.CommonLanguageSettings.selectiveGapicGeneration: object expected"); + message.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.fromObject(object.selectiveGapicGeneration); + } return message; }; @@ -7711,8 +7736,10 @@ var object = {}; if (options.arrays || options.defaults) object.destinations = []; - if (options.defaults) + if (options.defaults) { object.referenceDocsUri = ""; + object.selectiveGapicGeneration = null; + } if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) object.referenceDocsUri = message.referenceDocsUri; if (message.destinations && message.destinations.length) { @@ -7720,6 +7747,8 @@ for (var j = 0; j < message.destinations.length; ++j) object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; } + if (message.selectiveGapicGeneration != null && message.hasOwnProperty("selectiveGapicGeneration")) + object.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.toObject(message.selectiveGapicGeneration, options); return object; }; @@ -9542,6 +9571,7 @@ * @memberof google.api * @interface IPythonSettings * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common + * @property {google.api.PythonSettings.IExperimentalFeatures|null} [experimentalFeatures] PythonSettings experimentalFeatures */ /** @@ -9567,6 +9597,14 @@ */ PythonSettings.prototype.common = null; + /** + * PythonSettings experimentalFeatures. + * @member {google.api.PythonSettings.IExperimentalFeatures|null|undefined} experimentalFeatures + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.experimentalFeatures = null; + /** * Creates a new PythonSettings instance using the specified properties. * @function create @@ -9593,6 +9631,8 @@ writer = $Writer.create(); if (message.common != null && Object.hasOwnProperty.call(message, "common")) $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.experimentalFeatures != null && Object.hasOwnProperty.call(message, "experimentalFeatures")) + $root.google.api.PythonSettings.ExperimentalFeatures.encode(message.experimentalFeatures, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -9633,6 +9673,10 @@ message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); break; } + case 2: { + message.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -9673,6 +9717,11 @@ if (error) return "common." + error; } + if (message.experimentalFeatures != null && message.hasOwnProperty("experimentalFeatures")) { + var error = $root.google.api.PythonSettings.ExperimentalFeatures.verify(message.experimentalFeatures); + if (error) + return "experimentalFeatures." + error; + } return null; }; @@ -9693,6 +9742,11 @@ throw TypeError(".google.api.PythonSettings.common: object expected"); message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); } + if (object.experimentalFeatures != null) { + if (typeof object.experimentalFeatures !== "object") + throw TypeError(".google.api.PythonSettings.experimentalFeatures: object expected"); + message.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.fromObject(object.experimentalFeatures); + } return message; }; @@ -9709,10 +9763,14 @@ if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.common = null; + object.experimentalFeatures = null; + } if (message.common != null && message.hasOwnProperty("common")) object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + if (message.experimentalFeatures != null && message.hasOwnProperty("experimentalFeatures")) + object.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.toObject(message.experimentalFeatures, options); return object; }; @@ -9742,6 +9800,258 @@ return typeUrlPrefix + "/google.api.PythonSettings"; }; + PythonSettings.ExperimentalFeatures = (function() { + + /** + * Properties of an ExperimentalFeatures. + * @memberof google.api.PythonSettings + * @interface IExperimentalFeatures + * @property {boolean|null} [restAsyncIoEnabled] ExperimentalFeatures restAsyncIoEnabled + * @property {boolean|null} [protobufPythonicTypesEnabled] ExperimentalFeatures protobufPythonicTypesEnabled + * @property {boolean|null} [unversionedPackageDisabled] ExperimentalFeatures unversionedPackageDisabled + */ + + /** + * Constructs a new ExperimentalFeatures. + * @memberof google.api.PythonSettings + * @classdesc Represents an ExperimentalFeatures. + * @implements IExperimentalFeatures + * @constructor + * @param {google.api.PythonSettings.IExperimentalFeatures=} [properties] Properties to set + */ + function ExperimentalFeatures(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExperimentalFeatures restAsyncIoEnabled. + * @member {boolean} restAsyncIoEnabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.restAsyncIoEnabled = false; + + /** + * ExperimentalFeatures protobufPythonicTypesEnabled. + * @member {boolean} protobufPythonicTypesEnabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.protobufPythonicTypesEnabled = false; + + /** + * ExperimentalFeatures unversionedPackageDisabled. + * @member {boolean} unversionedPackageDisabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.unversionedPackageDisabled = false; + + /** + * Creates a new ExperimentalFeatures instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures=} [properties] Properties to set + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures instance + */ + ExperimentalFeatures.create = function create(properties) { + return new ExperimentalFeatures(properties); + }; + + /** + * Encodes the specified ExperimentalFeatures message. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures} message ExperimentalFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExperimentalFeatures.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.restAsyncIoEnabled != null && Object.hasOwnProperty.call(message, "restAsyncIoEnabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.restAsyncIoEnabled); + if (message.protobufPythonicTypesEnabled != null && Object.hasOwnProperty.call(message, "protobufPythonicTypesEnabled")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.protobufPythonicTypesEnabled); + if (message.unversionedPackageDisabled != null && Object.hasOwnProperty.call(message, "unversionedPackageDisabled")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.unversionedPackageDisabled); + return writer; + }; + + /** + * Encodes the specified ExperimentalFeatures message, length delimited. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures} message ExperimentalFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExperimentalFeatures.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExperimentalFeatures.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings.ExperimentalFeatures(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.restAsyncIoEnabled = reader.bool(); + break; + } + case 2: { + message.protobufPythonicTypesEnabled = reader.bool(); + break; + } + case 3: { + message.unversionedPackageDisabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExperimentalFeatures.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExperimentalFeatures message. + * @function verify + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExperimentalFeatures.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.restAsyncIoEnabled != null && message.hasOwnProperty("restAsyncIoEnabled")) + if (typeof message.restAsyncIoEnabled !== "boolean") + return "restAsyncIoEnabled: boolean expected"; + if (message.protobufPythonicTypesEnabled != null && message.hasOwnProperty("protobufPythonicTypesEnabled")) + if (typeof message.protobufPythonicTypesEnabled !== "boolean") + return "protobufPythonicTypesEnabled: boolean expected"; + if (message.unversionedPackageDisabled != null && message.hasOwnProperty("unversionedPackageDisabled")) + if (typeof message.unversionedPackageDisabled !== "boolean") + return "unversionedPackageDisabled: boolean expected"; + return null; + }; + + /** + * Creates an ExperimentalFeatures message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + */ + ExperimentalFeatures.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PythonSettings.ExperimentalFeatures) + return object; + var message = new $root.google.api.PythonSettings.ExperimentalFeatures(); + if (object.restAsyncIoEnabled != null) + message.restAsyncIoEnabled = Boolean(object.restAsyncIoEnabled); + if (object.protobufPythonicTypesEnabled != null) + message.protobufPythonicTypesEnabled = Boolean(object.protobufPythonicTypesEnabled); + if (object.unversionedPackageDisabled != null) + message.unversionedPackageDisabled = Boolean(object.unversionedPackageDisabled); + return message; + }; + + /** + * Creates a plain object from an ExperimentalFeatures message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.ExperimentalFeatures} message ExperimentalFeatures + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExperimentalFeatures.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.restAsyncIoEnabled = false; + object.protobufPythonicTypesEnabled = false; + object.unversionedPackageDisabled = false; + } + if (message.restAsyncIoEnabled != null && message.hasOwnProperty("restAsyncIoEnabled")) + object.restAsyncIoEnabled = message.restAsyncIoEnabled; + if (message.protobufPythonicTypesEnabled != null && message.hasOwnProperty("protobufPythonicTypesEnabled")) + object.protobufPythonicTypesEnabled = message.protobufPythonicTypesEnabled; + if (message.unversionedPackageDisabled != null && message.hasOwnProperty("unversionedPackageDisabled")) + object.unversionedPackageDisabled = message.unversionedPackageDisabled; + return object; + }; + + /** + * Converts this ExperimentalFeatures to JSON. + * @function toJSON + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + * @returns {Object.} JSON object + */ + ExperimentalFeatures.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExperimentalFeatures + * @function getTypeUrl + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExperimentalFeatures.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings.ExperimentalFeatures"; + }; + + return ExperimentalFeatures; + })(); + return PythonSettings; })(); @@ -10618,6 +10928,7 @@ * @memberof google.api * @interface IGoSettings * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common + * @property {Object.|null} [renamedServices] GoSettings renamedServices */ /** @@ -10629,6 +10940,7 @@ * @param {google.api.IGoSettings=} [properties] Properties to set */ function GoSettings(properties) { + this.renamedServices = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10643,6 +10955,14 @@ */ GoSettings.prototype.common = null; + /** + * GoSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.renamedServices = $util.emptyObject; + /** * Creates a new GoSettings instance using the specified properties. * @function create @@ -10669,6 +10989,9 @@ writer = $Writer.create(); if (message.common != null && Object.hasOwnProperty.call(message, "common")) $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); return writer; }; @@ -10699,7 +11022,7 @@ GoSettings.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(), key, value; while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) @@ -10709,6 +11032,29 @@ message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); break; } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedServices[key] = value; + break; + } default: reader.skipType(tag & 7); break; @@ -10749,6 +11095,14 @@ if (error) return "common." + error; } + if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } return null; }; @@ -10769,6 +11123,13 @@ throw TypeError(".google.api.GoSettings.common: object expected"); message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); } + if (object.renamedServices) { + if (typeof object.renamedServices !== "object") + throw TypeError(".google.api.GoSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } return message; }; @@ -10785,10 +11146,18 @@ if (!options) options = {}; var object = {}; + if (options.objects || options.defaults) + object.renamedServices = {}; if (options.defaults) object.common = null; if (message.common != null && message.hasOwnProperty("common")) object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } return object; }; @@ -11427,29 +11796,274 @@ return values; })(); - /** - * LaunchStage enum. - * @name google.api.LaunchStage - * @enum {number} - * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value - * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value - * @property {number} PRELAUNCH=7 PRELAUNCH value - * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value - * @property {number} ALPHA=2 ALPHA value - * @property {number} BETA=3 BETA value - * @property {number} GA=4 GA value - * @property {number} DEPRECATED=5 DEPRECATED value - */ - api.LaunchStage = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; - values[valuesById[6] = "UNIMPLEMENTED"] = 6; - values[valuesById[7] = "PRELAUNCH"] = 7; - values[valuesById[1] = "EARLY_ACCESS"] = 1; - values[valuesById[2] = "ALPHA"] = 2; - values[valuesById[3] = "BETA"] = 3; - values[valuesById[4] = "GA"] = 4; - values[valuesById[5] = "DEPRECATED"] = 5; + api.SelectiveGapicGeneration = (function() { + + /** + * Properties of a SelectiveGapicGeneration. + * @memberof google.api + * @interface ISelectiveGapicGeneration + * @property {Array.|null} [methods] SelectiveGapicGeneration methods + * @property {boolean|null} [generateOmittedAsInternal] SelectiveGapicGeneration generateOmittedAsInternal + */ + + /** + * Constructs a new SelectiveGapicGeneration. + * @memberof google.api + * @classdesc Represents a SelectiveGapicGeneration. + * @implements ISelectiveGapicGeneration + * @constructor + * @param {google.api.ISelectiveGapicGeneration=} [properties] Properties to set + */ + function SelectiveGapicGeneration(properties) { + this.methods = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SelectiveGapicGeneration methods. + * @member {Array.} methods + * @memberof google.api.SelectiveGapicGeneration + * @instance + */ + SelectiveGapicGeneration.prototype.methods = $util.emptyArray; + + /** + * SelectiveGapicGeneration generateOmittedAsInternal. + * @member {boolean} generateOmittedAsInternal + * @memberof google.api.SelectiveGapicGeneration + * @instance + */ + SelectiveGapicGeneration.prototype.generateOmittedAsInternal = false; + + /** + * Creates a new SelectiveGapicGeneration instance using the specified properties. + * @function create + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration=} [properties] Properties to set + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration instance + */ + SelectiveGapicGeneration.create = function create(properties) { + return new SelectiveGapicGeneration(properties); + }; + + /** + * Encodes the specified SelectiveGapicGeneration message. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @function encode + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration} message SelectiveGapicGeneration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelectiveGapicGeneration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.methods != null && message.methods.length) + for (var i = 0; i < message.methods.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.methods[i]); + if (message.generateOmittedAsInternal != null && Object.hasOwnProperty.call(message, "generateOmittedAsInternal")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.generateOmittedAsInternal); + return writer; + }; + + /** + * Encodes the specified SelectiveGapicGeneration message, length delimited. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration} message SelectiveGapicGeneration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelectiveGapicGeneration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer. + * @function decode + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelectiveGapicGeneration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.SelectiveGapicGeneration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.methods && message.methods.length)) + message.methods = []; + message.methods.push(reader.string()); + break; + } + case 2: { + message.generateOmittedAsInternal = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelectiveGapicGeneration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SelectiveGapicGeneration message. + * @function verify + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SelectiveGapicGeneration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.methods != null && message.hasOwnProperty("methods")) { + if (!Array.isArray(message.methods)) + return "methods: array expected"; + for (var i = 0; i < message.methods.length; ++i) + if (!$util.isString(message.methods[i])) + return "methods: string[] expected"; + } + if (message.generateOmittedAsInternal != null && message.hasOwnProperty("generateOmittedAsInternal")) + if (typeof message.generateOmittedAsInternal !== "boolean") + return "generateOmittedAsInternal: boolean expected"; + return null; + }; + + /** + * Creates a SelectiveGapicGeneration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {Object.} object Plain object + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + */ + SelectiveGapicGeneration.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.SelectiveGapicGeneration) + return object; + var message = new $root.google.api.SelectiveGapicGeneration(); + if (object.methods) { + if (!Array.isArray(object.methods)) + throw TypeError(".google.api.SelectiveGapicGeneration.methods: array expected"); + message.methods = []; + for (var i = 0; i < object.methods.length; ++i) + message.methods[i] = String(object.methods[i]); + } + if (object.generateOmittedAsInternal != null) + message.generateOmittedAsInternal = Boolean(object.generateOmittedAsInternal); + return message; + }; + + /** + * Creates a plain object from a SelectiveGapicGeneration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.SelectiveGapicGeneration} message SelectiveGapicGeneration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SelectiveGapicGeneration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.methods = []; + if (options.defaults) + object.generateOmittedAsInternal = false; + if (message.methods && message.methods.length) { + object.methods = []; + for (var j = 0; j < message.methods.length; ++j) + object.methods[j] = message.methods[j]; + } + if (message.generateOmittedAsInternal != null && message.hasOwnProperty("generateOmittedAsInternal")) + object.generateOmittedAsInternal = message.generateOmittedAsInternal; + return object; + }; + + /** + * Converts this SelectiveGapicGeneration to JSON. + * @function toJSON + * @memberof google.api.SelectiveGapicGeneration + * @instance + * @returns {Object.} JSON object + */ + SelectiveGapicGeneration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SelectiveGapicGeneration + * @function getTypeUrl + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SelectiveGapicGeneration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.SelectiveGapicGeneration"; + }; + + return SelectiveGapicGeneration; + })(); + + /** + * LaunchStage enum. + * @name google.api.LaunchStage + * @enum {number} + * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value + * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value + * @property {number} PRELAUNCH=7 PRELAUNCH value + * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value + * @property {number} ALPHA=2 ALPHA value + * @property {number} BETA=3 BETA value + * @property {number} GA=4 GA value + * @property {number} DEPRECATED=5 DEPRECATED value + */ + api.LaunchStage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; + values[valuesById[6] = "UNIMPLEMENTED"] = 6; + values[valuesById[7] = "PRELAUNCH"] = 7; + values[valuesById[1] = "EARLY_ACCESS"] = 1; + values[valuesById[2] = "ALPHA"] = 2; + values[valuesById[3] = "BETA"] = 3; + values[valuesById[4] = "GA"] = 4; + values[valuesById[5] = "DEPRECATED"] = 5; return values; })(); @@ -12412,6 +13026,7 @@ * @name google.protobuf.Edition * @enum {number} * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value + * @property {number} EDITION_LEGACY=900 EDITION_LEGACY value * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value * @property {number} EDITION_2023=1000 EDITION_2023 value @@ -12426,6 +13041,7 @@ protobuf.Edition = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "EDITION_UNKNOWN"] = 0; + values[valuesById[900] = "EDITION_LEGACY"] = 900; values[valuesById[998] = "EDITION_PROTO2"] = 998; values[valuesById[999] = "EDITION_PROTO3"] = 999; values[valuesById[1000] = "EDITION_2023"] = 1000; @@ -12450,6 +13066,7 @@ * @property {Array.|null} [dependency] FileDescriptorProto dependency * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [optionDependency] FileDescriptorProto optionDependency * @property {Array.|null} [messageType] FileDescriptorProto messageType * @property {Array.|null} [enumType] FileDescriptorProto enumType * @property {Array.|null} [service] FileDescriptorProto service @@ -12472,6 +13089,7 @@ this.dependency = []; this.publicDependency = []; this.weakDependency = []; + this.optionDependency = []; this.messageType = []; this.enumType = []; this.service = []; @@ -12522,6 +13140,14 @@ */ FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + /** + * FileDescriptorProto optionDependency. + * @member {Array.} optionDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.optionDependency = $util.emptyArray; + /** * FileDescriptorProto messageType. * @member {Array.} messageType @@ -12643,6 +13269,9 @@ writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); + if (message.optionDependency != null && message.optionDependency.length) + for (var i = 0; i < message.optionDependency.length; ++i) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.optionDependency[i]); return writer; }; @@ -12715,6 +13344,12 @@ message.weakDependency.push(reader.int32()); break; } + case 15: { + if (!(message.optionDependency && message.optionDependency.length)) + message.optionDependency = []; + message.optionDependency.push(reader.string()); + break; + } case 4: { if (!(message.messageType && message.messageType.length)) message.messageType = []; @@ -12817,6 +13452,13 @@ if (!$util.isInteger(message.weakDependency[i])) return "weakDependency: integer[] expected"; } + if (message.optionDependency != null && message.hasOwnProperty("optionDependency")) { + if (!Array.isArray(message.optionDependency)) + return "optionDependency: array expected"; + for (var i = 0; i < message.optionDependency.length; ++i) + if (!$util.isString(message.optionDependency[i])) + return "optionDependency: string[] expected"; + } if (message.messageType != null && message.hasOwnProperty("messageType")) { if (!Array.isArray(message.messageType)) return "messageType: array expected"; @@ -12871,6 +13513,7 @@ default: return "edition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -12923,6 +13566,13 @@ for (var i = 0; i < object.weakDependency.length; ++i) message.weakDependency[i] = object.weakDependency[i] | 0; } + if (object.optionDependency) { + if (!Array.isArray(object.optionDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.optionDependency: array expected"); + message.optionDependency = []; + for (var i = 0; i < object.optionDependency.length; ++i) + message.optionDependency[i] = String(object.optionDependency[i]); + } if (object.messageType) { if (!Array.isArray(object.messageType)) throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); @@ -12986,6 +13636,10 @@ case 0: message.edition = 0; break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; case "EDITION_PROTO2": case 998: message.edition = 998; @@ -13051,6 +13705,7 @@ object.extension = []; object.publicDependency = []; object.weakDependency = []; + object.optionDependency = []; } if (options.defaults) { object.name = ""; @@ -13107,6 +13762,11 @@ object.syntax = message.syntax; if (message.edition != null && message.hasOwnProperty("edition")) object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + if (message.optionDependency && message.optionDependency.length) { + object.optionDependency = []; + for (var j = 0; j < message.optionDependency.length; ++j) + object.optionDependency[j] = message.optionDependency[j]; + } return object; }; @@ -13155,6 +13815,7 @@ * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options * @property {Array.|null} [reservedRange] DescriptorProto reservedRange * @property {Array.|null} [reservedName] DescriptorProto reservedName + * @property {google.protobuf.SymbolVisibility|null} [visibility] DescriptorProto visibility */ /** @@ -13260,6 +13921,14 @@ */ DescriptorProto.prototype.reservedName = $util.emptyArray; + /** + * DescriptorProto visibility. + * @member {google.protobuf.SymbolVisibility} visibility + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.visibility = 0; + /** * Creates a new DescriptorProto instance using the specified properties. * @function create @@ -13312,6 +13981,8 @@ if (message.reservedName != null && message.reservedName.length) for (var i = 0; i < message.reservedName.length; ++i) writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.visibility); return writer; }; @@ -13404,6 +14075,10 @@ message.reservedName.push(reader.string()); break; } + case 11: { + message.visibility = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -13517,6 +14192,15 @@ if (!$util.isString(message.reservedName[i])) return "reservedName: string[] expected"; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + switch (message.visibility) { + default: + return "visibility: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; @@ -13616,6 +14300,26 @@ for (var i = 0; i < object.reservedName.length; ++i) message.reservedName[i] = String(object.reservedName[i]); } + switch (object.visibility) { + default: + if (typeof object.visibility === "number") { + message.visibility = object.visibility; + break; + } + break; + case "VISIBILITY_UNSET": + case 0: + message.visibility = 0; + break; + case "VISIBILITY_LOCAL": + case 1: + message.visibility = 1; + break; + case "VISIBILITY_EXPORT": + case 2: + message.visibility = 2; + break; + } return message; }; @@ -13645,6 +14349,7 @@ if (options.defaults) { object.name = ""; object.options = null; + object.visibility = options.enums === String ? "VISIBILITY_UNSET" : 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -13690,6 +14395,8 @@ for (var j = 0; j < message.reservedName.length; ++j) object.reservedName[j] = message.reservedName[j]; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + object.visibility = options.enums === String ? $root.google.protobuf.SymbolVisibility[message.visibility] === undefined ? message.visibility : $root.google.protobuf.SymbolVisibility[message.visibility] : message.visibility; return object; }; @@ -15734,6 +16441,7 @@ * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + * @property {google.protobuf.SymbolVisibility|null} [visibility] EnumDescriptorProto visibility */ /** @@ -15794,6 +16502,14 @@ */ EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + /** + * EnumDescriptorProto visibility. + * @member {google.protobuf.SymbolVisibility} visibility + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.visibility = 0; + /** * Creates a new EnumDescriptorProto instance using the specified properties. * @function create @@ -15831,6 +16547,8 @@ if (message.reservedName != null && message.reservedName.length) for (var i = 0; i < message.reservedName.length; ++i) writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.visibility); return writer; }; @@ -15893,6 +16611,10 @@ message.reservedName.push(reader.string()); break; } + case 6: { + message.visibility = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -15961,6 +16683,15 @@ if (!$util.isString(message.reservedName[i])) return "reservedName: string[] expected"; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + switch (message.visibility) { + default: + return "visibility: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; @@ -16010,6 +16741,26 @@ for (var i = 0; i < object.reservedName.length; ++i) message.reservedName[i] = String(object.reservedName[i]); } + switch (object.visibility) { + default: + if (typeof object.visibility === "number") { + message.visibility = object.visibility; + break; + } + break; + case "VISIBILITY_UNSET": + case 0: + message.visibility = 0; + break; + case "VISIBILITY_LOCAL": + case 1: + message.visibility = 1; + break; + case "VISIBILITY_EXPORT": + case 2: + message.visibility = 2; + break; + } return message; }; @@ -16034,6 +16785,7 @@ if (options.defaults) { object.name = ""; object.options = null; + object.visibility = options.enums === String ? "VISIBILITY_UNSET" : 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -16054,6 +16806,8 @@ for (var j = 0; j < message.reservedName.length; ++j) object.reservedName[j] = message.reservedName[j]; } + if (message.visibility != null && message.hasOwnProperty("visibility")) + object.visibility = options.enums === String ? $root.google.protobuf.SymbolVisibility[message.visibility] === undefined ? message.visibility : $root.google.protobuf.SymbolVisibility[message.visibility] : message.visibility; return object; }; @@ -18372,6 +19126,7 @@ * @property {Array.|null} [targets] FieldOptions targets * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features + * @property {google.protobuf.FieldOptions.IFeatureSupport|null} [featureSupport] FieldOptions featureSupport * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference @@ -18492,6 +19247,14 @@ */ FieldOptions.prototype.features = null; + /** + * FieldOptions featureSupport. + * @member {google.protobuf.FieldOptions.IFeatureSupport|null|undefined} featureSupport + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.featureSupport = null; + /** * FieldOptions uninterpretedOption. * @member {Array.} uninterpretedOption @@ -18566,6 +19329,8 @@ $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); if (message.features != null && Object.hasOwnProperty.call(message, "features")) $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) + $root.google.protobuf.FieldOptions.FeatureSupport.encode(message.featureSupport, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); @@ -18667,6 +19432,10 @@ message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); break; } + case 22: { + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.decode(reader, reader.uint32()); + break; + } case 999: { if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; @@ -18802,6 +19571,11 @@ if (error) return "features." + error; } + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) { + var error = $root.google.protobuf.FieldOptions.FeatureSupport.verify(message.featureSupport); + if (error) + return "featureSupport." + error; + } if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; @@ -18990,6 +19764,11 @@ throw TypeError(".google.protobuf.FieldOptions.features: object expected"); message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); } + if (object.featureSupport != null) { + if (typeof object.featureSupport !== "object") + throw TypeError(".google.protobuf.FieldOptions.featureSupport: object expected"); + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.fromObject(object.featureSupport); + } if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); @@ -19087,6 +19866,7 @@ object.debugRedact = false; object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; object.features = null; + object.featureSupport = null; object[".google.api.resourceReference"] = null; } if (message.ctype != null && message.hasOwnProperty("ctype")) @@ -19119,6 +19899,8 @@ } if (message.features != null && message.hasOwnProperty("features")) object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) + object.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.toObject(message.featureSupport, options); if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) @@ -19391,6 +20173,7 @@ default: return "edition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -19432,103 +20215,589 @@ case 0: message.edition = 0; break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this EditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + * @returns {Object.} JSON object + */ + EditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; + }; + + return EditionDefault; + })(); + + FieldOptions.FeatureSupport = (function() { + + /** + * Properties of a FeatureSupport. + * @memberof google.protobuf.FieldOptions + * @interface IFeatureSupport + * @property {google.protobuf.Edition|null} [editionIntroduced] FeatureSupport editionIntroduced + * @property {google.protobuf.Edition|null} [editionDeprecated] FeatureSupport editionDeprecated + * @property {string|null} [deprecationWarning] FeatureSupport deprecationWarning + * @property {google.protobuf.Edition|null} [editionRemoved] FeatureSupport editionRemoved + */ + + /** + * Constructs a new FeatureSupport. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents a FeatureSupport. + * @implements IFeatureSupport + * @constructor + * @param {google.protobuf.FieldOptions.IFeatureSupport=} [properties] Properties to set + */ + function FeatureSupport(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSupport editionIntroduced. + * @member {google.protobuf.Edition} editionIntroduced + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionIntroduced = 0; + + /** + * FeatureSupport editionDeprecated. + * @member {google.protobuf.Edition} editionDeprecated + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionDeprecated = 0; + + /** + * FeatureSupport deprecationWarning. + * @member {string} deprecationWarning + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.deprecationWarning = ""; + + /** + * FeatureSupport editionRemoved. + * @member {google.protobuf.Edition} editionRemoved + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionRemoved = 0; + + /** + * Creates a new FeatureSupport instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport instance + */ + FeatureSupport.create = function create(properties) { + return new FeatureSupport(properties); + }; + + /** + * Encodes the specified FeatureSupport message. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport} message FeatureSupport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSupport.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.editionIntroduced != null && Object.hasOwnProperty.call(message, "editionIntroduced")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.editionIntroduced); + if (message.editionDeprecated != null && Object.hasOwnProperty.call(message, "editionDeprecated")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.editionDeprecated); + if (message.deprecationWarning != null && Object.hasOwnProperty.call(message, "deprecationWarning")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.deprecationWarning); + if (message.editionRemoved != null && Object.hasOwnProperty.call(message, "editionRemoved")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.editionRemoved); + return writer; + }; + + /** + * Encodes the specified FeatureSupport message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport} message FeatureSupport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSupport.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSupport.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.FeatureSupport(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.editionIntroduced = reader.int32(); + break; + } + case 2: { + message.editionDeprecated = reader.int32(); + break; + } + case 3: { + message.deprecationWarning = reader.string(); + break; + } + case 4: { + message.editionRemoved = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSupport.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSupport message. + * @function verify + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSupport.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.editionIntroduced != null && message.hasOwnProperty("editionIntroduced")) + switch (message.editionIntroduced) { + default: + return "editionIntroduced: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.editionDeprecated != null && message.hasOwnProperty("editionDeprecated")) + switch (message.editionDeprecated) { + default: + return "editionDeprecated: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.deprecationWarning != null && message.hasOwnProperty("deprecationWarning")) + if (!$util.isString(message.deprecationWarning)) + return "deprecationWarning: string expected"; + if (message.editionRemoved != null && message.hasOwnProperty("editionRemoved")) + switch (message.editionRemoved) { + default: + return "editionRemoved: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FeatureSupport message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + */ + FeatureSupport.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions.FeatureSupport) + return object; + var message = new $root.google.protobuf.FieldOptions.FeatureSupport(); + switch (object.editionIntroduced) { + default: + if (typeof object.editionIntroduced === "number") { + message.editionIntroduced = object.editionIntroduced; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionIntroduced = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionIntroduced = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionIntroduced = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionIntroduced = 999; + break; + case "EDITION_2023": + case 1000: + message.editionIntroduced = 1000; + break; + case "EDITION_2024": + case 1001: + message.editionIntroduced = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.editionIntroduced = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.editionIntroduced = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.editionIntroduced = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.editionIntroduced = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.editionIntroduced = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.editionIntroduced = 2147483647; + break; + } + switch (object.editionDeprecated) { + default: + if (typeof object.editionDeprecated === "number") { + message.editionDeprecated = object.editionDeprecated; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionDeprecated = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionDeprecated = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionDeprecated = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionDeprecated = 999; + break; + case "EDITION_2023": + case 1000: + message.editionDeprecated = 1000; + break; + case "EDITION_2024": + case 1001: + message.editionDeprecated = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.editionDeprecated = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.editionDeprecated = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.editionDeprecated = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.editionDeprecated = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.editionDeprecated = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.editionDeprecated = 2147483647; + break; + } + if (object.deprecationWarning != null) + message.deprecationWarning = String(object.deprecationWarning); + switch (object.editionRemoved) { + default: + if (typeof object.editionRemoved === "number") { + message.editionRemoved = object.editionRemoved; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionRemoved = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionRemoved = 900; + break; case "EDITION_PROTO2": case 998: - message.edition = 998; + message.editionRemoved = 998; break; case "EDITION_PROTO3": case 999: - message.edition = 999; + message.editionRemoved = 999; break; case "EDITION_2023": case 1000: - message.edition = 1000; + message.editionRemoved = 1000; break; case "EDITION_2024": case 1001: - message.edition = 1001; + message.editionRemoved = 1001; break; case "EDITION_1_TEST_ONLY": case 1: - message.edition = 1; + message.editionRemoved = 1; break; case "EDITION_2_TEST_ONLY": case 2: - message.edition = 2; + message.editionRemoved = 2; break; case "EDITION_99997_TEST_ONLY": case 99997: - message.edition = 99997; + message.editionRemoved = 99997; break; case "EDITION_99998_TEST_ONLY": case 99998: - message.edition = 99998; + message.editionRemoved = 99998; break; case "EDITION_99999_TEST_ONLY": case 99999: - message.edition = 99999; + message.editionRemoved = 99999; break; case "EDITION_MAX": case 2147483647: - message.edition = 2147483647; + message.editionRemoved = 2147483647; break; } - if (object.value != null) - message.value = String(object.value); return message; }; /** - * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * Creates a plain object from a FeatureSupport message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.FieldOptions.EditionDefault + * @memberof google.protobuf.FieldOptions.FeatureSupport * @static - * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault + * @param {google.protobuf.FieldOptions.FeatureSupport} message FeatureSupport * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EditionDefault.toObject = function toObject(message, options) { + FeatureSupport.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.value = ""; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.editionIntroduced = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.editionDeprecated = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.deprecationWarning = ""; + object.editionRemoved = options.enums === String ? "EDITION_UNKNOWN" : 0; } - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + if (message.editionIntroduced != null && message.hasOwnProperty("editionIntroduced")) + object.editionIntroduced = options.enums === String ? $root.google.protobuf.Edition[message.editionIntroduced] === undefined ? message.editionIntroduced : $root.google.protobuf.Edition[message.editionIntroduced] : message.editionIntroduced; + if (message.editionDeprecated != null && message.hasOwnProperty("editionDeprecated")) + object.editionDeprecated = options.enums === String ? $root.google.protobuf.Edition[message.editionDeprecated] === undefined ? message.editionDeprecated : $root.google.protobuf.Edition[message.editionDeprecated] : message.editionDeprecated; + if (message.deprecationWarning != null && message.hasOwnProperty("deprecationWarning")) + object.deprecationWarning = message.deprecationWarning; + if (message.editionRemoved != null && message.hasOwnProperty("editionRemoved")) + object.editionRemoved = options.enums === String ? $root.google.protobuf.Edition[message.editionRemoved] === undefined ? message.editionRemoved : $root.google.protobuf.Edition[message.editionRemoved] : message.editionRemoved; return object; }; /** - * Converts this EditionDefault to JSON. + * Converts this FeatureSupport to JSON. * @function toJSON - * @memberof google.protobuf.FieldOptions.EditionDefault + * @memberof google.protobuf.FieldOptions.FeatureSupport * @instance * @returns {Object.} JSON object */ - EditionDefault.prototype.toJSON = function toJSON() { + FeatureSupport.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for EditionDefault + * Gets the default type url for FeatureSupport * @function getTypeUrl - * @memberof google.protobuf.FieldOptions.EditionDefault + * @memberof google.protobuf.FieldOptions.FeatureSupport * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + FeatureSupport.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; + return typeUrlPrefix + "/google.protobuf.FieldOptions.FeatureSupport"; }; - return EditionDefault; + return FeatureSupport; })(); return FieldOptions; @@ -20123,6 +21392,7 @@ * @property {boolean|null} [deprecated] EnumValueOptions deprecated * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact + * @property {google.protobuf.FieldOptions.IFeatureSupport|null} [featureSupport] EnumValueOptions featureSupport * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption */ @@ -20166,6 +21436,14 @@ */ EnumValueOptions.prototype.debugRedact = false; + /** + * EnumValueOptions featureSupport. + * @member {google.protobuf.FieldOptions.IFeatureSupport|null|undefined} featureSupport + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.featureSupport = null; + /** * EnumValueOptions uninterpretedOption. * @member {Array.} uninterpretedOption @@ -20204,6 +21482,8 @@ $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); + if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) + $root.google.protobuf.FieldOptions.FeatureSupport.encode(message.featureSupport, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); @@ -20255,6 +21535,10 @@ message.debugRedact = reader.bool(); break; } + case 4: { + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.decode(reader, reader.uint32()); + break; + } case 999: { if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; @@ -20307,6 +21591,11 @@ if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) if (typeof message.debugRedact !== "boolean") return "debugRedact: boolean expected"; + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) { + var error = $root.google.protobuf.FieldOptions.FeatureSupport.verify(message.featureSupport); + if (error) + return "featureSupport." + error; + } if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; @@ -20340,6 +21629,11 @@ } if (object.debugRedact != null) message.debugRedact = Boolean(object.debugRedact); + if (object.featureSupport != null) { + if (typeof object.featureSupport !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.featureSupport: object expected"); + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.fromObject(object.featureSupport); + } if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); @@ -20372,6 +21666,7 @@ object.deprecated = false; object.features = null; object.debugRedact = false; + object.featureSupport = null; } if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; @@ -20379,6 +21674,8 @@ object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) object.debugRedact = message.debugRedact; + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) + object.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.toObject(message.featureSupport, options); if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) @@ -21818,6 +23115,8 @@ * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat + * @property {google.protobuf.FeatureSet.EnforceNamingStyle|null} [enforceNamingStyle] FeatureSet enforceNamingStyle + * @property {google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|null} [defaultSymbolVisibility] FeatureSet defaultSymbolVisibility */ /** @@ -21883,6 +23182,22 @@ */ FeatureSet.prototype.jsonFormat = 0; + /** + * FeatureSet enforceNamingStyle. + * @member {google.protobuf.FeatureSet.EnforceNamingStyle} enforceNamingStyle + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enforceNamingStyle = 0; + + /** + * FeatureSet defaultSymbolVisibility. + * @member {google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility} defaultSymbolVisibility + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.defaultSymbolVisibility = 0; + /** * Creates a new FeatureSet instance using the specified properties. * @function create @@ -21919,6 +23234,10 @@ writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); + if (message.enforceNamingStyle != null && Object.hasOwnProperty.call(message, "enforceNamingStyle")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.enforceNamingStyle); + if (message.defaultSymbolVisibility != null && Object.hasOwnProperty.call(message, "defaultSymbolVisibility")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.defaultSymbolVisibility); return writer; }; @@ -21979,6 +23298,14 @@ message.jsonFormat = reader.int32(); break; } + case 7: { + message.enforceNamingStyle = reader.int32(); + break; + } + case 8: { + message.defaultSymbolVisibility = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -22069,6 +23396,26 @@ case 2: break; } + if (message.enforceNamingStyle != null && message.hasOwnProperty("enforceNamingStyle")) + switch (message.enforceNamingStyle) { + default: + return "enforceNamingStyle: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.defaultSymbolVisibility != null && message.hasOwnProperty("defaultSymbolVisibility")) + switch (message.defaultSymbolVisibility) { + default: + return "defaultSymbolVisibility: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } return null; }; @@ -22208,6 +23555,54 @@ message.jsonFormat = 2; break; } + switch (object.enforceNamingStyle) { + default: + if (typeof object.enforceNamingStyle === "number") { + message.enforceNamingStyle = object.enforceNamingStyle; + break; + } + break; + case "ENFORCE_NAMING_STYLE_UNKNOWN": + case 0: + message.enforceNamingStyle = 0; + break; + case "STYLE2024": + case 1: + message.enforceNamingStyle = 1; + break; + case "STYLE_LEGACY": + case 2: + message.enforceNamingStyle = 2; + break; + } + switch (object.defaultSymbolVisibility) { + default: + if (typeof object.defaultSymbolVisibility === "number") { + message.defaultSymbolVisibility = object.defaultSymbolVisibility; + break; + } + break; + case "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN": + case 0: + message.defaultSymbolVisibility = 0; + break; + case "EXPORT_ALL": + case 1: + message.defaultSymbolVisibility = 1; + break; + case "EXPORT_TOP_LEVEL": + case 2: + message.defaultSymbolVisibility = 2; + break; + case "LOCAL_ALL": + case 3: + message.defaultSymbolVisibility = 3; + break; + case "STRICT": + case 4: + message.defaultSymbolVisibility = 4; + break; + } return message; }; @@ -22231,6 +23626,8 @@ object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; + object.enforceNamingStyle = options.enums === String ? "ENFORCE_NAMING_STYLE_UNKNOWN" : 0; + object.defaultSymbolVisibility = options.enums === String ? "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN" : 0; } if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; @@ -22244,6 +23641,10 @@ object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; + if (message.enforceNamingStyle != null && message.hasOwnProperty("enforceNamingStyle")) + object.enforceNamingStyle = options.enums === String ? $root.google.protobuf.FeatureSet.EnforceNamingStyle[message.enforceNamingStyle] === undefined ? message.enforceNamingStyle : $root.google.protobuf.FeatureSet.EnforceNamingStyle[message.enforceNamingStyle] : message.enforceNamingStyle; + if (message.defaultSymbolVisibility != null && message.hasOwnProperty("defaultSymbolVisibility")) + object.defaultSymbolVisibility = options.enums === String ? $root.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility[message.defaultSymbolVisibility] === undefined ? message.defaultSymbolVisibility : $root.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility[message.defaultSymbolVisibility] : message.defaultSymbolVisibility; return object; }; @@ -22371,6 +23772,219 @@ return values; })(); + /** + * EnforceNamingStyle enum. + * @name google.protobuf.FeatureSet.EnforceNamingStyle + * @enum {number} + * @property {number} ENFORCE_NAMING_STYLE_UNKNOWN=0 ENFORCE_NAMING_STYLE_UNKNOWN value + * @property {number} STYLE2024=1 STYLE2024 value + * @property {number} STYLE_LEGACY=2 STYLE_LEGACY value + */ + FeatureSet.EnforceNamingStyle = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENFORCE_NAMING_STYLE_UNKNOWN"] = 0; + values[valuesById[1] = "STYLE2024"] = 1; + values[valuesById[2] = "STYLE_LEGACY"] = 2; + return values; + })(); + + FeatureSet.VisibilityFeature = (function() { + + /** + * Properties of a VisibilityFeature. + * @memberof google.protobuf.FeatureSet + * @interface IVisibilityFeature + */ + + /** + * Constructs a new VisibilityFeature. + * @memberof google.protobuf.FeatureSet + * @classdesc Represents a VisibilityFeature. + * @implements IVisibilityFeature + * @constructor + * @param {google.protobuf.FeatureSet.IVisibilityFeature=} [properties] Properties to set + */ + function VisibilityFeature(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new VisibilityFeature instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature instance + */ + VisibilityFeature.create = function create(properties) { + return new VisibilityFeature(properties); + }; + + /** + * Encodes the specified VisibilityFeature message. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature} message VisibilityFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VisibilityFeature.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified VisibilityFeature message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature} message VisibilityFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VisibilityFeature.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VisibilityFeature.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet.VisibilityFeature(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VisibilityFeature.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VisibilityFeature message. + * @function verify + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VisibilityFeature.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a VisibilityFeature message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + */ + VisibilityFeature.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSet.VisibilityFeature) + return object; + return new $root.google.protobuf.FeatureSet.VisibilityFeature(); + }; + + /** + * Creates a plain object from a VisibilityFeature message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.VisibilityFeature} message VisibilityFeature + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VisibilityFeature.toObject = function toObject() { + return {}; + }; + + /** + * Converts this VisibilityFeature to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @instance + * @returns {Object.} JSON object + */ + VisibilityFeature.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VisibilityFeature + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VisibilityFeature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet.VisibilityFeature"; + }; + + /** + * DefaultSymbolVisibility enum. + * @name google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility + * @enum {number} + * @property {number} DEFAULT_SYMBOL_VISIBILITY_UNKNOWN=0 DEFAULT_SYMBOL_VISIBILITY_UNKNOWN value + * @property {number} EXPORT_ALL=1 EXPORT_ALL value + * @property {number} EXPORT_TOP_LEVEL=2 EXPORT_TOP_LEVEL value + * @property {number} LOCAL_ALL=3 LOCAL_ALL value + * @property {number} STRICT=4 STRICT value + */ + VisibilityFeature.DefaultSymbolVisibility = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN"] = 0; + values[valuesById[1] = "EXPORT_ALL"] = 1; + values[valuesById[2] = "EXPORT_TOP_LEVEL"] = 2; + values[valuesById[3] = "LOCAL_ALL"] = 3; + values[valuesById[4] = "STRICT"] = 4; + return values; + })(); + + return VisibilityFeature; + })(); + return FeatureSet; })(); @@ -22555,6 +24169,7 @@ default: return "minimumEdition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -22572,6 +24187,7 @@ default: return "maximumEdition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -22620,6 +24236,10 @@ case 0: message.minimumEdition = 0; break; + case "EDITION_LEGACY": + case 900: + message.minimumEdition = 900; + break; case "EDITION_PROTO2": case 998: message.minimumEdition = 998; @@ -22672,6 +24292,10 @@ case 0: message.maximumEdition = 0; break; + case "EDITION_LEGACY": + case 900: + message.maximumEdition = 900; + break; case "EDITION_PROTO2": case 998: message.maximumEdition = 998; @@ -22780,7 +24404,8 @@ * @memberof google.protobuf.FeatureSetDefaults * @interface IFeatureSetEditionDefault * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition - * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features + * @property {google.protobuf.IFeatureSet|null} [overridableFeatures] FeatureSetEditionDefault overridableFeatures + * @property {google.protobuf.IFeatureSet|null} [fixedFeatures] FeatureSetEditionDefault fixedFeatures */ /** @@ -22807,12 +24432,20 @@ FeatureSetEditionDefault.prototype.edition = 0; /** - * FeatureSetEditionDefault features. - * @member {google.protobuf.IFeatureSet|null|undefined} features + * FeatureSetEditionDefault overridableFeatures. + * @member {google.protobuf.IFeatureSet|null|undefined} overridableFeatures + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.overridableFeatures = null; + + /** + * FeatureSetEditionDefault fixedFeatures. + * @member {google.protobuf.IFeatureSet|null|undefined} fixedFeatures * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault * @instance */ - FeatureSetEditionDefault.prototype.features = null; + FeatureSetEditionDefault.prototype.fixedFeatures = null; /** * Creates a new FeatureSetEditionDefault instance using the specified properties. @@ -22838,10 +24471,12 @@ FeatureSetEditionDefault.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + if (message.overridableFeatures != null && Object.hasOwnProperty.call(message, "overridableFeatures")) + $root.google.protobuf.FeatureSet.encode(message.overridableFeatures, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.fixedFeatures != null && Object.hasOwnProperty.call(message, "fixedFeatures")) + $root.google.protobuf.FeatureSet.encode(message.fixedFeatures, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -22882,8 +24517,12 @@ message.edition = reader.int32(); break; } - case 2: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + case 4: { + message.overridableFeatures = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 5: { + message.fixedFeatures = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); break; } default: @@ -22926,6 +24565,7 @@ default: return "edition: enum value expected"; case 0: + case 900: case 998: case 999: case 1000: @@ -22938,10 +24578,15 @@ case 2147483647: break; } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (message.overridableFeatures != null && message.hasOwnProperty("overridableFeatures")) { + var error = $root.google.protobuf.FeatureSet.verify(message.overridableFeatures); + if (error) + return "overridableFeatures." + error; + } + if (message.fixedFeatures != null && message.hasOwnProperty("fixedFeatures")) { + var error = $root.google.protobuf.FeatureSet.verify(message.fixedFeatures); if (error) - return "features." + error; + return "fixedFeatures." + error; } return null; }; @@ -22969,6 +24614,10 @@ case 0: message.edition = 0; break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; case "EDITION_PROTO2": case 998: message.edition = 998; @@ -23010,10 +24659,15 @@ message.edition = 2147483647; break; } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + if (object.overridableFeatures != null) { + if (typeof object.overridableFeatures !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.overridableFeatures: object expected"); + message.overridableFeatures = $root.google.protobuf.FeatureSet.fromObject(object.overridableFeatures); + } + if (object.fixedFeatures != null) { + if (typeof object.fixedFeatures !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fixedFeatures: object expected"); + message.fixedFeatures = $root.google.protobuf.FeatureSet.fromObject(object.fixedFeatures); } return message; }; @@ -23032,13 +24686,16 @@ options = {}; var object = {}; if (options.defaults) { - object.features = null; object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.overridableFeatures = null; + object.fixedFeatures = null; } - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); if (message.edition != null && message.hasOwnProperty("edition")) object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + if (message.overridableFeatures != null && message.hasOwnProperty("overridableFeatures")) + object.overridableFeatures = $root.google.protobuf.FeatureSet.toObject(message.overridableFeatures, options); + if (message.fixedFeatures != null && message.hasOwnProperty("fixedFeatures")) + object.fixedFeatures = $root.google.protobuf.FeatureSet.toObject(message.fixedFeatures, options); return object; }; @@ -24253,6 +25910,22 @@ return GeneratedCodeInfo; })(); + /** + * SymbolVisibility enum. + * @name google.protobuf.SymbolVisibility + * @enum {number} + * @property {number} VISIBILITY_UNSET=0 VISIBILITY_UNSET value + * @property {number} VISIBILITY_LOCAL=1 VISIBILITY_LOCAL value + * @property {number} VISIBILITY_EXPORT=2 VISIBILITY_EXPORT value + */ + protobuf.SymbolVisibility = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VISIBILITY_UNSET"] = 0; + values[valuesById[1] = "VISIBILITY_LOCAL"] = 1; + values[valuesById[2] = "VISIBILITY_EXPORT"] = 2; + return values; + })(); + protobuf.Duration = (function() { /** diff --git a/packages/google-area120-tables/protos/protos.json b/packages/google-area120-tables/protos/protos.json index 229a9398ef9..b0f6661d633 100644 --- a/packages/google-area120-tables/protos/protos.json +++ b/packages/google-area120-tables/protos/protos.json @@ -650,8 +650,7 @@ "java_multiple_files": true, "java_outer_classname": "ResourceProto", "java_package": "com.google.api", - "objc_class_prefix": "GAPI", - "cc_enable_arenas": true + "objc_class_prefix": "GAPI" }, "nested": { "http": { @@ -775,6 +774,10 @@ "rule": "repeated", "type": "ClientLibraryDestination", "id": 2 + }, + "selectiveGapicGeneration": { + "type": "SelectiveGapicGeneration", + "id": 3 } } }, @@ -915,6 +918,28 @@ "common": { "type": "CommonLanguageSettings", "id": 1 + }, + "experimentalFeatures": { + "type": "ExperimentalFeatures", + "id": 2 + } + }, + "nested": { + "ExperimentalFeatures": { + "fields": { + "restAsyncIoEnabled": { + "type": "bool", + "id": 1 + }, + "protobufPythonicTypesEnabled": { + "type": "bool", + "id": 2 + }, + "unversionedPackageDisabled": { + "type": "bool", + "id": 3 + } + } } } }, @@ -972,6 +997,11 @@ "common": { "type": "CommonLanguageSettings", "id": 1 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 } } }, @@ -1033,6 +1063,19 @@ "PACKAGE_MANAGER": 20 } }, + "SelectiveGapicGeneration": { + "fields": { + "methods": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "generateOmittedAsInternal": { + "type": "bool", + "id": 2 + } + } + }, "LaunchStage": { "values": { "LAUNCH_STAGE_UNSPECIFIED": 0, @@ -1165,12 +1208,19 @@ "type": "FileDescriptorProto", "id": 1 } - } + }, + "extensions": [ + [ + 536000000, + 536000000 + ] + ] }, "Edition": { "edition": "proto2", "values": { "EDITION_UNKNOWN": 0, + "EDITION_LEGACY": 900, "EDITION_PROTO2": 998, "EDITION_PROTO3": 999, "EDITION_2023": 1000, @@ -1209,6 +1259,11 @@ "type": "int32", "id": 11 }, + "optionDependency": { + "rule": "repeated", + "type": "string", + "id": 15 + }, "messageType": { "rule": "repeated", "type": "DescriptorProto", @@ -1297,6 +1352,10 @@ "rule": "repeated", "type": "string", "id": 10 + }, + "visibility": { + "type": "SymbolVisibility", + "id": 11 } }, "nested": { @@ -1522,6 +1581,10 @@ "rule": "repeated", "type": "string", "id": 5 + }, + "visibility": { + "type": "SymbolVisibility", + "id": 6 } }, "nested": { @@ -1736,6 +1799,7 @@ 42, 42 ], + "php_generic_services", [ 38, 38 @@ -1871,7 +1935,8 @@ "type": "bool", "id": 10, "options": { - "default": false + "default": false, + "deprecated": true } }, "debugRedact": { @@ -1899,6 +1964,10 @@ "type": "FeatureSet", "id": 21 }, + "featureSupport": { + "type": "FeatureSupport", + "id": 22 + }, "uninterpretedOption": { "rule": "repeated", "type": "UninterpretedOption", @@ -1968,6 +2037,26 @@ "id": 2 } } + }, + "FeatureSupport": { + "fields": { + "editionIntroduced": { + "type": "Edition", + "id": 1 + }, + "editionDeprecated": { + "type": "Edition", + "id": 2 + }, + "deprecationWarning": { + "type": "string", + "id": 3 + }, + "editionRemoved": { + "type": "Edition", + "id": 4 + } + } } } }, @@ -2056,6 +2145,10 @@ "default": false } }, + "featureSupport": { + "type": "FieldOptions.FeatureSupport", + "id": 4 + }, "uninterpretedOption": { "rule": "repeated", "type": "UninterpretedOption", @@ -2198,6 +2291,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_2023", "edition_defaults.value": "EXPLICIT" } @@ -2208,6 +2302,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "OPEN" } @@ -2218,6 +2313,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "PACKED" } @@ -2228,6 +2324,7 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "VERIFY" } @@ -2238,7 +2335,8 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO2", + "feature_support.edition_introduced": "EDITION_2023", + "edition_defaults.edition": "EDITION_LEGACY", "edition_defaults.value": "LENGTH_PREFIXED" } }, @@ -2248,27 +2346,38 @@ "options": { "retention": "RETENTION_RUNTIME", "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", "edition_defaults.edition": "EDITION_PROTO3", "edition_defaults.value": "ALLOW" } + }, + "enforceNamingStyle": { + "type": "EnforceNamingStyle", + "id": 7, + "options": { + "retention": "RETENTION_SOURCE", + "targets": "TARGET_TYPE_METHOD", + "feature_support.edition_introduced": "EDITION_2024", + "edition_defaults.edition": "EDITION_2024", + "edition_defaults.value": "STYLE2024" + } + }, + "defaultSymbolVisibility": { + "type": "VisibilityFeature.DefaultSymbolVisibility", + "id": 8, + "options": { + "retention": "RETENTION_SOURCE", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2024", + "edition_defaults.edition": "EDITION_2024", + "edition_defaults.value": "EXPORT_TOP_LEVEL" + } } }, "extensions": [ [ 1000, - 1000 - ], - [ - 1001, - 1001 - ], - [ - 1002, - 1002 - ], - [ - 9990, - 9990 + 9994 ], [ 9995, @@ -2313,7 +2422,13 @@ "UTF8_VALIDATION_UNKNOWN": 0, "VERIFY": 2, "NONE": 3 - } + }, + "reserved": [ + [ + 1, + 1 + ] + ] }, "MessageEncoding": { "values": { @@ -2328,6 +2443,33 @@ "ALLOW": 1, "LEGACY_BEST_EFFORT": 2 } + }, + "EnforceNamingStyle": { + "values": { + "ENFORCE_NAMING_STYLE_UNKNOWN": 0, + "STYLE2024": 1, + "STYLE_LEGACY": 2 + } + }, + "VisibilityFeature": { + "fields": {}, + "reserved": [ + [ + 1, + 536870911 + ] + ], + "nested": { + "DefaultSymbolVisibility": { + "values": { + "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN": 0, + "EXPORT_ALL": 1, + "EXPORT_TOP_LEVEL": 2, + "LOCAL_ALL": 3, + "STRICT": 4 + } + } + } } } }, @@ -2355,11 +2497,26 @@ "type": "Edition", "id": 3 }, - "features": { + "overridableFeatures": { "type": "FeatureSet", - "id": 2 + "id": 4 + }, + "fixedFeatures": { + "type": "FeatureSet", + "id": 5 } - } + }, + "reserved": [ + [ + 1, + 1 + ], + [ + 2, + 2 + ], + "features" + ] } } }, @@ -2372,6 +2529,12 @@ "id": 1 } }, + "extensions": [ + [ + 536000000, + 536000000 + ] + ], "nested": { "Location": { "fields": { @@ -2457,6 +2620,14 @@ } } }, + "SymbolVisibility": { + "edition": "proto2", + "values": { + "VISIBILITY_UNSET": 0, + "VISIBILITY_LOCAL": 1, + "VISIBILITY_EXPORT": 2 + } + }, "Duration": { "fields": { "seconds": { diff --git a/packages/google-chat/CHANGELOG.md b/packages/google-chat/CHANGELOG.md index 4fe04b43d7d..15cdfe4fdbb 100644 --- a/packages/google-chat/CHANGELOG.md +++ b/packages/google-chat/CHANGELOG.md @@ -1,5 +1,30 @@ # Changelog +## [0.19.0](https://github.com/googleapis/google-cloud-node/compare/chat-v0.18.0...chat-v0.19.0) (2025-08-27) + + +### âš  BREAKING CHANGES + +* [chat] Changed field behavior for an existing field `name` in message `.google.chat.v1.QuotedMessageMetadata` ([#6619](https://github.com/googleapis/google-cloud-node/issues/6619)) + +### Bug Fixes + +* [chat] Changed field behavior for an existing field `name` in message `.google.chat.v1.QuotedMessageMetadata` ([#6619](https://github.com/googleapis/google-cloud-node/issues/6619)) ([71b30db](https://github.com/googleapis/google-cloud-node/commit/71b30db34f8c83c1b2395270fd7ff8fb2621b669)) + +## [0.18.0](https://github.com/googleapis/google-cloud-node/compare/chat-v0.17.0...chat-v0.18.0) (2025-08-04) + + +### Features + +* [chat] Addition of app auth support for chat api ([#6545](https://github.com/googleapis/google-cloud-node/issues/6545)) ([f185fb1](https://github.com/googleapis/google-cloud-node/commit/f185fb1681c37ade2d8159af240b27a308ac05e3)) + +## [0.17.0](https://github.com/googleapis/google-cloud-node/compare/chat-v0.16.0...chat-v0.17.0) (2025-07-28) + + +### Features + +* [chat] Exposing 1p integration message content (drive, calendar, huddle, meet chips) ([#6517](https://github.com/googleapis/google-cloud-node/issues/6517)) ([e29b9a3](https://github.com/googleapis/google-cloud-node/commit/e29b9a30ca4580fb6370c83cd99279f03f251479)) + ## [0.16.0](https://github.com/googleapis/google-cloud-node/compare/chat-v0.15.0...chat-v0.16.0) (2025-07-09) diff --git a/packages/google-chat/package.json b/packages/google-chat/package.json index 1577cc5c372..d3b8b9ed214 100644 --- a/packages/google-chat/package.json +++ b/packages/google-chat/package.json @@ -1,6 +1,6 @@ { "name": "@google-apps/chat", - "version": "0.16.0", + "version": "0.19.0", "description": "Google Chat API client for Node.js", "repository": { "type": "git", diff --git a/packages/google-chat/protos/google/chat/v1/annotation.proto b/packages/google-chat/protos/google/chat/v1/annotation.proto index 0598c9c8bbf..99de340f0da 100644 --- a/packages/google-chat/protos/google/chat/v1/annotation.proto +++ b/packages/google-chat/protos/google/chat/v1/annotation.proto @@ -16,6 +16,7 @@ syntax = "proto3"; package google.chat.v1; +import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/chat/v1/attachment.proto"; import "google/chat/v1/reaction.proto"; @@ -30,9 +31,10 @@ option objc_class_prefix = "DYNAPIProto"; option php_namespace = "Google\\Apps\\Chat\\V1"; option ruby_package = "Google::Apps::Chat::V1"; -// Output only. Annotations associated with the plain-text body of the message. -// To add basic formatting to a text message, see -// [Format text +// Output only. Annotations can be associated with the plain-text body of the +// message or with chips that link to Google Workspace resources like Google +// Docs or Sheets with `start_index` and `length` of 0. To add basic formatting +// to a text message, see [Format text // messages](https://developers.google.com/workspace/chat/format-messages). // // Example plain-text message body: @@ -66,7 +68,7 @@ message Annotation { optional int32 start_index = 2; // Length of the substring in the plain-text message body this annotation - // corresponds to. + // corresponds to. If not present, indicates a length of 0. int32 length = 3; // Additional metadata about the annotation. @@ -134,7 +136,10 @@ message SlashCommandMetadata { bool triggers_dialog = 5; } -// A rich link to a resource. +// A rich link to a resource. Rich links can be associated with the plain-text +// body of the message or represent chips that link to Google Workspace +// resources like Google Docs or Sheets with `start_index` and `length` +// of 0. message RichLinkMetadata { // The rich link type. More types might be added in the future. enum RichLinkType { @@ -146,6 +151,12 @@ message RichLinkMetadata { // A Chat space rich link type. For example, a space smart chip. CHAT_SPACE = 2; + + // A Meet message rich link type. For example, a Meet chip. + MEET_SPACE = 4; + + // A Calendar message rich link type. For example, a Calendar chip. + CALENDAR_EVENT = 5; } // The URI of this link. @@ -161,6 +172,12 @@ message RichLinkMetadata { // Data for a chat space link. ChatSpaceLinkData chat_space_link_data = 4; + + // Data for a Meet space link. + MeetSpaceLinkData meet_space_link_data = 5; + + // Data for a Calendar event link. + CalendarEventLinkData calendar_event_link_data = 6; } } @@ -204,6 +221,64 @@ message ChatSpaceLinkData { ]; } +// Data for Meet space links. +message MeetSpaceLinkData { + // The type of the Meet space. + enum Type { + // Default value for the enum. Don't use. + TYPE_UNSPECIFIED = 0; + + // The Meet space is a meeting. + MEETING = 1; + + // The Meet space is a huddle. + HUDDLE = 2; + } + + // The status of the huddle + enum HuddleStatus { + // Default value for the enum. Don't use. + HUDDLE_STATUS_UNSPECIFIED = 0; + + // The huddle has started. + STARTED = 1; + + // The huddle has ended. In this case the Meet space URI and identifiers + // will no longer be valid. + ENDED = 2; + + // The huddle has been missed. In this case the Meet space URI and + // identifiers will no longer be valid. + MISSED = 3; + } + + // Meeting code of the linked Meet space. + string meeting_code = 1; + + // Indicates the type of the Meet space. + Type type = 2; + + // Optional. Output only. If the Meet is a Huddle, indicates the status of the + // huddle. Otherwise, this is unset. + HuddleStatus huddle_status = 3 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = OUTPUT_ONLY + ]; +} + +// Data for Calendar event links. +message CalendarEventLinkData { + // The [Calendar + // identifier](https://developers.google.com/workspace/calendar/api/v3/reference/calendars) + // of the linked Calendar. + string calendar_id = 1; + + // The [Event + // identifier](https://developers.google.com/workspace/calendar/api/v3/reference/events) + // of the linked Calendar event. + string event_id = 2; +} + // Type of the annotation. enum AnnotationType { // Default value for the enum. Don't use. diff --git a/packages/google-chat/protos/google/chat/v1/chat_service.proto b/packages/google-chat/protos/google/chat/v1/chat_service.proto index 3061ccb5532..0f5939a0fa3 100644 --- a/packages/google-chat/protos/google/chat/v1/chat_service.proto +++ b/packages/google-chat/protos/google/chat/v1/chat_service.proto @@ -49,6 +49,10 @@ service ChatService { "https://www.googleapis.com/auth/chat.admin.memberships.readonly," "https://www.googleapis.com/auth/chat.admin.spaces," "https://www.googleapis.com/auth/chat.admin.spaces.readonly," + "https://www.googleapis.com/auth/chat.app.delete," + "https://www.googleapis.com/auth/chat.app.memberships," + "https://www.googleapis.com/auth/chat.app.spaces," + "https://www.googleapis.com/auth/chat.app.spaces.create," "https://www.googleapis.com/auth/chat.bot," "https://www.googleapis.com/auth/chat.customemojis," "https://www.googleapis.com/auth/chat.customemojis.readonly," @@ -73,10 +77,21 @@ service ChatService { // Creates a message in a Google Chat space. For an example, see [Send a // message](https://developers.google.com/workspace/chat/create-messages). // - // The `create()` method requires either [user + // Supports the following types of + // [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + // + // - [App + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + // with the authorization scope: + // - `https://www.googleapis.com/auth/chat.bot` + // - [User // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - // or [app - // authentication](https://developers.google.com/workspace/chat/authorize-import). + // with one of the following authorization scopes: + // - `https://www.googleapis.com/auth/chat.messages.create` + // - `https://www.googleapis.com/auth/chat.messages` + // - `https://www.googleapis.com/auth/chat.import` (import mode spaces + // only) + // // Chat attributes the message sender differently depending on the type of // authentication that you use in your request. // @@ -120,7 +135,13 @@ service ChatService { // messages](https://developers.google.com/workspace/chat/api/guides/v1/messages/list). // // Requires [user - // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + // with one of the following [authorization + // scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + // + // - `https://www.googleapis.com/auth/chat.messages.readonly` + // - `https://www.googleapis.com/auth/chat.messages` + // - `https://www.googleapis.com/auth/chat.import` (import mode spaces only) rpc ListMessages(ListMessagesRequest) returns (ListMessagesResponse) { option (google.api.http) = { get: "/v1/{parent=spaces/*}/messages" @@ -145,11 +166,23 @@ service ChatService { // // - [App // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + // with one of the following authorization scopes: + // - `https://www.googleapis.com/auth/chat.bot` + // - `https://www.googleapis.com/auth/chat.app.memberships` (requires + // [administrator approval](https://support.google.com/a?p=chat-app-auth)) // // - [User // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - // You can authenticate and authorize this method with administrator - // privileges by setting the `use_admin_access` field in the request. + // with one of the following authorization scopes: + // - `https://www.googleapis.com/auth/chat.memberships.readonly` + // - `https://www.googleapis.com/auth/chat.memberships` + // - `https://www.googleapis.com/auth/chat.import` (import mode spaces + // only) + // - User authentication grants administrator privileges when an + // administrator account authenticates, `use_admin_access` is `true`, and + // one of the following authorization scopes is used: + // - `https://www.googleapis.com/auth/chat.admin.memberships.readonly` + // - `https://www.googleapis.com/auth/chat.admin.memberships` rpc ListMemberships(ListMembershipsRequest) returns (ListMembershipsResponse) { option (google.api.http) = { @@ -167,11 +200,21 @@ service ChatService { // // - [App // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + // with one of the following authorization scopes: + // - `https://www.googleapis.com/auth/chat.bot` + // - `https://www.googleapis.com/auth/chat.app.memberships` (requires + // [administrator approval](https://support.google.com/a?p=chat-app-auth)) // // - [User // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - // You can authenticate and authorize this method with administrator - // privileges by setting the `use_admin_access` field in the request. + // with one of the following authorization scopes: + // - `https://www.googleapis.com/auth/chat.memberships.readonly` + // - `https://www.googleapis.com/auth/chat.memberships` + // - User authentication grants administrator privileges when an + // administrator account authenticates, `use_admin_access` is `true`, and + // one of the following authorization scopes is used: + // - `https://www.googleapis.com/auth/chat.admin.memberships.readonly` + // - `https://www.googleapis.com/auth/chat.admin.memberships` rpc GetMembership(GetMembershipRequest) returns (Membership) { option (google.api.http) = { get: "/v1/{name=spaces/*/members/*}" @@ -188,9 +231,14 @@ service ChatService { // // - [App // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + // with the authorization scope: + // - `https://www.googleapis.com/auth/chat.bot` // // - [User // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + // with one of the following authorization scopes: + // - `https://www.googleapis.com/auth/chat.messages.readonly` + // - `https://www.googleapis.com/auth/chat.messages` // // Note: Might return a message from a blocked member or space. rpc GetMessage(GetMessageRequest) returns (Message) { @@ -212,9 +260,15 @@ service ChatService { // // - [App // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + // with the authorization scope: + // - `https://www.googleapis.com/auth/chat.bot` // // - [User // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + // with one of the following authorization scopes: + // - `https://www.googleapis.com/auth/chat.messages` + // - `https://www.googleapis.com/auth/chat.import` (import mode spaces + // only) // // When using app authentication, requests can only update messages // created by the calling Chat app. @@ -239,9 +293,15 @@ service ChatService { // // - [App // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + // with the authorization scope: + // - `https://www.googleapis.com/auth/chat.bot` // // - [User // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + // with one of the following authorization scopes: + // - `https://www.googleapis.com/auth/chat.messages` + // - `https://www.googleapis.com/auth/chat.import` (import mode spaces + // only) // // When using app authentication, requests can only delete messages // created by the calling Chat app. @@ -258,8 +318,13 @@ service ChatService { // For an example, see // [Get metadata about a message // attachment](https://developers.google.com/workspace/chat/get-media-attachments). + // // Requires [app - // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + // with the [authorization + // scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + // + // - `https://www.googleapis.com/auth/chat.bot` rpc GetAttachment(GetAttachmentRequest) returns (Attachment) { option (google.api.http) = { get: "/v1/{name=spaces/*/messages/*/attachments/*}" @@ -272,7 +337,13 @@ service ChatService { // attachment](https://developers.google.com/workspace/chat/upload-media-attachments). // // Requires user - // [authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + // [authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + // with one of the following [authorization + // scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + // + // - `https://www.googleapis.com/auth/chat.messages.create` + // - `https://www.googleapis.com/auth/chat.messages` + // - `https://www.googleapis.com/auth/chat.import` (import mode spaces only) // // You can upload attachments up to 200 MB. Certain file types aren't // supported. For details, see [File types blocked by Google @@ -295,9 +366,14 @@ service ChatService { // // - [App // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + // with the authorization scope: + // - `https://www.googleapis.com/auth/chat.bot` // // - [User // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + // with one of the following authorization scopes: + // - `https://www.googleapis.com/auth/chat.spaces.readonly` + // - `https://www.googleapis.com/auth/chat.spaces` // // To list all named spaces by Google Workspace organization, use the // [`spaces.search()`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/search) @@ -314,7 +390,13 @@ service ChatService { // // Requires [user // authentication with administrator - // privileges](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user#admin-privileges). + // privileges](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user#admin-privileges) + // and one of the following [authorization + // scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + // + // - `https://www.googleapis.com/auth/chat.admin.spaces.readonly` + // - `https://www.googleapis.com/auth/chat.admin.spaces` + // // In the request, set `use_admin_access` to `true`. rpc SearchSpaces(SearchSpacesRequest) returns (SearchSpacesResponse) { option (google.api.http) = { @@ -332,11 +414,29 @@ service ChatService { // // - [App // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + // with one of the following authorization scopes: + // - `https://www.googleapis.com/auth/chat.bot` + // - `https://www.googleapis.com/auth/chat.app.spaces` with [administrator + // approval](https://support.google.com/a?p=chat-app-auth) // // - [User // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - // You can authenticate and authorize this method with administrator - // privileges by setting the `use_admin_access` field in the request. + // with one of the following authorization scopes: + // - `https://www.googleapis.com/auth/chat.spaces.readonly` + // - `https://www.googleapis.com/auth/chat.spaces` + // - User authentication grants administrator privileges when an + // administrator account authenticates, `use_admin_access` is `true`, and + // one of the following authorization scopes is used: + // - `https://www.googleapis.com/auth/chat.admin.spaces.readonly` + // - `https://www.googleapis.com/auth/chat.admin.spaces` + // + // App authentication has the following limitations: + // + // - `space.access_settings` is only populated when using the + // `chat.app.spaces` scope. + // - `space.predefind_permission_settings` and `space.permission_settings` are + // only populated when using the `chat.app.spaces` scope, and only for + // spaces the app created. rpc GetSpace(GetSpaceRequest) returns (Space) { option (google.api.http) = { get: "/v1/{name=spaces/*}" @@ -344,27 +444,48 @@ service ChatService { option (google.api.method_signature) = "name"; } - // Creates a space with no members. Can be used to create a named space, or a + // Creates a space. Can be used to create a named space, or a // group chat in `Import mode`. For an example, see [Create a // space](https://developers.google.com/workspace/chat/create-spaces). // - // If you receive the error message `ALREADY_EXISTS` when creating - // a space, try a different `displayName`. An existing space within - // the Google Workspace organization might already use this display name. - // // Supports the following types of // [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): // // - [App // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) // with [administrator approval](https://support.google.com/a?p=chat-app-auth) - // in [Developer Preview](https://developers.google.com/workspace/preview) + // and one of the following authorization scopes: + // - `https://www.googleapis.com/auth/chat.app.spaces.create` + // - `https://www.googleapis.com/auth/chat.app.spaces` // // - [User // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + // with one of the following authorization scopes: + // - `https://www.googleapis.com/auth/chat.spaces.create` + // - `https://www.googleapis.com/auth/chat.spaces` + // - `https://www.googleapis.com/auth/chat.import` (import mode spaces + // only) // // When authenticating as an app, the `space.customer` field must be set in // the request. + // + // When authenticating as an app, the Chat app is added as a member of the + // space. However, unlike human authentication, the Chat app is not added as a + // space manager. By default, the Chat app can be removed from the space by + // all space members. To allow only space managers to remove the app from a + // space, set `space.permission_settings.manage_apps` to `managers_allowed`. + // + // Space membership upon creation depends on whether the space is created in + // `Import mode`: + // + // * **Import mode:** No members are created. + // * **All other modes:** The calling user is added as a member. This is: + // * The app itself when using app authentication. + // * The human user when using user authentication. + // + // If you receive the error message `ALREADY_EXISTS` when creating + // a space, try a different `displayName`. An existing space within + // the Google Workspace organization might already use this display name. rpc CreateSpace(CreateSpaceRequest) returns (Space) { option (google.api.http) = { post: "/v1/spaces" @@ -424,7 +545,12 @@ service ChatService { // might already use this display name. // // Requires [user - // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + // with one of the following [authorization + // scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + // + // - `https://www.googleapis.com/auth/chat.spaces.create` + // - `https://www.googleapis.com/auth/chat.spaces` rpc SetUpSpace(SetUpSpaceRequest) returns (Space) { option (google.api.http) = { post: "/v1/spaces:setup" @@ -446,12 +572,26 @@ service ChatService { // - [App // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) // with [administrator approval](https://support.google.com/a?p=chat-app-auth) - // in [Developer Preview](https://developers.google.com/workspace/preview) + // and one of the following authorization scopes: + // - `https://www.googleapis.com/auth/chat.app.spaces` // // - [User // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - // You can authenticate and authorize this method with administrator - // privileges by setting the `use_admin_access` field in the request. + // with one of the following authorization scopes: + // - `https://www.googleapis.com/auth/chat.spaces` + // - `https://www.googleapis.com/auth/chat.import` (import mode spaces + // only) + // - User authentication grants administrator privileges when an + // administrator account authenticates, `use_admin_access` is `true`, and + // the following authorization scopes is used: + // - `https://www.googleapis.com/auth/chat.admin.spaces` + // + // App authentication has the following limitations: + // + // - To update either `space.predefined_permission_settings` or + // `space.permission_settings`, the app must be the space creator. + // - Updating the `space.access_settings.audience` is not supported for app + // authentication. rpc UpdateSpace(UpdateSpaceRequest) returns (Space) { option (google.api.http) = { patch: "/v1/{space.name=spaces/*}" @@ -471,13 +611,22 @@ service ChatService { // // - [App // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - // with [administrator approval](https://support.google.com/a?p=chat-app-auth) - // in [Developer Preview](https://developers.google.com/workspace/preview) + // with [administrator + // approval](https://support.google.com/a?p=chat-app-auth) and the + // authorization scope: + // - `https://www.googleapis.com/auth/chat.app.delete` (only in + // spaces the app created) // // - [User // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - // You can authenticate and authorize this method with administrator - // privileges by setting the `use_admin_access` field in the request. + // with one of the following authorization scopes: + // - `https://www.googleapis.com/auth/chat.delete` + // - `https://www.googleapis.com/auth/chat.import` (import mode spaces + // only) + // - User authentication grants administrator privileges when an + // administrator account authenticates, `use_admin_access` is `true`, and + // the following authorization scope is used: + // - `https://www.googleapis.com/auth/chat.admin.delete` rpc DeleteSpace(DeleteSpaceRequest) returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v1/{name=spaces/*}" @@ -489,9 +638,14 @@ service ChatService { // [import process](https://developers.google.com/workspace/chat/import-data) // for the specified space and makes it visible to users. // - // Requires [app - // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - // and domain-wide delegation. For more information, see [Authorize Google + // Requires [user + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + // and domain-wide delegation with the [authorization + // scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + // + // - `https://www.googleapis.com/auth/chat.import` + // + // For more information, see [Authorize Google // Chat apps to import // data](https://developers.google.com/workspace/chat/authorize-import). rpc CompleteImportSpace(CompleteImportSpaceRequest) @@ -517,14 +671,19 @@ service ChatService { // returns the direct message space between the specified user and the // authenticated user. // - // // Supports the following types of + // Supports the following types of // [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): // // - [App // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + // with the authorization scope: + // - `https://www.googleapis.com/auth/chat.bot` // // - [User // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + // with one of the following authorization scopes: + // - `https://www.googleapis.com/auth/chat.spaces.readonly` + // - `https://www.googleapis.com/auth/chat.spaces` rpc FindDirectMessage(FindDirectMessageRequest) returns (Space) { option (google.api.http) = { get: "/v1/spaces:findDirectMessage" @@ -544,21 +703,35 @@ service ChatService { // - [App // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) // with [administrator approval](https://support.google.com/a?p=chat-app-auth) - // in [Developer Preview](https://developers.google.com/workspace/preview) + // and the authorization scope: + // - `https://www.googleapis.com/auth/chat.app.memberships` // // - [User // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - // You can authenticate and authorize this method with administrator - // privileges by setting the `use_admin_access` field in the request. + // with one of the following authorization scopes: + // - `https://www.googleapis.com/auth/chat.memberships` + // - `https://www.googleapis.com/auth/chat.memberships.app` (to add the + // calling app to the space) + // - `https://www.googleapis.com/auth/chat.import` (import mode spaces + // only) + // - User authentication grants administrator privileges when an + // administrator account authenticates, `use_admin_access` is `true`, and + // the following authorization scope is used: + // - `https://www.googleapis.com/auth/chat.admin.memberships` + // + // App authentication is not supported for the following use cases: + // + // - Inviting users external to the Workspace organization that owns the + // space. + // - Adding a Google Group to a space. + // - Adding a Chat app to a space. // // For example usage, see: // // - [Invite or add a user to a // space](https://developers.google.com/workspace/chat/create-members#create-user-membership). - // // - [Invite or add a Google Group to a // space](https://developers.google.com/workspace/chat/create-members#create-group-membership). - // // - [Add the Chat app to a // space](https://developers.google.com/workspace/chat/create-members#create-membership-calling-api). rpc CreateMembership(CreateMembershipRequest) returns (Membership) { @@ -577,13 +750,22 @@ service ChatService { // // - [App // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - // with [administrator approval](https://support.google.com/a?p=chat-app-auth) - // in [Developer Preview](https://developers.google.com/workspace/preview) + // with [administrator + // approval](https://support.google.com/a?p=chat-app-auth) and the + // authorization scope: + // - `https://www.googleapis.com/auth/chat.app.memberships` (only in + // spaces the app created) // // - [User // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - // You can authenticate and authorize this method with administrator - // privileges by setting the `use_admin_access` field in the request. + // with one of the following authorization scopes: + // - `https://www.googleapis.com/auth/chat.memberships` + // - `https://www.googleapis.com/auth/chat.import` (import mode spaces + // only) + // - User authentication grants administrator privileges when an + // administrator account authenticates, `use_admin_access` is `true`, and + // the following authorization scope is used: + // - `https://www.googleapis.com/auth/chat.admin.memberships` rpc UpdateMembership(UpdateMembershipRequest) returns (Membership) { option (google.api.http) = { patch: "/v1/{membership.name=spaces/*/members/*}" @@ -602,12 +784,31 @@ service ChatService { // - [App // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) // with [administrator approval](https://support.google.com/a?p=chat-app-auth) - // in [Developer Preview](https://developers.google.com/workspace/preview) + // and the authorization scope: + // - `https://www.googleapis.com/auth/chat.app.memberships` // // - [User // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - // You can authenticate and authorize this method with administrator - // privileges by setting the `use_admin_access` field in the request. + // with one of the following authorization scopes: + // - `https://www.googleapis.com/auth/chat.memberships` + // - `https://www.googleapis.com/auth/chat.memberships.app` (to remove + // the calling app from the space) + // - `https://www.googleapis.com/auth/chat.import` (import mode spaces + // only) + // - User authentication grants administrator privileges when an + // administrator account authenticates, `use_admin_access` is `true`, and + // the following authorization scope is used: + // - `https://www.googleapis.com/auth/chat.admin.memberships` + // + // App authentication is not supported for the following use cases: + // + // - Removing a Google Group from a space. + // - Removing a Chat app from a space. + // + // To delete memberships for space managers, the requester + // must be a space manager. If you're using [app + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + // the Chat app must be the space creator. rpc DeleteMembership(DeleteMembershipRequest) returns (Membership) { option (google.api.http) = { delete: "/v1/{name=spaces/*/members/*}" @@ -620,7 +821,14 @@ service ChatService { // message](https://developers.google.com/workspace/chat/create-reactions). // // Requires [user - // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + // with one of the following [authorization + // scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + // + // - `https://www.googleapis.com/auth/chat.messages.reactions.create` + // - `https://www.googleapis.com/auth/chat.messages.reactions` + // - `https://www.googleapis.com/auth/chat.messages` + // - `https://www.googleapis.com/auth/chat.import` (import mode spaces only) rpc CreateReaction(CreateReactionRequest) returns (Reaction) { option (google.api.http) = { post: "/v1/{parent=spaces/*/messages/*}/reactions" @@ -634,7 +842,14 @@ service ChatService { // message](https://developers.google.com/workspace/chat/list-reactions). // // Requires [user - // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + // with one of the following [authorization + // scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + // + // - `https://www.googleapis.com/auth/chat.messages.reactions.readonly` + // - `https://www.googleapis.com/auth/chat.messages.reactions` + // - `https://www.googleapis.com/auth/chat.messages.readonly` + // - `https://www.googleapis.com/auth/chat.messages` rpc ListReactions(ListReactionsRequest) returns (ListReactionsResponse) { option (google.api.http) = { get: "/v1/{parent=spaces/*/messages/*}/reactions" @@ -647,7 +862,13 @@ service ChatService { // reaction](https://developers.google.com/workspace/chat/delete-reactions). // // Requires [user - // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + // with one of the following [authorization + // scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + // + // - `https://www.googleapis.com/auth/chat.messages.reactions` + // - `https://www.googleapis.com/auth/chat.messages` + // - `https://www.googleapis.com/auth/chat.import` (import mode spaces only) rpc DeleteReaction(DeleteReactionRequest) returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v1/{name=spaces/*/messages/*/reactions/*}" @@ -665,7 +886,11 @@ service ChatService { // permissions](https://support.google.com/a/answer/12850085). // // Requires [user - // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + // with the [authorization + // scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + // + // - `https://www.googleapis.com/auth/chat.customemojis` rpc CreateCustomEmoji(CreateCustomEmojiRequest) returns (CustomEmoji) { option (google.api.http) = { post: "/v1/customEmojis" @@ -684,7 +909,12 @@ service ChatService { // permissions](https://support.google.com/a/answer/12850085). // // Requires [user - // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + // with one of the following [authorization + // scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + // + // - `https://www.googleapis.com/auth/chat.customemojis.readonly` + // - `https://www.googleapis.com/auth/chat.customemojis` rpc GetCustomEmoji(GetCustomEmojiRequest) returns (CustomEmoji) { option (google.api.http) = { get: "/v1/{name=customEmojis/*}" @@ -702,7 +932,12 @@ service ChatService { // permissions](https://support.google.com/a/answer/12850085). // // Requires [user - // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + // with one of the following [authorization + // scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + // + // - `https://www.googleapis.com/auth/chat.customemojis.readonly` + // - `https://www.googleapis.com/auth/chat.customemojis` rpc ListCustomEmojis(ListCustomEmojisRequest) returns (ListCustomEmojisResponse) { option (google.api.http) = { @@ -725,7 +960,11 @@ service ChatService { // permissions](https://support.google.com/a/answer/12850085). // // Requires [user - // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + // with the [authorization + // scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + // + // - `https://www.googleapis.com/auth/chat.customemojis` rpc DeleteCustomEmoji(DeleteCustomEmojiRequest) returns (google.protobuf.Empty) { option (google.api.http) = { @@ -740,7 +979,12 @@ service ChatService { // state](https://developers.google.com/workspace/chat/get-space-read-state). // // Requires [user - // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + // with one of the following [authorization + // scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + // + // - `https://www.googleapis.com/auth/chat.users.readstate.readonly` + // - `https://www.googleapis.com/auth/chat.users.readstate` rpc GetSpaceReadState(GetSpaceReadStateRequest) returns (SpaceReadState) { option (google.api.http) = { get: "/v1/{name=users/*/spaces/*/spaceReadState}" @@ -753,7 +997,11 @@ service ChatService { // state](https://developers.google.com/workspace/chat/update-space-read-state). // // Requires [user - // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + // with the [authorization + // scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + // + // - `https://www.googleapis.com/auth/chat.users.readstate` rpc UpdateSpaceReadState(UpdateSpaceReadStateRequest) returns (SpaceReadState) { option (google.api.http) = { @@ -769,7 +1017,12 @@ service ChatService { // state](https://developers.google.com/workspace/chat/get-thread-read-state). // // Requires [user - // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + // with one of the following [authorization + // scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + // + // - `https://www.googleapis.com/auth/chat.users.readstate.readonly` + // - `https://www.googleapis.com/auth/chat.users.readstate` rpc GetThreadReadState(GetThreadReadStateRequest) returns (ThreadReadState) { option (google.api.http) = { get: "/v1/{name=users/*/spaces/*/threads/*/threadReadState}" @@ -788,7 +1041,20 @@ service ChatService { // object of the Space event data for this request. // // Requires [user - // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + // with an [authorization + // scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes) + // appropriate for reading the requested data: + // + // - `https://www.googleapis.com/auth/chat.spaces.readonly` + // - `https://www.googleapis.com/auth/chat.spaces` + // - `https://www.googleapis.com/auth/chat.messages.readonly` + // - `https://www.googleapis.com/auth/chat.messages` + // - `https://www.googleapis.com/auth/chat.messages.reactions.readonly` + // - `https://www.googleapis.com/auth/chat.messages.reactions` + // - `https://www.googleapis.com/auth/chat.memberships.readonly` + // - `https://www.googleapis.com/auth/chat.memberships` + // // To get an event, the authenticated user must be a member of the space. // // For an example, see [Get details about an @@ -810,7 +1076,20 @@ service ChatService { // `Membership` resource. // // Requires [user - // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + // with an [authorization + // scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes) + // appropriate for reading the requested data: + // + // - `https://www.googleapis.com/auth/chat.spaces.readonly` + // - `https://www.googleapis.com/auth/chat.spaces` + // - `https://www.googleapis.com/auth/chat.messages.readonly` + // - `https://www.googleapis.com/auth/chat.messages` + // - `https://www.googleapis.com/auth/chat.messages.reactions.readonly` + // - `https://www.googleapis.com/auth/chat.messages.reactions` + // - `https://www.googleapis.com/auth/chat.memberships.readonly` + // - `https://www.googleapis.com/auth/chat.memberships` + // // To list events, the authenticated user must be a member of the space. // // For an example, see [List events from a Google Chat @@ -828,7 +1107,11 @@ service ChatService { // setting](https://developers.google.com/workspace/chat/get-space-notification-setting). // // Requires [user - // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + // with the [authorization + // scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + // + // - `https://www.googleapis.com/auth/chat.users.spacesettings` rpc GetSpaceNotificationSetting(GetSpaceNotificationSettingRequest) returns (SpaceNotificationSetting) { option (google.api.http) = { @@ -842,7 +1125,11 @@ service ChatService { // setting](https://developers.google.com/workspace/chat/update-space-notification-setting). // // Requires [user - // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + // with the [authorization + // scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + // + // - `https://www.googleapis.com/auth/chat.users.spacesettings` rpc UpdateSpaceNotificationSetting(UpdateSpaceNotificationSettingRequest) returns (SpaceNotificationSetting) { option (google.api.http) = { diff --git a/packages/google-chat/protos/google/chat/v1/deletion_metadata.proto b/packages/google-chat/protos/google/chat/v1/deletion_metadata.proto index 5946cb34438..a45b7fb2b4c 100644 --- a/packages/google-chat/protos/google/chat/v1/deletion_metadata.proto +++ b/packages/google-chat/protos/google/chat/v1/deletion_metadata.proto @@ -29,7 +29,9 @@ option ruby_package = "Google::Apps::Chat::V1"; // is set. message DeletionMetadata { // Who deleted the message and how it was deleted. More values may be added in - // the future. + // the future. See [Edit or delete a message in Google + // Chat](https://support.google.com/chat/answer/7653281) for details on when + // messages can be deleted. enum DeletionType { // This value is unused. DELETION_TYPE_UNSPECIFIED = 0; @@ -37,23 +39,27 @@ message DeletionMetadata { // User deleted their own message. CREATOR = 1; - // The space owner deleted the message. + // A space manager deleted the message. SPACE_OWNER = 2; - // A Google Workspace admin deleted the message. + // A Google Workspace administrator deleted the message. Administrators can + // delete any message in the space, including messages sent by any space + // member or Chat app. ADMIN = 3; // A Chat app deleted its own message when it expired. APP_MESSAGE_EXPIRY = 4; - // A Chat app deleted the message on behalf of the user. + // A Chat app deleted the message on behalf of the creator (using user + // authentication). CREATOR_VIA_APP = 5; - // A Chat app deleted the message on behalf of the space owner. + // A Chat app deleted the message on behalf of a space manager (using user + // authentication). SPACE_OWNER_VIA_APP = 6; - // A member of the space deleted the message. Human users can delete - // messages sent by apps. + // A member of the space deleted the message. Users can delete messages sent + // by apps. SPACE_MEMBER = 7; } diff --git a/packages/google-chat/protos/google/chat/v1/membership.proto b/packages/google-chat/protos/google/chat/v1/membership.proto index 62a71f26e8a..2981658cac8 100644 --- a/packages/google-chat/protos/google/chat/v1/membership.proto +++ b/packages/google-chat/protos/google/chat/v1/membership.proto @@ -156,8 +156,6 @@ message CreateMembershipRequest { // - When [authenticating as an // app](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app), // the `chat.app.memberships` authorization scope is required. - // Authenticating as an app is available in [Developer - // Preview](https://developers.google.com/workspace/preview). // // - Set `user.type` to `HUMAN`, and set `user.name` with format // `users/{user}`, where `{user}` can be the email address for the user. For @@ -377,9 +375,13 @@ message DeleteMembershipRequest { // human users' or their own memberships. Chat apps can't delete other apps' // memberships. // - // When deleting a human membership, requires the `chat.memberships` scope and - // `spaces/{space}/members/{member}` format. You can use the email as an - // alias for `{member}`. For example, + // When deleting a human membership, requires the `chat.memberships` scope + // with [user + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + // or the `chat.memberships.app` scope with [app + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + // and the `spaces/{space}/members/{member}` format. + // You can use the email as an alias for `{member}`. For example, // `spaces/{space}/members/example@gmail.com` where `example@gmail.com` is the // email of the Google Chat user. // diff --git a/packages/google-chat/protos/google/chat/v1/message.proto b/packages/google-chat/protos/google/chat/v1/message.proto index caa100524b9..9505139c64f 100644 --- a/packages/google-chat/protos/google/chat/v1/message.proto +++ b/packages/google-chat/protos/google/chat/v1/message.proto @@ -152,7 +152,9 @@ message Message { // [Card builder](https://addons.gsuite.google.com/uikit/builder) repeated CardWithId cards_v2 = 22 [(google.api.field_behavior) = OPTIONAL]; - // Output only. Annotations associated with the `text` in this message. + // Output only. Annotations can be associated with the plain-text body of the + // message or with chips that link to Google Workspace resources like Google + // Docs or Sheets with `start_index` and `length` of 0. repeated Annotation annotations = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; @@ -236,10 +238,19 @@ message Message { DeletionMetadata deletion_metadata = 38 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. Information about a message that's quoted by a Google Chat - // user in a space. Google Chat users can quote a message to reply to it. + // Optional. Information about a message that another message quotes. + // + // When you create a message, you can quote messages within the same + // thread, or quote a root message to create a new root message. + // However, you can't quote a message reply from a different thread. + // + // When you update a message, you can't add or replace the + // `quotedMessageMetadata` field, but you can remove it. + // + // For example usage, see [Quote another + // message](https://developers.google.com/workspace/chat/create-messages#quote-a-message). QuotedMessageMetadata quoted_message_metadata = 39 - [(google.api.field_behavior) = OUTPUT_ONLY]; + [(google.api.field_behavior) = OPTIONAL]; // Output only. GIF images that are attached to the message. repeated AttachedGif attached_gifs = 42 @@ -264,25 +275,41 @@ message AttachedGif { string uri = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; } -// Information about a quoted message. +// Information about a message that another message quotes. +// +// When you create a message, you can quote messages within the same +// thread, or quote a root message to create a new root message. +// However, you can't quote a message reply from a different thread. +// +// When you update a message, you can't add or replace the +// `quotedMessageMetadata` field, but you can remove it. +// +// For example usage, see [Quote another +// message](https://developers.google.com/workspace/chat/create-messages#quote-a-message). message QuotedMessageMetadata { option (google.api.resource) = { type: "chat.googleapis.com/QuotedMessageMetadata" pattern: "spaces/{space}/messages/{message}/quotedMessageMetadata/{quoted_message_metadata}" }; - // Output only. Resource name of the quoted message. + // Required. Resource name of the message that is quoted. // // Format: `spaces/{space}/messages/{message}` string name = 1 [ - (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { type: "chat.googleapis.com/Message" } ]; - // Output only. The timestamp when the quoted message was created or when the + // Required. The timestamp when the quoted message was created or when the // quoted message was last updated. + // + // If the message was edited, use this field, `last_update_time`. + // If the message was never edited, use `create_time`. + // + // If `last_update_time` doesn't match the latest version of the quoted + // message, the request fails. google.protobuf.Timestamp last_update_time = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; + [(google.api.field_behavior) = REQUIRED]; } // A thread in a Google Chat space. For example usage, see @@ -454,6 +481,8 @@ message UpdateMessageRequest { // // - `accessory_widgets` (Requires [app // authentication](/chat/api/guides/auth/service-accounts).) + // + // - `quoted_message_metadata` (Only allows removal of the quoted message.) google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; diff --git a/packages/google-chat/protos/google/chat/v1/slash_command.proto b/packages/google-chat/protos/google/chat/v1/slash_command.proto index e7ae47e181c..46257852eb9 100644 --- a/packages/google-chat/protos/google/chat/v1/slash_command.proto +++ b/packages/google-chat/protos/google/chat/v1/slash_command.proto @@ -25,10 +25,10 @@ option objc_class_prefix = "DYNAPIProto"; option php_namespace = "Google\\Apps\\Chat\\V1"; option ruby_package = "Google::Apps::Chat::V1"; -// A [slash +// Metadata about a [slash // command](https://developers.google.com/workspace/chat/commands) in // Google Chat. message SlashCommand { - // The ID of the slash command invoked. + // The ID of the slash command. int64 command_id = 1; } diff --git a/packages/google-chat/protos/google/chat/v1/space.proto b/packages/google-chat/protos/google/chat/v1/space.proto index 66d5ef2daba..03b533391a4 100644 --- a/packages/google-chat/protos/google/chat/v1/space.proto +++ b/packages/google-chat/protos/google/chat/v1/space.proto @@ -163,8 +163,7 @@ message Space { // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) // with [administrator // approval](https://support.google.com/a?p=chat-app-auth) - // with the `chat.app.spaces` scope in [Developer - // Preview](https://developers.google.com/workspace/preview). + // with the `chat.app.spaces` scope. // // This field is not populated when using the `chat.bot` scope with [app // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). @@ -350,20 +349,45 @@ message Space { // Only populated when the `space_type` is `SPACE`. AccessSettings access_settings = 23 [(google.api.field_behavior) = OPTIONAL]; + // Optional. Immutable. The customer id of the domain of the space. + // Required only when creating a space with [app + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + // and `SpaceType` is `SPACE`, otherwise should not be set. + // + // In the format `customers/{customer}`, where `customer` is the `id` from the + // [Admin SDK customer + // resource](https://developers.google.com/admin-sdk/directory/reference/rest/v1/customers). + // Private apps can also use the `customers/my_customer` alias to create + // the space in the same Google Workspace organization as the app. + // + // For DMs, this field isn't populated. + optional string customer = 24 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = OPTIONAL + ]; + // Output only. The URI for a user to access the space. string space_uri = 25 [(google.api.field_behavior) = OUTPUT_ONLY]; // Represents the [permission settings] // (https://support.google.com/chat/answer/13340792) of a space. Only // populated when the `space_type` is `SPACE`. - // - // Requires [user - // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). oneof space_permission_settings { // Optional. Input only. Predefined space permission settings, input only // when creating a space. If the field is not set, a collaboration space is // created. After you create the space, settings are populated in the // `PermissionSettings` field. + // + // Setting predefined permission settings supports: + // + // - [App + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + // with [administrator + // approval](https://support.google.com/a?p=chat-app-auth) with the + // `chat.app.spaces` or `chat.app.spaces.create` scopes. + // + // - [User + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) PredefinedPermissionSettings predefined_permission_settings = 26 [ (google.api.field_behavior) = INPUT_ONLY, (google.api.field_behavior) = OPTIONAL @@ -372,6 +396,18 @@ message Space { // Optional. Space permission settings for existing spaces. Input for // updating exact space permission settings, where existing permission // settings are replaced. Output lists current permission settings. + // + // Reading and updating permission settings supports: + // + // - [App + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + // with [administrator + // approval](https://support.google.com/a?p=chat-app-auth) with the + // `chat.app.spaces` scope. Only populated and settable when the Chat app + // created the space. + // + // - [User + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) PermissionSettings permission_settings = 27 [(google.api.field_behavior) = OPTIONAL]; } diff --git a/packages/google-chat/protos/google/chat/v1/space_setup.proto b/packages/google-chat/protos/google/chat/v1/space_setup.proto index 1a0811dad65..d1ad807f620 100644 --- a/packages/google-chat/protos/google/chat/v1/space_setup.proto +++ b/packages/google-chat/protos/google/chat/v1/space_setup.proto @@ -67,7 +67,7 @@ message SetUpSpaceRequest { // Optional. The Google Chat users or groups to invite to join the space. Omit // the calling user, as they are added automatically. // - // The set currently allows up to 20 memberships (in addition to the caller). + // The set currently allows up to 49 memberships (in addition to the caller). // // For human membership, the `Membership.member` field must contain a `user` // with `name` populated (format: `users/{user}`) and `type` set to diff --git a/packages/google-chat/protos/google/chat/v1/user.proto b/packages/google-chat/protos/google/chat/v1/user.proto index 67d56bc9036..0d39bf51441 100644 --- a/packages/google-chat/protos/google/chat/v1/user.proto +++ b/packages/google-chat/protos/google/chat/v1/user.proto @@ -17,7 +17,6 @@ syntax = "proto3"; package google.chat.v1; import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; option csharp_namespace = "Google.Apps.Chat.V1"; option go_package = "cloud.google.com/go/chat/apiv1/chatpb;chatpb"; diff --git a/packages/google-chat/protos/protos.d.ts b/packages/google-chat/protos/protos.d.ts index 1e8fad6d0b9..038fc678d8e 100644 --- a/packages/google-chat/protos/protos.d.ts +++ b/packages/google-chat/protos/protos.d.ts @@ -993,6 +993,7 @@ export namespace google { /** Edition enum. */ enum Edition { EDITION_UNKNOWN = 0, + EDITION_LEGACY = 900, EDITION_PROTO2 = 998, EDITION_PROTO3 = 999, EDITION_2023 = 1000, @@ -1023,6 +1024,9 @@ export namespace google { /** FileDescriptorProto weakDependency */ weakDependency?: (number[]|null); + /** FileDescriptorProto optionDependency */ + optionDependency?: (string[]|null); + /** FileDescriptorProto messageType */ messageType?: (google.protobuf.IDescriptorProto[]|null); @@ -1072,6 +1076,9 @@ export namespace google { /** FileDescriptorProto weakDependency. */ public weakDependency: number[]; + /** FileDescriptorProto optionDependency. */ + public optionDependency: string[]; + /** FileDescriptorProto messageType. */ public messageType: google.protobuf.IDescriptorProto[]; @@ -1206,6 +1213,9 @@ export namespace google { /** DescriptorProto reservedName */ reservedName?: (string[]|null); + + /** DescriptorProto visibility */ + visibility?: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility|null); } /** Represents a DescriptorProto. */ @@ -1247,6 +1257,9 @@ export namespace google { /** DescriptorProto reservedName. */ public reservedName: string[]; + /** DescriptorProto visibility. */ + public visibility: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility); + /** * Creates a new DescriptorProto instance using the specified properties. * @param [properties] Properties to set @@ -2094,6 +2107,9 @@ export namespace google { /** EnumDescriptorProto reservedName */ reservedName?: (string[]|null); + + /** EnumDescriptorProto visibility */ + visibility?: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility|null); } /** Represents an EnumDescriptorProto. */ @@ -2120,6 +2136,9 @@ export namespace google { /** EnumDescriptorProto reservedName. */ public reservedName: string[]; + /** EnumDescriptorProto visibility. */ + public visibility: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility); + /** * Creates a new EnumDescriptorProto instance using the specified properties. * @param [properties] Properties to set @@ -3054,15 +3073,18 @@ export namespace google { /** FieldOptions features */ features?: (google.protobuf.IFeatureSet|null); + /** FieldOptions featureSupport */ + featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** FieldOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - /** FieldOptions .google.api.resourceReference */ - ".google.api.resourceReference"?: (google.api.IResourceReference|null); - /** FieldOptions .google.api.fieldBehavior */ ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + /** FieldOptions .google.api.fieldInfo */ ".google.api.fieldInfo"?: (google.api.IFieldInfo|null); } @@ -3112,6 +3134,9 @@ export namespace google { /** FieldOptions features. */ public features?: (google.protobuf.IFeatureSet|null); + /** FieldOptions featureSupport. */ + public featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** FieldOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; @@ -3332,6 +3357,121 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** Properties of a FeatureSupport. */ + interface IFeatureSupport { + + /** FeatureSupport editionIntroduced */ + editionIntroduced?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSupport editionDeprecated */ + editionDeprecated?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSupport deprecationWarning */ + deprecationWarning?: (string|null); + + /** FeatureSupport editionRemoved */ + editionRemoved?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSupport. */ + class FeatureSupport implements IFeatureSupport { + + /** + * Constructs a new FeatureSupport. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IFeatureSupport); + + /** FeatureSupport editionIntroduced. */ + public editionIntroduced: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSupport editionDeprecated. */ + public editionDeprecated: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSupport deprecationWarning. */ + public deprecationWarning: string; + + /** FeatureSupport editionRemoved. */ + public editionRemoved: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSupport instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSupport instance + */ + public static create(properties?: google.protobuf.FieldOptions.IFeatureSupport): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Encodes the specified FeatureSupport message. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @param message FeatureSupport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IFeatureSupport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSupport message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @param message FeatureSupport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IFeatureSupport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Verifies a FeatureSupport message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSupport message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSupport + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Creates a plain object from a FeatureSupport message. Also converts values to other types if specified. + * @param message FeatureSupport + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.FeatureSupport, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSupport to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSupport + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } /** Properties of an OneofOptions. */ @@ -3570,6 +3710,9 @@ export namespace google { /** EnumValueOptions debugRedact */ debugRedact?: (boolean|null); + /** EnumValueOptions featureSupport */ + featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** EnumValueOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); } @@ -3592,6 +3735,9 @@ export namespace google { /** EnumValueOptions debugRedact. */ public debugRedact: boolean; + /** EnumValueOptions featureSupport. */ + public featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + /** EnumValueOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; @@ -4181,6 +4327,12 @@ export namespace google { /** FeatureSet jsonFormat */ jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); + + /** FeatureSet enforceNamingStyle */ + enforceNamingStyle?: (google.protobuf.FeatureSet.EnforceNamingStyle|keyof typeof google.protobuf.FeatureSet.EnforceNamingStyle|null); + + /** FeatureSet defaultSymbolVisibility */ + defaultSymbolVisibility?: (google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|keyof typeof google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|null); } /** Represents a FeatureSet. */ @@ -4210,6 +4362,12 @@ export namespace google { /** FeatureSet jsonFormat. */ public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); + /** FeatureSet enforceNamingStyle. */ + public enforceNamingStyle: (google.protobuf.FeatureSet.EnforceNamingStyle|keyof typeof google.protobuf.FeatureSet.EnforceNamingStyle); + + /** FeatureSet defaultSymbolVisibility. */ + public defaultSymbolVisibility: (google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|keyof typeof google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility); + /** * Creates a new FeatureSet instance using the specified properties. * @param [properties] Properties to set @@ -4332,6 +4490,116 @@ export namespace google { ALLOW = 1, LEGACY_BEST_EFFORT = 2 } + + /** EnforceNamingStyle enum. */ + enum EnforceNamingStyle { + ENFORCE_NAMING_STYLE_UNKNOWN = 0, + STYLE2024 = 1, + STYLE_LEGACY = 2 + } + + /** Properties of a VisibilityFeature. */ + interface IVisibilityFeature { + } + + /** Represents a VisibilityFeature. */ + class VisibilityFeature implements IVisibilityFeature { + + /** + * Constructs a new VisibilityFeature. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSet.IVisibilityFeature); + + /** + * Creates a new VisibilityFeature instance using the specified properties. + * @param [properties] Properties to set + * @returns VisibilityFeature instance + */ + public static create(properties?: google.protobuf.FeatureSet.IVisibilityFeature): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Encodes the specified VisibilityFeature message. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @param message VisibilityFeature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSet.IVisibilityFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VisibilityFeature message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @param message VisibilityFeature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSet.IVisibilityFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Verifies a VisibilityFeature message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VisibilityFeature message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VisibilityFeature + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Creates a plain object from a VisibilityFeature message. Also converts values to other types if specified. + * @param message VisibilityFeature + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet.VisibilityFeature, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VisibilityFeature to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VisibilityFeature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace VisibilityFeature { + + /** DefaultSymbolVisibility enum. */ + enum DefaultSymbolVisibility { + DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0, + EXPORT_ALL = 1, + EXPORT_TOP_LEVEL = 2, + LOCAL_ALL = 3, + STRICT = 4 + } + } } /** Properties of a FeatureSetDefaults. */ @@ -4451,8 +4719,11 @@ export namespace google { /** FeatureSetEditionDefault edition */ edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - /** FeatureSetEditionDefault features */ - features?: (google.protobuf.IFeatureSet|null); + /** FeatureSetEditionDefault overridableFeatures */ + overridableFeatures?: (google.protobuf.IFeatureSet|null); + + /** FeatureSetEditionDefault fixedFeatures */ + fixedFeatures?: (google.protobuf.IFeatureSet|null); } /** Represents a FeatureSetEditionDefault. */ @@ -4467,8 +4738,11 @@ export namespace google { /** FeatureSetEditionDefault edition. */ public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - /** FeatureSetEditionDefault features. */ - public features?: (google.protobuf.IFeatureSet|null); + /** FeatureSetEditionDefault overridableFeatures. */ + public overridableFeatures?: (google.protobuf.IFeatureSet|null); + + /** FeatureSetEditionDefault fixedFeatures. */ + public fixedFeatures?: (google.protobuf.IFeatureSet|null); /** * Creates a new FeatureSetEditionDefault instance using the specified properties. @@ -5001,6 +5275,13 @@ export namespace google { } } + /** SymbolVisibility enum. */ + enum SymbolVisibility { + VISIBILITY_UNSET = 0, + VISIBILITY_LOCAL = 1, + VISIBILITY_EXPORT = 2 + } + /** Properties of a Duration. */ interface IDuration { @@ -10188,6 +10469,12 @@ export namespace google { /** RichLinkMetadata chatSpaceLinkData */ chatSpaceLinkData?: (google.chat.v1.IChatSpaceLinkData|null); + + /** RichLinkMetadata meetSpaceLinkData */ + meetSpaceLinkData?: (google.chat.v1.IMeetSpaceLinkData|null); + + /** RichLinkMetadata calendarEventLinkData */ + calendarEventLinkData?: (google.chat.v1.ICalendarEventLinkData|null); } /** Represents a RichLinkMetadata. */ @@ -10211,8 +10498,14 @@ export namespace google { /** RichLinkMetadata chatSpaceLinkData. */ public chatSpaceLinkData?: (google.chat.v1.IChatSpaceLinkData|null); + /** RichLinkMetadata meetSpaceLinkData. */ + public meetSpaceLinkData?: (google.chat.v1.IMeetSpaceLinkData|null); + + /** RichLinkMetadata calendarEventLinkData. */ + public calendarEventLinkData?: (google.chat.v1.ICalendarEventLinkData|null); + /** RichLinkMetadata data. */ - public data?: ("driveLinkData"|"chatSpaceLinkData"); + public data?: ("driveLinkData"|"chatSpaceLinkData"|"meetSpaceLinkData"|"calendarEventLinkData"); /** * Creates a new RichLinkMetadata instance using the specified properties. @@ -10298,7 +10591,9 @@ export namespace google { enum RichLinkType { RICH_LINK_TYPE_UNSPECIFIED = 0, DRIVE_FILE = 1, - CHAT_SPACE = 2 + CHAT_SPACE = 2, + MEET_SPACE = 4, + CALENDAR_EVENT = 5 } } @@ -10546,65 +10841,295 @@ export namespace google { * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.chat.v1.IChatSpaceLinkData, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.chat.v1.IChatSpaceLinkData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ChatSpaceLinkData message, length delimited. Does not implicitly {@link google.chat.v1.ChatSpaceLinkData.verify|verify} messages. + * @param message ChatSpaceLinkData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IChatSpaceLinkData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ChatSpaceLinkData message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ChatSpaceLinkData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.ChatSpaceLinkData; + + /** + * Decodes a ChatSpaceLinkData message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ChatSpaceLinkData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.ChatSpaceLinkData; + + /** + * Verifies a ChatSpaceLinkData message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ChatSpaceLinkData message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ChatSpaceLinkData + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.ChatSpaceLinkData; + + /** + * Creates a plain object from a ChatSpaceLinkData message. Also converts values to other types if specified. + * @param message ChatSpaceLinkData + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.ChatSpaceLinkData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ChatSpaceLinkData to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ChatSpaceLinkData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MeetSpaceLinkData. */ + interface IMeetSpaceLinkData { + + /** MeetSpaceLinkData meetingCode */ + meetingCode?: (string|null); + + /** MeetSpaceLinkData type */ + type?: (google.chat.v1.MeetSpaceLinkData.Type|keyof typeof google.chat.v1.MeetSpaceLinkData.Type|null); + + /** MeetSpaceLinkData huddleStatus */ + huddleStatus?: (google.chat.v1.MeetSpaceLinkData.HuddleStatus|keyof typeof google.chat.v1.MeetSpaceLinkData.HuddleStatus|null); + } + + /** Represents a MeetSpaceLinkData. */ + class MeetSpaceLinkData implements IMeetSpaceLinkData { + + /** + * Constructs a new MeetSpaceLinkData. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IMeetSpaceLinkData); + + /** MeetSpaceLinkData meetingCode. */ + public meetingCode: string; + + /** MeetSpaceLinkData type. */ + public type: (google.chat.v1.MeetSpaceLinkData.Type|keyof typeof google.chat.v1.MeetSpaceLinkData.Type); + + /** MeetSpaceLinkData huddleStatus. */ + public huddleStatus: (google.chat.v1.MeetSpaceLinkData.HuddleStatus|keyof typeof google.chat.v1.MeetSpaceLinkData.HuddleStatus); + + /** + * Creates a new MeetSpaceLinkData instance using the specified properties. + * @param [properties] Properties to set + * @returns MeetSpaceLinkData instance + */ + public static create(properties?: google.chat.v1.IMeetSpaceLinkData): google.chat.v1.MeetSpaceLinkData; + + /** + * Encodes the specified MeetSpaceLinkData message. Does not implicitly {@link google.chat.v1.MeetSpaceLinkData.verify|verify} messages. + * @param message MeetSpaceLinkData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IMeetSpaceLinkData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MeetSpaceLinkData message, length delimited. Does not implicitly {@link google.chat.v1.MeetSpaceLinkData.verify|verify} messages. + * @param message MeetSpaceLinkData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IMeetSpaceLinkData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MeetSpaceLinkData message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MeetSpaceLinkData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.MeetSpaceLinkData; + + /** + * Decodes a MeetSpaceLinkData message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MeetSpaceLinkData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.MeetSpaceLinkData; + + /** + * Verifies a MeetSpaceLinkData message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MeetSpaceLinkData message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MeetSpaceLinkData + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.MeetSpaceLinkData; + + /** + * Creates a plain object from a MeetSpaceLinkData message. Also converts values to other types if specified. + * @param message MeetSpaceLinkData + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.MeetSpaceLinkData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MeetSpaceLinkData to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MeetSpaceLinkData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MeetSpaceLinkData { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + MEETING = 1, + HUDDLE = 2 + } + + /** HuddleStatus enum. */ + enum HuddleStatus { + HUDDLE_STATUS_UNSPECIFIED = 0, + STARTED = 1, + ENDED = 2, + MISSED = 3 + } + } + + /** Properties of a CalendarEventLinkData. */ + interface ICalendarEventLinkData { + + /** CalendarEventLinkData calendarId */ + calendarId?: (string|null); + + /** CalendarEventLinkData eventId */ + eventId?: (string|null); + } + + /** Represents a CalendarEventLinkData. */ + class CalendarEventLinkData implements ICalendarEventLinkData { + + /** + * Constructs a new CalendarEventLinkData. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.ICalendarEventLinkData); + + /** CalendarEventLinkData calendarId. */ + public calendarId: string; + + /** CalendarEventLinkData eventId. */ + public eventId: string; + + /** + * Creates a new CalendarEventLinkData instance using the specified properties. + * @param [properties] Properties to set + * @returns CalendarEventLinkData instance + */ + public static create(properties?: google.chat.v1.ICalendarEventLinkData): google.chat.v1.CalendarEventLinkData; + + /** + * Encodes the specified CalendarEventLinkData message. Does not implicitly {@link google.chat.v1.CalendarEventLinkData.verify|verify} messages. + * @param message CalendarEventLinkData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.ICalendarEventLinkData, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ChatSpaceLinkData message, length delimited. Does not implicitly {@link google.chat.v1.ChatSpaceLinkData.verify|verify} messages. - * @param message ChatSpaceLinkData message or plain object to encode + * Encodes the specified CalendarEventLinkData message, length delimited. Does not implicitly {@link google.chat.v1.CalendarEventLinkData.verify|verify} messages. + * @param message CalendarEventLinkData message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.chat.v1.IChatSpaceLinkData, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.chat.v1.ICalendarEventLinkData, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ChatSpaceLinkData message from the specified reader or buffer. + * Decodes a CalendarEventLinkData message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ChatSpaceLinkData + * @returns CalendarEventLinkData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.ChatSpaceLinkData; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.CalendarEventLinkData; /** - * Decodes a ChatSpaceLinkData message from the specified reader or buffer, length delimited. + * Decodes a CalendarEventLinkData message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ChatSpaceLinkData + * @returns CalendarEventLinkData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.ChatSpaceLinkData; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.CalendarEventLinkData; /** - * Verifies a ChatSpaceLinkData message. + * Verifies a CalendarEventLinkData message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ChatSpaceLinkData message from a plain object. Also converts values to their respective internal types. + * Creates a CalendarEventLinkData message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ChatSpaceLinkData + * @returns CalendarEventLinkData */ - public static fromObject(object: { [k: string]: any }): google.chat.v1.ChatSpaceLinkData; + public static fromObject(object: { [k: string]: any }): google.chat.v1.CalendarEventLinkData; /** - * Creates a plain object from a ChatSpaceLinkData message. Also converts values to other types if specified. - * @param message ChatSpaceLinkData + * Creates a plain object from a CalendarEventLinkData message. Also converts values to other types if specified. + * @param message CalendarEventLinkData * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.chat.v1.ChatSpaceLinkData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.chat.v1.CalendarEventLinkData, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ChatSpaceLinkData to JSON. + * Converts this CalendarEventLinkData to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ChatSpaceLinkData + * Gets the default type url for CalendarEventLinkData * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ @@ -18646,6 +19171,9 @@ export namespace google { /** Space accessSettings */ accessSettings?: (google.chat.v1.Space.IAccessSettings|null); + /** Space customer */ + customer?: (string|null); + /** Space spaceUri */ spaceUri?: (string|null); @@ -18716,6 +19244,9 @@ export namespace google { /** Space accessSettings. */ public accessSettings?: (google.chat.v1.Space.IAccessSettings|null); + /** Space customer. */ + public customer?: (string|null); + /** Space spaceUri. */ public spaceUri: string; @@ -23812,6 +24343,19 @@ export namespace google { /** Namespace api. */ namespace api { + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7, + IDENTIFIER = 8 + } + /** Properties of a ResourceDescriptor. */ interface IResourceDescriptor { @@ -24064,24 +24608,14 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } - /** FieldBehavior enum. */ - enum FieldBehavior { - FIELD_BEHAVIOR_UNSPECIFIED = 0, - OPTIONAL = 1, - REQUIRED = 2, - OUTPUT_ONLY = 3, - INPUT_ONLY = 4, - IMMUTABLE = 5, - UNORDERED_LIST = 6, - NON_EMPTY_DEFAULT = 7, - IDENTIFIER = 8 - } - /** Properties of a FieldInfo. */ interface IFieldInfo { /** FieldInfo format */ format?: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format|null); + + /** FieldInfo referencedTypes */ + referencedTypes?: (google.api.ITypeReference[]|null); } /** Represents a FieldInfo. */ @@ -24096,6 +24630,9 @@ export namespace google { /** FieldInfo format. */ public format: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format); + /** FieldInfo referencedTypes. */ + public referencedTypes: google.api.ITypeReference[]; + /** * Creates a new FieldInfo instance using the specified properties. * @param [properties] Properties to set @@ -24186,6 +24723,103 @@ export namespace google { } } + /** Properties of a TypeReference. */ + interface ITypeReference { + + /** TypeReference typeName */ + typeName?: (string|null); + } + + /** Represents a TypeReference. */ + class TypeReference implements ITypeReference { + + /** + * Constructs a new TypeReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ITypeReference); + + /** TypeReference typeName. */ + public typeName: string; + + /** + * Creates a new TypeReference instance using the specified properties. + * @param [properties] Properties to set + * @returns TypeReference instance + */ + public static create(properties?: google.api.ITypeReference): google.api.TypeReference; + + /** + * Encodes the specified TypeReference message. Does not implicitly {@link google.api.TypeReference.verify|verify} messages. + * @param message TypeReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ITypeReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TypeReference message, length delimited. Does not implicitly {@link google.api.TypeReference.verify|verify} messages. + * @param message TypeReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ITypeReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TypeReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TypeReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.TypeReference; + + /** + * Decodes a TypeReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TypeReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.TypeReference; + + /** + * Verifies a TypeReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TypeReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TypeReference + */ + public static fromObject(object: { [k: string]: any }): google.api.TypeReference; + + /** + * Creates a plain object from a TypeReference message. Also converts values to other types if specified. + * @param message TypeReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.TypeReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TypeReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TypeReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a Http. */ interface IHttp { @@ -24554,6 +25188,9 @@ export namespace google { /** CommonLanguageSettings destinations */ destinations?: (google.api.ClientLibraryDestination[]|null); + + /** CommonLanguageSettings selectiveGapicGeneration */ + selectiveGapicGeneration?: (google.api.ISelectiveGapicGeneration|null); } /** Represents a CommonLanguageSettings. */ @@ -24571,6 +25208,9 @@ export namespace google { /** CommonLanguageSettings destinations. */ public destinations: google.api.ClientLibraryDestination[]; + /** CommonLanguageSettings selectiveGapicGeneration. */ + public selectiveGapicGeneration?: (google.api.ISelectiveGapicGeneration|null); + /** * Creates a new CommonLanguageSettings instance using the specified properties. * @param [properties] Properties to set @@ -25271,6 +25911,9 @@ export namespace google { /** PythonSettings common */ common?: (google.api.ICommonLanguageSettings|null); + + /** PythonSettings experimentalFeatures */ + experimentalFeatures?: (google.api.PythonSettings.IExperimentalFeatures|null); } /** Represents a PythonSettings. */ @@ -25285,6 +25928,9 @@ export namespace google { /** PythonSettings common. */ public common?: (google.api.ICommonLanguageSettings|null); + /** PythonSettings experimentalFeatures. */ + public experimentalFeatures?: (google.api.PythonSettings.IExperimentalFeatures|null); + /** * Creates a new PythonSettings instance using the specified properties. * @param [properties] Properties to set @@ -25363,6 +26009,118 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + namespace PythonSettings { + + /** Properties of an ExperimentalFeatures. */ + interface IExperimentalFeatures { + + /** ExperimentalFeatures restAsyncIoEnabled */ + restAsyncIoEnabled?: (boolean|null); + + /** ExperimentalFeatures protobufPythonicTypesEnabled */ + protobufPythonicTypesEnabled?: (boolean|null); + + /** ExperimentalFeatures unversionedPackageDisabled */ + unversionedPackageDisabled?: (boolean|null); + } + + /** Represents an ExperimentalFeatures. */ + class ExperimentalFeatures implements IExperimentalFeatures { + + /** + * Constructs a new ExperimentalFeatures. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.PythonSettings.IExperimentalFeatures); + + /** ExperimentalFeatures restAsyncIoEnabled. */ + public restAsyncIoEnabled: boolean; + + /** ExperimentalFeatures protobufPythonicTypesEnabled. */ + public protobufPythonicTypesEnabled: boolean; + + /** ExperimentalFeatures unversionedPackageDisabled. */ + public unversionedPackageDisabled: boolean; + + /** + * Creates a new ExperimentalFeatures instance using the specified properties. + * @param [properties] Properties to set + * @returns ExperimentalFeatures instance + */ + public static create(properties?: google.api.PythonSettings.IExperimentalFeatures): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Encodes the specified ExperimentalFeatures message. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @param message ExperimentalFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.PythonSettings.IExperimentalFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExperimentalFeatures message, length delimited. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @param message ExperimentalFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.PythonSettings.IExperimentalFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Verifies an ExperimentalFeatures message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExperimentalFeatures message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExperimentalFeatures + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Creates a plain object from an ExperimentalFeatures message. Also converts values to other types if specified. + * @param message ExperimentalFeatures + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings.ExperimentalFeatures, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExperimentalFeatures to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExperimentalFeatures + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + /** Properties of a NodeSettings. */ interface INodeSettings { @@ -25689,6 +26447,9 @@ export namespace google { /** GoSettings common */ common?: (google.api.ICommonLanguageSettings|null); + + /** GoSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|null); } /** Represents a GoSettings. */ @@ -25703,6 +26464,9 @@ export namespace google { /** GoSettings common. */ public common?: (google.api.ICommonLanguageSettings|null); + /** GoSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + /** * Creates a new GoSettings instance using the specified properties. * @param [properties] Properties to set @@ -26027,6 +26791,109 @@ export namespace google { PACKAGE_MANAGER = 20 } + /** Properties of a SelectiveGapicGeneration. */ + interface ISelectiveGapicGeneration { + + /** SelectiveGapicGeneration methods */ + methods?: (string[]|null); + + /** SelectiveGapicGeneration generateOmittedAsInternal */ + generateOmittedAsInternal?: (boolean|null); + } + + /** Represents a SelectiveGapicGeneration. */ + class SelectiveGapicGeneration implements ISelectiveGapicGeneration { + + /** + * Constructs a new SelectiveGapicGeneration. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ISelectiveGapicGeneration); + + /** SelectiveGapicGeneration methods. */ + public methods: string[]; + + /** SelectiveGapicGeneration generateOmittedAsInternal. */ + public generateOmittedAsInternal: boolean; + + /** + * Creates a new SelectiveGapicGeneration instance using the specified properties. + * @param [properties] Properties to set + * @returns SelectiveGapicGeneration instance + */ + public static create(properties?: google.api.ISelectiveGapicGeneration): google.api.SelectiveGapicGeneration; + + /** + * Encodes the specified SelectiveGapicGeneration message. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @param message SelectiveGapicGeneration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ISelectiveGapicGeneration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SelectiveGapicGeneration message, length delimited. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @param message SelectiveGapicGeneration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ISelectiveGapicGeneration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.SelectiveGapicGeneration; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.SelectiveGapicGeneration; + + /** + * Verifies a SelectiveGapicGeneration message. + * @param message Plain object to ver{"code":"deadline_exceeded","msg":"operation timed out"}